MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / normalize

Method normalize

include/reactphysics3d/mathematics/Quaternion.h:238–249  ·  view source on GitHub ↗

Normalize the quaternion

Source from the content-addressed store, hash-verified

236
237// Normalize the quaternion
238RP3D_FORCE_INLINE void Quaternion::normalize() {
239
240 decimal l = length();
241
242 // Check if the length is not equal to zero
243 assert (l > MACHINE_EPSILON);
244
245 x /= l;
246 y /= l;
247 z /= l;
248 w /= l;
249}
250
251// Inverse the quaternion
252RP3D_FORCE_INLINE void Quaternion::inverse() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected