public Boolean call() throws Exception { detachedPhysicsLastUpdate = System.currentTimeMillis(); pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType); pSpace.addTickListener(app); return true; } };
public Boolean call() throws Exception { detachedPhysicsLastUpdate = System.currentTimeMillis(); pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType); pSpace.addTickListener(app); return 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; }
/** * 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; }
public void setPhysicsSpace(PhysicsSpace space) { createVehicle(space); if (space == null) { if (this.space != null) { this.space.removeCollisionObject(this); this.space.removeTickListener(this); } this.space = space; } else { space.addCollisionObject(this); space.addTickListener(this); } this.space = space; }
/** * Add all managed physics objects to the specified space. * * @param space which physics space to add to (not null) */ @Override protected void addPhysics(PhysicsSpace space) { space.getGravity(localUp).normalizeLocal().negateLocal(); updateLocalCoordinateSystem(); space.addCollisionObject(rigidBody); space.addTickListener(this); }
/** * Add all managed physics objects to the specified space. * * @param space which physics space to add to (not null) */ @Override protected void addPhysics(PhysicsSpace space) { space.getGravity(localUp).normalizeLocal().negateLocal(); updateLocalCoordinateSystem(); space.addCollisionObject(rigidBody); space.addTickListener(this); }
public void collision(PhysicsCollisionEvent event) { if (space == null) { return; } if (event.getObjectA() == this || event.getObjectB() == this) { space.add(ghostObject); ghostObject.setPhysicsLocation(getPhysicsLocation(vector)); space.addTickListener(this); if (effect != null && spatial.getParent() != null) { curTime = 0; effect.setLocalTranslation(spatial.getLocalTranslation()); spatial.getParent().attachChild(effect); effect.emitAllParticles(); } space.remove(this); spatial.removeFromParent(); } }
public Boolean call() throws Exception { detachedPhysicsLastUpdate = System.currentTimeMillis(); pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType); pSpace.addTickListener(app); return true; } };
public Boolean call() throws Exception { detachedPhysicsLastUpdate = System.currentTimeMillis(); pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType); pSpace.addTickListener(app); return true; } };
public Boolean call() throws Exception { detachedPhysicsLastUpdate = System.currentTimeMillis(); pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType); pSpace.addTickListener(app); return 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; }
/** * Add all managed physics objects to the specified space. * * @param space which physics space to add to (not null) */ @Override protected void addPhysics(PhysicsSpace space) { space.getGravity(localUp).normalizeLocal().negateLocal(); updateLocalCoordinateSystem(); space.addCollisionObject(rigidBody); space.addTickListener(this); }
/** * This is implemented from AbstractPhysicsControl and called when the * control is supposed to add all objects to the physics space. * * @param space */ @Override protected void addPhysics(PhysicsSpace space) { space.getGravity(localUp).normalizeLocal().negateLocal(); updateLocalCoordinateSystem(); space.addCollisionObject(rigidBody); space.addTickListener(this); }
public void collision(PhysicsCollisionEvent event) { if (space == null) { return; } if (event.getObjectA() == this || event.getObjectB() == this) { space.add(ghostObject); ghostObject.setPhysicsLocation(getPhysicsLocation(vector)); space.addTickListener(this); if (effect != null && spatial.getParent() != null) { curTime = 0; effect.setLocalTranslation(spatial.getLocalTranslation()); spatial.getParent().attachChild(effect); effect.emitAllParticles(); } space.remove(this); spatial.removeFromParent(); } }
physicsControl.getWorld().addPMDNode(pmdNode); physicsControl.getWorld().getPhysicsSpace().addTickListener(tl); ikControl = new IKControl(pmdNode); boneEnabled = new int[pmdNode.getSkeleton().getBoneCount()];