Constructors

  • Create one instance of this class

    Parameters

    • x: number = 0

      Input x coordinate

    • y: number = 0

      Input y coordinate

    • z: number = 0

      Input z coordinate

    • w: number = 1

      Input w coordinate

    Returns AcGeQuaternion

Accessors

Methods

  • Return the angle between this quaternion and quaternion q in radians.

    Parameters

    Returns number

    Return the angle between this quaternion and quaternion q in radians.

  • Return the rotational conjugate of this quaternion. The conjugate of a quaternion represents the same rotation in the opposite direction about the rotational axis.

    Returns AcGeQuaternion

    Return this quaternion

  • Compare the x, y, z and w properties of v to the equivalent properties of this quaternion to determine if they represent the same rotation.

    Parameters

    • quaternion: AcGeQuaternion

      Input quaternion that this quaternion will be compared to.

    Returns boolean

    Return true if the specified quaternion and this quaternion represent the same rotation.

  • Set this quaternion's x, y, z and w properties from an array.

    Parameters

    • array: number[]

      Input an array of format (x, y, z, w) used to construct the quaternion.

    • offset: number = 0

      Input an optional offset into the array

    Returns AcGeQuaternion

    Return this quaternion

  • Compute the Euclidean length (straight-line length) of this quaternion, considered as a 4 dimensional vector.

    Returns number

    Return the Euclidean length (straight-line length) of this quaternion.

  • Compute the squared Euclidean length (straight-line length) of this quaternion, considered as a 4 dimensional vector. This can be useful if you are comparing the lengths of two quaternions, as this is a slightly more efficient calculation than length().

    Returns number

    Return the squared Euclidean length (straight-line length) of this quaternion

  • Set x, y, z, w properties of this quaternion.

    Parameters

    • x: number

      Input x coordinate

    • y: number

      Input y coordinate

    • z: number

      Input z coordinate

    • w: number

      Input w coordinate

    Returns AcGeQuaternion

    Return this quaternion

  • Handles the spherical linear interpolation between quaternions. t represents the amount of rotation between this quaternion (where t is 0) and qb (where t is 1).

    Parameters

    • qb: AcGeQuaternion

      Input the other quaternion rotation

    • t: number

      Input interpolation factor in the closed interval [0, 1].

    Returns AcGeQuaternion

    Return this quaternion

  • Return the numerical elements of this quaternion in an array of format [x, y, z, w].

    Parameters

    • array: number[] = []

      Input an optional array to store the quaternion. If not specified, a new array will be created.

    • offset: number = 0

      (optional) if specified, the result will be copied into this Array.

    Returns number[]

    Return an array

  • This multiplication implementation assumes the quaternion data are managed in flat arrays.

    Parameters

    • dst: number[]

      Input the output array.

    • dstOffset: number

      Input an offset into the output array.

    • src0: number[]

      Input the source array of the starting quaternion.

    • srcOffset0: number

      Input an offset into the array src0.

    • src1: number[]

      Input the source array of the target quaternion.

    • srcOffset1: number

      Input an offset into the array src1.

    Returns number[]

    Return an array

  • This SLERP implementation assumes the quaternion data are managed in flat arrays.

    Parameters

    • dst: number[]

      Input the output array

    • dstOffset: number

      Input an offset into the output array

    • src0: number[]

      Input the source array of the starting quaternion.

    • srcOffset0: number

      Input an offset into the array src0.

    • src1: number[]

      Input the source array of the target quaternion.

    • srcOffset1: number

      Input an offset into the array src1.

    • t: number

      Input normalized interpolation factor (between 0 and 1).

    Returns void