FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Quaternion

    struct · ferroui-base · v0.5.0

    struct Quaternion
    

    A vector that is used to encode three-dimensional physical rotations.

    View source

    Members

    x

    x: f32
    

    The X value of the vector component of the quaternion.

    Source

    y

    y: f32
    

    The Y value of the vector component of the quaternion.

    Source

    z

    z: f32
    

    The Z value of the vector component of the quaternion.

    Source

    w

    w: f32
    

    The rotation component of the quaternion.

    Source

    IDENTITY

    const IDENTITY: Quaternion
    

    A quaternion that represents no rotation.

    Source

    ZERO

    const ZERO: Quaternion
    

    A quaternion whose components are all zero.

    Source

    new

    const fn new(x: f32, y: f32, z: f32, w: f32) -> Self
    

    Constructs a quaternion from the specified components.

    Source

    from_vector3

    const fn from_vector3(vector_part: Vector3, scalar_part: f32) -> Self
    

    Creates a quaternion from the specified vector and rotation parts.

    Source

    is_identity

    fn is_identity(self: &Self) -> bool
    

    Gets a value that indicates whether the current instance is the identity quaternion.

    Source

    concatenate

    fn concatenate(value1: Quaternion, value2: Quaternion) -> Quaternion
    

    Concatenates two quaternions: the result represents the value1 rotation followed by the value2 rotation.

    Source

    conjugate

    fn conjugate(value: Quaternion) -> Quaternion
    

    Returns the conjugate of a specified quaternion.

    Source

    create_from_axis_angle

    fn create_from_axis_angle(axis: Vector3, angle: f32) -> Quaternion
    

    Creates a quaternion from a unit vector and an angle to rotate around the vector.

    Source

    create_from_rotation_matrix

    fn create_from_rotation_matrix(matrix: Matrix4x4) -> Quaternion
    

    Creates a quaternion from the specified rotation matrix.

    Source

    create_from_yaw_pitch_roll

    fn create_from_yaw_pitch_roll(yaw: f32, pitch: f32, roll: f32) -> Quaternion
    

    Creates a new quaternion from the given yaw, pitch, and roll.

    Source

    dot

    fn dot(quaternion1: Quaternion, quaternion2: Quaternion) -> f32
    

    Calculates the dot product of two quaternions.

    Source

    inverse

    fn inverse(value: Quaternion) -> Quaternion
    

    Returns the inverse of a quaternion.

    Source

    length

    fn length(self: &Self) -> f32
    

    Calculates the length of the quaternion.

    Source

    length_squared

    fn length_squared(self: &Self) -> f32
    

    Calculates the squared length of the quaternion.

    Source

    lerp

    fn lerp(quaternion1: Quaternion, quaternion2: Quaternion, amount: f32) -> Quaternion
    

    Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. The result is normalized.

    Source

    normalize

    fn normalize(value: Quaternion) -> Quaternion
    

    Divides each component of a specified quaternion by its length.

    Source

    slerp

    fn slerp(quaternion1: Quaternion, quaternion2: Quaternion, amount: f32) -> Quaternion
    

    Interpolates between two quaternions, using spherical linear interpolation.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ErasedDestructor
    • IntoEither
    • Clone
    • Copy
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Default
    • Add
    • Sub
    • Neg
    • Mul
    • Mul<f32>
    • Div
    • Display
    • IInterpolator<Quaternion>
    • From<Quaternion>
    • ExpressionVariantValue
    • ServerPropertyValue
    • BatchValue

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.