Logo Search packages:      
Sourcecode: blender version File versions  Download package

int btSimpleDynamicsWorld::stepSimulation ( btScalar  timeStep,
int  maxSubSteps = 1,
btScalar  fixedTimeStep = btScalar(1.)/btScalar(60.) 
) [virtual]

maxSubSteps/fixedTimeStep for interpolation is currently ignored for btSimpleDynamicsWorld, use btDiscreteDynamicsWorld instead

apply gravity, predict motion

perform collision detection

solve contact constraints

integrate transforms

Implements btDynamicsWorld.

Definition at line 55 of file btSimpleDynamicsWorld.cpp.

References btConstraintSolver::allSolved(), clearForces(), btDispatcher::getNumManifolds(), btConstraintSolver::prepareSolve(), btConstraintSolver::solveGroup(), and synchronizeMotionStates().

{
      (void)fixedTimeStep;
      (void)maxSubSteps;


      ///apply gravity, predict motion
      predictUnconstraintMotion(timeStep);

      btDispatcherInfo& dispatchInfo = getDispatchInfo();
      dispatchInfo.m_timeStep = timeStep;
      dispatchInfo.m_stepCount = 0;
      dispatchInfo.m_debugDraw = getDebugDrawer();

      ///perform collision detection
      performDiscreteCollisionDetection();

      ///solve contact constraints
      int numManifolds = m_dispatcher1->getNumManifolds();
      if (numManifolds)
      {
            btPersistentManifold** manifoldPtr = ((btCollisionDispatcher*)m_dispatcher1)->getInternalManifoldPointer();
            
            btContactSolverInfo infoGlobal;
            infoGlobal.m_timeStep = timeStep;
            m_constraintSolver->prepareSolve(0,numManifolds);
            m_constraintSolver->solveGroup(0,0,manifoldPtr, numManifolds,0,0,infoGlobal,m_debugDrawer, m_stackAlloc,m_dispatcher1);
            m_constraintSolver->allSolved(infoGlobal,m_debugDrawer, m_stackAlloc);
      }

      ///integrate transforms
      integrateTransforms(timeStep);
            
      updateAabbs();

      synchronizeMotionStates();

      clearForces();

      return 1;

}


Generated by  Doxygen 1.6.0   Back to index