Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::Model Class Reference

Represents a 3D model composed of assemblies (pipeline, material, mesh), a skeleton, and animations. More...

#include <aeongames/Model.hpp>

Inheritance diagram for AeonGames::Model:
Inheritance graph
Collaboration diagram for AeonGames::Model:
Collaboration graph

Public Types

using Assembly
 A tuple of ResourceIds representing a pipeline, material, and mesh combination.

Public Member Functions

DLL void LoadFromPBMsg (const ModelMsg &aModelMsg)
 Load model data from a protobuf message.
DLL void LoadFromMemory (const void *aBuffer, size_t aBufferSize) final
 Load model data from a memory buffer.
DLL void Unload () final
 Unload model data and free resources.
DLL const std::vector< Assembly > & GetAssemblies () const
 Get the list of assemblies that compose this model.
DLL const SkeletonGetSkeleton () const
 Get the skeleton associated with this model.
DLL const std::vector< ResourceId > & GetAnimations () const
 Get the list of animation resource identifiers.
DLL void LoadRendererResources (Renderer &aRenderer) const
 Load renderer-specific resources for this model.
DLL void UnloadRendererResources (Renderer &aRenderer) const
 Unload renderer-specific resources for this model.
Public Member Functions inherited from AeonGames::Resource
virtual ~Resource ()
 Virtual destructor.
DLL void LoadFromId (uint32_t aId)
 Load the resource identified by a numeric id.
DLL void LoadFromFile (const std::string &aFilename)
 Load the resource from a file on disk.
DLL size_t GetConsecutiveId () const
 Get the Consecutive Id for the resource object.

Detailed Description

Represents a 3D model composed of assemblies (pipeline, material, mesh), a skeleton, and animations.

Definition at line 34 of file Model.hpp.

Member Typedef Documentation

◆ Assembly

Initial value:
typename std::tuple <
Identifies a resource by its type and path CRC32 hashes.

A tuple of ResourceIds representing a pipeline, material, and mesh combination.

Definition at line 38 of file Model.hpp.

Member Function Documentation

◆ GetAnimations()

const std::vector< ResourceId > & AeonGames::Model::GetAnimations ( ) const

Get the list of animation resource identifiers.

Returns
Reference to the vector of animation ResourceIds.

Definition at line 131 of file Model.cpp.

◆ GetAssemblies()

const std::vector< Model::Assembly > & AeonGames::Model::GetAssemblies ( ) const

Get the list of assemblies that compose this model.

Returns
Reference to the vector of assemblies.

Definition at line 121 of file Model.cpp.

◆ GetSkeleton()

const Skeleton * AeonGames::Model::GetSkeleton ( ) const

Get the skeleton associated with this model.

Returns
Pointer to the skeleton, or nullptr if none.

Definition at line 126 of file Model.cpp.

◆ LoadFromMemory()

void AeonGames::Model::LoadFromMemory ( const void * aBuffer,
size_t aBufferSize )
finalvirtual

Load model data from a memory buffer.

Parameters
aBufferPointer to the buffer containing model data.
aBufferSizeSize of the buffer in bytes.

Implements AeonGames::Resource.

Definition at line 49 of file Model.cpp.

◆ LoadFromPBMsg()

void AeonGames::Model::LoadFromPBMsg ( const ModelMsg & aModelMsg)

Load model data from a protobuf message.

Parameters
aModelMsgProtobuf message containing model data.

Definition at line 54 of file Model.cpp.

◆ LoadRendererResources()

void AeonGames::Model::LoadRendererResources ( Renderer & aRenderer) const

Load renderer-specific resources for this model.

Parameters
aRendererreference to the renderer.

Definition at line 136 of file Model.cpp.

◆ Unload()

void AeonGames::Model::Unload ( )
finalvirtual

Unload model data and free resources.

Todo
refcount Resource Id's?

Implements AeonGames::Resource.

Definition at line 114 of file Model.cpp.

◆ UnloadRendererResources()

void AeonGames::Model::UnloadRendererResources ( Renderer & aRenderer) const

Unload renderer-specific resources for this model.

Parameters
aRendererreference to the renderer.

Definition at line 146 of file Model.cpp.


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