|
Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
|
Registry store for glTF source files and their renderable node handles. More...
#include <AssetRegistry.h>
Classes | |
| struct | GltfRecord |
| Stored metadata for one glTF source handle slot. More... | |
| struct | RenderableRecord |
| Stored metadata for one glTF renderable handle slot. More... | |
Public Member Functions | |
| GltfStore (AssetManager *assetManager=nullptr, GeometryMeshStore *geometryMeshes=nullptr, MaterialStore *materials=nullptr) | |
| Creates a glTF store backed by optional asset and child stores. | |
| void | setAssetManager (AssetManager *assetManager) |
| Sets the asset manager used by this store and imported child records. | |
| void | setGeometryMeshStore (GeometryMeshStore *geometryMeshes) |
| Sets the geometry store used when importing glTF renderable metadata. | |
| void | setMaterialStore (MaterialStore *materials) |
| Sets the material store used when importing glTF primitive metadata. | |
| Assets::GltfHandle | load (const std::filesystem::path &source) |
| Gets or creates a stable handle for a glTF source file and imports its renderable metadata. | |
| Assets::GltfRenderableHandle | renderable (Assets::GltfHandle gltf, std::string_view nodeName) |
| Looks up a renderable node handle inside a loaded glTF file. | |
| Assets::GeometryMeshHandle | geometryMesh (Assets::GltfRenderableHandle renderable) const |
| Returns the geometry mesh handle used by a glTF renderable. | |
| std::optional< AnchorPoint > | anchorPoint (Assets::GltfRenderableHandle renderable, std::string_view name) const |
| Looks up an AnchorPoint authored below a renderable node. | |
| std::vector< std::string > | anchorPointNames (Assets::GltfRenderableHandle renderable) const |
| Lists the authored AnchorPoint names for a renderable node. | |
| const GltfRenderableRecord * | get (Assets::GltfRenderableHandle renderable) const |
| Returns imported metadata for a glTF renderable handle. | |
| const std::filesystem::path * | sourcePath (Assets::GltfHandle gltf) const |
| Returns the authored source path for a glTF handle. | |
| bool | isValid (Assets::GltfHandle handle) const |
| Checks whether a glTF handle refers to a live slot in this store. | |
| bool | isValid (Assets::GltfRenderableHandle handle) const |
| Checks whether a glTF renderable handle refers to a live slot in this store. | |
Private Member Functions | |
| void | importMetadata (Assets::GltfHandle gltf) |
| Imports renderable, geometry, and material metadata for a loaded glTF handle. | |
Static Private Member Functions | |
| static std::string | keyFor (const std::filesystem::path &source) |
| Builds the deduplication key for a glTF source path. | |
| static std::string | fallbackNodeName (size_t nodeIndex) |
| Builds the synthetic node name used for unnamed glTF nodes. | |
Private Attributes | |
| AssetManager * | assetManager_ = nullptr |
| Optional bridge retained for store wiring. | |
| GeometryMeshStore * | geometryMeshes_ = nullptr |
| Store that receives geometry handles during metadata import. | |
| MaterialStore * | materials_ = nullptr |
| Store that receives material handles during metadata import. | |
| std::vector< GltfRecord > | gltfRecords_ |
| Slot storage indexed by GltfHandle::index. | |
| std::vector< RenderableRecord > | renderableRecords_ |
| Slot storage indexed by GltfRenderableHandle::index. | |
| std::unordered_map< std::string, uint32_t > | sourceToIndex_ |
| Deduplication map from keyFor() to glTF slot index. | |
Registry store for glTF source files and their renderable node handles.
GltfStore imports metadata from a source glTF, creates renderable records for mesh-bearing nodes, and links those records to geometry and material handles.
Definition at line 583 of file AssetRegistry.h.
| Engine::Core::GltfStore::GltfStore | ( | AssetManager * | assetManager = nullptr, |
| GeometryMeshStore * | geometryMeshes = nullptr, | ||
| MaterialStore * | materials = nullptr ) |
Creates a glTF store backed by optional asset and child stores.
| assetManager | Asset manager used by child stores when importing metadata. |
| geometryMeshes | Store that receives geometry handles for mesh-bearing glTF nodes. |
| materials | Store that receives material handles for glTF primitives. |
|
nodiscard |
Looks up an AnchorPoint authored below a renderable node.
| renderable | Renderable node that owns the AnchorPoint. |
| name | Authored direct-child empty node name. |
References renderable().
|
nodiscard |
Lists the authored AnchorPoint names for a renderable node.
| renderable | Renderable node to inspect. |
References renderable().
|
staticnodiscardprivate |
Builds the synthetic node name used for unnamed glTF nodes.
| nodeIndex | Index of the unnamed glTF node. |
|
nodiscard |
Returns the geometry mesh handle used by a glTF renderable.
| renderable | Renderable node handle to inspect. |
References renderable().
|
nodiscard |
Returns imported metadata for a glTF renderable handle.
| renderable | Renderable node handle to inspect. |
References renderable().
|
private |
Imports renderable, geometry, and material metadata for a loaded glTF handle.
| gltf | Valid glTF handle whose source metadata should be imported. |
|
nodiscard |
Checks whether a glTF handle refers to a live slot in this store.
| handle | Handle to validate. |
|
nodiscard |
Checks whether a glTF renderable handle refers to a live slot in this store.
| handle | Handle to validate. |
|
staticnodiscardprivate |
Builds the deduplication key for a glTF source path.
| source | Engine-relative glTF source path. |
|
nodiscard |
Gets or creates a stable handle for a glTF source file and imports its renderable metadata.
| source | Engine-relative glTF source path. |
| std::invalid_argument | when source is an absolute path. |
Referenced by Engine::Entities::Scene::spawnAll().
|
nodiscard |
Looks up a renderable node handle inside a loaded glTF file.
| gltf | Valid glTF handle returned by load(). |
| nodeName | Name of the mesh-bearing node to look up. |
Referenced by anchorPoint(), anchorPointNames(), geometryMesh(), and get().
| void Engine::Core::GltfStore::setAssetManager | ( | AssetManager * | assetManager | ) |
Sets the asset manager used by this store and imported child records.
| assetManager | Asset manager to use, or nullptr for handle-only use. |
| void Engine::Core::GltfStore::setGeometryMeshStore | ( | GeometryMeshStore * | geometryMeshes | ) |
Sets the geometry store used when importing glTF renderable metadata.
| geometryMeshes | Geometry mesh store to receive node geometry handles. |
| void Engine::Core::GltfStore::setMaterialStore | ( | MaterialStore * | materials | ) |
Sets the material store used when importing glTF primitive metadata.
| materials | Material store to receive primitive material handles. |
|
nodiscard |
Returns the authored source path for a glTF handle.
| gltf | glTF handle to look up. |
|
private |
Optional bridge retained for store wiring.
Definition at line 725 of file AssetRegistry.h.
|
private |
Store that receives geometry handles during metadata import.
Definition at line 726 of file AssetRegistry.h.
|
private |
Slot storage indexed by GltfHandle::index.
Definition at line 728 of file AssetRegistry.h.
|
private |
Store that receives material handles during metadata import.
Definition at line 727 of file AssetRegistry.h.
|
private |
Slot storage indexed by GltfRenderableHandle::index.
Definition at line 729 of file AssetRegistry.h.
|
private |
Deduplication map from keyFor() to glTF slot index.
Definition at line 730 of file AssetRegistry.h.