| 126 | } |
| 127 | |
| 128 | void 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 |
nothing calls this directly
no test coverage detected