terrain.setLocked(false); // unlock it so we can edit the height terrain.setShadowMode(ShadowMode.Receive); rootNode.attachChild(terrain);
terrain.setLocked(false); // unlock it so we can edit the height terrain.setShadowMode(RenderQueue.ShadowMode.Receive); rootNode.attachChild(terrain);
terrain.setLocked(false); // unlock it so we can edit the height terrain.setShadowMode(ShadowMode.Receive); rootNode.attachChild(terrain);
terrain.setLocked(false); // unlock it so we can edit the height terrain.setShadowMode(ShadowMode.Receive); rootNode.attachChild(terrain);
terrain.setLocked(false); // unlock it so we can edit the height terrain.setShadowMode(ShadowMode.CastAndReceive); terrain.addControl(new RigidBodyControl(0)); rootNode.attachChild(terrain);
public void randomizeHeightMap() { if(terrain != null) { try { HillHeightMap heightmap = new HillHeightMap(513, 2000, 25, 100, (long)((byte)100 * Math.random())); Material mat = terrain.getMaterial(); Vector3f scale = terrain.getLocalScale(); Vector3f trans = terrain.getLocalTranslation(); rootNode.detachChildNamed("Terrain"); terrain = new TerrainQuad("Terrain", 65, 513, heightmap.getHeightMap()); terrain.setLocalTranslation(trans); terrain.setLocalScale(scale); terrain.setMaterial(mat); terrain.setShadowMode(ShadowMode.Receive); rootNode.attachChild(terrain); } catch(Exception ex) { ex.printStackTrace(); } } }
terrain.setShadowMode(ShadowMode.Cast); terrain.setShadowMode(ShadowMode.Receive);
public void setStaticGeometry(Node staticNode) { this.staticNode = staticNode; // Add SKY direct to Root Spatial sky = staticNode.getChild("Skymap"); if(sky != null) { sky.removeFromParent(); this.rootNode.attachChild(sky); } // Add TERRAIN direct to Root Spatial terra = staticNode.getChild("Terrain"); if(terra != null) { terra.removeFromParent(); // ShadowMode mode = terra.getShadowMode(); terrain = (TerrainQuad)terra; terrain.setLocalTranslation(appScaled / 2, 0, appScaled / 2); this.rootNode.attachChild(terrain); /** 5. The LOD (level of detail) depends on were the camera is: */ TerrainLodControl control = new TerrainLodControl(terrain, cam); terrain.addControl(control); terrain.setShadowMode(ShadowMode.Receive); } GeometryBatchFactory.optimize(this.staticNode, true); this.rootNode.attachChild(this.staticNode); }