|
group2 0.1.0
CSE 125 Group 2
|
A triangle mesh with BVH acceleration for collision queries. More...
#include <SweptCollision.hpp>
Public Attributes | |
| std::vector< glm::vec3 > | vertices |
| All vertex positions (world space, scaled). | |
| std::vector< uint32_t > | indices |
| Triangle indices (3 per triangle). | |
| std::vector< BVHNode > | bvhNodes |
| Flat BVH node array. | |
| std::vector< uint32_t > | triIndices |
| Permutation: BVH leaf ranges → triangle indices. | |
| glm::vec3 | boundsMin {0.0f} |
| Whole-mesh AABB min. | |
| glm::vec3 | boundsMax {0.0f} |
| Whole-mesh AABB max. | |
| std::vector< glm::vec3 > | faceNormals |
| CCW face normal (unit length) per triangle. | |
| std::vector< uint8_t > | edgeActive |
| Bit i set ⇔ edge i of this triangle is an active (boundary or convex) edge. | |
| std::vector< uint8_t > | vertActive |
| Bit i set ⇔ vertex i of this triangle is touched by an active edge. | |
| std::vector< uint32_t > | edgeNeighbor |
| Phase B — edge → neighbour triangle adjacency. | |
| std::vector< uint8_t > | triangleMaterials |
| One SurfaceType index per triangle (empty = use default). | |
| SurfaceType | defaultSurface = SurfaceType::Concrete |
| Fallback for triangles without per-face material data. | |
A triangle mesh with BVH acceleration for collision queries.
Built once at load time via buildTriMeshBVH(). The BVH is a flat array binary tree; leaves hold up to 4 triangles. triIndices is a permutation array mapping BVH leaf ranges to triangle indices in indices.
Phase 2 welding data (faceNormals, edgeActive, vertActive): produced by weldTriMesh() after buildTriMeshBVH(). Per-triangle edgeActive bits mark genuine boundary edges; vertActive marks corners touched by an active edge. Internal edges (welded coplanar / concave edges shared between adjacent triangles) are cleared for legacy AABB contact clipping. Capsule queries use bounded triangle closest points directly and keep these arrays as adjacency / feature metadata for traversal systems.
| glm::vec3 physics::WorldTriMesh::boundsMax {0.0f} |
Whole-mesh AABB max.
| glm::vec3 physics::WorldTriMesh::boundsMin {0.0f} |
Whole-mesh AABB min.
| std::vector<BVHNode> physics::WorldTriMesh::bvhNodes |
Flat BVH node array.
| SurfaceType physics::WorldTriMesh::defaultSurface = SurfaceType::Concrete |
Fallback for triangles without per-face material data.
| std::vector<uint8_t> physics::WorldTriMesh::edgeActive |
Bit i set ⇔ edge i of this triangle is an active (boundary or convex) edge.
| std::vector<uint32_t> physics::WorldTriMesh::edgeNeighbor |
Phase B — edge → neighbour triangle adjacency.
Three entries per triangle, one per edge: edgeNeighbor[3*t + e] is the triangle index of the triangle sharing edge e of triangle t, or UINT32_MAX for boundary edges (no neighbour) and non-manifold edges (more than two incident triangles).
Populated by weldTriMesh() as a side-product of the existing per-edge classification pass. Consumed by:
| std::vector<glm::vec3> physics::WorldTriMesh::faceNormals |
CCW face normal (unit length) per triangle.
| std::vector<uint32_t> physics::WorldTriMesh::indices |
Triangle indices (3 per triangle).
| std::vector<uint8_t> physics::WorldTriMesh::triangleMaterials |
One SurfaceType index per triangle (empty = use default).
| std::vector<uint32_t> physics::WorldTriMesh::triIndices |
Permutation: BVH leaf ranges → triangle indices.
| std::vector<uint8_t> physics::WorldTriMesh::vertActive |
Bit i set ⇔ vertex i of this triangle is touched by an active edge.
| std::vector<glm::vec3> physics::WorldTriMesh::vertices |
All vertex positions (world space, scaled).