Quaternion.
    public struct Quat : IEquatable<Quat>

A 4-dimensional vector representing a rotation.

The vector represents a 4 dimensional complex number where multiplication of the basis elements is not commutative (multiplying i with j gives a different result than multiplying j with i).

Multiplying quaternions reproduces rotation sequences. However quaternions need to be often renormalized, or else they suffer from precision issues.

It can be used to perform SLERP (spherical-linear interpolation) between two rotations.

Inheritance Chain

Interfaces

Static Properties

    public static  Identity { get; }

Constructors

    public Quat(float x, float y, float z, float w)

Returns a quaternion defined by these values.

    public Quat(Vector3 axis, float angle)

Returns a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.

    public Quat()

Fields

    public Single w

W component of the quaternion. Default value: 1

    public Single x

X component of the quaternion. Default value: 0

    public Single y

Y component of the quaternion. Default value: 0

    public Single z

Z component of the quaternion. Default value: 0

Properties

    public float this[] { get; set; }

Methods

    public Quat CubicSlerp(Quat b, Quat preA, Quat postB, float t)

Performs a cubic spherical-linear interpolation with another quaternion.

    public float Dot(Quat b)

Returns the dot product of two quaternions.

    public override bool Equals(object obj)

    public bool Equals(Quat other)

    public override int GetHashCode()

    public Quat Inverse()

Returns the inverse of the quaternion.

    public float Length()

Returns the length of the quaternion.

    public float LengthSquared()

Returns the length of the quaternion, squared.

    public Quat Normalized()

Returns a copy of the quaternion, normalized to unit length.

    public void Set(float x, float y, float z, float w)

    public Quat Slerp(Quat b, float t)

Performs a spherical-linear interpolation with another quaternion.

    public Quat Slerpni(Quat b, float t)

Performs a spherical-linear interpolation with another quaterion without checking if the rotation path is not bigger than 90°.

    public override string ToString()

    public string ToString(string format)

    public Vector3 Xform(Vector3 v)

Transforms the vector v by this quaternion.

Operators

    public static Quat operator +(Quat left, Quat right)

    public static Quat operator /(Quat left, float right)

    public static bool operator ==(Quat left, Quat right)

    public static bool operator !=(Quat left, Quat right)

    public static Quat operator *(Quat left, Quat right)

    public static Quat operator *(Quat left, Vector3 right)

    public static Quat operator *(Vector3 left, Quat right)

    public static Quat operator *(Quat left, float right)

    public static Quat operator *(float left, Quat right)

    public static Quat operator -(Quat left, Quat right)

    public static Quat operator -(Quat left)
Tags: