MeshManager class

Public types

struct GpuSkinSlotInfo
struct MeshSlot
struct SkinWeightSlot

Public static variables

static uint32_t MAX_MESH_SLOTS constexpr
static uint32_t VERTEX_MEGA_BUFFER_SIZE constexpr
static uint32_t INDEX_MEGA_BUFFER_SIZE constexpr
static uint32_t MAX_TOTAL_SKIN_WEIGHTS constexpr

Public static functions

static auto Get() -> MeshManager&

Public functions

auto Initialize(VulkanMemory* vkMem) -> bool
void Shutdown()
Free GPU buffers. Must be called before VulkanMemory::Shutdown().
auto LoadMesh(const MeshAsset& asset, TnxName name = {}, AssetID id = {}) -> uint32_t
auto LoadMesh(AssetID id) -> uint32_t
Resolve by AssetID from AssetRegistry, decode from disk, and load.
auto LoadMesh(TnxName name) -> uint32_t
Resolve by TnxName from AssetRegistry, decode from disk, and load.
auto LoadBuiltinCube() -> uint32_t
Load the built-in cube mesh as slot 0.
auto LoadBuiltinCapsule(float radius, float halfHeight, uint32_t segments) -> uint32_t
Load a built-in capsule mesh (two hemispheres + cylinder body).
auto GetVertexBufferAddr() const -> uint64_t
auto GetIndexBufferHandle() const -> VkBuffer
auto GetMeshTableAddr() const -> uint64_t
auto GetSkinWeightAddr() const -> uint64_t
auto GetSkinSlotTableAddr() const -> uint64_t
auto GetSlot(uint32_t id) const -> const MeshSlot&
auto GetSkinSlot(uint32_t id) const -> const SkinWeightSlot&
auto GetMeshCount() const -> uint32_t
void FlushPendingUploads()
auto IsUploadComplete() const -> bool
auto FindSlotByTName(TnxName name) const -> uint32_t
Find a mesh slot by TnxName (primary API). Returns UINT32_MAX if not registered.
auto FindSlotByName(const std::string& name) const -> uint32_t
Find a mesh slot by display name (string shim). Returns UINT32_MAX if not registered.
auto FindSlotByID(AssetID id) const -> uint32_t
Find a mesh slot by AssetID. Returns UINT32_MAX if not registered or not yet loaded.
auto GetSlotName(uint32_t slot) const -> const char*
Get the display name for a slot via AssetRegistry.
auto GetSlotID(uint32_t slot) const -> AssetID

Function documentation

uint32_t MeshManager::LoadMesh(const MeshAsset& asset, TnxName name = {}, AssetID id = {})

Load a MeshAsset — copies vertex/index data into the mega-buffers, then records name/ID in AssetRegistry (Data = slot index). Returns the slot ID, or UINT32_MAX on failure.