From d19845190969b318510537253355c7d23a91dd14 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Sat, 2 Apr 2011 00:44:15 +0000 Subject: [PATCH] clear the applied impulse for constraints (no warmstarting) simplify logic, see Issue 499 --- .../CollisionDispatch/btCollisionDispatcher.cpp | 3 +-- .../ConstraintSolver/btSequentialImpulseConstraintSolver.cpp | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp b/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp index 9fed44a19..691bad35f 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp +++ b/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp @@ -172,8 +172,7 @@ bool btCollisionDispatcher::needsCollision(btCollisionObject* body0,btCollisionO if (!(m_dispatcherFlags & btCollisionDispatcher::CD_STATIC_STATIC_REPORTED)) { //broadphase filtering already deals with this - if ((body0->isStaticObject() || body0->isKinematicObject()) && - (body1->isStaticObject() || body1->isKinematicObject())) + if (body0->isStaticOrKinematicObject() && body1->isStaticOrKinematicObject()) { m_dispatcherFlags |= btCollisionDispatcher::CD_STATIC_STATIC_REPORTED; printf("warning btCollisionDispatcher::needsCollision: static-static collision!\n"); diff --git a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp index ec0268f80..4a3440d5a 100644 --- a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp +++ b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp @@ -788,6 +788,7 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCol { btTypedConstraint* constraint = constraints[j]; constraint->buildJacobian(); + constraint->internalSetAppliedImpulse(0.0f); } } //btRigidBody* rb0=0,*rb1=0;