Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::AnimationComponent Class Referencefinal

#include <AnimationComponent.h>

+ Inheritance diagram for Divide::AnimationComponent:

Public Member Functions

 AnimationComponent (SceneGraphNode *parentSGN, PlatformContext &context)
 
bool playAnimation (const string &name)
 Select an animation by name.
 
bool playAnimation (U32 pAnimIndex)
 Select an animation by index.
 
bool playNextAnimation () noexcept
 Select next available animation.
 
bool playPreviousAnimation () noexcept
 Select previous available animation.
 
I32 frameCount (U32 animationID) const
 
U8 boneCount () const
 
bool frameTicked () const noexcept
 
const vector< Line > & skeletonLines () const
 
ShaderBuffergetBoneBuffer () const
 
AnimEvaluatorgetAnimationByIndex (U32 animationID) const
 
void resetTimers () noexcept
 
AnimEvaluator::FrameIndex frameIndex () const noexcept
 
I32 frameCount () const
 
AnimEvaluatorgetCurrentAnimation () const
 
 PROPERTY_R (bool, showSkeleton, false)
 
 PROPERTY_RW (F32, animationSpeed, 1.f)
 
 POINTER_RW (SceneAnimator, animator, nullptr)
 Pointer to the mesh's animator. Owned by the mesh!
 
 PROPERTY_R (U32, animationIndex, U32_MAX)
 Current animation index for the current SGN.
 
 PROPERTY_RW (U32, previousAnimationIndex, U32_MAX)
 
void playAnimations (const bool state) noexcept
 
bool playAnimations () const noexcept
 

Static Protected Member Functions

static void GlobalAnimationState (const bool state) noexcept
 
static bool GlobalAnimationState () noexcept
 

Protected Attributes

AnimEvaluator::FrameIndex _frameIndex = {}
 
D64 _currentTimeStamp = -1.0
 Current animation timestamp for the current SGN.
 
D64 _parentTimeStamp = 0.0
 
bool _playAnimations = true
 

Static Protected Attributes

static bool s_globalAnimationState = true
 

Private Types

using Parent = BaseComponentType< AnimationComponent, ComponentType::ANIMATION >
 

Friends

class AnimationSystem
 

Detailed Description

Definition at line 47 of file AnimationComponent.h.

Member Typedef Documentation

◆ Parent

Constructor & Destructor Documentation

◆ AnimationComponent()

Divide::AnimationComponent::AnimationComponent ( SceneGraphNode parentSGN,
PlatformContext context 
)
explicit

Definition at line 16 of file AnimationComponent.cpp.

Member Function Documentation

◆ boneCount()

U8 Divide::AnimationComponent::boneCount ( ) const

Definition at line 171 of file AnimationComponent.cpp.

◆ frameCount() [1/2]

I32 Divide::AnimationComponent::frameCount ( ) const
inline

Definition at line 73 of file AnimationComponent.h.

◆ frameCount() [2/2]

I32 Divide::AnimationComponent::frameCount ( U32  animationID) const

Definition at line 164 of file AnimationComponent.cpp.

◆ frameIndex()

AnimEvaluator::FrameIndex Divide::AnimationComponent::frameIndex ( ) const
inlinenoexcept

Definition at line 72 of file AnimationComponent.h.

◆ frameTicked()

bool Divide::AnimationComponent::frameTicked ( ) const
noexcept

Definition at line 178 of file AnimationComponent.cpp.

◆ getAnimationByIndex()

AnimEvaluator & Divide::AnimationComponent::getAnimationByIndex ( U32  animationID) const

Definition at line 183 of file AnimationComponent.cpp.

◆ getBoneBuffer()

ShaderBuffer * Divide::AnimationComponent::getBoneBuffer ( ) const

Definition at line 158 of file AnimationComponent.cpp.

◆ getCurrentAnimation()

AnimEvaluator & Divide::AnimationComponent::getCurrentAnimation ( ) const
inline

Definition at line 75 of file AnimationComponent.h.

◆ GlobalAnimationState() [1/2]

static bool Divide::AnimationComponent::GlobalAnimationState ( )
inlinestaticprotectednoexcept

Definition at line 90 of file AnimationComponent.h.

◆ GlobalAnimationState() [2/2]

static void Divide::AnimationComponent::GlobalAnimationState ( const bool  state)
inlinestaticprotectednoexcept

Definition at line 89 of file AnimationComponent.h.

◆ playAnimation() [1/2]

bool Divide::AnimationComponent::playAnimation ( const string name)

Select an animation by name.

Definition at line 68 of file AnimationComponent.cpp.

◆ playAnimation() [2/2]

bool Divide::AnimationComponent::playAnimation ( U32  pAnimIndex)

Select an animation by index.

Definition at line 77 of file AnimationComponent.cpp.

◆ playAnimations() [1/2]

bool Divide::AnimationComponent::playAnimations ( ) const
inlinenoexcept

Definition at line 86 of file AnimationComponent.h.

◆ playAnimations() [2/2]

void Divide::AnimationComponent::playAnimations ( const bool  state)
inlinenoexcept

Definition at line 85 of file AnimationComponent.h.

◆ playNextAnimation()

bool Divide::AnimationComponent::playNextAnimation ( )
noexcept

Select next available animation.

Definition at line 109 of file AnimationComponent.cpp.

◆ playPreviousAnimation()

bool Divide::AnimationComponent::playPreviousAnimation ( )
noexcept

Select previous available animation.

Definition at line 129 of file AnimationComponent.cpp.

◆ POINTER_RW()

Divide::AnimationComponent::POINTER_RW ( SceneAnimator  ,
animator  ,
nullptr   
)

Pointer to the mesh's animator. Owned by the mesh!

◆ PROPERTY_R() [1/2]

Divide::AnimationComponent::PROPERTY_R ( bool  ,
showSkeleton  ,
false   
)

◆ PROPERTY_R() [2/2]

Divide::AnimationComponent::PROPERTY_R ( U32  ,
animationIndex  ,
U32_MAX   
)

Current animation index for the current SGN.

◆ PROPERTY_RW() [1/2]

Divide::AnimationComponent::PROPERTY_RW ( F32  ,
animationSpeed  ,
1.  f 
)

◆ PROPERTY_RW() [2/2]

Divide::AnimationComponent::PROPERTY_RW ( U32  ,
previousAnimationIndex  ,
U32_MAX   
)

◆ resetTimers()

void Divide::AnimationComponent::resetTimers ( )
noexcept

Definition at line 61 of file AnimationComponent.cpp.

◆ skeletonLines()

const vector< Line > & Divide::AnimationComponent::skeletonLines ( ) const

Definition at line 149 of file AnimationComponent.cpp.

Friends And Related Function Documentation

◆ AnimationSystem

friend class AnimationSystem
friend

Definition at line 47 of file AnimationComponent.h.

Member Data Documentation

◆ _currentTimeStamp

D64 Divide::AnimationComponent::_currentTimeStamp = -1.0
protected

Current animation timestamp for the current SGN.

Definition at line 95 of file AnimationComponent.h.

◆ _frameIndex

AnimEvaluator::FrameIndex Divide::AnimationComponent::_frameIndex = {}
protected

Definition at line 93 of file AnimationComponent.h.

◆ _parentTimeStamp

D64 Divide::AnimationComponent::_parentTimeStamp = 0.0
protected

Previous animation index Parent time stamp (e.g. Mesh). Should be identical for all nodes of the same level with the same parent

Definition at line 99 of file AnimationComponent.h.

◆ _playAnimations

bool Divide::AnimationComponent::_playAnimations = true
protected

Definition at line 101 of file AnimationComponent.h.

◆ s_globalAnimationState

bool Divide::AnimationComponent::s_globalAnimationState = true
staticprotected

Definition at line 103 of file AnimationComponent.h.


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