Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Core::AnimationClipStore Class Reference

Registry store for animation clip handles. More...

#include <AssetRegistry.h>

Collaboration diagram for Engine::Core::AnimationClipStore:

Classes

struct  Record
 Stored metadata for one animation clip handle slot. More...

Public Member Functions

 AnimationClipStore (AssetManager *assetManager=nullptr)
 Creates an animation clip store backed by an optional asset manager.
void setAssetManager (AssetManager *assetManager)
 Sets the asset manager used when new animation handles request payload loading.
Assets::AnimationClipHandle load (const Asset::MeshPath &animationPath)
 Gets or creates a stable handle for an authored animation source path.
Assets::AnimationClipHandle registerRuntimeAnimation (Asset::MeshPath animationPath, std::unique_ptr< Assets::Animation > animation)
 Registers a runtime animation payload and returns its stable animation clip handle.
bool isValid (Assets::AnimationClipHandle handle) const
 Checks whether an animation clip handle refers to a live slot in this store.
const Asset::MeshPath * path (Assets::AnimationClipHandle handle) const
 Returns the authored animation path for an animation clip handle.
Assets::Animation * payload (Assets::AnimationClipHandle handle) const
 Resolves an animation clip handle to its loaded payload behind the manager boundary.

Static Private Member Functions

static std::string keyFor (const Asset::MeshPath &animationPath)
 Builds the deduplication key for an animation source path and animation name.

Private Attributes

AssetManager * assetManager_ = nullptr
 Optional bridge used to request animation refs.
std::vector< Record > records_
 Slot storage indexed by AnimationClipHandle::index.
std::unordered_map< std::string, uint32_t > pathToIndex_
 Deduplication map from keyFor() to slot index.

Detailed Description

Registry store for animation clip handles.

AnimationClipStore deduplicates authored animation paths (source glTF file plus animation name), returns stable AnimationClipHandle values, and can resolve a handle back to its loaded payload.

Definition at line 426 of file AssetRegistry.h.

Constructor & Destructor Documentation

◆ AnimationClipStore()

Engine::Core::AnimationClipStore::AnimationClipStore ( AssetManager * assetManager = nullptr)
explicit

Creates an animation clip store backed by an optional asset manager.

Parameters
assetManagerAsset manager used to request animation payload loads, or nullptr for handle-only use.

Member Function Documentation

◆ isValid()

bool Engine::Core::AnimationClipStore::isValid ( Assets::AnimationClipHandle handle) const
nodiscard

Checks whether an animation clip handle refers to a live slot in this store.

Parameters
handleHandle to validate.
Returns
True when the handle index and generation match a stored record.

◆ keyFor()

std::string Engine::Core::AnimationClipStore::keyFor ( const Asset::MeshPath & animationPath)
staticnodiscardprivate

Builds the deduplication key for an animation source path and animation name.

Parameters
animationPathAnimation source path and animation name.
Returns
Stable string key used by pathToIndex_.

◆ load()

Assets::AnimationClipHandle Engine::Core::AnimationClipStore::load ( const Asset::MeshPath & animationPath)
nodiscard

Gets or creates a stable handle for an authored animation source path.

Parameters
animationPathEngine-relative source path and animation name.
Returns
Existing or newly created animation clip handle, or a null handle for an empty path.

◆ path()

const Asset::MeshPath * Engine::Core::AnimationClipStore::path ( Assets::AnimationClipHandle handle) const
nodiscard

Returns the authored animation path for an animation clip handle.

Parameters
handleHandle to look up.
Returns
Pointer to the stored animation path, or nullptr when the handle is invalid.

◆ payload()

Assets::Animation * Engine::Core::AnimationClipStore::payload ( Assets::AnimationClipHandle handle) const
nodiscard

Resolves an animation clip handle to its loaded payload behind the manager boundary.

Parameters
handleHandle to resolve.
Returns
Pointer to the loaded animation, or nullptr when the handle is invalid or not loaded.

◆ registerRuntimeAnimation()

Assets::AnimationClipHandle Engine::Core::AnimationClipStore::registerRuntimeAnimation ( Asset::MeshPath animationPath,
std::unique_ptr< Assets::Animation > animation )
nodiscard

Registers a runtime animation payload and returns its stable animation clip handle.

Parameters
animationPathEngine-relative path and animation name used as the registry key.
animationAnimation payload to transfer to the attached animation asset manager.
Returns
Animation clip handle, or a null handle when animationPath is empty or animation is null.

◆ setAssetManager()

void Engine::Core::AnimationClipStore::setAssetManager ( AssetManager * assetManager)

Sets the asset manager used when new animation handles request payload loading.

Parameters
assetManagerAsset manager to use, or nullptr to disable payload load requests.

Member Data Documentation

◆ assetManager_

AssetManager* Engine::Core::AnimationClipStore::assetManager_ = nullptr
private

Optional bridge used to request animation refs.

Definition at line 499 of file AssetRegistry.h.

◆ pathToIndex_

std::unordered_map<std::string, uint32_t> Engine::Core::AnimationClipStore::pathToIndex_
private

Deduplication map from keyFor() to slot index.

Definition at line 501 of file AssetRegistry.h.

◆ records_

std::vector<Record> Engine::Core::AnimationClipStore::records_
private

Slot storage indexed by AnimationClipHandle::index.

Definition at line 500 of file AssetRegistry.h.


The documentation for this class was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/Asset/AssetRegistry.h