kythyria / payday2-model-tool

Diesel Model importer/exporter, with bones/rigging coming soon!
https://ci.appveyor.com/project/kythyria/payday2-model-tool/build/artifacts
GNU General Public License v3.0
19 stars 7 forks source link

Identity transform matrix for colliders #27

Open miniwolf opened 1 year ago

miniwolf commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.