@Override protected void updateWorldBound() { refreshFlags &= ~RF_BOUND; BoundingVolume resultBound = null; for (int i = 0; i < firstUnusedIndex; i++) { Geometry geom = geometries[i]; if (geom != null) { if (resultBound != null) { // merge current world bound with child world bound resultBound.mergeLocal(geom.getWorldBound()); } else { // set world bound to first non-null child world bound if (geom.getWorldBound() != null) { resultBound = geom.getWorldBound().clone(this.worldBound); } } } } this.worldBound = resultBound; }
@Override protected void updateWorldBound(){ super.updateWorldBound(); // for a node, the world bound is a combination of all its children // bounds BoundingVolume resultBound = null; for (Spatial child : children.getArray()) { // child bound is assumed to be updated assert (child.refreshFlags & RF_BOUND) == 0; if (resultBound != null) { // merge current world bound with child world bound resultBound.mergeLocal(child.getWorldBound()); } else { // set world bound to first non-null child world bound if (child.getWorldBound() != null) { resultBound = child.getWorldBound().clone(this.worldBound); } } } if (resultBound == null) { resultBound = new BoundingBox(getWorldTranslation(), 0f, 0f, 0f); } this.worldBound = resultBound; }
@Override protected void updateWorldBound() { refreshFlags &= ~RF_BOUND; BoundingVolume resultBound = null; for (int i = 0; i < firstUnusedIndex; i++) { Geometry geom = geometries[i]; if (geom != null) { if (resultBound != null) { // merge current world bound with child world bound resultBound.mergeLocal(geom.getWorldBound()); } else { // set world bound to first non-null child world bound if (geom.getWorldBound() != null) { resultBound = geom.getWorldBound().clone(this.worldBound); } } } } this.worldBound = resultBound; }
@Override protected void updateWorldBound(){ super.updateWorldBound(); // for a node, the world bound is a combination of all its children // bounds BoundingVolume resultBound = null; for (Spatial child : children.getArray()) { // child bound is assumed to be updated assert (child.refreshFlags & RF_BOUND) == 0; if (resultBound != null) { // merge current world bound with child world bound resultBound.mergeLocal(child.getWorldBound()); } else { // set world bound to first non-null child world bound if (child.getWorldBound() != null) { resultBound = child.getWorldBound().clone(this.worldBound); } } } this.worldBound = resultBound; }
@Override protected void updateWorldBound(){ super.updateWorldBound(); // for a node, the world bound is a combination of all it's children // bounds BoundingVolume resultBound = null; for (Spatial child : children.getArray()) { // child bound is assumed to be updated assert (child.refreshFlags & RF_BOUND) == 0; if (resultBound != null) { // merge current world bound with child world bound resultBound.mergeLocal(child.getWorldBound()); } else { // set world bound to first non-null child world bound if (child.getWorldBound() != null) { resultBound = child.getWorldBound().clone(this.worldBound); } } } this.worldBound = resultBound; }