if (rootNode != null) {
dispose();
}
rootNode = new Node("Bounds Viewer Node");
RenderManager rm = ClientContextJME.getWorldManager().getRenderManager();
RenderComponent rc = rm.createRenderComponent(rootNode);
this.addComponent(RenderComponent.class, rc);
// Set the Z-buffer state on the root node
ZBufferState zbuf = (ZBufferState)rm.createRendererState(StateType.ZBuffer);
zbuf.setEnabled(true);
zbuf.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo);
rootNode.setRenderState(zbuf);
// Set the wireframe state on the root node
WireframeState wf = (WireframeState)rm.createRendererState(StateType.Wireframe);
wf.setEnabled(true);
rootNode.setRenderState(wf);
// Draw some geometry that mimics the bounds, either a sphere or a
// box. Add to the scene graph of this Entity.