use of com.bulletphysics.dynamics.constraintsolver.TypedConstraint in project bdx by GoranM.
the class DiscreteDynamicsWorld method solveConstraints.
protected void solveConstraints(ContactSolverInfo solverInfo) {
BulletStats.pushProfile("solveConstraints");
try {
// sorted version of all btTypedConstraint, based on islandId
sortedConstraints.clear();
for (int i = 0; i < constraints.size(); i++) {
sortedConstraints.add(constraints.getQuick(i));
}
//Collections.sort(sortedConstraints, sortConstraintOnIslandPredicate);
MiscUtil.quickSort(sortedConstraints, sortConstraintOnIslandPredicate);
ObjectArrayList<TypedConstraint> constraintsPtr = getNumConstraints() != 0 ? sortedConstraints : null;
solverCallback.init(solverInfo, constraintSolver, constraintsPtr, sortedConstraints.size(), debugDrawer, /*,m_stackAlloc*/
dispatcher1);
constraintSolver.prepareSolve(getCollisionWorld().getNumCollisionObjects(), getCollisionWorld().getDispatcher().getNumManifolds());
// solve all the constraints for this island
islandManager.buildAndProcessIslands(getCollisionWorld().getDispatcher(), getCollisionWorld().getCollisionObjectArray(), solverCallback);
constraintSolver.allSolved(solverInfo, debugDrawer);
} finally {
BulletStats.popProfile();
}
}
use of com.bulletphysics.dynamics.constraintsolver.TypedConstraint in project bdx by GoranM.
the class RigidBody method addConstraintRef.
public void addConstraintRef(TypedConstraint c) {
int index = constraintRefs.indexOf(c);
if (index == -1) {
constraintRefs.add(c);
}
checkCollideWith = true;
}
use of com.bulletphysics.dynamics.constraintsolver.TypedConstraint in project bdx by GoranM.
the class DiscreteDynamicsWorld method getConstraintIslandId.
private static int getConstraintIslandId(TypedConstraint lhs) {
int islandId;
CollisionObject rcolObj0 = lhs.getRigidBodyA();
CollisionObject rcolObj1 = lhs.getRigidBodyB();
islandId = rcolObj0.getIslandTag() >= 0 ? rcolObj0.getIslandTag() : rcolObj1.getIslandTag();
return islandId;
}
Aggregations