Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::ModelComponent Class Referencefinal

Component that attaches a 3D model with skeletal animation support to a scene node. More...

#include <C:/Code/AeonEngine/engine/components/ModelComponent.h>

Inheritance diagram for AeonGames::ModelComponent:
Inheritance graph
Collaboration diagram for AeonGames::ModelComponent:
Collaboration graph

Public Member Functions

 ModelComponent ()
 Default constructor.
Overrides
const StringIdGetId () const final
 Get the unique identifier for this component type.
size_t GetPropertyCount () const final
 Get the number of properties exposed by this component.
const StringIdGetPropertyInfoArray () const final
 Get the array of property identifiers.
Property GetProperty (const StringId &aId) const final
 Get the value of a property.
void SetProperty (uint32_t, const Property &aProperty) final
 Set the value aProperty for the property identified by aId.
void Update (Node &aNode, double aDelta) final
 Update the component state.
void Render (const Node &aNode, Renderer &aRenderer, void *aWindowId) final
 Render the component.
void ProcessMessage (Node &aNode, uint32_t aMessageType, const void *aMessageData) final
 Process an incoming message.
Properties
void SetModel (const ResourceId &aModel)
 Sets the model resource.
const ResourceIdGetModel () const noexcept
 Returns the current model resource identifier.
void SetActiveAnimation (size_t aActiveAnimation) noexcept
 Sets the active animation index.
const size_t & GetActiveAnimation () const noexcept
 Returns the active animation index.
void SetStartingFrame (double aAnimationDelta) noexcept
 Sets the starting frame for the active animation.
const double & GetStartingFrame () const noexcept
 Returns the starting frame for the active animation.
Public Member Functions inherited from AeonGames::Component
virtual DLL ~Component ()=0
 Pure virtual destructor.
DLL void SetProperty (const StringId &aId, const Property &aProperty)
 Set a property by its StringId identifier.
DLL void SetProperty (const std::string &aId, const Property &aProperty)
 Set a property by its string name.

Static Public Member Functions

static const StringIdGetClassId ()
 Returns the class identifier for the ModelComponent.

Detailed Description

Component that attaches a 3D model with skeletal animation support to a scene node.

Definition at line 29 of file ModelComponent.h.

Member Function Documentation

◆ GetActiveAnimation()

const size_t & AeonGames::ModelComponent::GetActiveAnimation ( ) const
noexcept

Returns the active animation index.

Definition at line 133 of file ModelComponent.cpp.

◆ GetClassId()

const StringId & AeonGames::ModelComponent::GetClassId ( )
static

Returns the class identifier for the ModelComponent.

Definition at line 37 of file ModelComponent.cpp.

◆ GetId()

const StringId & AeonGames::ModelComponent::GetId ( ) const
finalvirtual

Get the unique identifier for this component type.

Returns
Reference to the component's StringId.

Implements AeonGames::Component.

Definition at line 45 of file ModelComponent.cpp.

◆ GetModel()

const ResourceId & AeonGames::ModelComponent::GetModel ( ) const
noexcept

Returns the current model resource identifier.

Definition at line 122 of file ModelComponent.cpp.

◆ GetProperty()

Property AeonGames::ModelComponent::GetProperty ( const StringId & aId) const
finalvirtual

Get the value of a property.

Parameters
aIdIdentifier of the property to retrieve.
Returns
The property value.

Implements AeonGames::Component.

Definition at line 69 of file ModelComponent.cpp.

◆ GetPropertyCount()

size_t AeonGames::ModelComponent::GetPropertyCount ( ) const
finalvirtual

Get the number of properties exposed by this component.

Returns
Property count.

Implements AeonGames::Component.

Definition at line 59 of file ModelComponent.cpp.

◆ GetPropertyInfoArray()

const StringId * AeonGames::ModelComponent::GetPropertyInfoArray ( ) const
finalvirtual

Get the array of property identifiers.

Returns
Pointer to the first element of the property info array.

Implements AeonGames::Component.

Definition at line 64 of file ModelComponent.cpp.

◆ GetStartingFrame()

const double & AeonGames::ModelComponent::GetStartingFrame ( ) const
noexcept

Returns the starting frame for the active animation.

Definition at line 143 of file ModelComponent.cpp.

◆ ProcessMessage()

void AeonGames::ModelComponent::ProcessMessage ( Node & aNode,
uint32_t aMessageType,
const void * aMessageData )
finalvirtual

Process an incoming message.

Parameters
aNodeNode this component is attached to.
aMessageTypeType identifier of the message.
aMessageDataPointer to message-specific data.

Implements AeonGames::Component.

Definition at line 220 of file ModelComponent.cpp.

◆ Render()

void AeonGames::ModelComponent::Render ( const Node & aNode,
Renderer & aRenderer,
void * aWindowId )
finalvirtual

Render the component.

Parameters
aNodeNode this component is attached to.
aRendererRenderer used for drawing.
aWindowIdPlatform-specific window identifier.

Implements AeonGames::Component.

Definition at line 192 of file ModelComponent.cpp.

◆ SetActiveAnimation()

void AeonGames::ModelComponent::SetActiveAnimation ( size_t aActiveAnimation)
noexcept

Sets the active animation index.

Parameters
aActiveAnimationZero-based index of the animation to activate.

Definition at line 127 of file ModelComponent.cpp.

◆ SetModel()

void AeonGames::ModelComponent::SetModel ( const ResourceId & aModel)

Sets the model resource.

Parameters
aModelResource identifier of the model.

Definition at line 116 of file ModelComponent.cpp.

◆ SetProperty()

void AeonGames::ModelComponent::SetProperty ( uint32_t aId,
const Property & aProperty )
finalvirtual

Set the value aProperty for the property identified by aId.

Note
If the type of the value passed does not match the expected types no change should be made.

Implements AeonGames::Component.

Definition at line 83 of file ModelComponent.cpp.

◆ SetStartingFrame()

void AeonGames::ModelComponent::SetStartingFrame ( double aAnimationDelta)
noexcept

Sets the starting frame for the active animation.

Parameters
aAnimationDeltaStarting frame value.

Definition at line 138 of file ModelComponent.cpp.

◆ Update()

void AeonGames::ModelComponent::Update ( Node & aNode,
double aDelta )
finalvirtual

Update the component state.

Parameters
aNodeNode this component is attached to.
aDeltaElapsed time since the last update, in seconds.

Implements AeonGames::Component.

Definition at line 148 of file ModelComponent.cpp.


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