MCPcopy Create free account
hub / github.com/defold/defold / Inv

Function Inv

engine/dlib/src/dlib/transform.h:124–132  ·  view source on GitHub ↗

* Invert a transform * @param t Transform to invert * @return Inverted transform */

Source from the content-addressed store, hash-verified

122 * @return Inverted transform
123 */
124 inline TransformS1 Inv(const TransformS1& t)
125 {
126 assert(t.GetScale() != 0.0f && "Transform can not be inverted (0 scale).");
127 TransformS1 res;
128 res.SetRotation(conj(t.GetRotation()));
129 res.SetScale(1.0f / t.GetScale());
130 res.SetTranslation(rotate(res.GetRotation(), -t.GetTranslation()) * res.GetScale());
131 return res;
132 }
133
134 /**
135 * Convert a transform into a 4-dim matrix

Callers 1

TESTFunction · 0.50

Calls 9

assertFunction · 0.50
conjFunction · 0.50
rotateFunction · 0.50
GetScaleMethod · 0.45
SetRotationMethod · 0.45
GetRotationMethod · 0.45
SetScaleMethod · 0.45
SetTranslationMethod · 0.45
GetTranslationMethod · 0.45

Tested by 1

TESTFunction · 0.40