use of com.bulletphysics.dynamics.constraintsolver.ContactSolverInfo in project bdx by GoranM.
the class SimpleDynamicsWorld method stepSimulation.
/**
* maxSubSteps/fixedTimeStep for interpolation is currently ignored for SimpleDynamicsWorld, use DiscreteDynamicsWorld instead.
*/
@Override
public int stepSimulation(float timeStep, int maxSubSteps, float fixedTimeStep) {
// apply gravity, predict motion
predictUnconstraintMotion(timeStep);
DispatcherInfo dispatchInfo = getDispatchInfo();
dispatchInfo.timeStep = timeStep;
dispatchInfo.stepCount = 0;
dispatchInfo.debugDraw = getDebugDrawer();
// perform collision detection
performDiscreteCollisionDetection();
// solve contact constraints
int numManifolds = dispatcher1.getNumManifolds();
if (numManifolds != 0) {
ObjectArrayList<PersistentManifold> manifoldPtr = ((CollisionDispatcher) dispatcher1).getInternalManifoldPointer();
ContactSolverInfo infoGlobal = new ContactSolverInfo();
infoGlobal.timeStep = timeStep;
constraintSolver.prepareSolve(0, numManifolds);
constraintSolver.solveGroup(null, 0, manifoldPtr, 0, numManifolds, null, 0, 0, infoGlobal, debugDrawer, /*, m_stackAlloc*/
dispatcher1);
constraintSolver.allSolved(infoGlobal, debugDrawer);
}
// integrate transforms
integrateTransforms(timeStep);
updateAabbs();
synchronizeMotionStates();
clearForces();
return 1;
}
Aggregations