diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-01-01 03:20:50 +0300 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-01-01 03:20:50 +0300 |
commit | 71991cf41ed5018ffaf3f00b75fd142419b36af0 (patch) | |
tree | f0996985944e302db7dcdaa87191599da28a7824 | |
parent | bab1b90edc55251ceb5e3033d588347b48cceca4 (diff) |
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.
4 files changed, 7 insertions, 6 deletions
diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 71a80e01f3b..fb5037345a8 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -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) diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index ee3b0ffb528..7051b8f7e13 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -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; } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 3a500a833c8..0a0b4939ea5 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -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; } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index 8e526421116..6050af2f3c8 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -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); |