pub trait UnitQuatExt {
// Required methods
fn from_array_unchecked(array: [Real; 4]) -> Self;
fn from_vec4_unchecked(v: Vec4) -> Self;
fn is_valid(array: [Real; 4], eps: Real) -> bool;
}Expand description
Extension trait for unit quaternions with spatial algebra utilities.
This trait provides additional methods for creating and validating unit quaternions specifically tailored for use in spatial transformations and dynamics calculations.
Required Methods§
Sourcefn from_array_unchecked(array: [Real; 4]) -> Self
fn from_array_unchecked(array: [Real; 4]) -> Self
Sourcefn from_vec4_unchecked(v: Vec4) -> Self
fn from_vec4_unchecked(v: Vec4) -> Self
Sourcefn is_valid(array: [Real; 4], eps: Real) -> bool
fn is_valid(array: [Real; 4], eps: Real) -> bool
Check if the array represents a valid unit quaternion.
Validates that the quaternion has unit length within the specified tolerance. This is useful for input validation and debugging quaternion-related issues.
§Arguments
array- The [x, y, z, w] array to checkeps- The tolerance for checking the unit length (typically 1e-6 or smaller)
§Returns
true if the quaternion is normalized within tolerance, false otherwise
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.