gpu-curtains
    Preparing search index...

    Class Quat

    Really basic quaternion class used for 3D rotation calculations.

    Index
    type: string

    The type of the Quat.

    elements: Float32Array

    Our quaternion array.

    axisOrder: AxisOrder

    Rotation axis order.

    • Sets the Quat axis order.

      Parameters

      • axisOrder: string = 'XYZ'

        axis order to use.

      Returns Quat

      • this Quat after axis order has been set.
    • Check if 2 Quat are equal.

      Parameters

      • quaternion: Quat = ...

        Quat to check against.

      Returns boolean

      • Whether the Quat are equal or not.
    • Sets this Quat to the rotation required to rotate the direction vector vFrom to the direction vector vTo.

      Parameters

      • vFrom: Vec3

        The first (normalized) direction Vec3.

      • vTo: Vec3

        The second (normalized) direction Vec3.

      Returns Quat

      • A reference to this Quat.
    • Set a Quat from a rotation axis vector and an angle.

      Parameters

      • axis: Vec3

        normalized vector around which to rotate.

      • angle: number = 0

        angle (in radians) to rotate.

      Returns Quat

      • Quat after having applied the rotation.
    • Calculate the spherical linear interpolation of this Quat by given Quat and alpha, where alpha is the percent distance.

      Parameters

      • quat: Quat = ...

        Quat to interpolate towards.

      • alpha: number = 0

        spherical interpolation factor in the [0, 1] interval.

      Returns Quat

      • this Quat after spherical linear interpolation.