Class Quaternion

Represents a four dimensional mathematical quaternion.

Hierarchy

  • Quaternion

Constructors

  • Constructor of Quaternion.

    Parameters

    • x: number = 0

      The x component of the quaternion, default 0

    • y: number = 0

      The y component of the quaternion, default 0

    • z: number = 0

      The z component of the quaternion, default 0

    • w: number = 1

      The w component of the quaternion, default 1

    Returns Quaternion

Properties

_onValueChanged: (() => void) = null

Type declaration

    • (): void
    • Internal

      Returns void

_w: number
_x: number
_y: number
_z: number
_tempQuat1: Quaternion = ...
_tempVector3: Vector3 = ...

Accessors

  • get normalized(): boolean
  • Indicting whether this instance is normalized.

    Returns boolean

Methods

  • Determines the dot product of this quaternion and the specified quaternion.

    Returns

    The dot product of two quaternions

    Parameters

    Returns number

  • Get the rotation axis and rotation angle of the quaternion (unit: radians).

    Returns

    The rotation angle (unit: radians)

    Parameters

    • out: Vector3

      The axis as an output parameter

    Returns number

  • Calculate the length of this quaternion.

    Returns

    The length of this quaternion

    Returns number

  • Calculates the squared length of this quaternion.

    Returns

    The squared length of this quaternion

    Returns number

  • Performs a linear blend between this quaternion and the specified quaternion.

    Returns

    • The result of linear blending between two quaternions

    Parameters

    • quat: Quaternion

      The specified quaternion

    • t: number

      The blend amount where 0 returns this and 1 quat

    Returns Quaternion

  • Calculate this quaternion rotate around X axis.

    Returns

    This quaternion

    Parameters

    • rad: number

      The rotation angle in radians

    Returns Quaternion

  • Calculate this quaternion rotate around Y axis.

    Returns

    This quaternion

    Parameters

    • rad: number

      The rotation angle in radians

    Returns Quaternion

  • Calculate this quaternion rotate around Z axis.

    Returns

    This quaternion

    Parameters

    • rad: number

      The rotation angle in radians

    Returns Quaternion

  • Set the value of this quaternion, and return this quaternion.

    Returns

    This quaternion

    Parameters

    • x: number

      The x component of the quaternion

    • y: number

      The y component of the quaternion

    • z: number

      The z component of the quaternion

    • w: number

      The w component of the quaternion

    Returns Quaternion

  • Set the value of this quaternion by an array.

    Returns

    This quaternion

    Parameters

    • array: ArrayLike<number>

      The array

    • offset: number = 0

      The start offset of the array

    Returns Quaternion

  • Clone the value of this quaternion to an array.

    Parameters

    • out: Float32Array | Float64Array | number[]

      The array

    • outOffset: number = 0

      The start offset of the array

    Returns void

  • Determines whether the specified quaternions are equals.

    Returns

    True if the specified quaternions are equals, false otherwise

    Parameters

    • left: Quaternion

      The first quaternion to compare

    • right: Quaternion

      The second quaternion to compare

    Returns boolean

  • Calculate a quaternion that the specified quaternion rotate around X axis.

    Parameters

    • quaternion: Quaternion

      The specified quaternion

    • rad: number

      The rotation angle in radians

    • out: Quaternion

      The calculated quaternion

    Returns void

  • Calculate a quaternion that the specified quaternion rotate around Y axis.

    Parameters

    • quaternion: Quaternion

      The specified quaternion

    • rad: number

      The rotation angle in radians

    • out: Quaternion

      The calculated quaternion

    Returns void

  • Calculate a quaternion that the specified quaternion rotate around Z axis.

    Parameters

    • quaternion: Quaternion

      The specified quaternion

    • rad: number

      The rotation angle in radians

    • out: Quaternion

      The calculated quaternion

    Returns void

  • Calculate a quaternion rotates around an arbitrary axis.

    Parameters

    • axis: Vector3

      The axis

    • rad: number

      The rotation angle in radians

    • out: Quaternion

      The quaternion after rotate

    Returns void

  • Calculate a quaternion rotates around x, y, z axis (pitch/yaw/roll).

    Parameters

    • x: number

      The radian of rotation around X (pitch)

    • y: number

      The radian of rotation around Y (yaw)

    • z: number

      The radian of rotation around Z (roll)

    • out: Quaternion

      The calculated quaternion

    Returns void

  • Calculate a quaternion rotate around X axis.

    Parameters

    • rad: number

      The rotation angle in radians

    • out: Quaternion

      The calculated quaternion

    Returns void

  • Calculate a quaternion rotate around Y axis.

    Parameters

    • rad: number

      The rotation angle in radians

    • out: Quaternion

      The calculated quaternion

    Returns void

  • Calculate a quaternion from the specified yaw, pitch and roll angles.

    Parameters

    • yaw: number

      Yaw around the y axis in radians

    • pitch: number

      Pitch around the x axis in radians

    • roll: number

      Roll around the z axis in radians

    • out: Quaternion

      The calculated quaternion

    Returns void

  • Calculate a quaternion rotate around Z axis.

    Parameters

    • rad: number

      The rotation angle in radians

    • out: Quaternion

      The calculated quaternion

    Returns void

Generated using TypeDoc