Deltas of linear and angular velocities applied to rigid bodies now are kept between simulation steps.

Read-only access functions added to btRigidBody to get these values
Several OpenCL functions are implemented for MiniCL
This commit is contained in:
rponom
2010-03-17 19:06:59 +00:00
parent 9de41ddd7a
commit b409abac09
4 changed files with 113 additions and 9 deletions

View File

@@ -732,7 +732,7 @@ void btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* m
}
btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCollisionObject** /*bodies */,int /*numBodies */,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc)
btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCollisionObject** bodies, int numBodies, btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc)
{
BT_PROFILE("solveGroupCacheFriendlySetup");
(void)stackAlloc;
@@ -745,6 +745,33 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCol
return 0.f;
}
if (infoGlobal.m_splitImpulse)
{
for (int i = 0; i < numBodies; i++)
{
btRigidBody* body = btRigidBody::upcast(bodies[i]);
if (body)
{
body->internalGetDeltaLinearVelocity().setZero();
body->internalGetDeltaAngularVelocity().setZero();
body->internalGetPushVelocity().setZero();
body->internalGetTurnVelocity().setZero();
}
}
}
else
{
for (int i = 0; i < numBodies; i++)
{
btRigidBody* body = btRigidBody::upcast(bodies[i]);
if (body)
{
body->internalGetDeltaLinearVelocity().setZero();
body->internalGetDeltaAngularVelocity().setZero();
}
}
}
if (1)
{
int j;