|
group2 0.1.0
CSE 125 Group 2
|
Load collision geometry (and optionally visual data) from a map GLB file. More...
Go to the source code of this file.
Classes | |
| struct | physics::MapCollisionData |
| Collision data. More... | |
| struct | physics::MapLoadOptions |
| Load options. More... | |
Namespaces | |
| namespace | physics |
| Pure physics math — no ECS types, no registry. | |
Functions | |
| bool | physics::loadMapCollision (const std::string &path, MapCollisionData &out, const MapLoadOptions &opts={}) |
| API. | |
| bool | physics::loadPropCollision (const std::string &path, MapCollisionData &out, glm::vec3 position, float scale, bool decomposeNonConvex=false) |
| Load collision for a standalone prop GLB and append to existing collision data. | |
Load collision geometry (and optionally visual data) from a map GLB file.
Maps are authored in Blender and exported as .glb. Collision geometry is identified by Blender collection hierarchy: meshes whose Assimp scene-graph ancestor is named after the collision collection (default "Collision") are extracted as physics primitives. Everything else is treated as visual-only.
Prototype mode (allMeshesAreCollision = true): every mesh in the file is used for both rendering and collision. Handy for blockout maps where the visual geometry is already simple enough to collide against.
Each collision mesh is auto-detected as the best-fitting primitive: sphere → cylinder → axis-aligned box → convex brush (fallback). Sub-collections (Boxes/, Cylinders/, Spheres/, Brushes/) can override the auto-detection to force a specific type.