I am still pondering BoundingVolumes

If I understand how things work, ulitmately I would like everything in my scenegraph to be bounded for performance purposes.  However I don't want to be creating BoundingVolumes where they aren't required, so I have come to some conclusions and I am looking to see if they are accurate.



Here are my conclusions:

  • Everything in the scenegraph that needs a BoundingVolume will be derived from either Geometry or Node (and ultimately Spatial).  This assumes that I don't derive my own classes from Spatial.
  • Nodes create their own WorldBounds based on the BoundingVolume of their first child merged with the BoundingVolumes of all subsequent children.  Therefore setWorldBounds on a Node really doesn't do anything because the update of the worldBounds will override it.
  • Geometry needs ModelBounds to ultimatly define their worldBounds, so setting worldBounds on these is worthless too, however the setting ModelBounds is important, as is updateModelBounds and updateWorldBounds so that the transforms are applied.



    So, what I am sitting here wondering is when do I ever need to call setWorldBounds() on anything?  Shouldn't I just make sure that I setModelBounds() on all my Geometry and update them as well as the updateWorldBounds() on all nodes (or the top-most one)?



    I appologize if this doesn't make sense or is stupid, I guess I only post questions when my brain is spinning from all the different stuff that I am playing with and all the easy things all of a sudden become incomprehensible.



    Lastly, as I try to do in all (3 or so) of my posts, I want to mention that the work of the jMonkey team is fantastic!  Features of engines that one would pay $100K for would be nice, documentation of every thought in you collective brains would be nice, hell it would be nice if I won the lottery and drove a Ferrari.  But the things being as they are - reality and all that - I think that what you produce is an incredible product.  Some day I hope to be productive enough to contribute.  Please keep up the good work it is all greatly appreciated.


LostInTheMatrices said:

So, what I am sitting here wondering is when do I ever need to call setWorldBounds() on anything?

Never :)
What you describe about boundings seems entirely correct to me.
Actually no code in jME does ever call setWorldBound, nor should it. I have removed that method.

Just to be orn'ry…I don't know how to spell that word, I can just hear my Granddad's voice in my head telling me that I am orn'ry…



If I never call setWorldBound() (cause I can't), does it make sense to have to call setModelBound(), updateModelBound(), and then updateWorldBound()?  I would suggest just setBoundingVolume() and updateBoundingVolume() is more intuative.  Just a suggestion, I don't want to sound presumptuous, just being orn'ry.



Later.



jMonkey rocks!