Definition at line 10 of file AnimatorComponent.h.
◆ Clone()
Reimplemented from CSE::SComponent.
Definition at line 124 of file AnimatorComponent.cpp.
124 {
126
127 clone->m_animationTime = m_animationTime;
128 clone->m_startTime = m_startTime;
129 clone->m_currentAnimation = m_currentAnimation;
130
131 return clone;
132}
◆ CopyReference()
◆ Exterminate()
void AnimatorComponent::Exterminate |
( |
| ) |
|
|
overridevirtual |
◆ Init()
void AnimatorComponent::Init |
( |
| ) |
|
|
overridevirtual |
◆ PlayAnimation()
void AnimatorComponent::PlayAnimation |
( |
Animation * |
animation | ) |
|
Definition at line 42 of file AnimatorComponent.cpp.
42 {
43 m_currentAnimation = animation;
44 m_animationTime = m_startTime = 0;
45}
◆ PrintValue()
std::string AnimatorComponent::PrintValue |
( |
| ) |
const |
|
overridevirtual |
Implements CSE::VariableBinder.
Definition at line 156 of file AnimatorComponent.cpp.
156 {
157
158 PRINT_START("component");
159
160 PRINT_VALUE(m_animationTime, m_animationTime);
161 PRINT_VALUE(m_startTime, m_startTime);
162 PRINT_VALUE(m_currentAnimation, ConvertSpaceStr(m_currentAnimation->GetHash()));
163 PRINT_VALUE_SPREFAB_REF(m_rootJoint);
164
165
166 PRINT_END("component");
167}
◆ SetRootJoint()
◆ SetValue()
void AnimatorComponent::SetValue |
( |
std::string |
name_str, |
|
|
Arguments |
value |
|
) |
| |
|
overridevirtual |
Implements CSE::VariableBinder.
Definition at line 144 of file AnimatorComponent.cpp.
144 {
145 if (name_str == "m_animationTime") {
146 m_animationTime = std::stof(value[0]);
147 } else if (name_str == "m_startTime") {
148 m_startTime = std::stof(value[0]);
149 } else if (name_str == "m_currentAnimation") {
150 m_currentAnimation = SResource::Create<Animation>(value[0]);
151 } else if (name_str == "m_rootJoint") {
153 }
154}
◆ Tick()
void AnimatorComponent::Tick |
( |
float |
elapsedTime | ) |
|
|
overridevirtual |
Implements CSE::SISComponent.
Definition at line 17 of file AnimatorComponent.cpp.
17 {
18 if (m_currentAnimation == nullptr) return;
19
20 if (m_startTime == 0) {
21 m_startTime = elapsedTime;
22 }
23 UpdateAnimationTime(elapsedTime);
24
25 std::vector<mat4> currentPose = calculateCurrentAnimationPose();
26 applyPoseToJoints(currentPose, m_rootJoint, mat4::Identity());
27
28}
The documentation for this class was generated from the following files: