payday2-model-tool icon indicating copy to clipboard operation
payday2-model-tool copied to clipboard

Identity transform matrix for colliders

Open miniwolf opened this issue 2 years ago • 2 comments

On the model: gov_c_ext_bottom_platform_24x12x1m The colliders c_box_1, c_box_2, etc. all have the identity transform matrix when exported. When verifying this with the in game editor I can see that the colliders are placed correctly. Is there some external data for this or is the model exporter doing something incorrectly here?

miniwolf avatar Mar 19 '23 02:03 miniwolf

So after digging for a while. I realized that the bounds_min and bounds_max contain information about how the collider should be set up in relation to the root object. I will locally make changes to store the bounding volume's center and scale in the transform to get the information out from the .model file.

miniwolf avatar Mar 19 '23 15:03 miniwolf

Here is my modified method for converting the bounding volume for non-meshed colliding children into the transform matrix. https://gist.github.com/miniwolf/4eaee2cc20bf28605a894c1d49991959 The objects do not get a new mesh but the transform matrix will have the translation, scale, and rotation necessary to create a bounding box around it matching the one you would find in the game.

miniwolf avatar Mar 21 '23 21:03 miniwolf