more solver experiments, randomize the order of contact points, not just manifolds
use #defines for constants, rather then const btScalar
This commit is contained in:
@@ -56,6 +56,7 @@ subject to the following restrictions:
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btConstraintSolver* constraintSolver)
|
||||
:btDynamicsWorld(),
|
||||
m_constraintSolver(constraintSolver? constraintSolver: new btSequentialImpulseConstraintSolver),
|
||||
@@ -69,6 +70,7 @@ m_profileTimings(0)
|
||||
m_ownsConstraintSolver = (constraintSolver==0);
|
||||
}
|
||||
|
||||
|
||||
btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher* dispatcher,btOverlappingPairCache* pairCache,btConstraintSolver* constraintSolver)
|
||||
:btDynamicsWorld(dispatcher,pairCache),
|
||||
m_constraintSolver(constraintSolver? constraintSolver: new btSequentialImpulseConstraintSolver),
|
||||
|
||||
@@ -116,18 +116,18 @@ btRigidBody::btRigidBody( float mass,const btTransform& worldTransform,btCollisi
|
||||
//note there this influences deactivation thresholds!
|
||||
float gClippedAngvelThresholdSqr = 0.01f;
|
||||
float gClippedLinearThresholdSqr = 0.01f;
|
||||
float gJitterVelocityDampingFactor = 1.0f;
|
||||
float gJitterVelocityDampingFactor = 1.f;
|
||||
#endif //EXPERIMENTAL_JITTER_REMOVAL
|
||||
|
||||
void btRigidBody::predictIntegratedTransform(btScalar timeStep,btTransform& predictedTransform)
|
||||
{
|
||||
|
||||
#ifdef EXPERIMENTAL_JITTER_REMOVAL
|
||||
if (wantsSleeping())
|
||||
//if (wantsSleeping())
|
||||
{
|
||||
//clip to avoid jitter
|
||||
// if ((m_angularVelocity.length2() < gClippedAngvelThresholdSqr) &&
|
||||
// (m_linearVelocity.length2() < gClippedLinearThresholdSqr))
|
||||
if ((m_angularVelocity.length2() < gClippedAngvelThresholdSqr) &&
|
||||
(m_linearVelocity.length2() < gClippedLinearThresholdSqr))
|
||||
{
|
||||
m_angularVelocity *= gJitterVelocityDampingFactor;
|
||||
m_linearVelocity *= gJitterVelocityDampingFactor;
|
||||
|
||||
@@ -194,4 +194,4 @@ void btSimpleDynamicsWorld::setConstraintSolver(btConstraintSolver* solver)
|
||||
}
|
||||
m_ownsConstraintSolver = false;
|
||||
m_constraintSolver = solver;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user