public static void drawBounds(SceneElement se, Renderer r, boolean doChildren) { if (se == null) return;  if (boundsWireState == null) { boundsWireState = r.createWireframeState(); boundsZState = r.createZBufferState(); boundingBox.setRenderState(boundsWireState); boundingBox.setRenderState(boundsZState); boundingBox.updateRenderState(); boundingOB.setRenderState(boundsWireState); boundingOB.setRenderState(boundsZState); boundingOB.updateRenderState(); boundingSphere.setRenderState(boundsWireState); boundingSphere.setRenderState(boundsZState); boundingSphere.updateRenderState(); }  if (se.getWorldBound() != null && se.getCullMode() != SceneElement.CULL_ALWAYS) { int state = r.getCamera().getPlaneState(); if (r.getCamera().contains(se.getWorldBound()) != Camera.OUTSIDE_FRUSTUM) drawBounds(se.getWorldBound(), r); else doChildren = false; r.getCamera().setPlaneState(state); } if (doChildren && (se.getType() & SceneElement.NODE) != 0) { Node n = (Node)se; if (n.getChildren() != null) { for (int i = n.getChildren().size(); --i >= 0; ) drawBounds(n.getChild(i), r, true); } } else if (doChildren && (se.getType() & SceneElement.GEOMETRY) != 0) { Geometry g = (Geometry)se; if (g.getBatchCount() > 0) { for (int i = g.getBatchCount(); --i >= 0; ) { GeomBatch gb = g.getBatch(i); if (gb.isEnabled()) drawBounds(gb, r, true); } } }
public static void drawBounds(SceneElement se, Renderer r) { drawBounds(se, r, true);
    public static void drawBounds(SceneElement se, Renderer r, boolean doChildren) {        if (se == null) return;        if (boundsWireState == null) {            boundsWireState = r.createWireframeState();            boundsZState = r.createZBufferState();            boundingBox.setRenderState(boundsWireState);            boundingBox.setRenderState(boundsZState);            boundingBox.updateRenderState();            boundingOB.setRenderState(boundsWireState);            boundingOB.setRenderState(boundsZState);            boundingOB.updateRenderState();            boundingSphere.setRenderState(boundsWireState);            boundingSphere.setRenderState(boundsZState);            boundingSphere.updateRenderState();        }                if (se.getWorldBound() != null && se.getCullMode() != SceneElement.CULL_ALWAYS) {            int state = r.getCamera().getPlaneState();            if (r.getCamera().contains(se.getWorldBound()) != Camera.OUTSIDE_FRUSTUM)                drawBounds(se.getWorldBound(), r);            else                doChildren = false;            r.getCamera().setPlaneState(state);        }        if (doChildren && (se.getType() & SceneElement.NODE) != 0) {            Node n = (Node)se;            if (n.getChildren() != null) {                for (int i = n.getChildren().size(); --i >= 0; )                    drawBounds(n.getChild(i), r, true);            }        } else if (doChildren && (se.getType() & SceneElement.GEOMETRY) != 0) {            Geometry g = (Geometry)se;            if (g.getBatchCount() > 0) {                for (int i = g.getBatchCount(); --i >= 0; ) {                    GeomBatch gb = g.getBatch(i);                    if (gb.isEnabled())                        drawBounds(gb, r, true);                }            }        }    }