/** * Allocate a physics space and start physics. * <p> * Physics starts automatically after the state is attached. To start it * sooner, invoke this method. */ public void startPhysics() { if (initialized) { return; } switch (threadingType) { case PARALLEL: boolean success = startPhysicsOnExecutor(); assert success; assert pSpace != null; break; case SEQUENTIAL: pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType); pSpace.addTickListener(this); break; default: throw new IllegalStateException(threadingType.toString()); } initialized = true; }
/** * Allocate a physics space and start physics. * <p> * Physics starts automatically after the state is attached. To start it * sooner, invoke this method. */ public void startPhysics() { if (initialized) { return; } switch (threadingType) { case PARALLEL: boolean success = startPhysicsOnExecutor(); assert success; assert pSpace != null; break; case SEQUENTIAL: pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType); pSpace.addTickListener(this); break; default: throw new IllegalStateException(threadingType.toString()); } initialized = true; }
/** * The physics system is started automatically on attaching, if you want to start it * before for some reason, you can use this method. */ public void startPhysics() { //start physics thread(pool) if (threadingType == ThreadingType.PARALLEL) { startPhysicsOnExecutor(); // } else if (threadingType == ThreadingType.DETACHED) { // startPhysicsOnExecutor(); // executor.submit(detachedPhysicsUpdate); } else { pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType); } pSpace.addTickListener(this); initialized = true; }
/** * The physics system is started automatically on attaching, if you want to * start it before for some reason, you can use this method. */ public void startPhysics() { if (initialized) { return; } //start physics thread(pool) if (threadingType == ThreadingType.PARALLEL) { startPhysicsOnExecutor(); } else { pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType); } pSpace.addTickListener(this); initialized = true; }
/** * Allocate a physics space and start physics. * <p> * Physics starts automatically after the state is attached. To start it * sooner, invoke this method. */ public void startPhysics() { if (initialized) { return; } switch (threadingType) { case PARALLEL: boolean success = startPhysicsOnExecutor(); assert success; assert pSpace != null; break; case SEQUENTIAL: pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType); pSpace.addTickListener(this); break; default: throw new IllegalStateException(threadingType.toString()); } initialized = true; }