Auto render the ModelBound of a Geometry

Hello.  I'm just getting started working through some of the examples and I was wondering about the easiest way to have Geometry render its ModelBounds (e.g. as a wireframe box or somesuch).



For instance:


      // Create the box in the middle. Give it a bounds
      Box b = new Box("My Box", new Vector3f(-1, -1, -1), new Vector3f(1, 1, 1));
      b.setModelBound(new BoundingBox());
      b.updateModelBound();
      b.setLightCombineMode(LightState.OFF);
      rootNode.attachChild(b);



What is the easiest way to tell 'b' to render its modelbounds whenever itself gets rendered?

Thanks!

I think Debugger.drawBounds( theNodeYouWantToRenderBounds ) is what you want. You just put this line in your render method.

if you want to only render the wireframe instead of the solid box, you can apply a Wireframestate to the box.