AnimationManager class
Manages GPU mega-buffers for animation tracks, keyframes, and slot tables. Slot 0 is reserved as the invalid sentinel; valid slot IDs start at 1.
Public types
- struct AnimSlot
Public static variables
- static uint32_t MAX_ANIM_SLOTS constexpr
- static uint32_t MAX_TOTAL_BONE_TRACKS constexpr
- static uint32_t MAX_TOTAL_KEYFRAMES constexpr
Public static functions
- static auto Get() -> AnimationManager&
Public functions
- auto Initialize(VulkanMemory* vkMem) -> bool
- Allocate GPU mega-buffers (PersistentMapped + BDA). Must be called before any LoadAnimation.
- void Shutdown()
- Must be called before VulkanMemory::Shutdown().
- auto LoadAnimation(const AnimationAsset& asset, TnxName name, AssetID id = {}) -> uint32_t
- Returns the slot ID, or UINT32_MAX on failure.
- auto LoadAnimation(AssetID id) -> uint32_t
- auto LoadAnimation(TnxName name) -> uint32_t
- auto GetAnimCPU(uint32_t slot) const -> const AnimationAsset*
- Returns the CPU-side AnimationAsset for
slot, or nullptr if the slot is invalid. - auto GetDuration(uint32_t slot) const -> float
- auto GetTrackBufferAddr() const -> uint64_t
- auto GetKeyframeBufferAddr() const -> uint64_t
- auto GetAnimSlotAddr() const -> uint64_t
- auto GetSlot(uint32_t slot) const -> const AnimSlot&
- auto GetAnimCount() const -> uint32_t
- void FlushPendingUploads()
- Submit all pending PersistentMapped writes to the GPU; called once per render frame.
- auto IsUploadComplete() const -> bool
- Returns true when all in-flight GPU upload jobs have completed.
- auto FindSlotByTName(TnxName name) const -> uint32_t
- Resolve an animation slot from a TnxName; returns UINT32_MAX if not loaded.
- auto FindSlotByID(AssetID id) const -> uint32_t
- Resolve an animation slot from an AssetID; returns UINT32_MAX if not loaded.
- auto GetSlotID(uint32_t slot) const -> AssetID