Skip to content

Fix PHY collision mesh importing flipped - #474

Open
atirna wants to merge 1 commit into
REDxEYE:masterfrom
atirna:fix/phy-vertex-axis
Open

Fix PHY collision mesh importing flipped#474
atirna wants to merge 1 commit into
REDxEYE:masterfrom
atirna:fix/phy-vertex-axis

Conversation

@atirna

@atirna atirna commented Sep 1, 2026

Copy link
Copy Markdown

Description

I changed PHY collision vertex decoding to preserve the Source1 XYZ coordinate order. Previously the decoder exchanged Y and Z before mesh creation, mirroring the collision mesh against the visual model.

Fixes #290

Why

Collision geometry needs the same coordinate order as the visual model it represents. The mdl49 and mdl52 visual importers already pass decoded VVD coordinates straight into Mesh.from_pydata, so the PHY-only swap was the odd one out.

Verification

  • before, on current master: raw PHY vertex floats 1, 2, 3 fed through CollisionModel.get_vertex_data came back 1, 3, 2 with lateral and vertical swapped
  • after: the same input decodes 1, 2, 3, matching the order the visual mesh importers use
  • python3 -m compileall -q library/models/phy/phy.py

Remove the Y/Z axis swap in CollisionModel.get_vertex_data so decoded
collision vertices keep the same Source1 XYZ order the visual mesh
importers already use.

Fixes REDxEYE#290
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Physics model imported flipped and out of scale

1 participant