Return true if it is a unit quaternion
| 298 | |
| 299 | // Return true if it is a unit quaternion |
| 300 | RP3D_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 |
| 307 | RP3D_FORCE_INLINE bool Quaternion::isValid() const { |
nothing calls this directly
no outgoing calls
no test coverage detected