private PhysicsSpace getPhysicsSpace() { return bulletAppState.getPhysicsSpace(); } }
private PhysicsSpace getPhysicsSpace() { return bulletAppState.getPhysicsSpace(); } }
private PhysicsSpace getPhysicsSpace() { return bulletAppState.getPhysicsSpace(); } private ActionListener actionListener = new ActionListener() {
private PhysicsSpace getPhysicsSpace() { return bulletAppState.getPhysicsSpace(); } private ActionListener actionListener = new ActionListener() {
private PhysicsSpace getPhysicsSpace() { return bulletAppState.getPhysicsSpace(); } }
private PhysicsSpace getPhysicsSpace() { return bulletAppState.getPhysicsSpace(); } private ActionListener actionListener = new ActionListener() {
public Boolean call() throws Exception { pSpace.update(getPhysicsSpace().getAccuracy() * getSpeed()); pSpace.distributeEvents(); long update = System.currentTimeMillis() - detachedPhysicsLastUpdate; detachedPhysicsLastUpdate = System.currentTimeMillis(); executor.schedule(detachedPhysicsUpdate, Math.round(getPhysicsSpace().getAccuracy() * 1000000.0f) - (update * 1000), TimeUnit.MICROSECONDS); return true; } };
public Boolean call() throws Exception { pSpace.update(getPhysicsSpace().getAccuracy() * getSpeed()); pSpace.distributeEvents(); long update = System.currentTimeMillis() - detachedPhysicsLastUpdate; detachedPhysicsLastUpdate = System.currentTimeMillis(); executor.schedule(detachedPhysicsUpdate, Math.round(getPhysicsSpace().getAccuracy() * 1000000.0f) - (update * 1000), TimeUnit.MICROSECONDS); return true; } };
public void tileDetached(Vector3f cell, TerrainQuad quad) { if (usePhysics) { if (quad.getControl(RigidBodyControl.class) != null) { bulletAppState.getPhysicsSpace().remove(quad); quad.removeControl(RigidBodyControl.class); } } updateMarkerElevations(); } });
public void tileDetached(Vector3f cell, TerrainQuad quad) { if (quad.getControl(RigidBodyControl.class) != null) { bulletAppState.getPhysicsSpace().remove(quad); quad.removeControl(RigidBodyControl.class); } }
public void tileDetached(Vector3f cell, TerrainQuad quad) { if (quad.getControl(RigidBodyControl.class) != null) { bulletAppState.getPhysicsSpace().remove(quad); quad.removeControl(RigidBodyControl.class); } }
public void tileDetached(Vector3f cell, TerrainQuad quad) { if (quad.getControl(RigidBodyControl.class) != null) { bulletAppState.getPhysicsSpace().remove(quad); quad.removeControl(RigidBodyControl.class); } }
@Override public void simpleInitApp() { bulletAppState = new BulletAppState(); stateManager.attach(bulletAppState); bulletAppState.setDebugEnabled(true); bullet = new Sphere(32, 32, 0.4f, true, false); bullet.setTextureMode(TextureMode.Projected); bulletCollisionShape = new SphereCollisionShape(0.4f); PhysicsTestHelper.createPhysicsTestWorld(rootNode, assetManager, bulletAppState.getPhysicsSpace()); PhysicsTestHelper.createBallShooter(this, rootNode, bulletAppState.getPhysicsSpace()); // add ourselves as collision listener getPhysicsSpace().addCollisionListener(this); }
@Override public void simpleInitApp() { bulletAppState = new BulletAppState(); stateManager.attach(bulletAppState); bulletAppState.setDebugEnabled(true); PhysicsTestHelper.createPhysicsTestWorld(rootNode, assetManager, bulletAppState.getPhysicsSpace()); setupKeys(); buildPlayer(); }
/** Make a solid floor and add it to the scene. */ public void initFloor() { Geometry floor_geo = new Geometry("Floor", floor); floor_geo.setMaterial(floor_mat); floor_geo.setLocalTranslation(0, -0.1f, 0); this.rootNode.attachChild(floor_geo); /* Make the floor physical with mass 0.0f! */ floor_phy = new RigidBodyControl(0.0f); floor_geo.addControl(floor_phy); bulletAppState.getPhysicsSpace().add(floor_phy); }
@Override public void simpleInitApp() { bulletAppState = new BulletAppState(); stateManager.attach(bulletAppState); bulletAppState.setDebugEnabled(true); inputManager.addMapping("Pull ragdoll up", new MouseButtonTrigger(0)); inputManager.addListener(this, "Pull ragdoll up"); PhysicsTestHelper.createPhysicsTestWorld(rootNode, assetManager, bulletAppState.getPhysicsSpace()); createRagDoll(); }
Node createTestNode(float mass, Vector3f location) { float size = 0.1f; Vector3f halfExtents = new Vector3f(size, size, size); CollisionShape shape = new BoxCollisionShape(halfExtents); RigidBodyControl control = new RigidBodyControl(shape, mass); Node node = new Node(); node.addControl(control); rootNode.attachChild(node); bulletAppState.getPhysicsSpace().add(node); control.setPhysicsLocation(location); return node; }
public void tileAttached(Vector3f cell, TerrainQuad quad) { //workaround for bugged test j3o's while(quad.getControl(RigidBodyControl.class)!=null){ quad.removeControl(RigidBodyControl.class); } quad.addControl(new RigidBodyControl(new HeightfieldCollisionShape(quad.getHeightMap(), terrain.getLocalScale()), 0)); bulletAppState.getPhysicsSpace().add(quad); }
public void tileAttached(Vector3f cell, TerrainQuad quad) { while(quad.getControl(RigidBodyControl.class)!=null){ quad.removeControl(RigidBodyControl.class); } quad.addControl(new RigidBodyControl(new HeightfieldCollisionShape(quad.getHeightMap(), terrain.getLocalScale()), 0)); bulletAppState.getPhysicsSpace().add(quad); }
public void tileAttached(Vector3f cell, TerrainQuad quad) { while(quad.getControl(RigidBodyControl.class)!=null){ quad.removeControl(RigidBodyControl.class); } quad.addControl(new RigidBodyControl(new HeightfieldCollisionShape(quad.getHeightMap(), terrain.getLocalScale()), 0)); bulletAppState.getPhysicsSpace().add(quad); }