OpenBarnyard
 
Loading...
Searching...
No Matches
AAnimatableObject.h
Go to the documentation of this file.
1#pragma once
5#include "AAnimController.h"
6#include "AModel.h"
7
8#include <Toshi/T2DList.h>
9#include <Toshi/T2SList.h>
10#include <Toshi/T2Vector.h>
11#include <Toshi/TPString8.h>
12#include <Math/TVector2.h>
13#include <Math/TQuaternion.h>
14
16 : public Toshi::TObject
17 , public Toshi::T2DList<AAnimatableObject>::Node
18 , public Toshi::T2SList<AAnimatableObject>::Node
19{
20public:
22
24 {
25 Toshi::TVector4 translation = Toshi::TVector4::VEC_ZERO;
26 Toshi::TQuaternion quaternion = Toshi::TQuaternion::IDENTITY;
31 };
32
33 using FLAGS = TUINT8;
40
47
49
50public:
53
54 TBOOL Create( AAnimatableObjectType* a_pObjectType, void* a_Unk1, CREATE_FLAGS a_eFlags = CREATE_FLAGS_NONE );
55 TBOOL Update( TFLOAT a_fDeltaTime );
56 void UpdateAnimControllers( TFLOAT a_fDeltaTime );
57
58 // Starts animation immediately if possible, or schedules it to play later. Return TTRUE if started immediately.
59 TBOOL PlayAnimation( const Toshi::TPString8& a_strName );
60
61 void KillAllAnimations();
62
63 void SetVisible( TBOOL a_bVisible );
64 void SetSkeletonUpdating( TBOOL a_bUpdating, TBOOL a_bRecursive );
65
66 const Toshi::T2Vector<Toshi::TPString8, 2>& GetQueuedAnimations() const { return m_vecQueuedAnims; }
67
68 AModelInstanceRef GetModelInstance() { return m_pModelInstance; }
69 TBOOL IsAnimated() const { return !HASANYFLAG( m_eFlags, FLAGS_NO_ANIMATION ); }
70
71private:
72 // Immediately starts animation if possible. Returns TTRUE if started animation.
73 TBOOL StartAnimation( const Toshi::TPString8& a_strName );
74
75 // Tries to play queued animations
76 void PlayQueuedAnimation();
77
78private:
79 AttachmentInfo m_oAttachmentInfo;
80 void* m_pUnk1;
81 AAnimatableObjectType* m_pObjectType;
82 AToshiAnimationInterface m_oToshiAnimInterface;
83 AModelInstanceRef m_pModelInstance;
84 Toshi::T2DList<AAnimController> m_llAnimControllers;
85 Toshi::T2Vector<Toshi::TPString8, 2> m_vecQueuedAnims;
86 Toshi::T2SList<AAnimatableObject> m_llAttachedObjects;
87 FLAGS m_eFlags;
88};
Quaternion implementation for the Toshi engine.
#define HASANYFLAG(STATE, FLAG)
Definition Defines.h:5
#define BITFLAG(x)
Definition Defines.h:10
#define TDECLARE_CLASS(THIS_CLASS, PARENT_CLASS)
Definition TObject.h:38
unsigned int TUINT
Definition Typedefs.h:8
uint8_t TUINT8
Definition Typedefs.h:17
float TFLOAT
Definition Typedefs.h:4
#define TNULL
Definition Typedefs.h:23
int TINT
Definition Typedefs.h:7
bool TBOOL
Definition Typedefs.h:6
int8_t TINT8
Definition Typedefs.h:16
Toshi::TRef< AModelInstance > AModelInstanceRef
Definition AModel.h:78
const Toshi::T2Vector< Toshi::TPString8, 2 > & GetQueuedAnimations() const
TBOOL PlayAnimation(const Toshi::TPString8 &a_strName)
friend class AAnimatableObjectManager
AModelInstanceRef GetModelInstance()
TBOOL Create(AAnimatableObjectType *a_pObjectType, void *a_Unk1, CREATE_FLAGS a_eFlags=CREATE_FLAGS_NONE)
TBOOL Update(TFLOAT a_fDeltaTime)
TBOOL IsAnimated() const
void SetVisible(TBOOL a_bVisible)
void SetSkeletonUpdating(TBOOL a_bUpdating, TBOOL a_bRecursive)
void UpdateAnimControllers(TFLOAT a_fDeltaTime)