/** * Initialize this state prior to its 1st update. Should be invoked only by * a subclass or by the AppStateManager. * * @param stateManager the manager for this state (not null) * @param app the application which owns this state (not null) */ public void initialize(AppStateManager stateManager, Application app) { this.app = app; this.stateManager = stateManager; startPhysics(); }
/** * Initialize this state prior to its 1st update. Should be invoked only by * a subclass or by the AppStateManager. * * @param stateManager the manager for this state (not null) * @param app the application which owns this state (not null) */ public void initialize(AppStateManager stateManager, Application app) { this.app = app; this.stateManager = stateManager; startPhysics(); }
/** * Transition this state from detached to initializing. Should be invoked * only by a subclass or by the AppStateManager. * * @param stateManager (not null) */ public void stateAttached(AppStateManager stateManager) { if (!initialized) { startPhysics(); } if (threadingType == ThreadingType.PARALLEL) { PhysicsSpace.setLocalThreadPhysicsSpace(pSpace); } if (debugEnabled) { debugAppState = new BulletDebugAppState(pSpace); stateManager.attach(debugAppState); } }
/** * Transition this state from detached to initializing. Should be invoked * only by a subclass or by the AppStateManager. * * @param stateManager (not null) */ public void stateAttached(AppStateManager stateManager) { if (!initialized) { startPhysics(); } if (threadingType == ThreadingType.PARALLEL) { PhysicsSpace.setLocalThreadPhysicsSpace(pSpace); } if (debugEnabled) { debugAppState = new BulletDebugAppState(pSpace); stateManager.attach(debugAppState); } }
private void initData() { getRootNode(); physicsState = new BulletAppState(); physicsState.startPhysics(); physicsState.getPhysicsSpace().setGravity(Vector3f.ZERO); //horizon physicsState.getPhysicsSpace().add(new RigidBodyControl(poiHorizonCollisionShape, 0)); int hashCode = inParentPosition.hashCode(); Vector3f[] positions = getPositions(poiCount, hashCode); for (int i = 0; i < positions.length; i++) { Vector3f vector3f = positions[i]; Geometry poiGeom = new Geometry("poi", poiMesh); poiGeom.setLocalTranslation(vector3f); poiGeom.setMaterial(poiMaterial); RigidBodyControl control = new RigidBodyControl(poiCollisionShape, 0); //!!! Important control.setApplyPhysicsLocal(true); poiGeom.addControl(control); physicsState.getPhysicsSpace().add(poiGeom); rootNode.attachChild(poiGeom); } //add balls after so first 10 geoms == locations for (int i = 0; i < positions.length; i++) { Vector3f vector3f = positions[i]; Geometry ball = getRandomBall(vector3f); physicsState.getPhysicsSpace().add(ball); rootNode.attachChild(ball); } }
/** * Initialize this state prior to its 1st update. Should be invoked only by * a subclass or by the AppStateManager. * * @param stateManager the manager for this state (not null) * @param app the application which owns this state (not null) */ public void initialize(AppStateManager stateManager, Application app) { this.app = app; this.stateManager = stateManager; startPhysics(); }
public void initialize(AppStateManager stateManager, Application app) { this.app = app; this.stateManager = stateManager; startPhysics(); }
public void initialize(AppStateManager stateManager, Application app) { if (!initialized) { startPhysics(); } initialized = true; }
public void stateAttached(AppStateManager stateManager) { if (!initialized) { startPhysics(); } if (threadingType == ThreadingType.PARALLEL) { PhysicsSpace.setLocalThreadPhysicsSpace(pSpace); } }
public void stateAttached(AppStateManager stateManager) { if (!initialized) { startPhysics(); } if (threadingType == ThreadingType.PARALLEL) { PhysicsSpace.setLocalThreadPhysicsSpace(pSpace); } if (debugEnabled) { debugAppState = new BulletDebugAppState(pSpace); stateManager.attach(debugAppState); } }
/** * Transition this state from detached to initializing. Should be invoked * only by a subclass or by the AppStateManager. * * @param stateManager (not null) */ public void stateAttached(AppStateManager stateManager) { if (!initialized) { startPhysics(); } if (threadingType == ThreadingType.PARALLEL) { PhysicsSpace.setLocalThreadPhysicsSpace(pSpace); } if (debugEnabled) { debugAppState = new BulletDebugAppState(pSpace); stateManager.attach(debugAppState); } }