Class Quaternion

Serializable THREE.js Quaternion

Hierarchy (view full)

Constructors

  • Parameters

    • Optional x: number

      x coordinate

    • Optional y: number

      y coordinate

    • Optional z: number

      z coordinate

    • Optional w: number

      w coordinate

    Returns Quaternion

Properties

_onChangeCallback: (() => void)

Type declaration

    • (): void
    • Returns void

isQuaternion: true
w: number
x: number
y: number
z: number

Methods

  • Returns Generator<number, void, unknown>

  • Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns this

  • Parameters

    • q: Quaternion

    Returns number

  • Returns this

  • Copies values of q to this quaternion.

    Parameters

    • q: QuaternionLike

    Returns this

  • Parameters

    • v: Quaternion

    Returns number

  • Parameters

    • v: Quaternion

    Returns boolean

  • Sets this quaternion's x, y, z and w value from the provided array or array-like.

    Parameters

    • array: number[] | ArrayLike<number>

      the source array or array-like.

    • Optional offset: number

      (optional) offset into the array. Default is 0.

    Returns this

  • Sets x, y, z, w properties of this quaternion from the attribute.

    Parameters

    • attribute: BufferAttribute | InterleavedBufferAttribute

      the source attribute.

    • index: number

      index in the attribute.

    Returns this

  • Returns this

  • Inverts this quaternion.

    Returns this

  • Computes length of this quaternion.

    Returns number

  • Returns number

  • Multiplies this quaternion by b.

    Parameters

    • q: Quaternion

    Returns this

  • Normalizes this quaternion.

    Returns this

  • Parameters

    • q: Quaternion

    Returns this

  • Returns this

  • Parameters

    • q: Quaternion
    • step: number

    Returns this

  • Sets values of this quaternion.

    Parameters

    • x: number
    • y: number
    • z: number
    • w: number

    Returns this

  • Sets this quaternion from rotation specified by Euler angles.

    Parameters

    • euler: Euler
    • Optional update: boolean

    Returns this

  • Parameters

    • vFrom: Vector3
    • vTo: Vector3Like

    Returns this

  • Parameters

    • qb: Quaternion
    • t: number

    Returns this

  • Parameters

    • qa: Quaternion
    • qb: Quaternion
    • t: number

    Returns this

  • Returns an array [x, y, z, w], or copies x, y, z and w into the provided array.

    Parameters

    • Optional array: number[]

      (optional) array to store the quaternion to. If this is not provided, a new array will be created.

    • Optional offset: number

      (optional) optional offset into the array.

    Returns number[]

    The created or provided array.

  • Copies x, y, z and w into the provided array-like.

    Parameters

    • array: ArrayLike<number>

      array-like to store the quaternion to.

    • Optional offset: number

      (optional) optional offset into the array.

    Returns ArrayLike<number>

    The provided array-like.

  • This method defines the serialization result of Quaternion.

    Returns [number, number, number, number]

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

  • Convert rotation matrix to quaternion

    Type Parameters

    Parameters

    • this: T

      This type

    • matrix: Matrix4

      Rotation matrix

    Returns InstanceType<T>

    Serializable quaternion

  • Convert a threejs quaternion to serializable quaternion

    Type Parameters

    Parameters

    • threeQuaternion: Quaternion

      ThreeJS created quaternion

    Returns InstanceType<T>

    Serializable quaternion

  • Parameters

    • dst: number[]
    • dstOffset: number
    • src0: number[]
    • srcOffset: number
    • src1: number[]
    • stcOffset1: number

    Returns number[]

  • Parameters

    • dst: number[]
    • dstOffset: number
    • src0: number[]
    • srcOffset: number
    • src1: number[]
    • stcOffset1: number
    • t: number

    Returns void