Adding bounds to a model?

I'm loading some OBJ files, but can't figure out how to add bounds to the Spatial. Anyone know how to do this?



I'm using the following line to convert:



          Spatial r=(Spatial)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));

  1. determine which bounds type best fits your model
  2. call setModelBound(new BoundingBox()); on your spatial (if you wanted to use box).
  3. call updateModelBound(); on the Spatial to calculate the bounds for the data.

P.S. set and update methods are new, so you'll need latest CVS.

How recent in the CVS? I just updated this morning, but don't see the setmodelbounds for Spatials. I did find a way to do it by casting the Spatial to a trimesh. Not sure how efficient that is though.

Well, look at that! I just updated again, and there they are. Thanks.  :smiley:

We need to have "Appreciate Your Local Monkey" day here on jME sometime soon. :slight_smile:



darkfrog