Пример #1
0
        protected void IntegrateTransforms(float timeStep)
        {
            Matrix predictedTrans = Matrix.Identity;

            for (int i = 0; i < CollisionObjects.Count; i++)
            {
                CollisionObject colObj = CollisionObjects[i];
                RigidBody       body   = RigidBody.Upcast(colObj);
                if (body != null)
                {
                    if (body.IsActive && (!body.IsStaticObject))
                    {
                        body.PredictIntegratedTransform(timeStep, ref predictedTrans);
                        body.ProceedToTransform(predictedTrans);
                    }
                }
            }
        }
Пример #2
0
 protected void PredictUnconstraintMotion(float timeStep)
 {
     for (int i = 0; i < CollisionObjects.Count; i++)
     {
         CollisionObject colObj = CollisionObjects[i];
         RigidBody       body   = RigidBody.Upcast(colObj);
         if (body != null)
         {
             if (!body.IsStaticObject)
             {
                 if (body.IsActive)
                 {
                     body.ApplyForces(timeStep);
                     body.IntegrateVelocities(timeStep);
                     Matrix temp = body.InterpolationWorldTransform;
                     body.PredictIntegratedTransform(timeStep, ref temp);
                     body.InterpolationWorldTransform = temp;
                 }
             }
         }
     }
 }