Some rigidbody dynamics fixes (scaling again) to make Happy 2006 domino simulation...
authorErwin Coumans <blender@erwincoumans.com>
Sun, 1 Jan 2006 00:20:50 +0000 (00:20 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Sun, 1 Jan 2006 00:20:50 +0000 (00:20 +0000)
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.

source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h

index 71a80e01f3ba133025e575bf336a6b03649830b7..fb5037345a8efec23d48d5dbb5c15e63f8db8e00 100644 (file)
@@ -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)
index ee3b0ffb528221f6f1dee4d46dd4c420e2b54303..7051b8f7e1318bd20ca11c8632f7db3fa8c7bcce 100644 (file)
@@ -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;
 }
 
index 3a500a833c83f9dbc9c9a026210da873ccbb493f..0a0b4939ea5d9ee24ea6bea29aad1757e9581bed 100644 (file)
@@ -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;
        }
 
 
index 8e52642111662604fe33204c7b486a0ef8d193cd..6050af2f3c8d5cc9162689d8e5ae9b7e74ec8c23 100644 (file)
@@ -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);