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

Stores skeletal animation data including keyframes and bone transforms. More...

#include <aeongames/Animation.hpp>

Inheritance diagram for AeonGames::Animation:
Inheritance graph
Collaboration diagram for AeonGames::Animation:
Collaboration graph

Public Member Functions

DLL void LoadFromMemory (const void *aBuffer, size_t aBufferSize) final
 Load animation data from a memory buffer.
DLL void Unload () final
 Unload animation data and free resources.
DLL uint32_t GetFrameRate () const
 Get the frame rate of the animation.
DLL double GetDuration () const
 Get the total duration of the animation.
DLL double GetSample (double aTime) const
 Get a normalized sample position for a given time.
DLL double AddTimeToSample (double aSample, double aTime) const
 Advance a sample position by a time delta.
DLL const Transform GetTransform (size_t aBoneIndex, double aSample) const
 Get the transform for a specific bone at a given sample.
DLL void LoadFromPBMsg (const AnimationMsg &aAnimationMsg)
 Load animation data from a protobuf message.
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

Stores skeletal animation data including keyframes and bone transforms.

Definition at line 28 of file Animation.hpp.

Member Function Documentation

◆ AddTimeToSample()

double AeonGames::Animation::AddTimeToSample ( double aSample,
double aTime ) const

Advance a sample position by a time delta.

Parameters
aSampleCurrent sample position.
aTimeTime delta in seconds.
Returns
New sample position.

Definition at line 116 of file Animation.cpp.

◆ GetDuration()

double AeonGames::Animation::GetDuration ( ) const

Get the total duration of the animation.

Returns
Duration in seconds.

Definition at line 101 of file Animation.cpp.

◆ GetFrameRate()

uint32_t AeonGames::Animation::GetFrameRate ( ) const

Get the frame rate of the animation.

Returns
Frame rate in frames per second.

Definition at line 96 of file Animation.cpp.

◆ GetSample()

double AeonGames::Animation::GetSample ( double aTime) const

Get a normalized sample position for a given time.

Parameters
aTimeTime in seconds.
Returns
Normalized sample position.

The sample integral part represents the initial frame, the fractional part is the interpolation between the initial frame and the next.

Definition at line 106 of file Animation.cpp.

◆ GetTransform()

const Transform AeonGames::Animation::GetTransform ( size_t aBoneIndex,
double aSample ) const

Get the transform for a specific bone at a given sample.

Parameters
aBoneIndexIndex of the bone in the skeleton.
aSampleSample position within the animation.
Returns
Transform for the bone at the given sample.

modf should guarantee interpolation to be in the range [0.0,1.0)

Definition at line 121 of file Animation.cpp.

◆ LoadFromMemory()

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

Load animation data from a memory buffer.

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

Implements AeonGames::Resource.

Definition at line 42 of file Animation.cpp.

◆ LoadFromPBMsg()

void AeonGames::Animation::LoadFromPBMsg ( const AnimationMsg & aAnimationMsg)

Load animation data from a protobuf message.

Parameters
aAnimationMsgProtobuf message containing animation data.

Definition at line 47 of file Animation.cpp.

◆ Unload()

void AeonGames::Animation::Unload ( )
finalvirtual

Unload animation data and free resources.

Implements AeonGames::Resource.

Definition at line 86 of file Animation.cpp.


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