/** * disable the display of the path and the waypoints */ public void disableDebugShape() { debugNode.detachAllChildren(); debugNode = null; assetManager = null; }
public void onAction(String name, boolean isPressed, float tpf) { if(isPressed && name.equals("refire")) { //fpp.removeFilter(tbf); // <-- add back in to fix particleNode.detachAllChildren(); createParticles(); //fpp.addFilter(tbf); } } }, "refire");
existingTerrain.removeFromParent(); existingTerrain.removeControl(TerrainLodControl.class); existingTerrain.detachAllChildren(); terrain = null;
/** * sets the tension of the curve (only for catmull rom) 0.0 will give a linear curve, 1.0 a round curve * @param curveTension */ public void setCurveTension(float curveTension) { spline.setCurveTension(curveTension); if (debugNode != null) { Node parent = debugNode.getParent(); debugNode.removeFromParent(); debugNode.detachAllChildren(); debugNode = null; attachDebugNode(parent); } }
/** * sets the type of spline used for the path interpolation for this path * @param pathSplineType */ public void setPathSplineType(SplineType pathSplineType) { spline.setType(pathSplineType); if (debugNode != null) { Node parent = debugNode.getParent(); debugNode.removeFromParent(); debugNode.detachAllChildren(); debugNode = null; attachDebugNode(parent); } }
/** * Sets the path to be a cycle * @param cycle */ public void setCycle(boolean cycle) { spline.setCycle(cycle); if (debugNode != null) { Node parent = debugNode.getParent(); debugNode.removeFromParent(); debugNode.detachAllChildren(); debugNode = null; attachDebugNode(parent); } }
@Override protected void cleanup(Application app) { ui.detachAllChildren(); InputManager manager = getApplication().getInputManager(); manager.deleteMapping(TOGGLE_KEY); manager.deleteMapping(CLICK_KEY); manager.removeListener(inputListener); }
@Override public void simpleUpdate(float tpf){ rootNode.detachAllChildren(); for (int y = -15; y < 15; y++){ for (int x = -15; x < 15; x++){ Mesh sphMesh = original.deepClone(); Geometry sphere = new Geometry("sphere", sphMesh); sphere.setMaterial(solidColor); sphere.setLocalTranslation(x * 1.5f, 0, y * 1.5f); rootNode.attachChild(sphere); } } } }
myPlayer.detachAllChildren(); SaveGame.saveGame("mycompany/mygame", "savegame_001", myPlayer);
@Test public void testCylinders() { Random random = new Random(); // Create a cylinder, cast a random ray, and ensure everything goes well. Node scene = new Node("Scene Node"); for (int i = 0; i < NUMBER_OF_TRIES; i++) { scene.detachAllChildren(); Cylinder cylinder = new Cylinder(2, 8, 1, 1, true); Geometry geometry = new Geometry("cylinder", cylinder); geometry.rotate(FastMath.HALF_PI, 0, 0); scene.attachChild(geometry); // Cast a random ray, and count successes and IndexOutOfBoundsExceptions. Vector3f randomPoint = new Vector3f(random.nextFloat(), random.nextFloat(), random.nextFloat()); Vector3f randomDirection = new Vector3f(random.nextFloat(), random.nextFloat(), random.nextFloat()); randomDirection.normalizeLocal(); Ray ray = new Ray(randomPoint, randomDirection); CollisionResults collisionResults = new CollisionResults(); // If the geometry is invalid, this should throw various exceptions. scene.collideWith(ray, collisionResults); } } }
joystickInfo.detachAllChildren();
private void createVehicle() { suspensionNode.detachAllChildren(); for (int i = 0; i < body.getNumWheels(); i++) { VehicleWheel physicsVehicleWheel = body.getWheel(i); Vector3f location = physicsVehicleWheel.getLocation().clone(); Vector3f direction = physicsVehicleWheel.getDirection().clone(); Vector3f axle = physicsVehicleWheel.getAxle().clone(); float restLength = physicsVehicleWheel.getRestLength(); float radius = physicsVehicleWheel.getRadius(); Arrow locArrow = new Arrow(location); Arrow axleArrow = new Arrow(axle.normalizeLocal().multLocal(0.3f)); Arrow wheelArrow = new Arrow(direction.normalizeLocal().multLocal(radius)); Arrow dirArrow = new Arrow(direction.normalizeLocal().multLocal(restLength)); Geometry locGeom = new Geometry("WheelLocationDebugShape" + i, locArrow); Geometry dirGeom = new Geometry("WheelDirectionDebugShape" + i, dirArrow); Geometry axleGeom = new Geometry("WheelAxleDebugShape" + i, axleArrow); Geometry wheelGeom = new Geometry("WheelRadiusDebugShape" + i, wheelArrow); dirGeom.setLocalTranslation(location); axleGeom.setLocalTranslation(location.add(direction)); wheelGeom.setLocalTranslation(location.add(direction)); locGeom.setMaterial(debugAppState.DEBUG_MAGENTA); dirGeom.setMaterial(debugAppState.DEBUG_MAGENTA); axleGeom.setMaterial(debugAppState.DEBUG_MAGENTA); wheelGeom.setMaterial(debugAppState.DEBUG_MAGENTA); suspensionNode.attachChild(locGeom); suspensionNode.attachChild(dirGeom); suspensionNode.attachChild(axleGeom); suspensionNode.attachChild(wheelGeom); } }
private void createVehicle() { suspensionNode.detachAllChildren(); for (int i = 0; i < body.getNumWheels(); i++) { VehicleWheel physicsVehicleWheel = body.getWheel(i); Vector3f location = physicsVehicleWheel.getLocation().clone(); Vector3f direction = physicsVehicleWheel.getDirection().clone(); Vector3f axle = physicsVehicleWheel.getAxle().clone(); float restLength = physicsVehicleWheel.getRestLength(); float radius = physicsVehicleWheel.getRadius(); Arrow locArrow = new Arrow(location); Arrow axleArrow = new Arrow(axle.normalizeLocal().multLocal(0.3f)); Arrow wheelArrow = new Arrow(direction.normalizeLocal().multLocal(radius)); Arrow dirArrow = new Arrow(direction.normalizeLocal().multLocal(restLength)); Geometry locGeom = new Geometry("WheelLocationDebugShape" + i, locArrow); Geometry dirGeom = new Geometry("WheelDirectionDebugShape" + i, dirArrow); Geometry axleGeom = new Geometry("WheelAxleDebugShape" + i, axleArrow); Geometry wheelGeom = new Geometry("WheelRadiusDebugShape" + i, wheelArrow); dirGeom.setLocalTranslation(location); axleGeom.setLocalTranslation(location.add(direction)); wheelGeom.setLocalTranslation(location.add(direction)); locGeom.setMaterial(debugAppState.DEBUG_MAGENTA); dirGeom.setMaterial(debugAppState.DEBUG_MAGENTA); axleGeom.setMaterial(debugAppState.DEBUG_MAGENTA); wheelGeom.setMaterial(debugAppState.DEBUG_MAGENTA); suspensionNode.attachChild(locGeom); suspensionNode.attachChild(dirGeom); suspensionNode.attachChild(axleGeom); suspensionNode.attachChild(wheelGeom); } }
/** * disable the display of the path and the waypoints */ public void disableDebugShape() { debugNode.detachAllChildren(); debugNode = null; assetManager = null; }
public Object call() throws Exception { thisObject.detachAllChildren(); return null; } });
public Object call() throws Exception { thisObject.detachAllChildren(); return null; } });
guiNode.detachAllChildren(); guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt"); helloText = new BitmapText(guiFont, false);
public void update() { Node newCloud; if ((newCloud = newPointCloud.getAndSet(null)) != null) { if (this.getParent() != null) { thisObject.detachAllChildren(); thisObject.attachChild(newCloud); } } }
public void update() { Node newCloud; if ((newCloud = newPointCloud.getAndSet(null)) != null) { if (this.getParent() != null) { thisObject.detachAllChildren(); thisObject.attachChild(newCloud); } } }
private void refreshResource() { ArtResource temp = getResource(); if (temp != currentResource) { currentResource = temp; Node nodeObject = (Node) AssetUtils.loadModel(worldState.getAssetManager(), currentResource.getName()); nodeObject.move(0, MapLoader.FLOOR_HEIGHT, 0); ((Node) getSpatial()).detachAllChildren(); for (Spatial spat : nodeObject.getChildren()) { ((Node) getSpatial()).attachChild(spat); } } }