use of com.bulletphysics.collision.broadphase.AxisSweep3 in project jmonkeyengine by jMonkeyEngine.
the class PhysicsSpace method create.
/**
* Has to be called from the (designated) physics thread
*/
public void create() {
pQueueTL.set(pQueue);
collisionConfiguration = new DefaultCollisionConfiguration();
dispatcher = new CollisionDispatcher(collisionConfiguration);
switch(broadphaseType) {
case SIMPLE:
broadphase = new SimpleBroadphase();
break;
case AXIS_SWEEP_3:
broadphase = new AxisSweep3(Converter.convert(worldMin), Converter.convert(worldMax));
break;
case AXIS_SWEEP_3_32:
broadphase = new AxisSweep3_32(Converter.convert(worldMin), Converter.convert(worldMax));
break;
case DBVT:
broadphase = new DbvtBroadphase();
break;
}
solver = new SequentialImpulseConstraintSolver();
dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);
dynamicsWorld.setGravity(new javax.vecmath.Vector3f(0, -9.81f, 0));
broadphase.getOverlappingPairCache().setInternalGhostPairCallback(new GhostPairCallback());
GImpactCollisionAlgorithm.registerAlgorithm(dispatcher);
physicsSpaceTL.set(this);
//register filter callback for tick / collision
setTickCallback();
setContactCallbacks();
//register filter callback for collision groups
setOverlapFilterCallback();
}
Aggregations