/** * lock or unlock the meshes of this terrain. * Locked meshes are uneditable but have better performance. * @param locked or unlocked */ public void setLocked(boolean locked) { for (int i = 0; i < this.getQuantity(); i++) { if (this.getChild(i) instanceof TerrainQuad) { ((TerrainQuad) getChild(i)).setLocked(locked); } else if (this.getChild(i) instanceof TerrainPatch) { if (locked) ((TerrainPatch) getChild(i)).lockMesh(); else ((TerrainPatch) getChild(i)).unlockMesh(); } } }
terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0)); terrain.setLocked(false); // unlock it so we can edit the height
terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0)); terrain.setLocked(false); // unlock it so we can edit the height
terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0)); terrain.setLocked(false); // unlock it so we can edit the height
terrain.setLocalScale(new Vector3f(5, 5, 5)); terrain.setLocalTranslation(new Vector3f(0, -30, 0)); terrain.setLocked(false); // unlock it so we can edit the height
terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(2, 2, 2)); terrain.setLocked(false); // unlock it so we can edit the height
terrain.setMaterial(matRock); terrain.setLocalScale(new Vector3f(2, 2, 2)); terrain.setLocked(false); // unlock it so we can edit the height rootNode.attachChild(terrain);
/** * lock or unlock the meshes of this terrain. * Locked meshes are uneditable but have better performance. * @param locked or unlocked */ public void setLocked(boolean locked) { for (int i = 0; i < this.getQuantity(); i++) { if (this.getChild(i) instanceof TerrainQuad) { ((TerrainQuad) getChild(i)).setLocked(locked); } else if (this.getChild(i) instanceof TerrainPatch) { if (locked) ((TerrainPatch) getChild(i)).lockMesh(); else ((TerrainPatch) getChild(i)).unlockMesh(); } } }