Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
EngineCore::ModelAsset Class Reference

The model asset is used to bind together all files of one gtlf model. The idea is that textures, materials etc are bundled in one model. More...

#include <ModelAssetManager.h>

Inheritance diagram for EngineCore::ModelAsset:
Collaboration diagram for EngineCore::ModelAsset:

Public Member Functions

 ModelAsset (std::filesystem::path path)
std::filesystem::path getPath () const
 Gets the models path on disc.
void registerCreatedAssetWithModel (Asset::AssetBase *asset)
 Registers an asset like a texture or 3d model with this gltf model.
void unload () override
 Unload overwrite which empties out the model data.
Public Member Functions inherited from Asset::AssetBase
 AssetBase (bool initializeDefaultEntity=false)
virtual ~AssetBase ()
CpuLoadingState getLoadingState ()
 Gets the loading state of this asset.
void requestLoad ()
 If this asset is in the UNLOADED state it will get added to the assets to load.
entt::entity getEntity () const
 Getter for data.

Protected Member Functions

void updateLoadingState () override
 Updates the loading state based on whether all registered sub-assets are loaded.

Private Attributes

std::filesystem::path path
std::vector< Asset::AssetBase * > assetsFromPath
std::optional< tinygltf::Model > model

Friends

class EngineCore::AssetManager
class Ecs::ModelAssetPipeline

Additional Inherited Members

Protected Attributes inherited from Asset::AssetBase
CpuLoadingState loadingState = UNLOADED
entt::registry & mainRegistry
entt::entity data

Detailed Description

The model asset is used to bind together all files of one gtlf model. The idea is that textures, materials etc are bundled in one model.

Author
Konstantin Passig
Date
10.12.2025

Definition at line 20 of file ModelAssetManager.h.

Constructor & Destructor Documentation

◆ ModelAsset()

EngineCore::ModelAsset::ModelAsset ( std::filesystem::path path)
explicit

Definition at line 6 of file ModelAssetManager.cpp.

References path.

Member Function Documentation

◆ getPath()

std::filesystem::path EngineCore::ModelAsset::getPath ( ) const
inlinenodiscard

Gets the models path on disc.

Author
Konstantin Passig
Date
10.12.2025

Definition at line 33 of file ModelAssetManager.h.

References path.

◆ registerCreatedAssetWithModel()

void EngineCore::ModelAsset::registerCreatedAssetWithModel ( Asset::AssetBase * asset)

Registers an asset like a texture or 3d model with this gltf model.

Parameters
assetThe asset to register with this model
Author
Konstantin Passig
Date
10.12.2025

Definition at line 10 of file ModelAssetManager.cpp.

References assetsFromPath, and TRACY_ZONE_SCOPED_NAMED.

Referenced by Ecs::ModelAssetPipeline::processModel(), and Ecs::ModelAssetPipeline::processTextures().

Here is the caller graph for this function:

◆ unload()

void EngineCore::ModelAsset::unload ( )
overridevirtual

Unload overwrite which empties out the model data.

Author
Konstantin Passig
Date
10.12.2025

Reimplemented from Asset::AssetBase.

Definition at line 15 of file ModelAssetManager.cpp.

References assetsFromPath, model, and path.

◆ updateLoadingState()

void EngineCore::ModelAsset::updateLoadingState ( )
overrideprotectedvirtual

Updates the loading state based on whether all registered sub-assets are loaded.

Author
Konstantin Passig
Date
13.01.2026

Reimplemented from Asset::AssetBase.

Definition at line 23 of file ModelAssetManager.cpp.

References assetsFromPath, Asset::LOADED, Asset::LOADING, Asset::AssetBase::loadingState, and Asset::UNLOADED.

◆ Ecs::ModelAssetPipeline

friend class Ecs::ModelAssetPipeline
friend

Definition at line 22 of file ModelAssetManager.h.

References path.

◆ EngineCore::AssetManager

friend class EngineCore::AssetManager
friend

Definition at line 21 of file ModelAssetManager.h.

Member Data Documentation

◆ assetsFromPath

std::vector<Asset::AssetBase*> EngineCore::ModelAsset::assetsFromPath
private

Definition at line 63 of file ModelAssetManager.h.

Referenced by registerCreatedAssetWithModel(), unload(), and updateLoadingState().

◆ model

std::optional<tinygltf::Model> EngineCore::ModelAsset::model
private

◆ path

std::filesystem::path EngineCore::ModelAsset::path
private

The documentation for this class was generated from the following files: