group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
MapLoader.hpp
Go to the documentation of this file.
1
17
18#pragma once
19
20#include "SweptCollision.hpp"
21
22#include <string>
23#include <vector>
24
25namespace physics
26{
27
29
36{
37 std::vector<Plane> planes;
38 std::vector<WorldAABB> boxes;
39 std::vector<WorldBrush> brushes;
40 std::vector<WorldCylinder> cylinders;
41 std::vector<WorldSphere> spheres;
42 std::vector<WorldTriMesh> triMeshes;
44
50 [[nodiscard]] WorldGeometry geometry() const
51 {
52 return {.planes = planes,
53 .boxes = boxes,
54 .brushes = brushes,
55 .cylinders = cylinders,
56 .spheres = spheres,
57 .triMeshes = triMeshes,
58 .staticBroadphase = &staticBroadphase};
59 }
60};
61
63
66{
68 float scale = 1.0f;
69
74 std::string collisionCollection = "Collision";
75
80
84 bool addFloorPlane = false;
85
90};
91
93
108bool loadMapCollision(const std::string& path, MapCollisionData& out, const MapLoadOptions& opts = {});
109
128 const std::string& path, MapCollisionData& out, glm::vec3 position, float scale, bool decomposeNonConvex = false);
129
130} // namespace physics
Swept AABB and sphere collision queries against world geometry.
Pure physics math — no ECS types, no registry.
Definition BroadphaseTree.cpp:11
bool loadMapCollision(const std::string &path, MapCollisionData &out, const MapLoadOptions &opts)
API.
Definition MapLoader.cpp:1210
bool loadPropCollision(const std::string &path, MapCollisionData &out, glm::vec3 position, float scale, bool decomposeNonConvex)
Load collision for a standalone prop GLB and append to existing collision data.
Definition MapLoader.cpp:1282
Collision data.
Definition MapLoader.hpp:36
std::vector< WorldTriMesh > triMeshes
Definition MapLoader.hpp:42
std::vector< WorldAABB > boxes
Definition MapLoader.hpp:38
std::vector< WorldSphere > spheres
Definition MapLoader.hpp:41
std::vector< WorldBrush > brushes
Definition MapLoader.hpp:39
std::vector< WorldCylinder > cylinders
Definition MapLoader.hpp:40
WorldGeometry geometry() const
Return a non-owning WorldGeometry view into this data.
Definition MapLoader.hpp:50
std::vector< Plane > planes
Definition MapLoader.hpp:37
StaticWorldBroadphase staticBroadphase
Definition MapLoader.hpp:43
Load options.
Definition MapLoader.hpp:66
bool allMeshesAreCollision
When true, every mesh in the file is treated as both visual and collision geometry.
Definition MapLoader.hpp:79
std::string collisionCollection
Name of the Blender collection (= Assimp parent node) whose children are collision geometry.
Definition MapLoader.hpp:74
float scale
Uniform scale applied to every vertex position (e.g. 39.37 for m → in).
Definition MapLoader.hpp:68
bool addFloorPlane
When true, an infinite floor plane is added at the lowest Y coordinate found across all collision geo...
Definition MapLoader.hpp:84
Immutable world-level BVH over WorldTriMesh bounds.
Definition SweptCollision.hpp:149
All world collision geometry for one tick.
Definition SweptCollision.hpp:225