MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / NormalizeAndUpdateRoot

Method NormalizeAndUpdateRoot

GTE/Applications/TrackObject.cpp:128–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void TrackObject::NormalizeAndUpdateRoot(Matrix4x4<float>& rotate)
129{
130 // Renormalize to avoid accumulated rounding errors that can cause the
131 // rotation matrix to degenerate.
132 Vector4<float> v[3] =
133 {
134 rotate.GetCol(0),
135 rotate.GetCol(1),
136 rotate.GetCol(2)
137 };
138
139 Orthonormalize<4, float>(3, v);
140
141 rotate.SetCol(0, v[0]);
142 rotate.SetCol(1, v[1]);
143 rotate.SetCol(2, v[2]);
144
145 mRoot->localTransform.SetRotation(rotate);
146 mRoot->Update();
147}
148
149

Callers

nothing calls this directly

Calls 4

SetRotationMethod · 0.80
GetColMethod · 0.45
SetColMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected