Skip to content

Commit

Permalink
feat(tools/vmap4_extractor) Add detection of collision-only material …
Browse files Browse the repository at this point in the history
…IDs (#20822)
  • Loading branch information
NathanHandley authored Dec 19, 2024
1 parent 866c304 commit 0b39bf0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tools/vmap4_extractor/wmo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,10 @@ int WMOGroup::ConvertToVMAPGroupWmo(FILE* output, bool preciseVectorData)
for (int i = 0; i < nTriangles; ++i)
{
// Skip no collision triangles
// TODO: Update to use MOBR in the future to catch any possibly missed edge cases
bool isRenderFace = (MOPY[2 * i] & WMO_MATERIAL_RENDER) && !(MOPY[2 * i] & WMO_MATERIAL_DETAIL);
bool isCollision = MOPY[2 * i] & WMO_MATERIAL_COLLISION || isRenderFace;
bool isCollisionOnlyFace = static_cast<unsigned char>(MOPY[(2 * i) + 1]) == 0xFF; // 255 is a collision-only material id
bool isCollision = MOPY[2 * i] & WMO_MATERIAL_COLLISION || isRenderFace || isCollisionOnlyFace;
if (!isCollision)
continue;
// Use this triangle
Expand Down

0 comments on commit 0b39bf0

Please sign in to comment.