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

Classes

struct  SpawnPoint
 A player spawn point: world position plus an authored facing yaw. More...
struct  WeaponSpawner
struct  PowerupSpawner
struct  HealthPackSpawner
struct  JumpPadSpawner
 Jump pad authored in Blender (entity_type = 3). More...
struct  KillzoneSpawner
 Killzone authored in Blender (entity_type = 4). More...

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.
void traverseNodeTree (const aiNode *node, int depth=0)
void * getMetadataValue (const aiMetadata *metadata, const std::string &key)
float getMetadataFloat (const aiMetadata *metadata, const std::string &key, float fallback)
 Read a numeric custom property as float.
bool loadConfiguredMap (physics::MapCollisionData &out, const char *tag)
 Load the configured map's collision into out.

Variables

constexpr bool k_separatedCollisionMap = false
 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_useVhacd = false
 Run V-HACD convex decomposition on non-convex prop meshes?
std::vector< SpawnPointspawnPoints_
std::vector< WeaponSpawnerweaponSpawner_
std::vector< PowerupSpawnerpowerupSpawner_
std::vector< HealthPackSpawnerhealthPackSpawner_
std::vector< JumpPadSpawnerjumpPadSpawner_
std::vector< KillzoneSpawnerkillzoneSpawner_

Function Documentation

◆ getMetadataFloat()

float gamemap::getMetadataFloat ( const aiMetadata * metadata,
const std::string & key,
float fallback )
inline

Read a numeric custom property as float.

Blender exports floats as AI_DOUBLE and ints as AI_INT32; either is accepted. Returns fallback when the key is missing or has an unsupported type.

Here is the caller graph for this function:

◆ getMetadataValue()

void * gamemap::getMetadataValue ( const aiMetadata * metadata,
const std::string & key )
Here is the caller graph for this function:

◆ 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:

◆ traverseNodeTree()

void gamemap::traverseNodeTree ( const aiNode * node,
int depth = 0 )
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ healthPackSpawner_

std::vector<HealthPackSpawner> gamemap::healthPackSpawner_
inline

◆ jumpPadSpawner_

std::vector<JumpPadSpawner> gamemap::jumpPadSpawner_
inline

◆ 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_separatedCollisionMap

bool gamemap::k_separatedCollisionMap = false
inlineconstexpr

Does this map use SEPARATED collision and visual meshes?

false → "all-mesh mode": every mesh in the GLB is both visual and collision, loaded as authored triangles with no shape guessing. 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?

Production map collision does not use V-HACD. COL_ map nodes are authored simplified triangle surfaces and stay triangle surfaces at runtime. This switch only exists for non-map prop experimentation.

Normal builds also compile without V-HACD; this flag only has an effect when CMake is configured with GROUP2_ENABLE_VHACD=ON. When false (default), V-HACD is bypassed and non-convex props fall back to triMesh. Disable to:

  • skip multi-second prop decomposition during 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 the primary map path. Curved prop contact may still benefit from authored simplified collision or a future dedicated prop solution; V-HACD should not be reintroduced into map loading.

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.

◆ killzoneSpawner_

std::vector<KillzoneSpawner> gamemap::killzoneSpawner_
inline

◆ powerupSpawner_

std::vector<PowerupSpawner> gamemap::powerupSpawner_
inline

◆ spawnPoints_

std::vector<SpawnPoint> gamemap::spawnPoints_
inline

◆ weaponSpawner_

std::vector<WeaponSpawner> gamemap::weaponSpawner_
inline