Quaternion¶
Represents a quaternion used for rotations.
Properties¶
- X:
number - Y:
number - Z:
number - W:
number - Identity:
Quaternion
Methods¶
New() → Quaternion¶
Creates a new Quaternion object with the specified components.
New(x: number, y: number, z: number, w: number) → Quaternion¶
Creates a new Quaternion object with the specified components.
Angle(a: Quaternion, b: Quaternion) → Quaternion¶
Calculates the angle between two quaternions.
AngleAxis(angle: number, axis: Vector3) → Quaternion¶
Creates a rotation which rotates angle degrees around axis.
Dot(a: Quaternion, b: Quaternion) → Quaternion¶
Calculates the dot product of two quaternions.
Euler(x: number, y: number, z: number) → Quaternion¶
Creates a quaternion from Euler angles specified by a Vector3.
Euler(euler: Vector3) → Quaternion¶
Creates a quaternion from Euler angles specified by a Vector3.
ToEuler(euler: Quaternion) → Vector3¶
Converts a quaternion to Euler angles represented as a Vector3.
FromToRotation(fromDirection: Vector3, toDirection: Vector3) → Quaternion¶
Creates a rotation which rotates angle degrees around axis.
Inverse(rotation: Quaternion) → Quaternion¶
Calculates the inverse of a quaternion.
Lerp(a: Quaternion, b: Quaternion, t: number) → Quaternion¶
Linearly interpolates between two quaternions.
LerpUnclamped(a: Quaternion, b: Quaternion, t: number) → Quaternion¶
Linearly interpolates between two quaternions without clamping the interpolant.
LookRotation(forward: Vector3) → Quaternion¶
Creates a rotation with the specified forward and upwards directions.
LookRotation(forward: Vector3, upwards: Vector3) → Quaternion¶
Creates a rotation with the specified forward and upwards directions.
Normalize(quaternion: Quaternion) → Quaternion¶
Normalizes the given quaternion.
RotateTowards(from: Quaternion, to: Quaternion, maxDegreesDelta: number) → Quaternion¶
Rotates a rotation from towards to by maxDegreesDelta.
Slerp(a: Quaternion, b: Quaternion, t: number) → Quaternion¶
Spherically interpolates between two quaternions.
SlerpUnclamped(a: Quaternion, b: Quaternion, t: number) → Quaternion¶
Spherically interpolates between two quaternions without clamping the interpolant.