OrientedBoundingBox (OBB) - why the OrientedBoundingBox (OBB) are no longer implemented in JME3?

Hello everyone,

A question that interests me.
Why the OrientedBoundingBox (OBB) are no longer implemented in JME3?



My humble assumption is that’s because of the complexity of the topic (which implies many subtle aspects like speed vs accuracy, precision limit errors etc) - and JME is not intended to be a full scale math library covering every possible use case… such class would be either just one or another way limited implementation, or a huge monster with correspondingly huge setup needed to run it the way you really want it to run…

Yeah, probably because JME wouldn’t use it for anything. OBBs are a performance problem in a scene graph… so we wouldn’t use it there. Then where else?

Half the development of a library is making sure not to add stuff that’s never used except by the one person who will find all of the bugs.

Thank you, I understand your reasoning


Though… it would be useful for light probes. The influence of the lightprobe for now is a bounding sphere, but you may want squarish zone of influences (for proper reflection parallax). and in that case AABB makes not much sense, so OOBB would be nice. Though for light probes we only need a structure that holds the data, not really all the maths for collision and so on…

Useful in that “hey, there’s this tool that seems to fit”. Not useful in the “wow, this is really a poor performing pig” when you actually get an implementation working.

I’d love to be proven wrong is someone gets a OBB implementation written that performs well enough that it ends up being better than rejecting false positives from your current approach.

And I don’t know enough to say if there is a better way. Lighting tends to not be ‘square’ at all and there would be many more conic solutions that would match closer to the requirements and perform better than any bounding box.

Well as said, for lighting we only need an oriented box to compute parallax for reflection. Taht’s not OOBB properly speaking, at least OOBB as it’s usually used in frustum culling.

The squarish use case is if you have a room, and compute a light probe in this room. Sure you can have a sphere as area of influence, but if you get close to a wall for example the reflection will be offset and look wrong. If you can have an area of influence that matches more precisely to the room, you can efficiently correct the parallax in the reflection.

But that kind of “oriented bounding box” is a more trivial case than the general “oriented bounding box” where you must compute the OBB from objects, merge them, intersect them, etc…

Your use-case could be covered with a simple transform and an AABB.

yes, definitely.
Actually I may even change how it’s done now that I think about it. Having a bounding sphere as the influence for a probe is just alright because, as you said, it fits, but it can be confusing. I just need a center and a radius…
I think i may roll a complete new class.