import { Matrix3, Quaternion, Vector3 } from "../../../cauldron/type_definitions/array_type_definitions.js"; import { EasingFunction } from "../math_utils.js"; export declare function create(): Quaternion; export declare function create(x: number, y: number, z: number, w: number): Quaternion; export declare function create(uniformValue: number): Quaternion; export declare function getAllocationFunction(): () => Quaternion; /** Specify the function that will be used to allocate the quaternion when calling the {@link create} function */ export declare function setAllocationFunction(allocationFunction: () => Quaternion): void; export declare function set(quat: T, x: number, y: number, z: number, w: number): T; export declare function set(quat: T, uniformValue: number): T; export declare function copy(from: Readonly, to: T): T; /** The overload where `T extends Quaternion` does also get `array` as `Readonly`, but is not marked as such due to Typescript having issues with inferring the proper type of `T` when `Readonly` is used */ export declare function clone(quat: Readonly): T; export declare function clone(quat: Readonly): number[]; export declare function clone(quat: T): T; export declare function equals(first: Readonly, second: Readonly, epsilon?: number): boolean; export declare function isNormalized(quat: Readonly, epsilon?: number): boolean; export declare function normalize(quat: Readonly): T; export declare function normalize(quat: Readonly, out: T): T; export declare function length(quat: Readonly): number; export declare function lengthSquared(quat: Readonly): number; export declare function identity(quat: T): T; export declare function mul(first: Readonly, second: Readonly): T; export declare function mul(first: Readonly, second: Readonly, out: T): T; export declare function invert(quat: Readonly): T; export declare function invert(quat: Readonly, out: T): T; export declare function conjugate(quat: Readonly): T; export declare function conjugate(quat: Readonly, out: T): T; export declare function lerp(from: Readonly, to: Readonly, interpolationFactor: number): T; export declare function lerp(from: Readonly, to: Readonly, interpolationFactor: number, out: T): T; export declare function interpolate(from: Readonly, to: Readonly, interpolationFactor: number, easingFunction?: EasingFunction): T; export declare function interpolate(from: Readonly, to: Readonly, interpolationFactor: number, easingFunction: EasingFunction, out: T): T; export declare function slerp(from: Readonly, to: Readonly, interpolationFactor: number): T; export declare function slerp(from: Readonly, to: Readonly, interpolationFactor: number, out: T): T; export declare function interpolateSpherical(from: Readonly, to: Readonly, interpolationFactor: number, easingFunction?: EasingFunction): T; export declare function interpolateSpherical(from: Readonly, to: Readonly, interpolationFactor: number, easingFunction: EasingFunction, out: T): T; export declare function getAngle(quat: Readonly): number; export declare function getAngleDegrees(quat: Readonly): number; export declare const getAngleRadians: (quat: Readonly) => number; export declare const getAxis: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; export declare function getAxisScaled(quat: Readonly): Vector3; export declare function getAxisScaled(quat: Readonly, out: T): T; export declare function getAxisScaledDegrees(quat: Readonly): Vector3; export declare function getAxisScaledDegrees(quat: Readonly, out: T): T; export declare const getAxisScaledRadians: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; export declare function getAxes(quat: Readonly): [Vector3, Vector3, Vector3]; export declare function getAxes(quat: Readonly, out: [T, U, V]): [T, U, V]; export declare const getForward: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; export declare function getBackward(quat: Readonly): Vector3; export declare function getBackward(quat: Readonly, out: T): T; export declare const getLeft: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; export declare function getRight(quat: Readonly): Vector3; export declare function getRight(quat: Readonly, out: T): T; export declare const getUp: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; export declare function getDown(quat: Readonly): Vector3; export declare function getDown(quat: Readonly, out: T): T; export declare function setAxes(quat: T, left: Readonly, up: Readonly, forward: Readonly): T; export declare const setForward: (quat: T, forward: Readonly, up?: Readonly, left?: Readonly) => T; export declare const setBackward: (quat: T, backward: Readonly, up?: Readonly, left?: Readonly) => T; export declare const setUp: (quat: T, up: Readonly, forward?: Readonly, left?: Readonly) => T; export declare const setDown: (quat: T, down: Readonly, forward?: Readonly, left?: Readonly) => T; export declare const setLeft: (quat: T, left: Readonly, up?: Readonly, forward?: Readonly) => T; export declare const setRight: (quat: T, right: Readonly, up?: Readonly, forward?: Readonly) => T; export declare function toWorld(quat: Readonly, parentRotationQuat: Readonly): T; export declare function toWorld(quat: Readonly, parentRotationQuat: Readonly, out: T): T; export declare const toLocal: { (quat: Readonly, parentRotationQuat: Readonly): T; (quat: Readonly, parentRotationQuat: Readonly, out: T): T; }; export declare function fromDegrees(rotation: Readonly): Quaternion; export declare function fromDegrees(rotation: Readonly, out: T): T; export declare const fromRadians: { (rotation: Readonly): Quaternion; (rotation: Readonly, out: T): T; }; export declare function fromAxis(angle: number, axis: Readonly): Quaternion; export declare function fromAxis(angle: number, axis: Readonly, out: T): T; export declare function fromAxisDegrees(angle: number, axis: Readonly): Quaternion; export declare function fromAxisDegrees(angle: number, axis: Readonly, out: T): T; export declare function fromAxisRadians(angle: number, axis: Readonly): Quaternion; export declare function fromAxisRadians(angle: number, axis: Readonly, out: T): T; export declare const fromAxes: { (left: Readonly, up: Readonly, forward: Readonly): Quaternion; (left: Readonly, up: Readonly, forward: Readonly, out: T): T; }; export declare function toDegrees(quat: Readonly): Vector3; export declare function toDegrees(quat: Readonly, out: T): T; export declare const toRadians: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; export declare function toMatrix(quat: Readonly): Matrix3; export declare function toMatrix(quat: Readonly, out: T): T; export declare function addRotation(first: Readonly, second: Readonly): T; export declare function addRotation(first: Readonly, second: Readonly, out: T): T; export declare const addRotationDegrees: { (first: Readonly, second: Readonly): T; (first: Readonly, second: Readonly, out: T): T; }; export declare const addRotationRadians: { (first: Readonly, second: Readonly): T; (first: Readonly, second: Readonly, out: T): T; }; export declare function addRotationQuat(first: Readonly, second: Readonly): T; export declare function addRotationQuat(first: Readonly, second: Readonly, out: T): T; export declare function subRotation(first: Readonly, second: Readonly): T; export declare function subRotation(first: Readonly, second: Readonly, out: T): T; export declare const subRotationDegrees: { (first: Readonly, second: Readonly): T; (first: Readonly, second: Readonly, out: T): T; }; export declare const subRotationRadians: { (first: Readonly, second: Readonly): T; (first: Readonly, second: Readonly, out: T): T; }; export declare const subRotationQuat: { (first: Readonly, second: Readonly): T; (first: Readonly, second: Readonly, out: T): T; }; export declare function rotationTo(from: Readonly, to: Readonly): T; export declare function rotationTo(from: Readonly, to: Readonly, out: T): T; export declare const rotationToDegrees: { (from: Readonly, to: Readonly): T; (from: Readonly, to: Readonly, out: T): T; }; export declare const rotationToRadians: { (from: Readonly, to: Readonly): T; (from: Readonly, to: Readonly, out: T): T; }; export declare function rotationToQuat(from: Readonly, to: Readonly): T; export declare function rotationToQuat(from: Readonly, to: Readonly, out: T): T; export declare function rotationAroundAxis(quat: Readonly, axis: Readonly): T; export declare function rotationAroundAxis(quat: Readonly, axis: Readonly, out: T): T; export declare const rotationAroundAxisDegrees: { (quat: Readonly, axis: Readonly): T; (quat: Readonly, axis: Readonly, out: T): T; }; export declare const rotationAroundAxisRadians: { (quat: Readonly, axis: Readonly): T; (quat: Readonly, axis: Readonly, out: T): T; }; export declare function rotationAroundAxisQuat(quat: Readonly, axis: Readonly): T; export declare function rotationAroundAxisQuat(quat: Readonly, axis: Readonly, out: T): T; export declare const getTwist: { (quat: Readonly, axis: Readonly): T; (quat: Readonly, axis: Readonly, out: T): T; }; export declare const getSwing: { (quat: Readonly, axis: Readonly): T; (quat: Readonly, axis: Readonly, out: T): T; }; export declare function getSwingFromTwist(quat: Readonly, axis: Readonly): T; export declare function getSwingFromTwist(quat: Readonly, axis: Readonly, out: T): T; export declare const getTwistFromSwing: { (quat: Readonly, swing: Readonly): T; (quat: Readonly, swing: Readonly, out: T): T; }; export declare function fromTwistSwing(twist: Readonly, swing: Readonly): T; export declare function fromTwistSwing(twist: Readonly, swing: Readonly, out: T): T; export declare function rotate(first: Readonly, second: Readonly): T; export declare function rotate(first: Readonly, second: Readonly, out: T): T; export declare function rotateDegrees(first: Readonly, second: Readonly): T; export declare function rotateDegrees(first: Readonly, second: Readonly, out: T): T; export declare function rotateRadians(first: Readonly, second: Readonly): T; export declare function rotateRadians(first: Readonly, second: Readonly, out: T): T; export declare function rotateQuat(first: Readonly, second: Readonly): T; export declare function rotateQuat(first: Readonly, second: Readonly, out: T): T; export declare function rotateAxis(quat: Readonly, angle: number, axis: Readonly): T; export declare function rotateAxis(quat: Readonly, angle: number, axis: Readonly, out?: T): T; export declare const rotateAxisDegrees: { (quat: Readonly, angle: number, axis: Readonly): T; (quat: Readonly, angle: number, axis: Readonly, out?: T): T; }; export declare const rotateAxisRadians: { (quat: Readonly, angle: number, axis: Readonly): T; (quat: Readonly, angle: number, axis: Readonly, out?: T): T; }; /** * How to use * * By default rotations are in `Degrees` and transforms are `Matrix4` (and not `Quat2`) * For functions that work with rotations, `Matrix` means `Matrix3` and `Quat` means `Quat` * For functions that work with transforms, `Matrix` means `Matrix4` and `Quat` means `Quat2` * * For rotations u can add a suffix like `Degrees`/`Radians`/`Quat`/`Matrix` to use a specific version, example: * - `getAngleRadians` * - `addRotationQuat` * * The functions leave u the choice of forwarding an out parameter or just get the return value, example: * - `let forward = QuatUtils.getForward(quat)` * - `QuatUtils.getForward(quat, forward)` * - the out parameter is always the last one */ export declare const QuatUtils: { readonly create: typeof create; readonly getAllocationFunction: typeof getAllocationFunction; readonly setAllocationFunction: typeof setAllocationFunction; readonly set: typeof set; readonly copy: typeof copy; readonly clone: typeof clone; readonly equals: typeof equals; readonly isNormalized: typeof isNormalized; readonly normalize: typeof normalize; readonly length: typeof length; readonly lengthSquared: typeof lengthSquared; readonly identity: typeof identity; readonly mul: typeof mul; readonly invert: typeof invert; readonly conjugate: typeof conjugate; readonly lerp: typeof lerp; readonly interpolate: typeof interpolate; readonly slerp: typeof slerp; readonly interpolateSpherical: typeof interpolateSpherical; readonly getAngle: typeof getAngle; readonly getAngleDegrees: typeof getAngleDegrees; readonly getAngleRadians: (quat: Readonly) => number; readonly getAxis: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; readonly getAxisScaled: typeof getAxisScaled; readonly getAxisScaledDegrees: typeof getAxisScaledDegrees; readonly getAxisScaledRadians: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; readonly getAxes: typeof getAxes; readonly getForward: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; readonly getBackward: typeof getBackward; readonly getLeft: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; readonly getRight: typeof getRight; readonly getUp: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; readonly getDown: typeof getDown; readonly setAxes: typeof setAxes; readonly setForward: (quat: T, forward: Readonly, up?: Readonly, left?: Readonly) => T; readonly setBackward: (quat: T, backward: Readonly, up?: Readonly, left?: Readonly) => T; readonly setUp: (quat: T, up: Readonly, forward?: Readonly, left?: Readonly) => T; readonly setDown: (quat: T, down: Readonly, forward?: Readonly, left?: Readonly) => T; readonly setLeft: (quat: T, left: Readonly, up?: Readonly, forward?: Readonly) => T; readonly setRight: (quat: T, right: Readonly, up?: Readonly, forward?: Readonly) => T; readonly toWorld: typeof toWorld; readonly toLocal: { (quat: Readonly, parentRotationQuat: Readonly): T; (quat: Readonly, parentRotationQuat: Readonly, out: T): T; }; readonly addRotation: typeof addRotation; readonly addRotationDegrees: { (first: Readonly, second: Readonly): T; (first: Readonly, second: Readonly, out: T): T; }; readonly addRotationRadians: { (first: Readonly, second: Readonly): T; (first: Readonly, second: Readonly, out: T): T; }; readonly addRotationQuat: typeof addRotationQuat; readonly subRotation: typeof subRotation; readonly subRotationDegrees: { (first: Readonly, second: Readonly): T; (first: Readonly, second: Readonly, out: T): T; }; readonly subRotationRadians: { (first: Readonly, second: Readonly): T; (first: Readonly, second: Readonly, out: T): T; }; readonly subRotationQuat: { (first: Readonly, second: Readonly): T; (first: Readonly, second: Readonly, out: T): T; }; readonly rotationTo: typeof rotationTo; readonly rotationToDegrees: { (from: Readonly, to: Readonly): T; (from: Readonly, to: Readonly, out: T): T; }; readonly rotationToRadians: { (from: Readonly, to: Readonly): T; (from: Readonly, to: Readonly, out: T): T; }; readonly rotationToQuat: typeof rotationToQuat; readonly rotationAroundAxis: typeof rotationAroundAxis; readonly rotationAroundAxisDegrees: { (quat: Readonly, axis: Readonly): T; (quat: Readonly, axis: Readonly, out: T): T; }; readonly rotationAroundAxisRadians: { (quat: Readonly, axis: Readonly): T; (quat: Readonly, axis: Readonly, out: T): T; }; readonly rotationAroundAxisQuat: typeof rotationAroundAxisQuat; readonly getTwist: { (quat: Readonly, axis: Readonly): T; (quat: Readonly, axis: Readonly, out: T): T; }; readonly getSwing: { (quat: Readonly, axis: Readonly): T; (quat: Readonly, axis: Readonly, out: T): T; }; readonly getSwingFromTwist: typeof getSwingFromTwist; readonly getTwistFromSwing: { (quat: Readonly, swing: Readonly): T; (quat: Readonly, swing: Readonly, out: T): T; }; readonly fromTwistSwing: typeof fromTwistSwing; readonly rotate: typeof rotate; readonly rotateDegrees: typeof rotateDegrees; readonly rotateRadians: typeof rotateRadians; readonly rotateQuat: typeof rotateQuat; readonly rotateAxis: typeof rotateAxis; readonly rotateAxisDegrees: { (quat: Readonly, angle: number, axis: Readonly): T; (quat: Readonly, angle: number, axis: Readonly, out?: T): T; }; readonly rotateAxisRadians: { (quat: Readonly, angle: number, axis: Readonly): T; (quat: Readonly, angle: number, axis: Readonly, out?: T): T; }; readonly fromDegrees: typeof fromDegrees; readonly fromRadians: { (rotation: Readonly): Quaternion; (rotation: Readonly, out: T): T; }; readonly fromAxis: typeof fromAxis; readonly fromAxisDegrees: typeof fromAxisDegrees; readonly fromAxisRadians: typeof fromAxisRadians; readonly fromAxes: { (left: Readonly, up: Readonly, forward: Readonly): Quaternion; (left: Readonly, up: Readonly, forward: Readonly, out: T): T; }; readonly toDegrees: typeof toDegrees; readonly toRadians: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; readonly toMatrix: typeof toMatrix; };