import { QuatArg, QuatType } from './quat'; import { Mat3Arg } from './mat3.js'; import { Mat4Arg } from './mat4.js'; import { Vec3Arg } from './vec3.js'; import { BaseArgType } from './types'; export { QuatArg, QuatType }; type QuatCtor = new (n: number) => T; export type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx'; /** * Generates am typed API for Qud * */ declare function getAPIImpl(Ctor: QuatCtor): { create: (x?: number, y?: number, z?: number, w?: number) => QuatType; fromValues: (x?: number, y?: number, z?: number, w?: number) => QuatType; set: (x: number, y: number, z: number, w: number, dst?: T) => T; fromAxisAngle: (axis: Vec3Arg, angleInRadians: number, dst?: T) => T; toAxisAngle: (q: QuatArg, dst?: T) => { angle: number; axis: T; }; angle: (a: QuatArg, b: QuatArg) => number; multiply: (a: QuatArg, b: QuatArg, dst?: T) => T; mul: (a: QuatArg, b: QuatArg, dst?: T) => T; rotateX: (q: QuatArg, angleInRadians: number, dst?: T) => T; rotateY: (q: QuatArg, angleInRadians: number, dst?: T) => T; rotateZ: (q: QuatArg, angleInRadians: number, dst?: T) => T; slerp: (a: QuatArg, b: QuatArg, t: number, dst?: T) => T; inverse: (q: QuatArg, dst?: T) => T; conjugate: (q: QuatArg, dst?: T) => T; fromMat: (m: Mat3Arg | Mat4Arg, dst?: T) => T; fromEuler: (xAngleInRadians: number, yAngleInRadians: number, zAngleInRadians: number, order: RotationOrder, dst?: T) => T; copy: (q: QuatArg, dst?: T) => T; clone: (q: QuatArg, dst?: T) => T; add: (a: QuatArg, b: QuatArg, dst?: T) => T; subtract: (a: QuatArg, b: QuatArg, dst?: T) => T; sub: (a: QuatArg, b: QuatArg, dst?: T) => T; mulScalar: (v: QuatArg, k: number, dst?: T) => T; scale: (v: QuatArg, k: number, dst?: T) => T; divScalar: (v: QuatArg, k: number, dst?: T) => T; dot: (a: QuatArg, b: QuatArg) => number; lerp: (a: QuatArg, b: QuatArg, t: number, dst?: T) => T; length: (v: QuatArg) => number; len: (v: QuatArg) => number; lengthSq: (v: QuatArg) => number; lenSq: (v: QuatArg) => number; normalize: (v: QuatArg, dst?: T) => T; equalsApproximately: (a: QuatArg, b: QuatArg) => boolean; equals: (a: QuatArg, b: QuatArg) => boolean; identity: (dst?: T) => T; rotationTo: (aUnit: Vec3Arg, bUnit: Vec3Arg, dst?: T) => T; sqlerp: (a: QuatArg, b: QuatArg, c: QuatArg, d: QuatArg, t: number, dst?: T) => T; }; type API = ReturnType>; /** * * Quat4 math functions. * * Almost all functions take an optional `newDst` argument. If it is not passed in the * functions will create a new `Quat4`. In other words you can do this * * const v = quat4.cross(v1, v2); // Creates a new Quat4 with the cross product of v1 x v2. * * or * * const v = quat4.create(); * quat4.cross(v1, v2, v); // Puts the cross product of v1 x v2 in v * * The first style is often easier but depending on where it's used it generates garbage where * as there is almost never allocation with the second style. * * It is always safe to pass any vector as the destination. So for example * * quat4.cross(v1, v2, v1); // Puts the cross product of v1 x v2 in v1 * */ export declare function getAPI(Ctor: QuatCtor): API;