Some rigidbody dynamics fixes (scaling again) to make Happy 2006 domino simulation to work.

See http://www.continuousphysics.com/ftp/pub/test/index.php?dir=blender/&file=happy_2006_blend.zip
For the baked dominos. Thanks to Tom M (LetterRip) for the blend.
This commit is contained in:
Erwin Coumans 2006-01-01 00:20:50 +00:00
parent bab1b90edc
commit 71991cf41e
4 changed files with 7 additions and 6 deletions

@ -1022,7 +1022,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
ci.m_angularDamping = 1.f - shapeprops->m_ang_drag;
//need a bit of damping, else system doesn't behave well
ci.m_inertiaFactor = shapeprops->m_inertia/0.4f;//defaults to 0.4, don't want to change behaviour
KX_BulletPhysicsController* physicscontroller = new KX_BulletPhysicsController(ci,isbulletdyna);
if (objprop->m_in_active_layer)

@ -95,11 +95,9 @@ bool CcdPhysicsController::SynchronizeMotionStates(float time)
float scale[3];
m_MotionState->getWorldScaling(scale[0],scale[1],scale[2]);
SimdVector3 scaling(scale[0],scale[1],scale[2]);
m_collisionShape->setLocalScaling(scaling);
return true;
}

@ -296,7 +296,10 @@ void CcdPhysicsEnvironment::UpdateActivationState()
}
void CcdPhysicsEnvironment::beginFrame()
{
}
/// Perform an integration step of duration 'timeStep'.
bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep)
@ -322,8 +325,8 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep)
//this is needed because scaling is not known in advance, and scaling has to propagate to the shape
if (!m_scalingPropagated)
{
//SyncMotionStates(timeStep);
//m_scalingPropagated = true;
SyncMotionStates(timeStep);
m_scalingPropagated = true;
}

@ -59,7 +59,7 @@ class CcdPhysicsEnvironment : public PHY_IPhysicsEnvironment
virtual void setLinearAirDamping(float damping);
virtual void setUseEpa(bool epa) ;
virtual void beginFrame() {};
virtual void beginFrame();
virtual void endFrame() {};
/// Perform an integration step of duration 'timeStep'.
virtual bool proceedDeltaTime(double curTime,float timeStep);