use of com.bulletphysics.collision.broadphase.DispatcherInfo in project bdx by GoranM.
the class DiscreteDynamicsWorld method internalSingleStepSimulation.
protected void internalSingleStepSimulation(float timeStep) {
BulletStats.pushProfile("internalSingleStepSimulation");
Stack stack = Stack.enter();
int sp = stack.getSp();
try {
// apply gravity, predict motion
predictUnconstraintMotion(timeStep);
DispatcherInfo dispatchInfo = getDispatchInfo();
dispatchInfo.timeStep = timeStep;
dispatchInfo.stepCount = 0;
dispatchInfo.debugDraw = getDebugDrawer();
// perform collision detection
performDiscreteCollisionDetection();
calculateSimulationIslands();
getSolverInfo().timeStep = timeStep;
// solve contact and other joint constraints
solveConstraints(getSolverInfo());
//CallbackTriggers();
// integrate transforms
integrateTransforms(timeStep);
// update vehicle simulation
updateActions(timeStep);
// update vehicle simulation
updateVehicles(timeStep);
updateActivationState(timeStep);
if (internalTickCallback != null) {
internalTickCallback.internalTick(this, timeStep);
}
} finally {
BulletStats.popProfile();
stack.leave(sp);
}
}
use of com.bulletphysics.collision.broadphase.DispatcherInfo 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