import Vector from './Vector'; /** * Class representing a Quaternion for 3D rotations */ export default class Quat { /** Values of the quaternion as [x, y, z, w] */ private _values; constructor(values?: [number, number, number, number]); get values(): number[]; /** * Set values into the quaternion. * @param newValues Array of new values [x, y, z, w]. */ set values(newValues: number[]); get x(): number; get y(): number; get z(): number; get w(): number; get xy(): [number, number]; get xyz(): [number, number, number]; get xyzw(): [number, number, number, number]; /** * Get an identity quaternion (rotation by 0 degrees) * @return A new identity quaternion */ static identity(): Quat; /** * Get a quaternion value at a specific index * @param index Index from 0 to 3 * @return The value at the specified index */ at(index: number): number; /** * Sets all quaternion values to 0 */ reset(): void; /** * Get a copy of this quaternion * @return A new quaternion with the same values */ copy(): Quat; /** * Calculate the roll angle (rotation around x-axis) * @return Roll angle in radians */ roll(): number; /** * Calculate the pitch angle (rotation around y-axis) * @return Pitch angle in radians */ pitch(): number; /** * Calculate the yaw angle (rotation around z-axis) * @return Yaw angle in radians */ yaw(): number; /** * Check if two quaternions are equal within a threshold * @param quat The quaternion to compare against * @param threshold The threshold for comparison (default: EPSILON) * @return True if quaternions are equal within threshold */ equals(quat: Quat, threshold?: number): boolean; /** * Sets the quaternion as an identity quaternion * @return This quaternion for method chaining */ setIdentity(): Quat; /** * Calculate the w component based on x, y, z components. * Note: this always yields a non-positive w (a valid unit quaternion, * on the opposite hemisphere from `Quat.identity()`, due to the sign * convention below). * @return A new quaternion with the computed w component */ calculateW(): Quat; /** * Compute the inverse of the quaternion * @return A new, inversed quaternion */ inverse(): Quat; /** * Compute the conjugate of the quaternion * @return A new, conjugated quaternion */ conjugate(): Quat; /** * Calculate the length (magnitude) of the quaternion * @return The length of the quaternion */ length(): number; /** * Computes the normalized quaternion * @return A new, normalized quaternion */ normalize(): Quat; /** * Add another quaternion to this quaternion * @param other The quaternion to add * @return A new quaternion with the sum */ add(other: Quat): Quat; /** * Multiply this quaternion by another quaternion * @param other The quaternion to multiply with * @return A new quaternion with the product */ multiply(other: Quat): Quat; /** * Calculate the dot product of two quaternions * @param q1 First quaternion * @param q2 Second quaternion * @return The dot product */ static dot(q1: Quat, q2: Quat): number; /** * Calculate the sum of two quaternions * @param q1 First quaternion * @param q2 Second quaternion * @return A new quaternion with the sum */ static sum(q1: Quat, q2: Quat): Quat; /** * Calculate the product of two quaternions * @param q1 First quaternion * @param q2 Second quaternion * @return A new quaternion with the product */ static product(q1: Quat, q2: Quat): Quat; /** * Calculate the cross product of two quaternions, i.e. (q1 * q2 - q2 * q1) / 2. * For quaternions with a 0 w component, this is equivalent to the cross * product of their [x, y, z] vector parts. * @param q1 First quaternion * @param q2 Second quaternion * @return A new quaternion with the cross product */ static cross(q1: Quat, q2: Quat): Quat; /** * Spherical linear interpolation between two quaternions with short path * @param q1 First quaternion * @param q2 Second quaternion * @param time Interpolation parameter (0 to 1) * @return A new interpolated quaternion */ static shortMix(q1: Quat, q2: Quat, time: number): Quat; /** * Spherical linear interpolation between two quaternions * @param q1 First quaternion * @param q2 Second quaternion * @param time Interpolation parameter (0 to 1) * @return A new interpolated quaternion */ static mix(q1: Quat, q2: Quat, time: number): Quat; /** * Create a quaternion from an axis and angle * @param axis The rotation axis as a 3D vector * @param angle The rotation angle in radians * @return A new quaternion representing the rotation * @throws Error if the axis vector is not 3D */ static fromAxisAngle(axis: Vector, angle: number): Quat; toString(): string; } //# sourceMappingURL=Quat.d.ts.map