mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
Fix invisible walls from WMO doodad M2 collision and MOPY filtering
WMO interior doodads (gears, decorations) were blocking player movement via M2 collision. Skip collision for all WMO doodad M2 instances since the WMO itself handles wall collision. Also filter WMO wall collision using MOPY per-triangle flags: only rendered+collidable triangles block the player, skipping invisible collision hulls. Revert tram portal extended range (no longer needed with collision fix).
This commit is contained in:
parent
ee4e6a31ce
commit
4cbceced67
7 changed files with 44 additions and 20 deletions
|
|
@ -182,6 +182,7 @@ struct M2Instance {
|
|||
bool cachedIsGroundDetail = false;
|
||||
bool cachedIsInvisibleTrap = false;
|
||||
bool cachedIsValid = false;
|
||||
bool skipCollision = false; // WMO interior doodads — skip player wall collision
|
||||
float cachedBoundRadius = 0.0f;
|
||||
|
||||
// Frame-skip optimization (update distant animations less frequently)
|
||||
|
|
@ -287,6 +288,7 @@ public:
|
|||
void setInstanceAnimationFrozen(uint32_t instanceId, bool frozen);
|
||||
void removeInstance(uint32_t instanceId);
|
||||
void removeInstances(const std::vector<uint32_t>& instanceIds);
|
||||
void setSkipCollision(uint32_t instanceId, bool skip);
|
||||
void clear();
|
||||
void cleanupUnusedModels();
|
||||
|
||||
|
|
|
|||
|
|
@ -409,6 +409,9 @@ private:
|
|||
// Pre-computed per-triangle normals (unit length, indexed by triStart/3)
|
||||
std::vector<glm::vec3> triNormals;
|
||||
|
||||
// Per-collision-triangle MOPY flags (indexed by collision tri index, i.e. triStart/3)
|
||||
std::vector<uint8_t> triMopyFlags;
|
||||
|
||||
// Scratch bitset for deduplicating triangle queries (sized to numTriangles)
|
||||
mutable std::vector<uint8_t> triVisited;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue