import { Matrix4, Quaternion, Quaternion2, Vector3 } from "../../../cauldron/type_definitions/array_type_definitions.js"; import { EasingFunction } from "../math_utils.js"; export declare function create(): Quaternion2; export declare function create(x1: number, y1: number, z1: number, w1: number, x2: number, y2: number, z2: number, w2: number): Quaternion2; export declare function getAllocationFunction(): () => Quaternion2; /** Specify the function that will be used to allocate the quaternion when calling the {@link create} function */ export declare function setAllocationFunction(allocationFunction: () => Quaternion2): void; export declare function set(quat: T, x1: number, y1: number, z1: number, w1: number, x2: number, y2: number, z2: number, w2: 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 Quaternion2` 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 const slerp: { (from: Readonly, to: Readonly, interpolationFactor: number): T; (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 getPosition(quat: Readonly): Vector3; export declare function getPosition(quat: Readonly, out: T): T; export declare function getRotation(quat: Readonly): Vector3; export declare function getRotation(quat: Readonly, out: T): T; export declare const getRotationDegrees: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; export declare const getRotationRadians: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; export declare function getRotationQuat(quat: Readonly): Quaternion; export declare function getRotationQuat(quat: Readonly, out: T): T; export declare const setPosition: (quat: T, position: Readonly) => T; export declare function setRotation(quat: T, rotation: Readonly): T; export declare const setRotationDegrees: (quat: T, rotation: Readonly) => T; export declare const setRotationRadians: (quat: T, rotation: Readonly) => T; export declare const setRotationQuat: (quat: T, rotation: Readonly) => T; export declare function setPositionRotation(quat: T, position: Readonly, rotation: Readonly): T; export declare const setPositionRotationDegrees: (quat: T, position: Readonly, rotation: Readonly) => T; export declare const setPositionRotationRadians: (quat: T, position: Readonly, rotation: Readonly) => T; export declare function setPositionRotationQuat(quat: T, position: Readonly, rotation: Readonly): 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 rotateAxis(quat: Readonly, angle: number, axis: Readonly): T; export declare function rotateAxis(quat: Readonly, angle: number, axis: Readonly, out: T): T; export declare function rotateAxisDegrees(quat: Readonly, angle: number, axis: Readonly): T; export declare function rotateAxisDegrees(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; }; export declare function toWorld(quat: Readonly, parentTransformQuat: Readonly): T; export declare function toWorld(quat: Readonly, parentTransformQuat: Readonly, out: T): T; export declare const toLocal: { (quat: Readonly, parentTransformQuat: Readonly): T; (quat: Readonly, parentTransformQuat: Readonly, out: T): T; }; export declare function toMatrix(quat: Readonly): Matrix4; export declare function toMatrix(quat: Readonly, out: T): T; export declare function fromMatrix(matrix: Readonly): Quaternion2; export declare function fromMatrix(matrix: 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: * - `getRotationRadians` * - `setRotationQuat` * * The functions leave u the choice of forwarding an out parameter or just get the return value, example: * - `let position = Quat2Utils.getPosition(quat)` * - `Quat2Utils.getPosition(quat, position)` * - the out parameter is always the last one */ export declare const Quat2Utils: { 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: { (from: Readonly, to: Readonly, interpolationFactor: number): T; (from: Readonly, to: Readonly, interpolationFactor: number, out: T): T; }; readonly interpolateSpherical: typeof interpolateSpherical; readonly getPosition: typeof getPosition; readonly getRotation: typeof getRotation; readonly getRotationDegrees: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; readonly getRotationRadians: { (quat: Readonly): Vector3; (quat: Readonly, out: T): T; }; readonly getRotationQuat: typeof getRotationQuat; readonly setPosition: (quat: T, position: Readonly) => T; readonly setRotation: typeof setRotation; readonly setRotationDegrees: (quat: T, rotation: Readonly) => T; readonly setRotationRadians: (quat: T, rotation: Readonly) => T; readonly setRotationQuat: (quat: T, rotation: Readonly) => T; readonly setPositionRotation: typeof setPositionRotation; readonly setPositionRotationDegrees: (quat: T, position: Readonly, rotation: Readonly) => T; readonly setPositionRotationRadians: (quat: T, position: Readonly, rotation: Readonly) => T; readonly setPositionRotationQuat: typeof setPositionRotationQuat; 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 rotateAxis: typeof rotateAxis; readonly rotateAxisDegrees: typeof rotateAxisDegrees; readonly rotateAxisRadians: { (quat: Readonly, angle: number, axis: Readonly): T; (quat: Readonly, angle: number, axis: Readonly, out: T): T; }; readonly toWorld: typeof toWorld; readonly toLocal: { (quat: Readonly, parentTransformQuat: Readonly): T; (quat: Readonly, parentTransformQuat: Readonly, out: T): T; }; readonly toMatrix: typeof toMatrix; readonly fromMatrix: typeof fromMatrix; };