CSEngine
Loading...
Searching...
No Matches
JointComponent.h
1#pragma once
2
3#include "../SComponent.h"
4#include "../../Util/Matrix.h"
5
6namespace CSE {
7
8 class JointComponent : public SComponent {
9 public:
10 COMPONENT_DEFINE_CONSTRUCTOR(JointComponent);
11
13
14 ~JointComponent() override;
15
16 void Exterminate() override;
17
18 void Init() override;
19
20 void Tick(float elapsedTime) override;
21
22 SComponent* Clone(SGameObject* object) override;
23
24 void SetValue(std::string name_str, Arguments value) override;
25
26 std::string PrintValue() const override;
27
28 void SetAnimationMatrix(mat4&& animation);
29
30 mat4 GetAnimationMatrix() const {
31 return m_animatedMatrix;
32 }
33
34 void SetID(int id) {
35 m_id = id;
36 }
37
38 int GetID() const {
39 return m_id;
40 }
41
42 int GetAnimationJointId() const {
43 return m_animationJointId;
44 }
45
46 void SetAnimationJointId(int animation_joint_id) {
47 m_animationJointId = animation_joint_id;
48 }
49
50 mat4 GetInverseTransformMatrix() const {
51 return m_inverseTransformMatrix;
52 }
53
54 void calcInverseBindTransform(const mat4& parentTransform);
55
56 void SetBindLocalMatrix(const mat4& mat);
57
58 private:
59 int m_id;
60 int m_animationJointId;
61 mat4 m_animatedMatrix;
62 mat4 m_inverseTransformMatrix;
63 mat4 m_localBindMatrix;
64 };
65}