[solved] Defining BoundingBox for optimization


I have a question about bounding boxes:
In a previous (old) technology i used, it was possible to define a bounding box to a node for optimization purpose, here is an example of how it was used:

I have a node with a complex model (like a house), and i know that the house’s size is 10x10x8 meters, so i define a bounding box of size 10, 10, 8 around the house i add to the node, so the engine knows that:

  • If that bounding box is not visible in the screen, it’s not necessary to display the house.
  • Something which is not into that bounding box can’t collision anything in the house.
    It has to be well set, if it’s not big enough, you would see the house disappearing or go through the walls.

It was possible of course to define nested bounding boxes, like in each room of the house.

I tried to search if a similar mecanism was present in Jme but i was confused with topics talking about the collision box of items in Jbullet which is not the same thing.

So my two questions are:

  • Is it possible in Jmonkeyengine ?
  • Is it necessary in Jmonkeyengine ?

Thanks in advance

Yes, JME uses bounding shapes. JME will already calculate a bounding box based on the mesh.

Did you look at the javadoc? There are a bunch of methods related to getWorldBound(), getLocalBound(), etc…

It’s a rare case that you would have to calculate these yourself.

Thanks for the answer, yes i saw the javadoc but i was confused with that, i didn’t knew it was automatically calculated, but i realize it’s normal as it’s a more modern engine !