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:
@@ -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;
|
||||
|
||||
@@ -328,10 +328,10 @@ void btRigidBody::internalWritebackVelocity(btScalar timeStep)
|
||||
setWorldTransform(newTransform);
|
||||
//m_originalBody->setCompanionId(-1);
|
||||
}
|
||||
m_deltaLinearVelocity.setZero();
|
||||
m_deltaAngularVelocity .setZero();
|
||||
m_pushVelocity.setZero();
|
||||
m_turnVelocity.setZero();
|
||||
// m_deltaLinearVelocity.setZero();
|
||||
// m_deltaAngularVelocity .setZero();
|
||||
// m_pushVelocity.setZero();
|
||||
// m_turnVelocity.setZero();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -519,6 +519,26 @@ public:
|
||||
return m_rigidbodyFlags;
|
||||
}
|
||||
|
||||
const btVector3& getDeltaLinearVelocity() const
|
||||
{
|
||||
return m_deltaLinearVelocity;
|
||||
}
|
||||
|
||||
const btVector3& getDeltaAngularVelocity() const
|
||||
{
|
||||
return m_deltaAngularVelocity;
|
||||
}
|
||||
|
||||
const btVector3& getPushVelocity() const
|
||||
{
|
||||
return m_pushVelocity;
|
||||
}
|
||||
|
||||
const btVector3& getTurnVelocity() const
|
||||
{
|
||||
return m_turnVelocity;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////
|
||||
///some internal methods, don't use them
|
||||
@@ -589,8 +609,8 @@ public:
|
||||
{
|
||||
setLinearVelocity(getLinearVelocity()+ m_deltaLinearVelocity);
|
||||
setAngularVelocity(getAngularVelocity()+m_deltaAngularVelocity);
|
||||
m_deltaLinearVelocity.setZero();
|
||||
m_deltaAngularVelocity .setZero();
|
||||
//m_deltaLinearVelocity.setZero();
|
||||
//m_deltaAngularVelocity .setZero();
|
||||
//m_originalBody->setCompanionId(-1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user