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

Method isUnit

include/reactphysics3d/mathematics/Quaternion.h:300–304  ·  view source on GitHub ↗

Return true if it is a unit quaternion

Source from the content-addressed store, hash-verified

298
299// Return true if it is a unit quaternion
300RP3D_FORCE_INLINE bool Quaternion::isUnit() const {
301 const decimal length = std::sqrt(x*x + y*y + z*z + w*w);
302 const decimal tolerance = 1e-5f;
303 return std::abs(length - decimal(1.0)) < tolerance;
304}
305
306// Return true if it is a valid quaternion
307RP3D_FORCE_INLINE bool Quaternion::isValid() const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected