mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
Add M2 collision mesh parsing and mesh-based wall/floor collision
Parse bounding vertices, triangles, and normals from M2 files and use them for proper triangle-level collision instead of AABB heuristics. Spatial grid bucketing for efficient queries, closest-point wall push with soft clamping, and ray-triangle floor detection alongside existing AABB fallback.
This commit is contained in:
parent
fc003a2aba
commit
d7aabc0caa
4 changed files with 360 additions and 0 deletions
|
|
@ -200,6 +200,11 @@ struct M2Model {
|
|||
// Particle emitters
|
||||
std::vector<M2ParticleEmitter> particleEmitters;
|
||||
|
||||
// Collision mesh (simplified geometry for physics)
|
||||
std::vector<glm::vec3> collisionVertices;
|
||||
std::vector<uint16_t> collisionIndices; // 3 per triangle
|
||||
std::vector<glm::vec4> collisionNormals; // xyz=normal, w=distance; one per triangle
|
||||
|
||||
// Flags
|
||||
uint32_t globalFlags;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue