group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
gamemap Namespace Reference

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?

Function Documentation

◆ loadConfiguredMap()

bool gamemap::loadConfiguredMap ( physics::MapCollisionData & out,
const char * tag )
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.

Parameters
outFilled with extracted collision primitives on success.
tagShort side identifier used in log output ("client" / "server").
Returns
Whatever physics::loadMapCollision returns.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeLoadOptions()

physics::MapLoadOptions gamemap::makeLoadOptions ( )
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.

Here is the caller graph for this function:

◆ mapAbsolutePath()

std::string gamemap::mapAbsolutePath ( )
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.

Here is the caller graph for this function:

Variable Documentation

◆ k_collisionPattern

const char* gamemap::k_collisionPattern = "COL_"
inlineconstexpr

Substring that identifies collision-only nodes in separated mode.

Matched case-insensitively against Assimp node names.

◆ k_guessShapesProcessed

bool gamemap::k_guessShapesProcessed = true
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.

◆ k_separatedCollisionMap

bool gamemap::k_separatedCollisionMap = true
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.

◆ k_useVhacd

bool gamemap::k_useVhacd = false
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:

  • skip the multi-second V-HACD step during map iteration,
  • sidestep V-HACD regressions on a particular asset, or
  • keep parity with bot/headless tooling that doesn't need smooth curved-contact collision.

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.