Default bounding volumes

All Geometry should have a default bounding volume. It’s more standardized (user proof) and makes sense in a generic way. I propose a new BoundingVolume class called InfiniteBounds that is staticly created and only one of its type exist. When merged with other bounds, it simply returns itself. This bound is always inside the ViewFrustum and is the default bounds for all Geometry objects.

The advantage is that it

  1. Allows us to create a “standard” that all Geometry objects should follow, especially for something as basic to jME’s design as bounding volumes.

  2. Doesn’t allow users to “screw up” and forget to assign a bounding volume, which creates a TriMesh that pops on the screen.

  3. Is speed and memory efficient.

  4. Is the theoretically correct state for a Geometry object to be in that hasn’t been assigned a Bounding Volume. The state of “null” just doesn’t seem right.

  5. Quick and easy to code

    What’s everyone think?

I like this idea. Looking through the BoundingVolume interface we could just make:

merge return itself, intersection return false, whichSide is always POSITIVE_SIDE, etc.

I like the idea, but how is it more memory efficient?

Well rather not more efficient, but “very” as it’s only a single object that has to be on the heap, yet we can solve a lot of things.

Cool, just making sure I understood correctly. :slight_smile: