1 | import { Quaternion } from "./Quaternion.js";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export const DEG2RAD: number;
|
8 |
|
9 | export const RAD2DEG: number;
|
10 |
|
11 | export function generateUUID(): string;
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | export function clamp(value: number, min: number, max: number): number;
|
21 |
|
22 | export function euclideanModulo(n: number, m: number): number;
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export function mapLinear(x: number, a1: number, a2: number, b1: number, b2: number): number;
|
34 |
|
35 | export function inverseLerp(x: number, y: number, t: number): number;
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export function lerp(x: number, y: number, t: number): number;
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | export function damp(x: number, y: number, lambda: number, dt: number): number;
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | export function pingpong(x: number, length?: number): number;
|
65 |
|
66 | export function smoothstep(x: number, min: number, max: number): number;
|
67 |
|
68 | export function smootherstep(x: number, min: number, max: number): number;
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | export function randInt(low: number, high: number): number;
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | export function randFloat(low: number, high: number): number;
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | export function randFloatSpread(range: number): number;
|
84 |
|
85 |
|
86 |
|
87 |
|
88 | export function seededRandom(seed?: number): number;
|
89 |
|
90 | export function degToRad(degrees: number): number;
|
91 |
|
92 | export function radToDeg(radians: number): number;
|
93 |
|
94 | export function isPowerOfTwo(value: number): boolean;
|
95 |
|
96 | export function ceilPowerOfTwo(value: number): number;
|
97 |
|
98 | export function floorPowerOfTwo(value: number): number;
|
99 |
|
100 | export function setQuaternionFromProperEuler(q: Quaternion, a: number, b: number, c: number, order: string): void;
|
101 |
|
102 | export function denormalize(
|
103 | value: number,
|
104 | array: Float32Array | Uint32Array | Uint16Array | Uint8Array | Int32Array | Int16Array | Int8Array,
|
105 | ): number;
|
106 |
|
107 | export function normalize(
|
108 | value: number,
|
109 | array: Float32Array | Uint32Array | Uint16Array | Uint8Array | Int32Array | Int16Array | Int8Array,
|
110 | ): number;
|
111 |
|
112 | export const MathUtils: {
|
113 | DEG2RAD: typeof DEG2RAD;
|
114 | RAD2DEG: typeof RAD2DEG;
|
115 | generateUUID: typeof generateUUID;
|
116 | clamp: typeof clamp;
|
117 | euclideanModulo: typeof euclideanModulo;
|
118 | mapLinear: typeof mapLinear;
|
119 | inverseLerp: typeof inverseLerp;
|
120 | lerp: typeof lerp;
|
121 | damp: typeof damp;
|
122 | pingpong: typeof pingpong;
|
123 | smoothstep: typeof smoothstep;
|
124 | smootherstep: typeof smootherstep;
|
125 | randInt: typeof randInt;
|
126 | randFloat: typeof randFloat;
|
127 | randFloatSpread: typeof randFloatSpread;
|
128 | seededRandom: typeof seededRandom;
|
129 | degToRad: typeof degToRad;
|
130 | radToDeg: typeof radToDeg;
|
131 | isPowerOfTwo: typeof isPowerOfTwo;
|
132 | ceilPowerOfTwo: typeof ceilPowerOfTwo;
|
133 | floorPowerOfTwo: typeof floorPowerOfTwo;
|
134 | setQuaternionFromProperEuler: typeof setQuaternionFromProperEuler;
|
135 | normalize: typeof normalize;
|
136 | denormalize: typeof denormalize;
|
137 | };
|