/** * 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(); } } }
float[] ul=null, ur=null, bl=null, br=null; if (getChild(0) instanceof TerrainPatch) { for (Spatial s : getChildren()) { if ( ((TerrainPatch)s).getQuadrant() == 1)
float[] ul=null, ur=null, bl=null, br=null; if (getChild(0) instanceof TerrainPatch) { for (Spatial s : getChildren()) { if ( ((TerrainPatch)s).getQuadrant() == 1)
/** * A handy method that will attach all bounding boxes of this terrain * to the node you supply. * Useful to visualize the bounding boxes when debugging. * * @param parent that will get the bounding box shapes of the terrain attached to */ public void attachBoundChildren(Node parent) { for (int i = 0; i < this.getQuantity(); i++) { if (this.getChild(i) instanceof TerrainQuad) { ((TerrainQuad) getChild(i)).attachBoundChildren(parent); } else if (this.getChild(i) instanceof TerrainPatch) { BoundingVolume bv = getChild(i).getWorldBound(); if (bv instanceof BoundingBox) { attachBoundingBox((BoundingBox)bv, parent); } } } BoundingVolume bv = getWorldBound(); if (bv instanceof BoundingBox) { attachBoundingBox((BoundingBox)bv, parent); } }
/** * 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(); } } }
/** * A handy method that will attach all bounding boxes of this terrain * to the node you supply. * Useful to visualize the bounding boxes when debugging. * * @param parent that will get the bounding box shapes of the terrain attached to */ public void attachBoundChildren(Node parent) { for (int i = 0; i < this.getQuantity(); i++) { if (this.getChild(i) instanceof TerrainQuad) { ((TerrainQuad) getChild(i)).attachBoundChildren(parent); } else if (this.getChild(i) instanceof TerrainPatch) { BoundingVolume bv = getChild(i).getWorldBound(); if (bv instanceof BoundingBox) { attachBoundingBox((BoundingBox)bv, parent); } } } BoundingVolume bv = getWorldBound(); if (bv instanceof BoundingBox) { attachBoundingBox((BoundingBox)bv, parent); } }