@oliversalzburg/js-utils 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/lib/async/async.d.ts +0 -44
- package/lib/async/async.js +0 -76
- package/lib/async/async.js.map +0 -1
- package/lib/async/async.test.d.ts +0 -1
- package/lib/async/async.test.js +0 -26
- package/lib/async/async.test.js.map +0 -1
- package/lib/core.d.ts +0 -43
- package/lib/core.js +0 -2
- package/lib/core.js.map +0 -1
- package/lib/data/array.d.ts +0 -45
- package/lib/data/array.js +0 -70
- package/lib/data/array.js.map +0 -1
- package/lib/data/nil.d.ts +0 -92
- package/lib/data/nil.js +0 -131
- package/lib/data/nil.js.map +0 -1
- package/lib/data/random.d.ts +0 -111
- package/lib/data/random.js +0 -377
- package/lib/data/random.js.map +0 -1
- package/lib/data/string.d.ts +0 -30
- package/lib/data/string.js +0 -52
- package/lib/data/string.js.map +0 -1
- package/lib/data/tree.d.ts +0 -28
- package/lib/data/tree.js +0 -45
- package/lib/data/tree.js.map +0 -1
- package/lib/device/shake.d.ts +0 -79
- package/lib/device/shake.js +0 -135
- package/lib/device/shake.js.map +0 -1
- package/lib/dom/core.d.ts +0 -21
- package/lib/dom/core.js +0 -41
- package/lib/dom/core.js.map +0 -1
- package/lib/errors/AbstractError.d.ts +0 -29
- package/lib/errors/AbstractError.js +0 -59
- package/lib/errors/AbstractError.js.map +0 -1
- package/lib/errors/InternalError.d.ts +0 -19
- package/lib/errors/InternalError.js +0 -38
- package/lib/errors/InternalError.js.map +0 -1
- package/lib/errors/InvalidArgumentError.d.ts +0 -13
- package/lib/errors/InvalidArgumentError.js +0 -22
- package/lib/errors/InvalidArgumentError.js.map +0 -1
- package/lib/errors/InvalidOperationError.d.ts +0 -13
- package/lib/errors/InvalidOperationError.js +0 -22
- package/lib/errors/InvalidOperationError.js.map +0 -1
- package/lib/errors/NotImplementedError.d.ts +0 -12
- package/lib/errors/NotImplementedError.js +0 -21
- package/lib/errors/NotImplementedError.js.map +0 -1
- package/lib/errors/PermissionViolationError.d.ts +0 -13
- package/lib/errors/PermissionViolationError.js +0 -22
- package/lib/errors/PermissionViolationError.js.map +0 -1
- package/lib/errors/ResourceConflictError.d.ts +0 -12
- package/lib/errors/ResourceConflictError.js +0 -21
- package/lib/errors/ResourceConflictError.js.map +0 -1
- package/lib/errors/UnknownError.d.ts +0 -16
- package/lib/errors/UnknownError.js +0 -25
- package/lib/errors/UnknownError.js.map +0 -1
- package/lib/errors/console.d.ts +0 -7
- package/lib/errors/console.js +0 -13
- package/lib/errors/console.js.map +0 -1
- package/lib/errors/error-serializer.d.ts +0 -45
- package/lib/errors/error-serializer.js +0 -71
- package/lib/errors/error-serializer.js.map +0 -1
- package/lib/errors/error-serializer.test.d.ts +0 -1
- package/lib/errors/error-serializer.test.js +0 -109
- package/lib/errors/error-serializer.test.js.map +0 -1
- package/lib/errors/stream.d.ts +0 -7
- package/lib/errors/stream.js +0 -15
- package/lib/errors/stream.js.map +0 -1
- package/lib/errors/tools.d.ts +0 -10
- package/lib/errors/tools.js +0 -13
- package/lib/errors/tools.js.map +0 -1
- package/lib/events/event.d.ts +0 -9
- package/lib/events/event.js +0 -10
- package/lib/events/event.js.map +0 -1
- package/lib/format/bytes.d.ts +0 -118
- package/lib/format/bytes.js +0 -99
- package/lib/format/bytes.js.map +0 -1
- package/lib/format/bytes.test.d.ts +0 -1
- package/lib/format/bytes.test.js +0 -138
- package/lib/format/bytes.test.js.map +0 -1
- package/lib/format/count.d.ts +0 -14
- package/lib/format/count.js +0 -50
- package/lib/format/count.js.map +0 -1
- package/lib/format/count.test.d.ts +0 -1
- package/lib/format/count.test.js +0 -42
- package/lib/format/count.test.js.map +0 -1
- package/lib/format/milliseconds.d.ts +0 -100
- package/lib/format/milliseconds.js +0 -192
- package/lib/format/milliseconds.js.map +0 -1
- package/lib/format/milliseconds.test.d.ts +0 -1
- package/lib/format/milliseconds.test.js +0 -343
- package/lib/format/milliseconds.test.js.map +0 -1
- package/lib/format/string.d.ts +0 -24
- package/lib/format/string.js +0 -30
- package/lib/format/string.js.map +0 -1
- package/lib/format/string.test.d.ts +0 -1
- package/lib/format/string.test.js +0 -17
- package/lib/format/string.test.js.map +0 -1
- package/lib/graphics/canvas-sandbox-mp.d.ts +0 -258
- package/lib/graphics/canvas-sandbox-mp.js +0 -279
- package/lib/graphics/canvas-sandbox-mp.js.map +0 -1
- package/lib/graphics/canvas-sandbox.d.ts +0 -255
- package/lib/graphics/canvas-sandbox.js +0 -361
- package/lib/graphics/canvas-sandbox.js.map +0 -1
- package/lib/graphics/canvas.d.ts +0 -57
- package/lib/graphics/canvas.js +0 -37
- package/lib/graphics/canvas.js.map +0 -1
- package/lib/graphics/canvas2d-headless.d.ts +0 -85
- package/lib/graphics/canvas2d-headless.js +0 -193
- package/lib/graphics/canvas2d-headless.js.map +0 -1
- package/lib/graphics/canvas2d.d.ts +0 -162
- package/lib/graphics/canvas2d.js +0 -328
- package/lib/graphics/canvas2d.js.map +0 -1
- package/lib/graphics/canvas3d.d.ts +0 -41
- package/lib/graphics/canvas3d.js +0 -67
- package/lib/graphics/canvas3d.js.map +0 -1
- package/lib/graphics/color.d.ts +0 -22
- package/lib/graphics/color.js +0 -42
- package/lib/graphics/color.js.map +0 -1
- package/lib/graphics/core.d.ts +0 -89
- package/lib/graphics/core.js +0 -146
- package/lib/graphics/core.js.map +0 -1
- package/lib/graphics/palette-sampler.d.ts +0 -7
- package/lib/graphics/palette-sampler.js +0 -21
- package/lib/graphics/palette-sampler.js.map +0 -1
- package/lib/graphics/palette.d.ts +0 -120
- package/lib/graphics/palette.js +0 -494
- package/lib/graphics/palette.js.map +0 -1
- package/lib/graphics/palette.test.d.ts +0 -1
- package/lib/graphics/palette.test.js +0 -43
- package/lib/graphics/palette.test.js.map +0 -1
- package/lib/graphics/render-loop.d.ts +0 -80
- package/lib/graphics/render-loop.js +0 -120
- package/lib/graphics/render-loop.js.map +0 -1
- package/lib/graphics/shader.d.ts +0 -56
- package/lib/graphics/shader.js +0 -80
- package/lib/graphics/shader.js.map +0 -1
- package/lib/log/log.d.ts +0 -11
- package/lib/log/log.js +0 -2
- package/lib/log/log.js.map +0 -1
- package/lib/log/report.d.ts +0 -57
- package/lib/log/report.js +0 -88
- package/lib/log/report.js.map +0 -1
- package/lib/math/core.d.ts +0 -85
- package/lib/math/core.js +0 -125
- package/lib/math/core.js.map +0 -1
- package/lib/math/easing.d.ts +0 -204
- package/lib/math/easing.js +0 -332
- package/lib/math/easing.js.map +0 -1
- package/lib/math/euler.d.ts +0 -18
- package/lib/math/euler.js +0 -22
- package/lib/math/euler.js.map +0 -1
- package/lib/math/matrix3.d.ts +0 -217
- package/lib/math/matrix3.js +0 -508
- package/lib/math/matrix3.js.map +0 -1
- package/lib/math/quaternion.d.ts +0 -119
- package/lib/math/quaternion.js +0 -270
- package/lib/math/quaternion.js.map +0 -1
- package/lib/math/transformation.d.ts +0 -26
- package/lib/math/transformation.js +0 -31
- package/lib/math/transformation.js.map +0 -1
- package/lib/math/vector2.d.ts +0 -202
- package/lib/math/vector2.js +0 -310
- package/lib/math/vector2.js.map +0 -1
- package/lib/math/vector3.d.ts +0 -293
- package/lib/math/vector3.js +0 -492
- package/lib/math/vector3.js.map +0 -1
- package/lib/math/vector4.d.ts +0 -182
- package/lib/math/vector4.js +0 -302
- package/lib/math/vector4.js.map +0 -1
- package/lib/measurement/performance.d.ts +0 -13
- package/lib/measurement/performance.js +0 -19
- package/lib/measurement/performance.js.map +0 -1
package/lib/math/quaternion.js
DELETED
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import { Vector4 } from "./vector4.js";
|
|
2
|
-
/**
|
|
3
|
-
* A quaternion.
|
|
4
|
-
*/
|
|
5
|
-
export class Quaternion extends Vector4 {
|
|
6
|
-
/**
|
|
7
|
-
* Constructs a new {@linkcode Quaternion}.
|
|
8
|
-
* @param x - The X component.
|
|
9
|
-
* @param y - The Y component.
|
|
10
|
-
* @param z - The Z component.
|
|
11
|
-
* @param w - The W component.
|
|
12
|
-
*/
|
|
13
|
-
constructor(x = 0, y = 0, z = 0, w = 0) {
|
|
14
|
-
super(x, y, z, w);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Creates a new {@linkcode Quaternion} from a rotation matrix.
|
|
18
|
-
* @param matrix - The matrix to construct the quaternion from.
|
|
19
|
-
* @returns A new quaternion.
|
|
20
|
-
*/
|
|
21
|
-
static fromMatrix3(matrix) {
|
|
22
|
-
return new Quaternion().setMatrix3(matrix);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Creates a new {@linkcode Quaternion} from a rotation in Euler angles.
|
|
26
|
-
* @param degrees - The rotation in Euler angles.
|
|
27
|
-
* @returns A new quaternion.
|
|
28
|
-
*/
|
|
29
|
-
static fromEuler(degrees) {
|
|
30
|
-
return new Quaternion().setEuler(degrees);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Creates a new {@linkcode Quaternion} from a rotation around an axis.
|
|
34
|
-
* @param axis - The axis around which to rotate.
|
|
35
|
-
* @param degrees - The rotation in degrees.
|
|
36
|
-
* @returns A new quaternion.
|
|
37
|
-
*/
|
|
38
|
-
static fromVector3(axis, degrees) {
|
|
39
|
-
return new Quaternion().setVector3(axis, degrees);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Creates a new {@linkcode Quaternion} from a {@linkcode Vector4}.
|
|
43
|
-
* @param vector - The vector to copy the components from.
|
|
44
|
-
* @returns A new quaternion.
|
|
45
|
-
*/
|
|
46
|
-
static fromVector4(vector) {
|
|
47
|
-
return new Quaternion().setVector4(vector);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Creates a new {@linkcode Quaternion} from another {@linkcode Quaternion}.
|
|
51
|
-
* @param quaternion - The quaternion to copy.
|
|
52
|
-
* @returns A new quaternion.
|
|
53
|
-
*/
|
|
54
|
-
static fromQuaternion(quaternion) {
|
|
55
|
-
return new Quaternion().set(quaternion);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Sets the quaternion to the values of another quaternion.
|
|
59
|
-
* @param quaternion - The quaternion to copy.
|
|
60
|
-
* @returns This instance.
|
|
61
|
-
*/
|
|
62
|
-
set(quaternion) {
|
|
63
|
-
this.x = quaternion.x;
|
|
64
|
-
this.y = quaternion.y;
|
|
65
|
-
this.z = quaternion.z;
|
|
66
|
-
this.w = quaternion.w;
|
|
67
|
-
return this;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Sets all components of the quaternion to the given value.
|
|
71
|
-
* @param value - The value to assign to the components of the quaternion.
|
|
72
|
-
* @returns This instance.
|
|
73
|
-
*/
|
|
74
|
-
setValue(value) {
|
|
75
|
-
this.x = value;
|
|
76
|
-
this.y = value;
|
|
77
|
-
this.z = value;
|
|
78
|
-
this.w = 1;
|
|
79
|
-
return this;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Sets the components of the quaternion to the given values.
|
|
83
|
-
* @param x - The X component for the quaternion.
|
|
84
|
-
* @param y - The Y component for the quaternion.
|
|
85
|
-
* @param z - The Z component for the quaternion.
|
|
86
|
-
* @param w - The W component for the quaternion.
|
|
87
|
-
* @returns This instance.
|
|
88
|
-
*/
|
|
89
|
-
setXYZW(x, y, z = 0, w = 1) {
|
|
90
|
-
this.x = x;
|
|
91
|
-
this.y = y;
|
|
92
|
-
this.z = z;
|
|
93
|
-
this.w = w;
|
|
94
|
-
return this;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Sets the quaternion to the rotation of the given matrix.
|
|
98
|
-
* @param matrix - The matrix describing the rotation of the quaternion.
|
|
99
|
-
* @returns This instance.
|
|
100
|
-
*/
|
|
101
|
-
setMatrix3(matrix) {
|
|
102
|
-
const nxt = [1, 2, 0];
|
|
103
|
-
// check the diagonal
|
|
104
|
-
const tr = matrix.m00 + matrix.m11 + matrix.m22;
|
|
105
|
-
if (tr > 0) {
|
|
106
|
-
let s = Math.sqrt(tr + 1);
|
|
107
|
-
this.w = s / 2;
|
|
108
|
-
s = 0.5 / s;
|
|
109
|
-
this.x = (matrix.m21 - matrix.m12) * s;
|
|
110
|
-
this.y = (matrix.m02 - matrix.m20) * s;
|
|
111
|
-
this.z = (matrix.m10 - matrix.m01) * s;
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
let h = 0;
|
|
115
|
-
if (matrix.m11 > matrix.m00)
|
|
116
|
-
h = 1;
|
|
117
|
-
if (matrix.m22 > matrix.m[h][h])
|
|
118
|
-
h = 2;
|
|
119
|
-
const i = nxt[h];
|
|
120
|
-
const j = nxt[i];
|
|
121
|
-
let s = Math.sqrt(matrix.m[h][h] - (matrix.m[i][i] + matrix.m[j][j]) + 1);
|
|
122
|
-
this.k[h] = s * 0.5;
|
|
123
|
-
if (s !== 0)
|
|
124
|
-
s = 0.5 / s;
|
|
125
|
-
this.w = (matrix.m[j][i] - matrix.m[i][j]) * s;
|
|
126
|
-
this.k[i] = (matrix.m[i][h] + matrix.m[h][i]) * s;
|
|
127
|
-
this.k[j] = (matrix.m[j][h] + matrix.m[h][j]) * s;
|
|
128
|
-
}
|
|
129
|
-
return this;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Sets the quaternion to a rotation in Euler angles.
|
|
133
|
-
* @param degrees - The rotation in Euler angles.
|
|
134
|
-
* @returns This instance.
|
|
135
|
-
*/
|
|
136
|
-
setEuler(degrees) {
|
|
137
|
-
const cr = Math.cos(degrees.x / 2);
|
|
138
|
-
const cp = Math.cos(degrees.y / 2);
|
|
139
|
-
const cy = Math.cos(degrees.z / 2);
|
|
140
|
-
const sr = Math.sin(degrees.x / 2);
|
|
141
|
-
const sp = Math.sin(degrees.y / 2);
|
|
142
|
-
const sy = Math.sin(degrees.z / 2);
|
|
143
|
-
const cpcy = cp * cy;
|
|
144
|
-
const spsy = sp * sy;
|
|
145
|
-
this.x = sr * cpcy - cr * spsy;
|
|
146
|
-
this.y = cr * sp * cy + sr * cp * sy;
|
|
147
|
-
this.z = cr * cp * sy - sr * sp * cy;
|
|
148
|
-
this.w = cr * cpcy + sr * spsy;
|
|
149
|
-
return this;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Sets the quaternion to a rotation around an axis.
|
|
153
|
-
* @param axis - The axis around which to rotate.
|
|
154
|
-
* @param degrees - The rotation in degrees.
|
|
155
|
-
* @returns This instance.
|
|
156
|
-
*/
|
|
157
|
-
setVector3(axis, degrees) {
|
|
158
|
-
const si = Math.sin(degrees / 2);
|
|
159
|
-
this.x = axis.x * si;
|
|
160
|
-
this.y = axis.y * si;
|
|
161
|
-
this.z = axis.z * si;
|
|
162
|
-
this.w = Math.cos(degrees / 2);
|
|
163
|
-
return this;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Sets the quaternion to the components of a {@linkcode Vector4}.
|
|
167
|
-
* @param vector - The vector to copy.
|
|
168
|
-
* @returns This instance.
|
|
169
|
-
*/
|
|
170
|
-
setVector4(vector) {
|
|
171
|
-
this.x = vector.x;
|
|
172
|
-
this.y = vector.y;
|
|
173
|
-
this.z = vector.z;
|
|
174
|
-
this.w = vector.w;
|
|
175
|
-
return this;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Normalize the quaternion.
|
|
179
|
-
* @returns This instance.
|
|
180
|
-
*/
|
|
181
|
-
normalize() {
|
|
182
|
-
const l = this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
|
|
183
|
-
if (l === 0)
|
|
184
|
-
return this;
|
|
185
|
-
this.x = this.x / l;
|
|
186
|
-
this.y = this.y / l;
|
|
187
|
-
this.z = this.z / l;
|
|
188
|
-
this.w = this.w / l;
|
|
189
|
-
return this;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Invert the quaternion.
|
|
193
|
-
* @returns This instance.
|
|
194
|
-
*/
|
|
195
|
-
invert() {
|
|
196
|
-
this.x = -this.x;
|
|
197
|
-
this.y = -this.y;
|
|
198
|
-
this.z = -this.z;
|
|
199
|
-
return this;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Multiply with another quaternion from the right.
|
|
203
|
-
* @param quaternion - The quaternion to multiply with.
|
|
204
|
-
* @returns This instance.
|
|
205
|
-
*/
|
|
206
|
-
multiplyR(quaternion) {
|
|
207
|
-
const A = (this.w + this.x) * (quaternion.w + quaternion.x);
|
|
208
|
-
const B = (this.z - this.y) * (quaternion.y - quaternion.z);
|
|
209
|
-
const C = (this.x - this.w) * (quaternion.y - quaternion.z);
|
|
210
|
-
const D = (this.y + this.z) * (quaternion.x - quaternion.w);
|
|
211
|
-
const E = (this.x + this.z) * (quaternion.x + quaternion.y);
|
|
212
|
-
const F = (this.x - this.z) * (quaternion.x - quaternion.y);
|
|
213
|
-
const G = (this.w + this.y) * (quaternion.w - quaternion.z);
|
|
214
|
-
const H = (this.w - this.y) * (quaternion.w + quaternion.z);
|
|
215
|
-
this.w = B + (-E - F + G + H) / 2;
|
|
216
|
-
this.x = A - (E + F + G + H) / 2;
|
|
217
|
-
this.y = -C + (E - F + G - H) / 2;
|
|
218
|
-
this.z = -D + (E - F - G + H) / 2;
|
|
219
|
-
return this;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Performs spherical linear interpolation between two rotations, and sets this
|
|
223
|
-
* quaternion to the resulting rotation.
|
|
224
|
-
* @param q1 - The initial rotation.
|
|
225
|
-
* @param q2 - The target rotation.
|
|
226
|
-
* @param t - The location on the scale from `0` to `1`.
|
|
227
|
-
* @returns This instance.
|
|
228
|
-
*/
|
|
229
|
-
slerp(q1, q2, t) {
|
|
230
|
-
const q2a = [0, 0, 0, 0];
|
|
231
|
-
let omega, sinom, scale0, scale1;
|
|
232
|
-
// calc cosine
|
|
233
|
-
let cosom = q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w;
|
|
234
|
-
// adjust signs (if necessary)
|
|
235
|
-
if (cosom < 0) {
|
|
236
|
-
cosom = -cosom;
|
|
237
|
-
q2a[0] = -q2.x;
|
|
238
|
-
q2a[1] = -q2.y;
|
|
239
|
-
q2a[2] = -q2.z;
|
|
240
|
-
q2a[3] = -q2.w;
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
q2a[0] = q2.x;
|
|
244
|
-
q2a[1] = q2.y;
|
|
245
|
-
q2a[2] = q2.z;
|
|
246
|
-
q2a[3] = q2.w;
|
|
247
|
-
}
|
|
248
|
-
// Delta below only linear interpolation is done
|
|
249
|
-
if (1 - cosom > 0.0001) {
|
|
250
|
-
// standard case (slerp)
|
|
251
|
-
omega = Math.acos(cosom);
|
|
252
|
-
sinom = Math.sin(omega);
|
|
253
|
-
scale0 = Math.sin((1 - t) * omega) / sinom;
|
|
254
|
-
scale1 = Math.sin(t * omega) / sinom;
|
|
255
|
-
}
|
|
256
|
-
else {
|
|
257
|
-
// "from" and "to" quaternions are very close
|
|
258
|
-
// ... so we can do a linear interpolation
|
|
259
|
-
scale0 = 1 - t;
|
|
260
|
-
scale1 = t;
|
|
261
|
-
}
|
|
262
|
-
// calculate final values
|
|
263
|
-
this.x = scale0 * q1.x + scale1 * q2a[0];
|
|
264
|
-
this.y = scale0 * q1.y + scale1 * q2a[1];
|
|
265
|
-
this.z = scale0 * q1.z + scale1 * q2a[2];
|
|
266
|
-
this.w = scale0 * q1.w + scale1 * q2a[3];
|
|
267
|
-
return this;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
//# sourceMappingURL=quaternion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quaternion.js","sourceRoot":"","sources":["../../source/math/quaternion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IACrC;;;;;;OAMG;IACH,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAA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AAC,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACzC,IAAI,CAAC,CAAC,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACzC,IAAI,CAAC,CAAC,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Matrix3 } from "./matrix3.js";
|
|
2
|
-
import { Vector3 } from "./vector3.js";
|
|
3
|
-
/**
|
|
4
|
-
* Encapsulates an entire transformation, including rotation, position, and scale.
|
|
5
|
-
*/
|
|
6
|
-
export declare class Transformation {
|
|
7
|
-
/**
|
|
8
|
-
* The rotation to apply through this transformation.
|
|
9
|
-
*/
|
|
10
|
-
rotation: Matrix3;
|
|
11
|
-
/**
|
|
12
|
-
* The position to apply through this transformation.
|
|
13
|
-
*/
|
|
14
|
-
position: Vector3;
|
|
15
|
-
/**
|
|
16
|
-
* The scale to apply through this transformation.
|
|
17
|
-
*/
|
|
18
|
-
scale: Vector3;
|
|
19
|
-
/**
|
|
20
|
-
* Construct a new {@linkcode Transformation}.
|
|
21
|
-
* @param rotation - The rotation to apply through the transformation.
|
|
22
|
-
* @param position - The position to apply through the transformation.
|
|
23
|
-
* @param scale - The scale to apply through the transformation.
|
|
24
|
-
*/
|
|
25
|
-
constructor(rotation: Readonly<Matrix3>, position: Readonly<Vector3>, scale: Readonly<Vector3>);
|
|
26
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Matrix3 } from "./matrix3.js";
|
|
2
|
-
import { Vector3 } from "./vector3.js";
|
|
3
|
-
/**
|
|
4
|
-
* Encapsulates an entire transformation, including rotation, position, and scale.
|
|
5
|
-
*/
|
|
6
|
-
export class Transformation {
|
|
7
|
-
/**
|
|
8
|
-
* The rotation to apply through this transformation.
|
|
9
|
-
*/
|
|
10
|
-
rotation;
|
|
11
|
-
/**
|
|
12
|
-
* The position to apply through this transformation.
|
|
13
|
-
*/
|
|
14
|
-
position;
|
|
15
|
-
/**
|
|
16
|
-
* The scale to apply through this transformation.
|
|
17
|
-
*/
|
|
18
|
-
scale;
|
|
19
|
-
/**
|
|
20
|
-
* Construct a new {@linkcode Transformation}.
|
|
21
|
-
* @param rotation - The rotation to apply through the transformation.
|
|
22
|
-
* @param position - The position to apply through the transformation.
|
|
23
|
-
* @param scale - The scale to apply through the transformation.
|
|
24
|
-
*/
|
|
25
|
-
constructor(rotation, position, scale) {
|
|
26
|
-
this.rotation = Matrix3.fromMatrix3(rotation);
|
|
27
|
-
this.position = Vector3.fromVector3(position);
|
|
28
|
-
this.scale = Vector3.fromVector3(scale);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=transformation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformation.js","sourceRoot":"","sources":["../../source/math/transformation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;GAEG;AACH,MAAM,OAAO,cAAc;IACzB;;OAEG;IACH,QAAQ,CAAU;IAElB;;OAEG;IACH,QAAQ,CAAU;IAElB;;OAEG;IACH,KAAK,CAAU;IAEf;;;;;OAKG;IACH,YAAY,QAA2B,EAAE,QAA2B,EAAE,KAAwB;QAC5F,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
package/lib/math/vector2.d.ts
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A vector with 2 components, labeled: `X`, `Y`.
|
|
3
|
-
*/
|
|
4
|
-
export declare class Vector2 {
|
|
5
|
-
/**
|
|
6
|
-
* The X component of the vector.
|
|
7
|
-
*/
|
|
8
|
-
x: number;
|
|
9
|
-
/**
|
|
10
|
-
* The Y component of the vector.
|
|
11
|
-
*/
|
|
12
|
-
y: number;
|
|
13
|
-
/**
|
|
14
|
-
* Constructs a new {@linkcode Vector2}.
|
|
15
|
-
* @param x - The X component.
|
|
16
|
-
* @param y - The Y component.
|
|
17
|
-
*/
|
|
18
|
-
constructor(x: number, y: number);
|
|
19
|
-
/**
|
|
20
|
-
* Creates a copy of another {@linkcode Vector2}.
|
|
21
|
-
* @param vector - The vector to copy.
|
|
22
|
-
* @returns A new vector.
|
|
23
|
-
*/
|
|
24
|
-
static fromVector2(vector: Readonly<Vector2>): Vector2;
|
|
25
|
-
/**
|
|
26
|
-
* Sets the vector to new coordinates.
|
|
27
|
-
* @param vector - The coordinates to set the vector to.
|
|
28
|
-
* @returns This instance.
|
|
29
|
-
*/
|
|
30
|
-
set(vector: Readonly<Vector2>): this;
|
|
31
|
-
/**
|
|
32
|
-
* Sets the vector to new coordinates.
|
|
33
|
-
* @param x - The new X component for the vector.
|
|
34
|
-
* @param y - The new Y component for the vector.
|
|
35
|
-
* @returns This instance.
|
|
36
|
-
*/
|
|
37
|
-
setXY(x: number, y: number): this;
|
|
38
|
-
/**
|
|
39
|
-
* Adds another vector to this vector.
|
|
40
|
-
* @param vector - The vector to add to this vector.
|
|
41
|
-
* @returns This instance.
|
|
42
|
-
*/
|
|
43
|
-
add(vector: Readonly<Vector2>): this;
|
|
44
|
-
/**
|
|
45
|
-
* Adds another vector to this vector.
|
|
46
|
-
* @param x - The value to add to the X component.
|
|
47
|
-
* @param y - The value to add to the Y component.
|
|
48
|
-
* @returns This instance.
|
|
49
|
-
*/
|
|
50
|
-
addXY(x: number, y: number): this;
|
|
51
|
-
/**
|
|
52
|
-
* Scales another vector and adds it to this vector.
|
|
53
|
-
* @param vector - The vector to add to this vector.
|
|
54
|
-
* @param scale - The scaling to apply to the input vector.
|
|
55
|
-
* @returns This instance.
|
|
56
|
-
*/
|
|
57
|
-
addMultiply(vector: Readonly<Vector2>, scale: number): this;
|
|
58
|
-
/**
|
|
59
|
-
* Scales another vector and adds it to this vector.
|
|
60
|
-
* @param x - The value to add to the X component.
|
|
61
|
-
* @param y - The value to add to the Y component.
|
|
62
|
-
* @param scale - The scaling to apply to the input vector.
|
|
63
|
-
* @returns This instance.
|
|
64
|
-
*/
|
|
65
|
-
addMultiplyXY(x: number, y: number, scale: number): this;
|
|
66
|
-
/**
|
|
67
|
-
* Subtracts another vector from this vector.
|
|
68
|
-
* @param vector - The vector to subtract from this vector.
|
|
69
|
-
* @returns This instance.
|
|
70
|
-
*/
|
|
71
|
-
subtract(vector: Readonly<Vector2>): this;
|
|
72
|
-
/**
|
|
73
|
-
* Subtracts another vector from this vector.
|
|
74
|
-
* @param x - The value to subtract from the X component.
|
|
75
|
-
* @param y - The value to subtract from the Y component.
|
|
76
|
-
* @returns This instance.
|
|
77
|
-
*/
|
|
78
|
-
subtractXY(x: number, y: number): this;
|
|
79
|
-
/**
|
|
80
|
-
* Multiplies this vector by another vector.
|
|
81
|
-
* @param vector - The vector to multiply with this vector.
|
|
82
|
-
* @returns This instance.
|
|
83
|
-
*/
|
|
84
|
-
multiply(vector: Readonly<Vector2>): this;
|
|
85
|
-
/**
|
|
86
|
-
* Multiplies this vector by another vector.
|
|
87
|
-
* @param x - The value to multiply with the X component.
|
|
88
|
-
* @param y - The value to multiply with the Y component.
|
|
89
|
-
* @returns This instance.
|
|
90
|
-
*/
|
|
91
|
-
multiplyXY(x: number, y: number): this;
|
|
92
|
-
/**
|
|
93
|
-
* Multiplies the vector by the given scale.
|
|
94
|
-
* @param scale - The scaling to apply to the vector.
|
|
95
|
-
* @returns This instance.
|
|
96
|
-
*/
|
|
97
|
-
multiplyScale(scale: number): this;
|
|
98
|
-
/**
|
|
99
|
-
* Divides this vector by another vector.
|
|
100
|
-
* @param vector - The vector to divide this vector with.
|
|
101
|
-
* @returns This instance.
|
|
102
|
-
*/
|
|
103
|
-
divide(vector: Readonly<Vector2>): this;
|
|
104
|
-
/**
|
|
105
|
-
* Divides this vector by another vector.
|
|
106
|
-
* @param x - The value to divide the X component with.
|
|
107
|
-
* @param y - The value to divide the Y component with.
|
|
108
|
-
* @returns This instance.
|
|
109
|
-
*/
|
|
110
|
-
divideXY(x: number, y: number): this;
|
|
111
|
-
/**
|
|
112
|
-
* Divides the vector by the given scale.
|
|
113
|
-
* @param scale - The scaling to apply to the vector.
|
|
114
|
-
* @returns This instance.
|
|
115
|
-
*/
|
|
116
|
-
divideScale(scale: number): this;
|
|
117
|
-
/**
|
|
118
|
-
* Inverts the direction of the vector.
|
|
119
|
-
* @returns This instance.
|
|
120
|
-
*/
|
|
121
|
-
invertAdd(): this;
|
|
122
|
-
/**
|
|
123
|
-
* Inverts the vectors scale.
|
|
124
|
-
* @returns This instance.
|
|
125
|
-
*/
|
|
126
|
-
invertMultiply(): this;
|
|
127
|
-
/**
|
|
128
|
-
* Clamps the components of the vector at the given boundary.
|
|
129
|
-
* @param floor - The lowest value to allow.
|
|
130
|
-
* @param ceil - The largest value to allow.
|
|
131
|
-
* @returns This instance.
|
|
132
|
-
*/
|
|
133
|
-
clamp(floor: number, ceil: number): this;
|
|
134
|
-
/**
|
|
135
|
-
* Calculates the length of the vector.
|
|
136
|
-
* @returns The length of the vector.
|
|
137
|
-
*/
|
|
138
|
-
length(): number;
|
|
139
|
-
/**
|
|
140
|
-
* Normalizes the vector.
|
|
141
|
-
* @returns This instance.
|
|
142
|
-
*/
|
|
143
|
-
normalize(): this;
|
|
144
|
-
/**
|
|
145
|
-
* Compares two vectors.
|
|
146
|
-
* @param vector - The vector to compare this vector to.
|
|
147
|
-
* @returns `true` if the vectors are idently, `false` otherwise.
|
|
148
|
-
*/
|
|
149
|
-
compare(vector: Readonly<Vector2>): boolean;
|
|
150
|
-
/**
|
|
151
|
-
* Linearly moves this vector towards a target vector.
|
|
152
|
-
* @param vector - The target vector.
|
|
153
|
-
* @param t - The location on the scale, from `0` to `1`.
|
|
154
|
-
* @returns This instance.
|
|
155
|
-
*/
|
|
156
|
-
lerp(vector: Readonly<Vector2>, t: number): this;
|
|
157
|
-
/**
|
|
158
|
-
* Rotates the vector by the given angle.
|
|
159
|
-
* @param angle - The angle in degrees.
|
|
160
|
-
* @returns This instance.
|
|
161
|
-
*/
|
|
162
|
-
rotate(angle: number): this;
|
|
163
|
-
/**
|
|
164
|
-
* Returns the dot product between two vectors.
|
|
165
|
-
* @param vector - The other vector.
|
|
166
|
-
* @returns The dot product between the two vectors.
|
|
167
|
-
*/
|
|
168
|
-
dot(vector: Readonly<Vector2>): number;
|
|
169
|
-
/**
|
|
170
|
-
* Returns the dot product between two vectors.
|
|
171
|
-
* @param x - The X component of the other vector.
|
|
172
|
-
* @param y - The Y component of the other vector.
|
|
173
|
-
* @returns The dot product between the two vectors.
|
|
174
|
-
*/
|
|
175
|
-
dotXY(x: number, y: number): number;
|
|
176
|
-
/**
|
|
177
|
-
* Return the components of this vector as an array.
|
|
178
|
-
* @returns The components of this vector as an array.
|
|
179
|
-
*/
|
|
180
|
-
asArray(): [number, number];
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Adds two vectors and returns a new vector with the result.
|
|
184
|
-
* @param a - The first input vector.
|
|
185
|
-
* @param b - The second input vector.
|
|
186
|
-
* @returns A new {@linkcode Vector2}.
|
|
187
|
-
*/
|
|
188
|
-
export declare const addVector2: (a: Readonly<Vector2>, b: Readonly<Vector2>) => Vector2;
|
|
189
|
-
/**
|
|
190
|
-
* Multiplies two vectors and returns a new vector with the result.
|
|
191
|
-
* @param a - The first input vector.
|
|
192
|
-
* @param b - The second input vector.
|
|
193
|
-
* @returns A new {@linkcode Vector2}.
|
|
194
|
-
*/
|
|
195
|
-
export declare const multiplyVector2: (a: Readonly<Vector2>, b: Readonly<Vector2>) => Vector2;
|
|
196
|
-
/**
|
|
197
|
-
* Subtracts two vectors and returns a new vector with the result.
|
|
198
|
-
* @param a - The first input vector.
|
|
199
|
-
* @param b - The second input vector.
|
|
200
|
-
* @returns A new {@linkcode Vector2}.
|
|
201
|
-
*/
|
|
202
|
-
export declare const subtractVector2: (a: Readonly<Vector2>, b: Readonly<Vector2>) => Vector2;
|