Topic: 3dsmax exporter - physics mesh VS graphics mesh aligment issue.

I'm currently updating my 3dsmax exporter for maratis, and I've run into a slight issue.
It seems as if the physics mesh is not overlapping the graphics mesh the way I want.

Let's take a box as example (in 3dsmax) -
the default pivot point of a 3dsmax box is at the lower end of the box.
But it seems as if maratis expects the 'pivot' to be in the center of the box?

So I guess my question now is:
How does maratis create the physics box? is it created from the 'center' and out?
What parameters does it use from the graphics mesh to get the proper size it should be? (bounding box?).
And is there a way to see the physics mesh for debugging?

Right now it's pretty hard to 'see' whats going on when all you see is physics shapes going into other shapes.
For example spheres goes half into the floor, when they should be on top, the sphere is fine if I set the pivot on the box floor to be in the center,  so it seems as if it's the issue.

All though it's not ideal in any way - because I would like to move my pivot freely and then also align the physics with the graphics - regardless of where the pivot is located in 3dsmax. I'm sure I can fix it somehow on my end, but it's just a bit unclear to me how it works.

If it's unclear I can upload a scene, one where the pivot\graphics\physics is wrong, and one where it's aligned.

Re: 3dsmax exporter - physics mesh VS graphics mesh aligment issue.


the pivot is the mesh origin (where the mesh local coordinates is 0, 0, 0).

There is a way to control the collision shape position:
- Create an Invisible centered-box (or sphere or tube to visualise) and enable collision
- Parent your object to the Invisible box
(you can even parent the invisible object to another one to use compound physical shapes)

Look at this example for complex cases : "Small Demos" > Physics.level

If you want to look at how the engine create the shapes, have a look at the function "createShape" here : … MScene.cpp