Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Quaternion

Index

Constructors

  • new Quaternion(x?: number, y?: number, z?: number, w?: number): Quaternion
  • Creates a new Quaternion from the given floats

    Parameters

    • Optional x: number

      defines the first component (0 by default)

    • Optional y: number

      defines the second component (0 by default)

    • Optional z: number

      defines the third component (0 by default)

    • Optional w: number

      defines the fourth component (1.0 by default)

    Returns Quaternion

Accessors

  • get w(): number
  • set w(value: number): void
  • Gets or sets the w coordinate

    Returns number

  • Gets or sets the w coordinate

    Parameters

    • value: number

    Returns void

  • get x(): number
  • set x(value: number): void
  • Gets or sets the x coordinate

    Returns number

  • Gets or sets the x coordinate

    Parameters

    • value: number

    Returns void

  • get y(): number
  • set y(value: number): void
  • Gets or sets the y coordinate

    Returns number

  • Gets or sets the y coordinate

    Parameters

    • value: number

    Returns void

  • get z(): number
  • set z(value: number): void
  • Gets or sets the z coordinate

    Returns number

  • Gets or sets the z coordinate

    Parameters

    • value: number

    Returns void

Methods

  • Adds two quaternions

    Parameters

    Returns Quaternion

    a new quaternion as the addition result of the given one and the current quaternion

  • Add a quaternion to the current one

    Parameters

    Returns Quaternion

    the current quaternion

  • asArray(): number[]
  • Copy the quaternion to an array

    Returns number[]

    a new array populated with 4 elements from the quaternion coordinates

  • Clone the current quaternion

    Returns Quaternion

    a new quaternion copied from the current one

  • Conjugates (1-q) the current quaternion

    Returns Quaternion

    a new quaternion

  • Conjugates in place the current quaternion

    Returns Quaternion

    the current updated quaternion

  • Conjugates the current quaternion and stores the result in the given quaternion

    Parameters

    Returns Quaternion

    the current quaternion

  • Copy a quaternion to the current one

    Parameters

    Returns Quaternion

    the updated current quaternion

  • copyFromFloats(x: number, y: number, z: number, w: number): Quaternion
  • Updates the current quaternion with the given float coordinates

    Parameters

    • x: number

      defines the x coordinate

    • y: number

      defines the y coordinate

    • z: number

      defines the z coordinate

    • w: number

      defines the w coordinate

    Returns Quaternion

    the updated current quaternion

  • Check if two quaternions are equals

    Parameters

    Returns boolean

    true if the current quaternion and the given one coordinates are strictly equals

  • Gets a boolean if two quaternions are equals (using an epsilon value)

    Parameters

    • otherQuaternion: DeepImmutableObject<Quaternion>

      defines the other quaternion

    • Optional epsilon: number

      defines the minimal distance to consider equality

    Returns boolean

    true if the given quaternion coordinates are close to the current ones by a distance of epsilon.

  • Updates the current quaternion from the given rotation matrix values

    Parameters

    Returns Quaternion

    the current updated quaternion

  • getClassName(): string
  • Gets the class name of the quaternion

    Returns string

    the string "Quaternion"

  • getHashCode(): number
  • Gets a hash code for this quaternion

    Returns number

    the quaternion hash code

  • Returns the inverse of the current quaternion

    Returns Quaternion

    a new quaternion

  • Invert in place the current quaternion

    Returns Quaternion

    this quaternion

  • length(): number
  • Gets length of current quaternion

    Returns number

    the quaternion length (float)

  • lengthSquared(): number
  • Gets squared length of current quaternion

    Returns number

    the quaternion length (float)

  • Multiplies two quaternions

    Parameters

    Returns Quaternion

    a new quaternion set as the multiplication result of the current one with the given one "q1"

  • Updates the current quaternion with the multiplication of itself with the given one "q1"

    Parameters

    Returns Quaternion

    the currentupdated quaternion

  • Sets the given "result" as the the multiplication result of the current one with the given one "q1"

    Parameters

    Returns Quaternion

    the current quaternion

  • Normalize in place the current quaternion

    Returns Quaternion

    the current updated quaternion

  • Normalize a copy of the current quaternion

    Returns Quaternion

    the normalized quaternion

  • Multiplies the current quaternion by a scale factor

    Parameters

    • value: number

      defines the scale factor

    Returns Quaternion

    a new quaternion set by multiplying the current quaternion coordinates by the float "scale"

  • Scale the current quaternion values by a factor and add the result to a given quaternion

    Parameters

    • scale: number

      defines the scale factor

    • result: Quaternion

      defines the Quaternion object where to store the result

    Returns Quaternion

    the unmodified current quaternion

  • Multiplies in place the current quaternion by a scale factor

    Parameters

    • value: number

      defines the scale factor

    Returns Quaternion

    the current modified quaternion

  • Scale the current quaternion values by a factor and stores the result to a given quaternion

    Parameters

    • scale: number

      defines the scale factor

    • result: Quaternion

      defines the Quaternion object where to store the result

    Returns Quaternion

    the unmodified current quaternion

  • set(x: number, y: number, z: number, w: number): Quaternion
  • Updates the current quaternion from the given float coordinates

    Parameters

    • x: number

      defines the x coordinate

    • y: number

      defines the y coordinate

    • z: number

      defines the z coordinate

    • w: number

      defines the w coordinate

    Returns Quaternion

    the updated current quaternion

  • Subtract two quaternions

    Parameters

    Returns Quaternion

    a new quaternion as the subtraction result of the given one from the current one

  • Subtract a quaternion to the current one

    Parameters

    Returns Quaternion

    the current quaternion

  • Stores from the starting index in the given array the Quaternion successive values

    Parameters

    • array: FloatArray

      defines the array where to store the x,y,z,w components

    • Optional index: number

      defines an optional index in the target array to define where to start storing values

    Returns Quaternion

    the current Quaternion object

  • Updates the given rotation matrix with the current quaternion values

    Parameters

    • result: Matrix

      defines the target matrix

    Returns Quaternion

    the current unchanged quaternion

  • toString(): string
  • Gets a string representation for the current quaternion

    Returns string

    a string with the Quaternion coordinates

  • Checks if the orientations of two rotation quaternions are close to each other

    Parameters

    Returns boolean

    true if the two quaternions are close to each other within epsilon

  • Creates a new quaternion from data stored into an array

    Parameters

    • array: DeepImmutableObject<ArrayLike<number>>

      defines the data source

    • Optional offset: number

      defines the offset in the source array where the data starts

    Returns Quaternion

    a new quaternion

  • Updates the given quaternion "result" from the starting index of the given array.

    Parameters

    • array: DeepImmutableObject<ArrayLike<number>>

      the array to pull values from

    • offset: number

      the offset into the array to start at

    • result: Quaternion

      the quaternion to store the result in

    Returns void

  • FromEulerAngles(x: number, y: number, z: number): Quaternion
  • Create a quaternion from Euler rotation angles

    Parameters

    • x: number

      Pitch

    • y: number

      Yaw

    • z: number

      Roll

    Returns Quaternion

    the new Quaternion

  • Updates a quaternion from Euler rotation angles

    Parameters

    • x: number

      Pitch

    • y: number

      Yaw

    • z: number

      Roll

    • result: Quaternion

      the quaternion to store the result

    Returns Quaternion

    the updated quaternion

  • Create a quaternion from Euler rotation vector

    Parameters

    Returns Quaternion

    the new Quaternion

  • Updates a quaternion from Euler rotation vector

    Parameters

    Returns Quaternion

    the updated quaternion

  • Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up". This function works in left handed mode

    Parameters

    Returns Quaternion

    A new quaternion oriented toward the specified forward and up.

  • Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like "up", and stores it in the target quaternion. This function works in left handed mode

    Parameters

    Returns void

  • Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up". This function works in right handed mode

    Parameters

    Returns Quaternion

    A new quaternion oriented toward the specified forward and up.

  • Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like "up", and stores it in the target quaternion. This function works in right handed mode

    Parameters

    Returns void

  • Creates a new quaternion from a rotation matrix

    Parameters

    Returns Quaternion

    a new quaternion created from the given rotation matrix values

  • Updates the given quaternion with the given rotation matrix values

    Parameters

    Returns void

  • Updates a quaternion so that it rotates vector vecFrom to vector vecTo

    Parameters

    Returns Quaternion

    the updated quaternion

  • Creates an identity quaternion

    Returns Quaternion

    the identity quaternion

  • Inverse a given quaternion

    Parameters

    Returns Quaternion

    a new quaternion as the inverted current quaternion

  • Inverse a given quaternion

    Parameters

    • q: Quaternion

      defines the source quaternion

    • result: Quaternion

      the quaternion the result will be stored in

    Returns Quaternion

    the result quaternion

  • Gets a boolean indicating if the given quaternion is identity

    Parameters

    Returns boolean

    true if the quaternion is identity

  • RotationAlphaBetaGamma(alpha: number, beta: number, gamma: number): Quaternion
  • Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation

    Parameters

    • alpha: number

      defines the rotation around first axis

    • beta: number

      defines the rotation around second axis

    • gamma: number

      defines the rotation around third axis

    Returns Quaternion

    the new quaternion

  • RotationAlphaBetaGammaToRef(alpha: number, beta: number, gamma: number, result: Quaternion): void
  • Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation and stores it in the target quaternion

    Parameters

    • alpha: number

      defines the rotation around first axis

    • beta: number

      defines the rotation around second axis

    • gamma: number

      defines the rotation around third axis

    • result: Quaternion

      defines the target quaternion

    Returns void

  • Creates a quaternion from a rotation around an axis

    Parameters

    Returns Quaternion

    a new quaternion created from the given axis (Vector3) and angle in radians (float)

  • Creates a rotation around an axis and stores it into the given quaternion

    Parameters

    Returns Quaternion

    the target quaternion

  • Creates a new quaternion containing the rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation)

    Parameters

    Returns Quaternion

    the new quaternion

  • Creates a rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation) and stores it in the target quaternion

    Parameters

    Returns void

  • RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Quaternion
  • Creates a new quaternion from the given Euler float angles (y, x, z)

    Parameters

    • yaw: number

      defines the rotation around Y axis

    • pitch: number

      defines the rotation around X axis

    • roll: number

      defines the rotation around Z axis

    Returns Quaternion

    the new quaternion

  • RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Quaternion): void
  • Creates a new rotation from the given Euler float angles (y, x, z) and stores it in the target quaternion

    Parameters

    • yaw: number

      defines the rotation around Y axis

    • pitch: number

      defines the rotation around X axis

    • roll: number

      defines the rotation around Z axis

    • result: Quaternion

      defines the target quaternion

    Returns void

  • Interpolates between two quaternions and stores it into a target quaternion

    Parameters

    Returns void

  • Smooth interpolation between two quaternions using Slerp

    Parameters

    • source: Quaternion

      source quaternion

    • goal: Quaternion

      goal quaternion

    • deltaTime: number

      current interpolation frame

    • lerpTime: number

      total interpolation time

    • result: Quaternion

      the smoothed quaternion

    Returns void

  • Creates an empty quaternion

    Returns Quaternion

    a new quaternion set to (0.0, 0.0, 0.0)

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme