Center and extents of a geometry

Hi,

I am trying to arrange a couple of geometries (imported Blender models mainly) in certain way, but I have problems get done exactly as I want.

Lets say I have a car mesh and I want its wheels to be in contact with the floor, which is a 100x100 horizontal quad with local translation <0,0,0>. So, I set car’s translation to <50,0,-50>, but then the car is not over the floor but the floor splits the car in two pieces.

How can I get car’s center and extents to set the correct translation to achieve the result I desire?



Thanks in advance!

Thanks, that lets me solve my problems.

One more question: the world bound is not created until rootNode’s geometry state is updated. When should I call updateGeometryState()? Each time a new geometry is added to the tree? What about updateLogicalState()? Sorry if these topics are addressed somewhere on the documentation, I didn’t find them.



Thanks one more Momoko!

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:updategeometricstate

Thanks Normen, reading immediately.

car.getWorldBound()



You can cast the world bound to a BoundingBox (this depends on how you setup your boundings).

The BoundingBox gives you the center and extends of the model.