|
group2 0.1.0
CSE 125 Group 2
|
Single source of truth for which map is loaded and how, shared by client and server. More...
#include "ecs/AssetCatalog.hpp"#include "ecs/physics/MapLoader.hpp"#include <SDL3/SDL_filesystem.h>#include <SDL3/SDL_log.h>#include <string>Go to the source code of this file.
Namespaces | |
| namespace | gamemap |
Functions | |
| physics::MapLoadOptions | gamemap::makeLoadOptions () |
| Build the MapLoadOptions used by both client and server. | |
| std::string | gamemap::mapAbsolutePath () |
| Resolve the absolute path of the configured map file. | |
| bool | gamemap::loadConfiguredMap (physics::MapCollisionData &out, const char *tag) |
| Load the configured map's collision into out. | |
Variables | |
| constexpr bool | gamemap::k_separatedCollisionMap = true |
| Does this map use SEPARATED collision and visual meshes? | |
| constexpr const char * | gamemap::k_collisionPattern = "COL_" |
| Substring that identifies collision-only nodes in separated mode. | |
| constexpr bool | gamemap::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 | gamemap::k_useVhacd = false |
| Run V-HACD convex decomposition on non-convex prop meshes? | |
Single source of truth for which map is loaded and how, shared by client and server.
Why this exists. The server is authoritative for movement and the client predicts; for prediction to agree with the server, both sides must extract exactly the same collision primitives from the exact same map file. Previously this code was duplicated in client/game/Game.cpp and server/game/ServerGame.cpp and the two could silently drift. Now both call gamemap::loadConfiguredMap() and read the same constants from this header.
What lives here.
What does NOT live here. The map filename itself. That stays in AssetCatalog.hpp (kMapAsset.filename) so there is one and only one source of truth for which file is loaded. Flipping the toggles below changes how the map is processed, never which map. To switch to a different map, edit kMapAsset in AssetCatalog.hpp.