Quarternion

Trait Quarternion 

Source
pub trait Quarternion:
    Clone
    + Copy
    + Default
    + Debug
    + 'static {
    type S: Scalar;
    type Vec3: Vector3D<S = Self::S>;
    type Vec4: Vector4D<S = Self::S>;

    // Required methods
    fn identity() -> Self;
    fn from_rotation_arc(from: Self::Vec3, to: Self::Vec3) -> Self;
    fn from_axis_angle(axis: Self::Vec3, angle: Self::S) -> Self;
    fn axis_angle(&self) -> (Self::Vec3, Self::S);
    fn vec4(&self) -> Self::Vec4;
}
Expand description

Trait for quarternions.

Required Associated Types§

Source

type S: Scalar

The scalar type of the coordinates and angles used in the rotation.

Source

type Vec3: Vector3D<S = Self::S>

The 3d vector type used in the rotation.

Source

type Vec4: Vector4D<S = Self::S>

The 4d vector type used in the rotation.

Required Methods§

Source

fn identity() -> Self

Returns the identity rotation.

Source

fn from_rotation_arc(from: Self::Vec3, to: Self::Vec3) -> Self

Returns a rotation from a rotation arc.

Source

fn from_axis_angle(axis: Self::Vec3, angle: Self::S) -> Self

Returns a rotation from an axis and an angle.

Source

fn axis_angle(&self) -> (Self::Vec3, Self::S)

Returns the axis and angle of the rotation.

Source

fn vec4(&self) -> Self::Vec4

Returns the matrix representation of the rotation.

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.

Implementors§