OpenClonk
StdMeshTransformation Struct Reference

#include <StdMeshMath.h>

Collaboration diagram for StdMeshTransformation:
[legend]

Static Public Member Functions

static StdMeshTransformation Zero ()
 
static StdMeshTransformation Identity ()
 
static StdMeshTransformation Inverse (const StdMeshTransformation &transform)
 
static StdMeshTransformation Translate (float dx, float dy, float dz)
 
static StdMeshTransformation Scale (float sx, float sy, float sz)
 
static StdMeshTransformation Rotate (float angle, float rx, float ry, float rz)
 
static StdMeshTransformation Nlerp (const StdMeshTransformation &lhs, const StdMeshTransformation &rhs, float w)
 

Public Attributes

StdMeshVector scale
 
StdMeshQuaternion rotate
 
StdMeshVector translate
 

Detailed Description

Definition at line 72 of file StdMeshMath.h.

Member Function Documentation

◆ Identity()

StdMeshTransformation StdMeshTransformation::Identity ( )
static

Definition at line 114 of file StdMeshMath.cpp.

115 {
118  t.rotate.w = 1.0f;
119  t.rotate.x = t.rotate.y = t.rotate.z = 0.0f;
121  return t;
122 }
StdMeshVector translate
Definition: StdMeshMath.h:76
StdMeshQuaternion rotate
Definition: StdMeshMath.h:75
StdMeshVector scale
Definition: StdMeshMath.h:74
static StdMeshVector Zero()
Definition: StdMeshMath.cpp:20
static StdMeshVector UnitScale()
Definition: StdMeshMath.cpp:29

References rotate, scale, translate, StdMeshVector::UnitScale(), StdMeshQuaternion::w, StdMeshQuaternion::x, StdMeshQuaternion::y, StdMeshQuaternion::z, and StdMeshVector::Zero().

Here is the call graph for this function:

◆ Inverse()

StdMeshTransformation StdMeshTransformation::Inverse ( const StdMeshTransformation transform)
static

Definition at line 124 of file StdMeshMath.cpp.

125 {
127  t.scale = 1.0f/transform.scale;
128  t.rotate.w = transform.rotate.w;
129  t.rotate.x = -transform.rotate.x;
130  t.rotate.y = -transform.rotate.y;
131  t.rotate.z = -transform.rotate.z;
132  t.translate = t.rotate * (t.scale * -transform.translate);
133  return t;
134 }

References rotate, scale, translate, StdMeshQuaternion::w, StdMeshQuaternion::x, StdMeshQuaternion::y, and StdMeshQuaternion::z.

Referenced by StdMeshSkeletonLoader::LoadSkeletonBinary(), StdMeshSkeletonLoader::LoadSkeletonXml(), and StdMeshSkeleton::MirrorAnimation().

Here is the caller graph for this function:

◆ Nlerp()

StdMeshTransformation StdMeshTransformation::Nlerp ( const StdMeshTransformation lhs,
const StdMeshTransformation rhs,
float  w 
)
static

Definition at line 165 of file StdMeshMath.cpp.

166 {
168  t.translate = (1 - w) * lhs.translate + w * rhs.translate;
169  t.rotate = StdMeshQuaternion::Nlerp(lhs.rotate, rhs.rotate, w);
170  t.scale = (1 - w) * lhs.scale + w * rhs.scale;
171  return t;
172 }
static StdMeshQuaternion Nlerp(const StdMeshQuaternion &lhs, const StdMeshQuaternion &rhs, float w)
Definition: StdMeshMath.cpp:93

References StdMeshQuaternion::Nlerp(), rotate, scale, and translate.

Referenced by StdMeshInstanceAnimationNode::GetBoneTransform(), StdMeshTrack::GetTransformAt(), and StdMeshInstance::UpdateBoneTransforms().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Rotate()

StdMeshTransformation StdMeshTransformation::Rotate ( float  angle,
float  rx,
float  ry,
float  rz 
)
static

Definition at line 156 of file StdMeshMath.cpp.

157 {
162  return t;
163 }
static StdMeshQuaternion AngleAxis(float theta, const StdMeshVector &axis)
Definition: StdMeshMath.cpp:72
static StdMeshVector Translate(float dx, float dy, float dz)
Definition: StdMeshMath.cpp:38

References StdMeshQuaternion::AngleAxis(), rotate, scale, StdMeshVector::Translate(), translate, StdMeshVector::UnitScale(), and StdMeshVector::Zero().

Here is the call graph for this function:

◆ Scale()

StdMeshTransformation StdMeshTransformation::Scale ( float  sx,
float  sy,
float  sz 
)
static

Definition at line 146 of file StdMeshMath.cpp.

147 {
149  t.scale = StdMeshVector::Translate(sx, sy, sz);
150  t.rotate.w = 1.0f;
151  t.rotate.x = t.rotate.y = t.rotate.z = 0.0f;
153  return t;
154 }

References rotate, scale, StdMeshVector::Translate(), translate, StdMeshQuaternion::w, StdMeshQuaternion::x, StdMeshQuaternion::y, StdMeshQuaternion::z, and StdMeshVector::Zero().

Here is the call graph for this function:

◆ Translate()

StdMeshTransformation StdMeshTransformation::Translate ( float  dx,
float  dy,
float  dz 
)
static

Definition at line 136 of file StdMeshMath.cpp.

137 {
140  t.rotate.w = 1.0f;
141  t.rotate.x = t.rotate.y = t.rotate.z = 0.0f;
142  t.translate = StdMeshVector::Translate(dx, dy, dz);
143  return t;
144 }

References rotate, scale, StdMeshVector::Translate(), translate, StdMeshVector::UnitScale(), StdMeshQuaternion::w, StdMeshQuaternion::x, StdMeshQuaternion::y, and StdMeshQuaternion::z.

Here is the call graph for this function:

◆ Zero()

StdMeshTransformation StdMeshTransformation::Zero ( )
static

Definition at line 105 of file StdMeshMath.cpp.

106 {
111  return t;
112 }
static StdMeshQuaternion Zero()
Definition: StdMeshMath.cpp:62

References rotate, scale, translate, StdMeshVector::Zero(), and StdMeshQuaternion::Zero().

Here is the call graph for this function:

Member Data Documentation

◆ rotate

◆ scale

◆ translate


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