|
group2 0.1.0
CSE 125 Group 2
|
Functions | |
| physics::MapLoadOptions | makeLoadOptions () |
| Build the MapLoadOptions used by both client and server. | |
| std::string | mapAbsolutePath () |
| Resolve the absolute path of the configured map file. | |
| bool | loadConfiguredMap (physics::MapCollisionData &out, const char *tag) |
| Load the configured map's collision into out. | |
Variables | |
| constexpr bool | k_separatedCollisionMap = true |
| Does this map use SEPARATED collision and visual meshes? | |
| constexpr const char * | k_collisionPattern = "COL_" |
| Substring that identifies collision-only nodes in separated mode. | |
| constexpr bool | k_guessShapesProcessed = true |
| Should collision meshes be auto-fit to primitive shapes, or kept as raw triMeshes (the exact artist-authored Blender geometry)? | |
| constexpr bool | k_useVhacd = false |
| Run V-HACD convex decomposition on non-convex prop meshes? | |
|
inline |
Load the configured map's collision into out.
Both client and server call this so they end up with identical primitives (a prerequisite for prediction parity). Logs success/failure with tag so each side keeps its [client] / [server] prefix.
| out | Filled with extracted collision primitives on success. |
| tag | Short side identifier used in log output ("client" / "server"). |
|
inlinenodiscard |
Build the MapLoadOptions used by both client and server.
Centralised so the two sides cannot drift. The client also reads k_separatedCollisionMap / k_collisionPattern directly when deciding which visual meshes to exclude from the renderer.
|
inlinenodiscard |
Resolve the absolute path of the configured map file.
Reads the filename from kMapAsset (in AssetCatalog.hpp) — never affected by the load-mode toggles above.
|
inlineconstexpr |
Substring that identifies collision-only nodes in separated mode.
Matched case-insensitively against Assimp node names.
|
inlineconstexpr |
Should collision meshes be auto-fit to primitive shapes, or kept as raw triMeshes (the exact artist-authored Blender geometry)?
true (default) → run the auto-detection pipeline (AABB → cylinder → sphere → convex brush → triMesh). Convex meshes become cheap primitives or brushes; only truly non-convex meshes fall back to triMesh. false → trust the artist: every collision mesh stays a triMesh, vertex-for-vertex.
Has no effect in prototype mode (k_separatedCollisionMap = false): every mesh is collision there, and forcing all of them to triMesh would be prohibitively expensive.
|
inlineconstexpr |
Does this map use SEPARATED collision and visual meshes?
false → "prototype mode": every mesh in the GLB is both visual and collision. Used for blockout maps like map1.glb. true → "separated mode": collision-only nodes are tagged in Blender with the prefix kCollisionPattern and excluded from the visual model. Used for production maps where collision is hand-authored independently from rendering geometry.
IMPORTANT: this flag controls how the map is processed, not which map is loaded. The map filename comes solely from kMapAsset in AssetCatalog.hpp.
|
inlineconstexpr |
Run V-HACD convex decomposition on non-convex prop meshes?
When true, prop meshes flagged with decomposeCollision = true in AssetCatalog.hpp (currently the bottle and metallic pallet) are split into a small set of convex WorldBrushes by V-HACD. Smoother runtime collision than triMesh (no per-triangle MTV jitter on curved surfaces) at the cost of a few seconds of map-load time per affected prop.
When false (default), V-HACD is bypassed and non-convex props fall back to triMesh. Disable to:
WorldTriMesh collision is correct, just visibly jittery on curved contacts because the mover's MTV flips between adjacent triangle normals. Acceptable for the placeholder bottle/pallet props.
Call sites that pass decomposeCollision to physics::loadPropCollision must AND that argument with this flag — see client/game/Game.cpp, server/game/ServerGame.cpp, and clientbot/main.cpp.