Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Orientation

Orientation quaternion with accuracy

Hierarchy

Index

Constructors

constructor

  • new Orientation(x?: number, y?: number, z?: number, w?: number, accuracy?: number): Orientation

Properties

_onChangeCallback

_onChangeCallback: () => void

Type declaration

    • (): void
    • Returns void

Optional accuracy

accuracy?: number

Readonly isQuaternion

isQuaternion: true

Optional timestamp

timestamp?: number

w

w: number

x

x: number

y

y: number

z

z: number

Methods

_onChange

  • _onChange(callback: () => void): Quaternion
  • Parameters

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

    Returns Quaternion

angleTo

  • angleTo(q: Quaternion): number
  • Parameters

    • q: Quaternion

    Returns number

clone

conjugate

  • conjugate(): Quaternion
  • Returns Quaternion

copy

  • Copies values of q to this quaternion.

    Parameters

    • q: Quaternion

    Returns Orientation

dot

  • dot(v: Quaternion): number
  • Parameters

    • v: Quaternion

    Returns number

equals

  • equals(v: Quaternion): boolean
  • Parameters

    • v: Quaternion

    Returns boolean

fromArray

  • fromArray(array: number[] | ArrayLike<number>, offset?: number): Orientation
  • 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 Orientation

identity

  • identity(): Quaternion
  • Returns Quaternion

inverse

  • inverse(): Quaternion
  • deprecated

    Use {@link Quaternion#invert .invert()} instead.

    Returns Quaternion

invert

  • invert(): Quaternion
  • Inverts this quaternion.

    Returns Quaternion

length

  • length(): number
  • Computes length of this quaternion.

    Returns number

lengthSq

  • lengthSq(): number
  • Returns number

multiply

  • multiply(q: Quaternion): Quaternion
  • Multiplies this quaternion by b.

    Parameters

    • q: Quaternion

    Returns Quaternion

multiplyQuaternions

  • multiplyQuaternions(a: Quaternion, b: Quaternion): Quaternion

multiplyVector3

  • multiplyVector3(v: any): any
  • deprecated

    Use {@link Vector#applyQuaternion vector.applyQuaternion( quaternion )} instead.

    Parameters

    • v: any

    Returns any

normalize

  • normalize(): Quaternion
  • Normalizes this quaternion.

    Returns Quaternion

premultiply

  • premultiply(q: Quaternion): Quaternion
  • Parameters

    • q: Quaternion

    Returns Quaternion

random

  • random(): Quaternion
  • Returns Quaternion

rotateTowards

  • rotateTowards(q: Quaternion, step: number): Quaternion
  • Parameters

    • q: Quaternion
    • step: number

    Returns Quaternion

set

  • set(x: number, y: number, z: number, w: number): Quaternion
  • Sets values of this quaternion.

    Parameters

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

    Returns Quaternion

setFromAxisAngle

  • setFromAxisAngle(axis: Vector3, angle: number): Quaternion

setFromEuler

  • setFromEuler(euler: Euler, update?: boolean): Quaternion
  • Sets this quaternion from rotation specified by Euler angles.

    Parameters

    • euler: Euler
    • Optional update: boolean

    Returns Quaternion

setFromRotationMatrix

  • setFromRotationMatrix(m: Matrix4): Quaternion

setFromUnitVectors

  • setFromUnitVectors(vFrom: Vector3, vTo: Vector3): Quaternion
  • Parameters

    • vFrom: Vector3
    • vTo: Vector3

    Returns Quaternion

slerp

  • slerp(qb: Quaternion, t: number): Quaternion
  • Parameters

    • qb: Quaternion
    • t: number

    Returns Quaternion

slerpQuaternions

  • slerpQuaternions(qa: Quaternion, qb: Quaternion, t: number): Quaternion
  • Parameters

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

    Returns Quaternion

toArray

  • toArray(array?: number[], offset?: number): number[]
  • toArray(array: ArrayLike<number>, offset?: number): ArrayLike<number>
  • 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.

toAxisAngle

toEuler

toRotationMatrix

Static deserializer

Static fromAxisAngle

  • fromAxisAngle<T>(axis: { angle?: number; unit?: AngleUnit; x: number; y: number; z: number }): T
  • fromAxisAngle<T>(axis: number[]): T
  • fromAxisAngle<T>(axis: AxisAngle): T

Static fromEuler

  • fromEuler<T>(euler: Vector3): T
  • fromEuler<T>(euler: Euler): T
  • fromEuler<T>(euler: { pitch: number; roll: number; unit?: AngleUnit; yaw: number }): T
  • fromEuler<T>(euler: { order?: EulerOrder; unit?: AngleUnit; x: number; y: number; z: number }): T
  • fromEuler<T>(euler: number[]): T

Static fromQuaternion

Static fromRotationMatrix

  • fromRotationMatrix<T>(matrix: Matrix4): T

Static fromThreeJS

  • fromThreeJS<T>(threeQuaternion: Quaternion): T

Static multiplyQuaternionsFlat

  • multiplyQuaternionsFlat(dst: number[], dstOffset: number, src0: number[], srcOffset: number, src1: number[], stcOffset1: number): number[]
  • Parameters

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

    Returns number[]

Static serializer

  • serializer(value: Orientation): { accuracy: number; timestamp: number; w: number; x: number; y: number; z: number }
  • Parameters

    Returns { accuracy: number; timestamp: number; w: number; x: number; y: number; z: number }

    • accuracy: number
    • timestamp: number
    • w: number
    • x: number
    • y: number
    • z: number

Static slerp

  • slerp(qa: Quaternion, qb: Quaternion, qm: Quaternion, t: number): number
  • deprecated

    Use qm.slerpQuaternions( qa, qb, t ) instead..

    Parameters

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

    Returns number

Static slerpFlat

  • slerpFlat(dst: number[], dstOffset: number, src0: number[], srcOffset: number, src1: number[], stcOffset1: number, t: number): Quaternion
  • Parameters

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

    Returns Quaternion