import type { Euler } from "./euler.js"; import type { Matrix3 } from "./matrix3.js"; import type { Vector3 } from "./vector3.js"; import { Vector4 } from "./vector4.js"; /** * A quaternion. */ export declare class Quaternion extends Vector4 { /** * Constructs a new {@linkcode Quaternion}. * @param x - The X component. * @param y - The Y component. * @param z - The Z component. * @param w - The W component. */ constructor(x?: number, y?: number, z?: number, w?: number); /** * Creates a new {@linkcode Quaternion} from a rotation matrix. * @param matrix - The matrix to construct the quaternion from. * @returns A new quaternion. */ static fromMatrix3(matrix: Readonly): Quaternion; /** * Creates a new {@linkcode Quaternion} from a rotation in Euler angles. * @param degrees - The rotation in Euler angles. * @returns A new quaternion. */ static fromEuler(degrees: Readonly): Quaternion; /** * Creates a new {@linkcode Quaternion} from a rotation around an axis. * @param axis - The axis around which to rotate. * @param degrees - The rotation in degrees. * @returns A new quaternion. */ static fromVector3(axis: Readonly, degrees: number): Quaternion; /** * Creates a new {@linkcode Quaternion} from a {@linkcode Vector4}. * @param vector - The vector to copy the components from. * @returns A new quaternion. */ static fromVector4(vector: Readonly): Quaternion; /** * Creates a new {@linkcode Quaternion} from another {@linkcode Quaternion}. * @param quaternion - The quaternion to copy. * @returns A new quaternion. */ static fromQuaternion(quaternion: Readonly): Quaternion; /** * Sets the quaternion to the values of another quaternion. * @param quaternion - The quaternion to copy. * @returns This instance. */ set(quaternion: Readonly): this; /** * Sets all components of the quaternion to the given value. * @param value - The value to assign to the components of the quaternion. * @returns This instance. */ setValue(value: number): this; /** * Sets the components of the quaternion to the given values. * @param x - The X component for the quaternion. * @param y - The Y component for the quaternion. * @param z - The Z component for the quaternion. * @param w - The W component for the quaternion. * @returns This instance. */ setXYZW(x: number, y: number, z?: number, w?: number): this; /** * Sets the quaternion to the rotation of the given matrix. * @param matrix - The matrix describing the rotation of the quaternion. * @returns This instance. */ setMatrix3(matrix: Readonly): this; /** * Sets the quaternion to a rotation in Euler angles. * @param degrees - The rotation in Euler angles. * @returns This instance. */ setEuler(degrees: Readonly): this; /** * Sets the quaternion to a rotation around an axis. * @param axis - The axis around which to rotate. * @param degrees - The rotation in degrees. * @returns This instance. */ setVector3(axis: Readonly, degrees: number): this; /** * Sets the quaternion to the components of a {@linkcode Vector4}. * @param vector - The vector to copy. * @returns This instance. */ setVector4(vector: Readonly): this; /** * Normalize the quaternion. * @returns This instance. */ normalize(): this; /** * Invert the quaternion. * @returns This instance. */ invert(): this; /** * Multiply with another quaternion from the right. * @param quaternion - The quaternion to multiply with. * @returns This instance. */ multiplyR(quaternion: Readonly): this; /** * Performs spherical linear interpolation between two rotations, and sets this * quaternion to the resulting rotation. * @param q1 - The initial rotation. * @param q2 - The target rotation. * @param t - The location on the scale from `0` to `1`. * @returns This instance. */ slerp(q1: Readonly, q2: Readonly, t: number): this; }