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

Groups typed asset registry stores and resolves authored asset references. More...

#include <AssetRegistry.h>

Collaboration diagram for Engine::Core::AssetRegistry:

Public Member Functions

 AssetRegistry (AssetManager *assetManager=nullptr)
 Creates an asset registry and wires all child stores to the same asset manager.
void setAssetManager (AssetManager *assetManager)
 Updates the asset manager used by every child store.
GltfStore & gltfs ()
 Returns the mutable glTF store.
const GltfStore & gltfs () const
 Returns the read-only glTF store.
GeometryMeshStore & geometryMeshes ()
 Returns the mutable geometry mesh store.
const GeometryMeshStore & geometryMeshes () const
 Returns the read-only geometry mesh store.
MaterialStore & materials ()
 Returns the mutable material store.
const MaterialStore & materials () const
 Returns the read-only material store.
Texture2DStore & texture2Ds ()
 Returns the mutable 2D texture store.
const Texture2DStore & texture2Ds () const
 Returns the read-only 2D texture store.
AudioClipStore & audioClips ()
 Returns the mutable audio clip store.
const AudioClipStore & audioClips () const
 Returns the read-only audio clip store.
AnimationClipStore & animations ()
 Returns the mutable animation clip store.
const AnimationClipStore & animations () const
 Returns the read-only animation clip store.
SkinStore & skins ()
 Returns the mutable skin store.
const SkinStore & skins () const
 Returns the read-only skin store.
Assets::GltfHandle resolve (Assets::Authored::GltfAssetRef ref)
 Resolves an authored glTF file reference to a stable glTF handle.
Assets::GltfRenderableHandle resolve (Assets::Authored::GltfRenderableAssetRef ref)
 Resolves an authored glTF node reference to a stable renderable handle.
Assets::GeometryMeshHandle resolve (Assets::Authored::GeometryMeshAssetRef ref)
 Resolves an authored geometry mesh reference through its glTF renderable node.
Assets::Texture2DHandle resolve (Assets::Authored::Texture2DAssetRef ref)
 Resolves an authored 2D texture reference to a stable texture handle.
Assets::AudioClipHandle resolve (Assets::Authored::AudioAssetRef ref)
 Resolves an authored audio reference to a stable audio clip handle.

Private Attributes

AssetManager * assetManager_ = nullptr
 Optional bridge shared by all child stores.
GeometryMeshStore geometryMeshes_
 Store for non-skinned mesh geometry handles.
MaterialStore materials_
 Store for material handles.
Texture2DStore texture2Ds_
 Store for sampled 2D texture handles.
AudioClipStore audioClips_
 Store for audio clip handles.
AnimationClipStore animations_
 Store for animation clip handles.
SkinStore skins_
 Store for skin/skeleton binding handles.
GltfStore gltfs_
 Store for glTF source and renderable node handles.

Detailed Description

Groups typed asset registry stores and resolves authored asset references.

AssetRegistry is the handle-facing layer for scene data. It owns Engine::Core::GltfStore, Engine::Core::GeometryMeshStore, Engine::Core::MaterialStore, Engine::Core::Texture2DStore, and Engine::Core::AudioClipStore instances, and translates authored refs into stable typed handles.

Definition at line 741 of file AssetRegistry.h.

Constructor & Destructor Documentation

◆ AssetRegistry()

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

Creates an asset registry and wires all child stores to the same asset manager.

Parameters
assetManagerAsset manager used by child stores, or nullptr for handle-only use.

Member Function Documentation

◆ animations() [1/2]

AnimationClipStore & Engine::Core::AssetRegistry::animations ( )
inlinenodiscard

Returns the mutable animation clip store.

Definition at line 839 of file AssetRegistry.h.

References animations_.

◆ animations() [2/2]

const AnimationClipStore & Engine::Core::AssetRegistry::animations ( ) const
inlinenodiscard

Returns the read-only animation clip store.

Definition at line 847 of file AssetRegistry.h.

References animations_.

◆ audioClips() [1/2]

AudioClipStore & Engine::Core::AssetRegistry::audioClips ( )
inlinenodiscard

Returns the mutable audio clip store.

Definition at line 823 of file AssetRegistry.h.

References audioClips_.

◆ audioClips() [2/2]

const AudioClipStore & Engine::Core::AssetRegistry::audioClips ( ) const
inlinenodiscard

Returns the read-only audio clip store.

Definition at line 831 of file AssetRegistry.h.

References audioClips_.

◆ geometryMeshes() [1/2]

GeometryMeshStore & Engine::Core::AssetRegistry::geometryMeshes ( )
inlinenodiscard

Returns the mutable geometry mesh store.

Definition at line 775 of file AssetRegistry.h.

References geometryMeshes_.

◆ geometryMeshes() [2/2]

const GeometryMeshStore & Engine::Core::AssetRegistry::geometryMeshes ( ) const
inlinenodiscard

Returns the read-only geometry mesh store.

Definition at line 783 of file AssetRegistry.h.

References geometryMeshes_.

◆ gltfs() [1/2]

GltfStore & Engine::Core::AssetRegistry::gltfs ( )
inlinenodiscard

Returns the mutable glTF store.

Definition at line 759 of file AssetRegistry.h.

References gltfs_.

Referenced by Engine::Entities::Scene::spawnAll().

Here is the caller graph for this function:

◆ gltfs() [2/2]

const GltfStore & Engine::Core::AssetRegistry::gltfs ( ) const
inlinenodiscard

Returns the read-only glTF store.

Definition at line 767 of file AssetRegistry.h.

References gltfs_.

◆ materials() [1/2]

MaterialStore & Engine::Core::AssetRegistry::materials ( )
inlinenodiscard

Returns the mutable material store.

Definition at line 791 of file AssetRegistry.h.

References materials_.

◆ materials() [2/2]

const MaterialStore & Engine::Core::AssetRegistry::materials ( ) const
inlinenodiscard

Returns the read-only material store.

Definition at line 799 of file AssetRegistry.h.

References materials_.

◆ resolve() [1/5]

Assets::AudioClipHandle Engine::Core::AssetRegistry::resolve ( Assets::Authored::AudioAssetRef ref)
nodiscard

Resolves an authored audio reference to a stable audio clip handle.

Parameters
refAuthored reference containing an engine-relative source path.
Returns
Stable audio clip handle for the source, or a null handle for an empty source.
Exceptions
std::invalid_argumentwhen ref.source is an absolute path.

◆ resolve() [2/5]

Assets::GeometryMeshHandle Engine::Core::AssetRegistry::resolve ( Assets::Authored::GeometryMeshAssetRef ref)
nodiscard

Resolves an authored geometry mesh reference through its glTF renderable node.

Parameters
refAuthored reference containing source path and node name.
Returns
Stable geometry mesh handle, or a null handle when the node is unknown.
Exceptions
std::invalid_argumentwhen ref.source is an absolute path.

◆ resolve() [3/5]

Assets::GltfHandle Engine::Core::AssetRegistry::resolve ( Assets::Authored::GltfAssetRef ref)
nodiscard

Resolves an authored glTF file reference to a stable glTF handle.

Parameters
refAuthored reference containing an engine-relative source path.
Returns
Stable glTF handle for the source.
Exceptions
std::invalid_argumentwhen ref.source is an absolute path.

◆ resolve() [4/5]

Assets::GltfRenderableHandle Engine::Core::AssetRegistry::resolve ( Assets::Authored::GltfRenderableAssetRef ref)
nodiscard

Resolves an authored glTF node reference to a stable renderable handle.

Parameters
refAuthored reference containing source path and node name.
Returns
Stable renderable handle, or a null handle when the node is unknown.
Exceptions
std::invalid_argumentwhen ref.source is an absolute path.

◆ resolve() [5/5]

Assets::Texture2DHandle Engine::Core::AssetRegistry::resolve ( Assets::Authored::Texture2DAssetRef ref)
nodiscard

Resolves an authored 2D texture reference to a stable texture handle.

Parameters
refAuthored reference containing an engine-relative source path.
Returns
Stable texture handle for the source, or a null handle for an empty source.
Exceptions
std::invalid_argumentwhen ref.source is an absolute path.

◆ setAssetManager()

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

Updates the asset manager used by every child store.

Parameters
assetManagerAsset manager to use, or nullptr for handle-only use.

◆ skins() [1/2]

SkinStore & Engine::Core::AssetRegistry::skins ( )
inlinenodiscard

Returns the mutable skin store.

Definition at line 855 of file AssetRegistry.h.

References skins_.

◆ skins() [2/2]

const SkinStore & Engine::Core::AssetRegistry::skins ( ) const
inlinenodiscard

Returns the read-only skin store.

Definition at line 863 of file AssetRegistry.h.

References skins_.

◆ texture2Ds() [1/2]

Texture2DStore & Engine::Core::AssetRegistry::texture2Ds ( )
inlinenodiscard

Returns the mutable 2D texture store.

Definition at line 807 of file AssetRegistry.h.

References texture2Ds_.

◆ texture2Ds() [2/2]

const Texture2DStore & Engine::Core::AssetRegistry::texture2Ds ( ) const
inlinenodiscard

Returns the read-only 2D texture store.

Definition at line 815 of file AssetRegistry.h.

References texture2Ds_.

Member Data Documentation

◆ animations_

AnimationClipStore Engine::Core::AssetRegistry::animations_
private

Store for animation clip handles.

Definition at line 914 of file AssetRegistry.h.

Referenced by animations(), and animations().

◆ assetManager_

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

Optional bridge shared by all child stores.

Definition at line 909 of file AssetRegistry.h.

◆ audioClips_

AudioClipStore Engine::Core::AssetRegistry::audioClips_
private

Store for audio clip handles.

Definition at line 913 of file AssetRegistry.h.

Referenced by audioClips(), and audioClips().

◆ geometryMeshes_

GeometryMeshStore Engine::Core::AssetRegistry::geometryMeshes_
private

Store for non-skinned mesh geometry handles.

Definition at line 910 of file AssetRegistry.h.

Referenced by geometryMeshes(), and geometryMeshes().

◆ gltfs_

GltfStore Engine::Core::AssetRegistry::gltfs_
private

Store for glTF source and renderable node handles.

Definition at line 916 of file AssetRegistry.h.

Referenced by gltfs(), and gltfs().

◆ materials_

MaterialStore Engine::Core::AssetRegistry::materials_
private

Store for material handles.

Definition at line 911 of file AssetRegistry.h.

Referenced by materials(), and materials().

◆ skins_

SkinStore Engine::Core::AssetRegistry::skins_
private

Store for skin/skeleton binding handles.

Definition at line 915 of file AssetRegistry.h.

Referenced by skins(), and skins().

◆ texture2Ds_

Texture2DStore Engine::Core::AssetRegistry::texture2Ds_
private

Store for sampled 2D texture handles.

Definition at line 912 of file AssetRegistry.h.

Referenced by texture2Ds(), and texture2Ds().


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