26#include <SDL3/SDL_filesystem.h>
27#include <SDL3/SDL_log.h>
114 const char*
const base = SDL_GetBasePath();
115 return std::string(base ? base :
"") +
"assets/" +
kMapAsset.filename;
133 SDL_Log(
"[%s] map collision loaded (%s): %zu planes, %zu boxes, %zu brushes, %zu cylinders, %zu spheres, "
146 SDL_Log(
"[%s] WARNING: map collision load failed (%s) — falling back to testWorld()", tag,
kMapAsset.filename);
Static asset loading and render-default metadata.
const AssetDefinition kMapAsset
Definition AssetCatalog.hpp:26
Load collision geometry (and optionally visual data) from a map GLB file.
Definition MapConfig.hpp:32
bool loadConfiguredMap(physics::MapCollisionData &out, const char *tag)
Load the configured map's collision into out.
Definition MapConfig.hpp:127
constexpr bool k_useVhacd
Run V-HACD convex decomposition on non-convex prop meshes?
Definition MapConfig.hpp:88
std::string mapAbsolutePath()
Resolve the absolute path of the configured map file.
Definition MapConfig.hpp:112
constexpr bool k_separatedCollisionMap
Does this map use SEPARATED collision and visual meshes?
Definition MapConfig.hpp:45
physics::MapLoadOptions makeLoadOptions()
Build the MapLoadOptions used by both client and server.
Definition MapConfig.hpp:95
constexpr bool k_guessShapesProcessed
Should collision meshes be auto-fit to primitive shapes, or kept as raw triMeshes (the exact artist-a...
Definition MapConfig.hpp:64
constexpr const char * k_collisionPattern
Substring that identifies collision-only nodes in separated mode.
Definition MapConfig.hpp:49
bool loadMapCollision(const std::string &path, MapCollisionData &out, const MapLoadOptions &opts)
API.
Definition MapLoader.cpp:1232
Collision data.
Definition MapLoader.hpp:38
std::vector< WorldTriMesh > triMeshes
Definition MapLoader.hpp:44
std::vector< WorldAABB > boxes
Definition MapLoader.hpp:40
std::vector< WorldSphere > spheres
Definition MapLoader.hpp:43
std::vector< WorldBrush > brushes
Definition MapLoader.hpp:41
std::vector< WorldCylinder > cylinders
Definition MapLoader.hpp:42
std::vector< Plane > planes
Definition MapLoader.hpp:39
Load options.
Definition MapLoader.hpp:66
bool guessShapesProcessed
In separated mode (allMeshesAreCollision = false), should the loader auto-detect/guess each collision...
Definition MapLoader.hpp:109
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
bool decomposeNonConvex
In separated mode with shape-guessing on, when a collision mesh is non-convex (so it can't be a singl...
Definition MapLoader.hpp:131