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

Method normalize

include/reactphysics3d/mathematics/Vector3.h:219–227  ·  view source on GitHub ↗

Normalize the vector

Source from the content-addressed store, hash-verified

217
218// Normalize the vector
219RP3D_FORCE_INLINE void Vector3::normalize() {
220 decimal l = length();
221 if (l < MACHINE_EPSILON) {
222 return;
223 }
224 x /= l;
225 y /= l;
226 z /= l;
227}
228
229// Return the corresponding absolute value vector
230RP3D_FORCE_INLINE Vector3 Vector3::getAbsoluteVector() const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected