Quaternion
Overview
Quaternion is a class in Aspose.3d for Typescript.
Inherits from: Quaternion.
Quaternion.constructor creates a quaternion with default components (0,0,0,0).
Properties
| Name | Type | Access | Description |
|---|---|---|---|
w | number | Read | Is the scalar component of the quaternion |
x | number | Read | Is the first vector component of the quaternion |
y | number | Read | Is the second vector component of the quaternion |
z | number | Read | Is the third vector component of the quaternion |
length | number | Read | Returns the magnitude of the quaternion |
Methods
| Signature | Description |
|---|---|
constructor() | Initializes a quaternion with the given w, x, y, and z components |
constructor(w: number, x: number, y: number, z: number) | |
constructor(w: number, x: number, y: number, z: number) | |
IDENTITY() → Quaternion | Returns a quaternion representing no rotation (identity quaternion) |
normalize() → Quaternion | Returns a unit-length quaternion equivalent to the original |
conjugate() → Quaternion | Returns the conjugate of the quaternion, negating the vector part |
inverse() → Quaternion | Returns the multiplicative inverse of the quaternion |
dot(q: Quaternion) → number | Computes the dot product between this quaternion and another |
concat(rhs: Quaternion) → Quaternion | Multiplies this quaternion by another (rhs) and returns the result |
eulerAngles() → Vector3 | Converts the quaternion to Euler angles and returns them as a Vector3 |
fromEulerAngle(pitch: number, yaw: number, roll: number) → Quaternion | Overload creates a quaternion from either a Vector3 or separate pitch, yaw, roll numbers |
fromEulerAngle(vec: Vector3) → Quaternion | |
fromEulerAngle(pitch: Vector3 | number, yaw: number, roll: number) → Quaternion | |
fromAngleAxis(a: number, axis: Vector3) → Quaternion | Builds a quaternion representing rotation of angle a around the given axis |
fromRotation(orig: Vector3, dest: Vector3) → Quaternion | Creates a quaternion that rotates vector orig to align with dest |
interpolate(t: number, fromQ: Quaternion, toQ: Quaternion) → Quaternion | Linearly interpolates between fromQ and toQ by factor t |
slerp(t: number, v1: Quaternion, v2: Quaternion) → Quaternion | Performs spherical linear interpolation between v1 and v2 by factor t |
toString() → string | Returns a string representation of the quaternion components |
equals(other: Quaternion) → boolean | Checks whether another quaternion has the same component values |
toMatrix() → Matrix4 | Converts the quaternion into a 4x4 rotation matrix |