CSEngine
Loading...
Searching...
No Matches
CSE::JointTransform Class Reference

Public Member Functions

 JointTransform (const vec3 &position, Quaternion rotation)
 
mat4 GetLocalMatrix ()
 

Static Public Member Functions

static JointTransform Interpolate (float t, JointTransform &a, JointTransform &b)
 

Detailed Description

Definition at line 14 of file AnimationUtil.h.

Constructor & Destructor Documentation

◆ JointTransform() [1/2]

CSE::JointTransform::JointTransform ( )
inline

Definition at line 16 of file AnimationUtil.h.

16 {
17 m_position = vec3();
18 m_rotation = Quaternion();
19 }

◆ JointTransform() [2/2]

CSE::JointTransform::JointTransform ( const vec3 position,
Quaternion  rotation 
)
inline

Definition at line 21 of file AnimationUtil.h.

21 {
22 m_position.Set(position.x, position.y, position.z);
23 m_rotation = rotation;
24 }

Member Function Documentation

◆ GetLocalMatrix()

mat4 CSE::JointTransform::GetLocalMatrix ( )
inline

Definition at line 35 of file AnimationUtil.h.

35 {
36 mat4 mat;
37 mat = mat4::Translate(m_position.x, m_position.y, m_position.z);
38 mat = m_rotation.ToMatrix4() * mat;
39
40
41 return mat;
42 }

◆ Interpolate()

static JointTransform CSE::JointTransform::Interpolate ( float  t,
JointTransform a,
JointTransform b 
)
inlinestatic

Definition at line 28 of file AnimationUtil.h.

28 {
29 vec3 position = vec3::Lerp(t, a.m_position, b.m_position);
30 Quaternion rotation = a.m_rotation.Slerp(t, b.m_rotation);
31
32 return {position, rotation};
33 }

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