processed a lot of feedback: added 'realtime' simulation with fixed substeps (and clamping maximum number of substeps), this means that when stepSimulation is called with smaller timesteps then 'fixed substep' the motionstate is interpolated.
renamed m_ccdSweptSphereRadius, enabled wireframe debugDrawObject (using debugDrawer)
This commit is contained in:
@@ -43,11 +43,9 @@ btRigidBody::btRigidBody(float mass, btMotionState* motionState, btCollisionShap
|
||||
m_frictionSolverType(0)
|
||||
{
|
||||
|
||||
btQuaternion worldOrn;
|
||||
btVector3 worldPos;
|
||||
motionState->getWorldOrientation(worldOrn);
|
||||
motionState->getWorldPosition(worldPos);
|
||||
m_worldTransform = btTransform(worldOrn,worldPos);
|
||||
motionState->getWorldTransform(m_worldTransform);
|
||||
|
||||
m_interpolationWorldTransform = m_worldTransform;
|
||||
|
||||
//moved to btCollisionObject
|
||||
m_friction = friction;
|
||||
@@ -82,6 +80,7 @@ btRigidBody::btRigidBody( float mass,const btTransform& worldTransform,btCollisi
|
||||
{
|
||||
|
||||
m_worldTransform = worldTransform;
|
||||
m_interpolationWorldTransform = m_worldTransform;
|
||||
|
||||
//moved to btCollisionObject
|
||||
m_friction = friction;
|
||||
@@ -118,9 +117,6 @@ void btRigidBody::saveKinematicState(btScalar timeStep)
|
||||
//printf("angular = %f %f %f\n",m_angularVelocity.getX(),m_angularVelocity.getY(),m_angularVelocity.getZ());
|
||||
}
|
||||
|
||||
|
||||
m_interpolationWorldTransform = m_worldTransform;
|
||||
|
||||
m_kinematicTimeStep = timeStep;
|
||||
}
|
||||
|
||||
@@ -260,6 +256,7 @@ btQuaternion btRigidBody::getOrientation() const
|
||||
|
||||
void btRigidBody::setCenterOfMassTransform(const btTransform& xform)
|
||||
{
|
||||
m_interpolationWorldTransform = m_worldTransform;
|
||||
m_worldTransform = xform;
|
||||
updateInertiaTensor();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user