@ac-kit/math-linear 0.2.1 → 0.3.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/CHANGELOG.md +257 -0
- package/README.md +229 -16
- package/dist/_brand.d.ts +14 -0
- package/dist/_brand.d.ts.map +1 -0
- package/dist/_brand.js +2 -0
- package/dist/_brand.js.map +1 -0
- package/dist/_invert.d.ts +19 -0
- package/dist/_invert.d.ts.map +1 -0
- package/dist/_invert.js +48 -0
- package/dist/_invert.js.map +1 -0
- package/dist/_slerp.d.ts +15 -0
- package/dist/_slerp.d.ts.map +1 -1
- package/dist/_slerp.js +47 -0
- package/dist/_slerp.js.map +1 -1
- package/dist/_strided-range.d.ts +23 -0
- package/dist/_strided-range.d.ts.map +1 -0
- package/dist/_strided-range.js +75 -0
- package/dist/_strided-range.js.map +1 -0
- package/dist/_trs.d.ts +38 -0
- package/dist/_trs.d.ts.map +1 -0
- package/dist/_trs.js +132 -0
- package/dist/_trs.js.map +1 -0
- package/dist/affine2-array.d.ts +53 -0
- package/dist/affine2-array.d.ts.map +1 -0
- package/dist/affine2-array.js +107 -0
- package/dist/affine2-array.js.map +1 -0
- package/dist/affine2-componentwise.d.ts +28 -0
- package/dist/affine2-componentwise.d.ts.map +1 -0
- package/dist/affine2-componentwise.js +66 -0
- package/dist/affine2-componentwise.js.map +1 -0
- package/dist/affine2.d.ts +144 -0
- package/dist/affine2.d.ts.map +1 -0
- package/dist/affine2.js +375 -0
- package/dist/affine2.js.map +1 -0
- package/dist/affine3-array.d.ts +53 -0
- package/dist/affine3-array.d.ts.map +1 -0
- package/dist/affine3-array.js +137 -0
- package/dist/affine3-array.js.map +1 -0
- package/dist/affine3-componentwise.d.ts +32 -0
- package/dist/affine3-componentwise.d.ts.map +1 -0
- package/dist/affine3-componentwise.js +100 -0
- package/dist/affine3-componentwise.js.map +1 -0
- package/dist/affine3.d.ts +192 -0
- package/dist/affine3.d.ts.map +1 -0
- package/dist/affine3.js +718 -0
- package/dist/affine3.js.map +1 -0
- package/dist/checked/index.d.ts +35 -0
- package/dist/checked/index.d.ts.map +1 -0
- package/dist/checked/index.js +58 -0
- package/dist/checked/index.js.map +1 -0
- package/dist/euler.d.ts +65 -0
- package/dist/euler.d.ts.map +1 -0
- package/dist/euler.js +217 -0
- package/dist/euler.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/dist/kl-activations.d.ts.map +1 -1
- package/dist/kl-activations.js +4 -3
- package/dist/kl-activations.js.map +1 -1
- package/dist/mat2x2-array.d.ts +36 -0
- package/dist/mat2x2-array.d.ts.map +1 -0
- package/dist/mat2x2-array.js +71 -0
- package/dist/mat2x2-array.js.map +1 -0
- package/dist/mat2x2-componentwise.d.ts +86 -0
- package/dist/mat2x2-componentwise.d.ts.map +1 -0
- package/dist/mat2x2-componentwise.js +199 -0
- package/dist/mat2x2-componentwise.js.map +1 -0
- package/dist/mat2x2.d.ts +67 -25
- package/dist/mat2x2.d.ts.map +1 -1
- package/dist/mat2x2.js +150 -94
- package/dist/mat2x2.js.map +1 -1
- package/dist/mat3x3-array.d.ts +36 -0
- package/dist/mat3x3-array.d.ts.map +1 -0
- package/dist/mat3x3-array.js +91 -0
- package/dist/mat3x3-array.js.map +1 -0
- package/dist/mat3x3-componentwise.d.ts +86 -0
- package/dist/mat3x3-componentwise.d.ts.map +1 -0
- package/dist/mat3x3-componentwise.js +299 -0
- package/dist/mat3x3-componentwise.js.map +1 -0
- package/dist/mat3x3.d.ts +131 -48
- package/dist/mat3x3.d.ts.map +1 -1
- package/dist/mat3x3.js +434 -193
- package/dist/mat3x3.js.map +1 -1
- package/dist/mat4x4-array.d.ts +46 -0
- package/dist/mat4x4-array.d.ts.map +1 -0
- package/dist/mat4x4-array.js +133 -0
- package/dist/mat4x4-array.js.map +1 -0
- package/dist/mat4x4-componentwise.d.ts +87 -0
- package/dist/mat4x4-componentwise.d.ts.map +1 -0
- package/dist/mat4x4-componentwise.js +434 -0
- package/dist/mat4x4-componentwise.js.map +1 -0
- package/dist/mat4x4.d.ts +195 -67
- package/dist/mat4x4.d.ts.map +1 -1
- package/dist/mat4x4.js +849 -335
- package/dist/mat4x4.js.map +1 -1
- package/dist/projection.d.ts +98 -0
- package/dist/projection.d.ts.map +1 -0
- package/dist/projection.js +369 -0
- package/dist/projection.js.map +1 -0
- package/dist/quaternion-array.d.ts +47 -0
- package/dist/quaternion-array.d.ts.map +1 -0
- package/dist/quaternion-array.js +86 -0
- package/dist/quaternion-array.js.map +1 -0
- package/dist/quaternion.d.ts +104 -22
- package/dist/quaternion.d.ts.map +1 -1
- package/dist/quaternion.js +294 -181
- package/dist/quaternion.js.map +1 -1
- package/dist/transform.d.ts +220 -0
- package/dist/transform.d.ts.map +1 -0
- package/dist/transform.js +412 -0
- package/dist/transform.js.map +1 -0
- package/dist/tridiagonal.d.ts +52 -0
- package/dist/tridiagonal.d.ts.map +1 -0
- package/dist/tridiagonal.js +90 -0
- package/dist/tridiagonal.js.map +1 -0
- package/dist/upload.d.ts +55 -0
- package/dist/upload.d.ts.map +1 -0
- package/dist/upload.js +129 -0
- package/dist/upload.js.map +1 -0
- package/dist/vec2-array-componentwise.d.ts +189 -0
- package/dist/vec2-array-componentwise.d.ts.map +1 -0
- package/dist/vec2-array-componentwise.js +424 -0
- package/dist/vec2-array-componentwise.js.map +1 -0
- package/dist/vec2-array.d.ts +53 -0
- package/dist/vec2-array.d.ts.map +1 -0
- package/dist/vec2-array.js +123 -0
- package/dist/vec2-array.js.map +1 -0
- package/dist/vec2-componentwise.d.ts +311 -0
- package/dist/vec2-componentwise.d.ts.map +1 -0
- package/dist/vec2-componentwise.js +542 -0
- package/dist/vec2-componentwise.js.map +1 -0
- package/dist/vec2.d.ts +97 -82
- package/dist/vec2.d.ts.map +1 -1
- package/dist/vec2.js +121 -216
- package/dist/vec2.js.map +1 -1
- package/dist/vec3-array-componentwise.d.ts +189 -0
- package/dist/vec3-array-componentwise.d.ts.map +1 -0
- package/dist/vec3-array-componentwise.js +458 -0
- package/dist/vec3-array-componentwise.js.map +1 -0
- package/dist/vec3-array.d.ts +102 -0
- package/dist/vec3-array.d.ts.map +1 -0
- package/dist/vec3-array.js +299 -0
- package/dist/vec3-array.js.map +1 -0
- package/dist/vec3-componentwise.d.ts +310 -0
- package/dist/vec3-componentwise.d.ts.map +1 -0
- package/dist/vec3-componentwise.js +594 -0
- package/dist/vec3-componentwise.js.map +1 -0
- package/dist/vec3.d.ts +177 -87
- package/dist/vec3.d.ts.map +1 -1
- package/dist/vec3.js +366 -273
- package/dist/vec3.js.map +1 -1
- package/dist/vec4-array-componentwise.d.ts +155 -0
- package/dist/vec4-array-componentwise.d.ts.map +1 -0
- package/dist/vec4-array-componentwise.js +401 -0
- package/dist/vec4-array-componentwise.js.map +1 -0
- package/dist/vec4-array.d.ts +12 -0
- package/dist/vec4-array.d.ts.map +1 -0
- package/dist/vec4-array.js +43 -0
- package/dist/vec4-array.js.map +1 -0
- package/dist/vec4-componentwise.d.ts +299 -0
- package/dist/vec4-componentwise.d.ts.map +1 -0
- package/dist/vec4-componentwise.js +637 -0
- package/dist/vec4-componentwise.js.map +1 -0
- package/dist/vec4.d.ts +57 -53
- package/dist/vec4.d.ts.map +1 -1
- package/dist/vec4.js +94 -246
- package/dist/vec4.js.map +1 -1
- package/dist/view-basis.d.ts +15 -0
- package/dist/view-basis.d.ts.map +1 -0
- package/dist/view-basis.js +29 -0
- package/dist/view-basis.js.map +1 -0
- package/dist/viewport.d.ts +114 -0
- package/dist/viewport.d.ts.map +1 -0
- package/dist/viewport.js +250 -0
- package/dist/viewport.js.map +1 -0
- package/package.json +18 -9
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { type ReadonlyQuaternion } from "@ac-kit/math-complex";
|
|
2
|
+
import type { Brand_ } from "./_brand.js";
|
|
3
|
+
import type { Affine2, ReadonlyAffine2 } from "./affine2.js";
|
|
4
|
+
import { type Affine3, type ReadonlyAffine3 } from "./affine3.js";
|
|
5
|
+
import type { ReadonlyVec3 } from "./vec3.js";
|
|
6
|
+
/**
|
|
7
|
+
* A 2D translate-rotate-scale record, `[tx, ty, angle, sx, sy]`: the
|
|
8
|
+
* translation, the rotation in radians counter-clockwise, and the scale along
|
|
9
|
+
* the rotated axes, applied as translate · rotate · scale. The form of a glTF
|
|
10
|
+
* node and of an animation key. A plain array of five binary64 numbers carrying
|
|
11
|
+
* a type-level brand; composition and inversion go through the affine
|
|
12
|
+
* transform, as a record is not closed under them when the scale is not
|
|
13
|
+
* uniform.
|
|
14
|
+
*
|
|
15
|
+
* Only {@link transform2Create}, {@link transform2Of}, {@link transform2Clone},
|
|
16
|
+
* {@link transform2FromArray} and the functions that write an `out` make one;
|
|
17
|
+
* see {@link Vec3} for the rules that bind callers who bypass the types.
|
|
18
|
+
*/
|
|
19
|
+
export type Transform2 = [
|
|
20
|
+
tx: number,
|
|
21
|
+
ty: number,
|
|
22
|
+
angle: number,
|
|
23
|
+
sx: number,
|
|
24
|
+
sy: number
|
|
25
|
+
] & Brand_<"Transform2">;
|
|
26
|
+
/** A {@link Transform2} that is only read. */
|
|
27
|
+
export type ReadonlyTransform2 = readonly [
|
|
28
|
+
tx: number,
|
|
29
|
+
ty: number,
|
|
30
|
+
angle: number,
|
|
31
|
+
sx: number,
|
|
32
|
+
sy: number
|
|
33
|
+
] & Brand_<"Transform2">;
|
|
34
|
+
/**
|
|
35
|
+
* A 3D translate-rotate-scale record, `[tx, ty, tz, qx, qy, qz, qw, sx, sy,
|
|
36
|
+
* sz]`: the translation, the rotation as a unit quaternion `[x, y, z, w]`, and
|
|
37
|
+
* the scale along the rotated axes, applied as translate · rotate · scale. The
|
|
38
|
+
* form of a glTF node and of an animation key. A plain array of ten binary64
|
|
39
|
+
* numbers carrying a type-level brand; composition and inversion go through the
|
|
40
|
+
* affine transform, as a record is not closed under them when the scale is not
|
|
41
|
+
* uniform.
|
|
42
|
+
*
|
|
43
|
+
* Only {@link transform3Create}, {@link transform3Of}, {@link transform3Clone},
|
|
44
|
+
* {@link transform3FromArray} and the functions that write an `out` make one;
|
|
45
|
+
* see {@link Vec3} for the rules that bind callers who bypass the types.
|
|
46
|
+
*/
|
|
47
|
+
export type Transform3 = [
|
|
48
|
+
tx: number,
|
|
49
|
+
ty: number,
|
|
50
|
+
tz: number,
|
|
51
|
+
qx: number,
|
|
52
|
+
qy: number,
|
|
53
|
+
qz: number,
|
|
54
|
+
qw: number,
|
|
55
|
+
sx: number,
|
|
56
|
+
sy: number,
|
|
57
|
+
sz: number
|
|
58
|
+
] & Brand_<"Transform3">;
|
|
59
|
+
/** A {@link Transform3} that is only read. */
|
|
60
|
+
export type ReadonlyTransform3 = readonly [
|
|
61
|
+
tx: number,
|
|
62
|
+
ty: number,
|
|
63
|
+
tz: number,
|
|
64
|
+
qx: number,
|
|
65
|
+
qy: number,
|
|
66
|
+
qz: number,
|
|
67
|
+
qw: number,
|
|
68
|
+
sx: number,
|
|
69
|
+
sy: number,
|
|
70
|
+
sz: number
|
|
71
|
+
] & Brand_<"Transform3">;
|
|
72
|
+
/**
|
|
73
|
+
* Creates the identity record `[0, 0, 0, 1, 1]`: no translation, no rotation,
|
|
74
|
+
* unit scale.
|
|
75
|
+
*
|
|
76
|
+
* Allocates; keep it out of hot loops.
|
|
77
|
+
*/
|
|
78
|
+
export declare function transform2Create(): Transform2;
|
|
79
|
+
/**
|
|
80
|
+
* Creates the record with the translation `[tx, ty]`, the rotation `angle` in
|
|
81
|
+
* radians and the scale `[sx, sy]`.
|
|
82
|
+
*
|
|
83
|
+
* Allocates; keep it out of hot loops.
|
|
84
|
+
*/
|
|
85
|
+
export declare function transform2Of(tx: number, ty: number, angle: number, sx: number, sy: number): Transform2;
|
|
86
|
+
/**
|
|
87
|
+
* Creates a copy of `transform`. Like every creator it starts from a clean
|
|
88
|
+
* array.
|
|
89
|
+
*
|
|
90
|
+
* Allocates; keep it out of hot loops.
|
|
91
|
+
*/
|
|
92
|
+
export declare function transform2Clone(transform: ReadonlyTransform2): Transform2;
|
|
93
|
+
/**
|
|
94
|
+
* The checked way in from untyped data (JSON, messages, arrays of unknown
|
|
95
|
+
* origin): `source[offset … offset + 5)` copied into `out`, each element that
|
|
96
|
+
* is not a number written as `NaN`, an index past the end of `source` too, so
|
|
97
|
+
* `out` never holds a non-number. A cold path. O(1).
|
|
98
|
+
*
|
|
99
|
+
* `source` may be `out` itself: the five elements are read before the first
|
|
100
|
+
* write.
|
|
101
|
+
*
|
|
102
|
+
* @param out The record to fill.
|
|
103
|
+
* @param source The array to read, of any length and any content.
|
|
104
|
+
* @param offset The index of the first entry in `source`.
|
|
105
|
+
* @returns `out`.
|
|
106
|
+
*/
|
|
107
|
+
export declare function transform2FromArray(out: Transform2, source: ArrayLike<number>, offset?: number): Transform2;
|
|
108
|
+
/**
|
|
109
|
+
* Whether every entry is a finite number: the check to run after parsing
|
|
110
|
+
* untrusted data or before an upload, as operations never check. An entry that
|
|
111
|
+
* is not a number at all counts as not finite.
|
|
112
|
+
*/
|
|
113
|
+
export declare function transform2IsFinite(transform: ReadonlyTransform2): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Creates the identity record: no translation, the identity rotation `[0, 0, 0,
|
|
116
|
+
* 1]`, unit scale.
|
|
117
|
+
*
|
|
118
|
+
* Allocates; keep it out of hot loops.
|
|
119
|
+
*/
|
|
120
|
+
export declare function transform3Create(): Transform3;
|
|
121
|
+
/**
|
|
122
|
+
* Creates a record from its three parts, copying them: the translation, the
|
|
123
|
+
* rotation (a unit quaternion, not normalised here) and the scale along the
|
|
124
|
+
* rotated axes.
|
|
125
|
+
*
|
|
126
|
+
* Allocates; keep it out of hot loops.
|
|
127
|
+
*/
|
|
128
|
+
export declare function transform3Of(translation: ReadonlyVec3, rotation: ReadonlyQuaternion, scale: ReadonlyVec3): Transform3;
|
|
129
|
+
/**
|
|
130
|
+
* Creates a copy of `transform`. Like every creator it starts from a clean
|
|
131
|
+
* array.
|
|
132
|
+
*
|
|
133
|
+
* Allocates; keep it out of hot loops.
|
|
134
|
+
*/
|
|
135
|
+
export declare function transform3Clone(transform: ReadonlyTransform3): Transform3;
|
|
136
|
+
/**
|
|
137
|
+
* The checked way in from untyped data (JSON, messages, arrays of unknown
|
|
138
|
+
* origin): `source[offset … offset + 10)` copied into `out`, each element that
|
|
139
|
+
* is not a number written as `NaN`, an index past the end of `source` too, so
|
|
140
|
+
* `out` never holds a non-number. A cold path. O(1).
|
|
141
|
+
*
|
|
142
|
+
* `source` may be `out` itself: the ten elements are read before the first
|
|
143
|
+
* write.
|
|
144
|
+
*
|
|
145
|
+
* @param out The record to fill.
|
|
146
|
+
* @param source The array to read, of any length and any content.
|
|
147
|
+
* @param offset The index of the first entry in `source`.
|
|
148
|
+
* @returns `out`.
|
|
149
|
+
*/
|
|
150
|
+
export declare function transform3FromArray(out: Transform3, source: ArrayLike<number>, offset?: number): Transform3;
|
|
151
|
+
/**
|
|
152
|
+
* Whether every entry is a finite number: the check to run after parsing
|
|
153
|
+
* untrusted data or before an upload, as operations never check. An entry that
|
|
154
|
+
* is not a number at all counts as not finite.
|
|
155
|
+
*/
|
|
156
|
+
export declare function transform3IsFinite(transform: ReadonlyTransform3): boolean;
|
|
157
|
+
/** Writes the identity record `[0, 0, 0, 1, 1]` into `out`. */
|
|
158
|
+
export declare function transform2Identity(out: Transform2): Transform2;
|
|
159
|
+
/**
|
|
160
|
+
* Writes the interpolation from `a` to `b` into `out`: the translation and the
|
|
161
|
+
* scale linearly (`@ac-kit/math-scalar`'s `lerp`, but exactly `a` at `t = 0`
|
|
162
|
+
* and exactly `b` at `t = 1`, which `lerp` is not where `a` and `b` differ
|
|
163
|
+
* greatly in magnitude: a translation of `1e16` to `1` would end at `0`), the
|
|
164
|
+
* angle along the shorter arc (`angleLerpRad`, the result in `(−π, π]`), so a
|
|
165
|
+
* key at 350° and one at 10° meet at 0°; at `t = 0` and `t = 1` the angle is
|
|
166
|
+
* that of `a` and of `b`, normalised. A `t` outside `[0, 1]` extrapolates.
|
|
167
|
+
* `out` may be `a` or `b`.
|
|
168
|
+
*/
|
|
169
|
+
export declare function transform2Lerp(out: Transform2, a: ReadonlyTransform2, b: ReadonlyTransform2, t: number): Transform2;
|
|
170
|
+
/**
|
|
171
|
+
* Writes the affine transform `T · R · S` of `transform` into `out`: the scale
|
|
172
|
+
* first, then the rotation, then the translation.
|
|
173
|
+
*/
|
|
174
|
+
export declare function affine2FromTransform2(out: Affine2, transform: ReadonlyTransform2): Affine2;
|
|
175
|
+
/**
|
|
176
|
+
* Splits the affine transform `a` into the translation, rotation and scale that
|
|
177
|
+
* {@link affine2FromTransform2} composes it from: the translation is the last
|
|
178
|
+
* column, the angle is that of the first column (in `(−π, π]`), the x scale is
|
|
179
|
+
* its length and the y scale is the length of the second, negative for a
|
|
180
|
+
* reflection.
|
|
181
|
+
*
|
|
182
|
+
* Returns `false` when there is no such split: a column of zero length or not
|
|
183
|
+
* finite, the two columns further from perpendicular than about `1e-6` in
|
|
184
|
+
* cosine (a shear), or a translation that is not finite. `out` then holds
|
|
185
|
+
* `NaN`, never a stale or partial record, and nothing throws.
|
|
186
|
+
*/
|
|
187
|
+
export declare function transform2FromAffine2(out: Transform2, a: ReadonlyAffine2): boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Writes the identity record into `out`: no translation, the identity rotation,
|
|
190
|
+
* unit scale.
|
|
191
|
+
*/
|
|
192
|
+
export declare function transform3Identity(out: Transform3): Transform3;
|
|
193
|
+
/**
|
|
194
|
+
* Writes the interpolation from `a` to `b` into `out`: the translation and the
|
|
195
|
+
* scale linearly (`@ac-kit/math-scalar`'s `lerp`, but exactly `a` at `t = 0`
|
|
196
|
+
* and exactly `b` at `t = 1`, which `lerp` is not where `a` and `b` differ
|
|
197
|
+
* greatly in magnitude: a translation of `1e16` to `1` would end at `0`), the
|
|
198
|
+
* rotation by {@link quaternionSlerp} along the shorter arc (the quaternions
|
|
199
|
+
* must be unit length). A `t` outside `[0, 1]` extrapolates. `out` may be `a`
|
|
200
|
+
* or `b`.
|
|
201
|
+
*/
|
|
202
|
+
export declare function transform3Lerp(out: Transform3, a: ReadonlyTransform3, b: ReadonlyTransform3, t: number): Transform3;
|
|
203
|
+
/**
|
|
204
|
+
* Writes the affine transform `T · R · S` of `transform` into `out`:
|
|
205
|
+
* {@link affine3Compose} of its three parts, the rotation a unit quaternion.
|
|
206
|
+
*/
|
|
207
|
+
export declare function affine3FromTransform3(out: Affine3, transform: ReadonlyTransform3): Affine3;
|
|
208
|
+
/**
|
|
209
|
+
* Splits the affine transform `a` into the record that
|
|
210
|
+
* {@link affine3FromTransform3} composes it from, by {@link affine3Decompose}:
|
|
211
|
+
* the translation is the last column, the scale the length of each of the
|
|
212
|
+
* others (the x scale negative for a reflection) and the rotation their unit
|
|
213
|
+
* quaternion.
|
|
214
|
+
*
|
|
215
|
+
* Returns `false` when there is no such split (a column of zero length or not
|
|
216
|
+
* finite, a shear, a translation that is not finite): `out` then holds `NaN`,
|
|
217
|
+
* never a stale or partial record, and nothing throws.
|
|
218
|
+
*/
|
|
219
|
+
export declare function transform3FromAffine3(out: Transform3, a: ReadonlyAffine3): boolean;
|
|
220
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,KAAK,kBAAkB,EACvB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EACN,KAAK,OAAO,EAGZ,KAAK,eAAe,EACpB,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAAG;IACx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EACf,CAAC,EAAE,eAAe,GAChB,OAAO,CAyCT;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAY9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC7B,GAAG,EAAE,UAAU,EACf,CAAC,EAAE,kBAAkB,EACrB,CAAC,EAAE,kBAAkB,EACrB,CAAC,EAAE,MAAM,GACP,UAAU,CAeZ;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACpC,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,kBAAkB,GAC3B,OAAO,CAWT;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACpC,GAAG,EAAE,UAAU,EACf,CAAC,EAAE,eAAe,GAChB,OAAO,CAkBT"}
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { numberAtOrNaN } from "@ac-kit/core";
|
|
2
|
+
import { quaternionCreate, quaternionSet, } from "@ac-kit/math-complex";
|
|
3
|
+
import { angleLerpRad, lerp } from "@ac-kit/math-scalar";
|
|
4
|
+
import { SHEAR_TOLERANCE_ } from "./_trs.js";
|
|
5
|
+
import { affine3Compose, affine3Decompose, } from "./affine3.js";
|
|
6
|
+
import { quaternionSlerp } from "./quaternion.js";
|
|
7
|
+
import { vec2Create, vec2LengthScaled, vec2NormalizeScaled, vec2Set, } from "./vec2-componentwise.js";
|
|
8
|
+
import { vec3Create, vec3Set } from "./vec3-componentwise.js";
|
|
9
|
+
/**
|
|
10
|
+
* Every creator copies one of these arrays, which hold non-integer doubles and
|
|
11
|
+
* are never exposed: nothing a caller does can change the element kind they
|
|
12
|
+
* copy.
|
|
13
|
+
*/
|
|
14
|
+
const TEMPLATE_2_ = [0.5, 0.5, 0.5, 0.5, 0.5];
|
|
15
|
+
const TEMPLATE_3_ = [
|
|
16
|
+
0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Scratch for the 3D conversions and {@link transform3Lerp}: one call at a time,
|
|
20
|
+
* no callback inside it.
|
|
21
|
+
*/
|
|
22
|
+
const FROM_ROTATION_ = quaternionCreate();
|
|
23
|
+
const TO_ROTATION_ = quaternionCreate();
|
|
24
|
+
const MIDDLE_ROTATION_ = quaternionCreate();
|
|
25
|
+
const PART_TRANSLATION_ = vec3Create();
|
|
26
|
+
const PART_SCALE_ = vec3Create();
|
|
27
|
+
/** The two columns of a 2D affine in {@link transform2FromAffine2}. */
|
|
28
|
+
const COLUMN_X_ = vec2Create();
|
|
29
|
+
const COLUMN_Y_ = vec2Create();
|
|
30
|
+
/**
|
|
31
|
+
* `lerp`, exact at the ends: `a` at `t = 0` and `b` at `t = 1`, whatever `a`
|
|
32
|
+
* and `b`.
|
|
33
|
+
*/
|
|
34
|
+
function lerpExact_(a, b, t) {
|
|
35
|
+
if (t === 0) {
|
|
36
|
+
return a;
|
|
37
|
+
}
|
|
38
|
+
return t === 1 ? b : lerp(a, b, t);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates the identity record `[0, 0, 0, 1, 1]`: no translation, no rotation,
|
|
42
|
+
* unit scale.
|
|
43
|
+
*
|
|
44
|
+
* Allocates; keep it out of hot loops.
|
|
45
|
+
*/
|
|
46
|
+
export function transform2Create() {
|
|
47
|
+
const out = TEMPLATE_2_.slice();
|
|
48
|
+
out[0] = 0;
|
|
49
|
+
out[1] = 0;
|
|
50
|
+
out[2] = 0;
|
|
51
|
+
out[3] = 1;
|
|
52
|
+
out[4] = 1;
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Creates the record with the translation `[tx, ty]`, the rotation `angle` in
|
|
57
|
+
* radians and the scale `[sx, sy]`.
|
|
58
|
+
*
|
|
59
|
+
* Allocates; keep it out of hot loops.
|
|
60
|
+
*/
|
|
61
|
+
export function transform2Of(tx, ty, angle, sx, sy) {
|
|
62
|
+
const out = TEMPLATE_2_.slice();
|
|
63
|
+
out[0] = tx;
|
|
64
|
+
out[1] = ty;
|
|
65
|
+
out[2] = angle;
|
|
66
|
+
out[3] = sx;
|
|
67
|
+
out[4] = sy;
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Creates a copy of `transform`. Like every creator it starts from a clean
|
|
72
|
+
* array.
|
|
73
|
+
*
|
|
74
|
+
* Allocates; keep it out of hot loops.
|
|
75
|
+
*/
|
|
76
|
+
export function transform2Clone(transform) {
|
|
77
|
+
const out = TEMPLATE_2_.slice();
|
|
78
|
+
out[0] = transform[0];
|
|
79
|
+
out[1] = transform[1];
|
|
80
|
+
out[2] = transform[2];
|
|
81
|
+
out[3] = transform[3];
|
|
82
|
+
out[4] = transform[4];
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The checked way in from untyped data (JSON, messages, arrays of unknown
|
|
87
|
+
* origin): `source[offset … offset + 5)` copied into `out`, each element that
|
|
88
|
+
* is not a number written as `NaN`, an index past the end of `source` too, so
|
|
89
|
+
* `out` never holds a non-number. A cold path. O(1).
|
|
90
|
+
*
|
|
91
|
+
* `source` may be `out` itself: the five elements are read before the first
|
|
92
|
+
* write.
|
|
93
|
+
*
|
|
94
|
+
* @param out The record to fill.
|
|
95
|
+
* @param source The array to read, of any length and any content.
|
|
96
|
+
* @param offset The index of the first entry in `source`.
|
|
97
|
+
* @returns `out`.
|
|
98
|
+
*/
|
|
99
|
+
export function transform2FromArray(out, source, offset = 0) {
|
|
100
|
+
const tx = numberAtOrNaN(source, offset);
|
|
101
|
+
const ty = numberAtOrNaN(source, offset + 1);
|
|
102
|
+
const angle = numberAtOrNaN(source, offset + 2);
|
|
103
|
+
const sx = numberAtOrNaN(source, offset + 3);
|
|
104
|
+
const sy = numberAtOrNaN(source, offset + 4);
|
|
105
|
+
out[0] = tx;
|
|
106
|
+
out[1] = ty;
|
|
107
|
+
out[2] = angle;
|
|
108
|
+
out[3] = sx;
|
|
109
|
+
out[4] = sy;
|
|
110
|
+
return out;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Whether every entry is a finite number: the check to run after parsing
|
|
114
|
+
* untrusted data or before an upload, as operations never check. An entry that
|
|
115
|
+
* is not a number at all counts as not finite.
|
|
116
|
+
*/
|
|
117
|
+
export function transform2IsFinite(transform) {
|
|
118
|
+
return (Number.isFinite(transform[0]) &&
|
|
119
|
+
Number.isFinite(transform[1]) &&
|
|
120
|
+
Number.isFinite(transform[2]) &&
|
|
121
|
+
Number.isFinite(transform[3]) &&
|
|
122
|
+
Number.isFinite(transform[4]));
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Creates the identity record: no translation, the identity rotation `[0, 0, 0,
|
|
126
|
+
* 1]`, unit scale.
|
|
127
|
+
*
|
|
128
|
+
* Allocates; keep it out of hot loops.
|
|
129
|
+
*/
|
|
130
|
+
export function transform3Create() {
|
|
131
|
+
const out = TEMPLATE_3_.slice();
|
|
132
|
+
out[0] = 0;
|
|
133
|
+
out[1] = 0;
|
|
134
|
+
out[2] = 0;
|
|
135
|
+
out[3] = 0;
|
|
136
|
+
out[4] = 0;
|
|
137
|
+
out[5] = 0;
|
|
138
|
+
out[6] = 1;
|
|
139
|
+
out[7] = 1;
|
|
140
|
+
out[8] = 1;
|
|
141
|
+
out[9] = 1;
|
|
142
|
+
return out;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Creates a record from its three parts, copying them: the translation, the
|
|
146
|
+
* rotation (a unit quaternion, not normalised here) and the scale along the
|
|
147
|
+
* rotated axes.
|
|
148
|
+
*
|
|
149
|
+
* Allocates; keep it out of hot loops.
|
|
150
|
+
*/
|
|
151
|
+
export function transform3Of(translation, rotation, scale) {
|
|
152
|
+
const out = TEMPLATE_3_.slice();
|
|
153
|
+
out[0] = translation[0];
|
|
154
|
+
out[1] = translation[1];
|
|
155
|
+
out[2] = translation[2];
|
|
156
|
+
out[3] = rotation[0];
|
|
157
|
+
out[4] = rotation[1];
|
|
158
|
+
out[5] = rotation[2];
|
|
159
|
+
out[6] = rotation[3];
|
|
160
|
+
out[7] = scale[0];
|
|
161
|
+
out[8] = scale[1];
|
|
162
|
+
out[9] = scale[2];
|
|
163
|
+
return out;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Creates a copy of `transform`. Like every creator it starts from a clean
|
|
167
|
+
* array.
|
|
168
|
+
*
|
|
169
|
+
* Allocates; keep it out of hot loops.
|
|
170
|
+
*/
|
|
171
|
+
export function transform3Clone(transform) {
|
|
172
|
+
const out = TEMPLATE_3_.slice();
|
|
173
|
+
out[0] = transform[0];
|
|
174
|
+
out[1] = transform[1];
|
|
175
|
+
out[2] = transform[2];
|
|
176
|
+
out[3] = transform[3];
|
|
177
|
+
out[4] = transform[4];
|
|
178
|
+
out[5] = transform[5];
|
|
179
|
+
out[6] = transform[6];
|
|
180
|
+
out[7] = transform[7];
|
|
181
|
+
out[8] = transform[8];
|
|
182
|
+
out[9] = transform[9];
|
|
183
|
+
return out;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* The checked way in from untyped data (JSON, messages, arrays of unknown
|
|
187
|
+
* origin): `source[offset … offset + 10)` copied into `out`, each element that
|
|
188
|
+
* is not a number written as `NaN`, an index past the end of `source` too, so
|
|
189
|
+
* `out` never holds a non-number. A cold path. O(1).
|
|
190
|
+
*
|
|
191
|
+
* `source` may be `out` itself: the ten elements are read before the first
|
|
192
|
+
* write.
|
|
193
|
+
*
|
|
194
|
+
* @param out The record to fill.
|
|
195
|
+
* @param source The array to read, of any length and any content.
|
|
196
|
+
* @param offset The index of the first entry in `source`.
|
|
197
|
+
* @returns `out`.
|
|
198
|
+
*/
|
|
199
|
+
export function transform3FromArray(out, source, offset = 0) {
|
|
200
|
+
const tx = numberAtOrNaN(source, offset);
|
|
201
|
+
const ty = numberAtOrNaN(source, offset + 1);
|
|
202
|
+
const tz = numberAtOrNaN(source, offset + 2);
|
|
203
|
+
const qx = numberAtOrNaN(source, offset + 3);
|
|
204
|
+
const qy = numberAtOrNaN(source, offset + 4);
|
|
205
|
+
const qz = numberAtOrNaN(source, offset + 5);
|
|
206
|
+
const qw = numberAtOrNaN(source, offset + 6);
|
|
207
|
+
const sx = numberAtOrNaN(source, offset + 7);
|
|
208
|
+
const sy = numberAtOrNaN(source, offset + 8);
|
|
209
|
+
const sz = numberAtOrNaN(source, offset + 9);
|
|
210
|
+
out[0] = tx;
|
|
211
|
+
out[1] = ty;
|
|
212
|
+
out[2] = tz;
|
|
213
|
+
out[3] = qx;
|
|
214
|
+
out[4] = qy;
|
|
215
|
+
out[5] = qz;
|
|
216
|
+
out[6] = qw;
|
|
217
|
+
out[7] = sx;
|
|
218
|
+
out[8] = sy;
|
|
219
|
+
out[9] = sz;
|
|
220
|
+
return out;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Whether every entry is a finite number: the check to run after parsing
|
|
224
|
+
* untrusted data or before an upload, as operations never check. An entry that
|
|
225
|
+
* is not a number at all counts as not finite.
|
|
226
|
+
*/
|
|
227
|
+
export function transform3IsFinite(transform) {
|
|
228
|
+
return (Number.isFinite(transform[0]) &&
|
|
229
|
+
Number.isFinite(transform[1]) &&
|
|
230
|
+
Number.isFinite(transform[2]) &&
|
|
231
|
+
Number.isFinite(transform[3]) &&
|
|
232
|
+
Number.isFinite(transform[4]) &&
|
|
233
|
+
Number.isFinite(transform[5]) &&
|
|
234
|
+
Number.isFinite(transform[6]) &&
|
|
235
|
+
Number.isFinite(transform[7]) &&
|
|
236
|
+
Number.isFinite(transform[8]) &&
|
|
237
|
+
Number.isFinite(transform[9]));
|
|
238
|
+
}
|
|
239
|
+
/** Writes the identity record `[0, 0, 0, 1, 1]` into `out`. */
|
|
240
|
+
export function transform2Identity(out) {
|
|
241
|
+
out[0] = 0;
|
|
242
|
+
out[1] = 0;
|
|
243
|
+
out[2] = 0;
|
|
244
|
+
out[3] = 1;
|
|
245
|
+
out[4] = 1;
|
|
246
|
+
return out;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Writes the interpolation from `a` to `b` into `out`: the translation and the
|
|
250
|
+
* scale linearly (`@ac-kit/math-scalar`'s `lerp`, but exactly `a` at `t = 0`
|
|
251
|
+
* and exactly `b` at `t = 1`, which `lerp` is not where `a` and `b` differ
|
|
252
|
+
* greatly in magnitude: a translation of `1e16` to `1` would end at `0`), the
|
|
253
|
+
* angle along the shorter arc (`angleLerpRad`, the result in `(−π, π]`), so a
|
|
254
|
+
* key at 350° and one at 10° meet at 0°; at `t = 0` and `t = 1` the angle is
|
|
255
|
+
* that of `a` and of `b`, normalised. A `t` outside `[0, 1]` extrapolates.
|
|
256
|
+
* `out` may be `a` or `b`.
|
|
257
|
+
*/
|
|
258
|
+
export function transform2Lerp(out, a, b, t) {
|
|
259
|
+
out[0] = lerpExact_(a[0], b[0], t);
|
|
260
|
+
out[1] = lerpExact_(a[1], b[1], t);
|
|
261
|
+
out[2] = angleLerpRad(a[2], b[2], t);
|
|
262
|
+
out[3] = lerpExact_(a[3], b[3], t);
|
|
263
|
+
out[4] = lerpExact_(a[4], b[4], t);
|
|
264
|
+
return out;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Writes the affine transform `T · R · S` of `transform` into `out`: the scale
|
|
268
|
+
* first, then the rotation, then the translation.
|
|
269
|
+
*/
|
|
270
|
+
export function affine2FromTransform2(out, transform) {
|
|
271
|
+
const cos = Math.cos(transform[2]);
|
|
272
|
+
const sin = Math.sin(transform[2]);
|
|
273
|
+
const sx = transform[3];
|
|
274
|
+
const sy = transform[4];
|
|
275
|
+
out[0] = cos * sx;
|
|
276
|
+
out[1] = sin * sx;
|
|
277
|
+
out[2] = -sin * sy;
|
|
278
|
+
out[3] = cos * sy;
|
|
279
|
+
out[4] = transform[0];
|
|
280
|
+
out[5] = transform[1];
|
|
281
|
+
return out;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Splits the affine transform `a` into the translation, rotation and scale that
|
|
285
|
+
* {@link affine2FromTransform2} composes it from: the translation is the last
|
|
286
|
+
* column, the angle is that of the first column (in `(−π, π]`), the x scale is
|
|
287
|
+
* its length and the y scale is the length of the second, negative for a
|
|
288
|
+
* reflection.
|
|
289
|
+
*
|
|
290
|
+
* Returns `false` when there is no such split: a column of zero length or not
|
|
291
|
+
* finite, the two columns further from perpendicular than about `1e-6` in
|
|
292
|
+
* cosine (a shear), or a translation that is not finite. `out` then holds
|
|
293
|
+
* `NaN`, never a stale or partial record, and nothing throws.
|
|
294
|
+
*/
|
|
295
|
+
export function transform2FromAffine2(out, a) {
|
|
296
|
+
const a0 = a[0];
|
|
297
|
+
const a1 = a[1];
|
|
298
|
+
const a2 = a[2];
|
|
299
|
+
const a3 = a[3];
|
|
300
|
+
const x = a[4];
|
|
301
|
+
const y = a[5];
|
|
302
|
+
const lengthX = vec2LengthScaled(vec2Set(COLUMN_X_, a0, a1));
|
|
303
|
+
const lengthY = vec2LengthScaled(vec2Set(COLUMN_Y_, a2, a3));
|
|
304
|
+
// The unit columns come from the scaled normalisation, not from dividing by
|
|
305
|
+
// the rounded length: a column of subnormal numbers has a length that rounds
|
|
306
|
+
// to a coarse multiple of the smallest one.
|
|
307
|
+
vec2NormalizeScaled(COLUMN_X_, COLUMN_X_);
|
|
308
|
+
vec2NormalizeScaled(COLUMN_Y_, COLUMN_Y_);
|
|
309
|
+
const ux = COLUMN_X_[0];
|
|
310
|
+
const uy = COLUMN_X_[1];
|
|
311
|
+
const vx = COLUMN_Y_[0];
|
|
312
|
+
const vy = COLUMN_Y_[1];
|
|
313
|
+
if (lengthX > 0 &&
|
|
314
|
+
lengthY > 0 &&
|
|
315
|
+
lengthX < Infinity &&
|
|
316
|
+
lengthY < Infinity &&
|
|
317
|
+
Number.isFinite(x) &&
|
|
318
|
+
Number.isFinite(y) &&
|
|
319
|
+
Math.abs(ux * vx + uy * vy) <= SHEAR_TOLERANCE_) {
|
|
320
|
+
out[0] = x;
|
|
321
|
+
out[1] = y;
|
|
322
|
+
// Adding zero turns −0 into +0, so a half turn is π and not −π.
|
|
323
|
+
out[2] = Math.atan2(a1 + 0, a0);
|
|
324
|
+
out[3] = lengthX;
|
|
325
|
+
out[4] = ux * vy - uy * vx < 0 ? -lengthY : lengthY;
|
|
326
|
+
return true;
|
|
327
|
+
}
|
|
328
|
+
out[0] = Number.NaN;
|
|
329
|
+
out[1] = Number.NaN;
|
|
330
|
+
out[2] = Number.NaN;
|
|
331
|
+
out[3] = Number.NaN;
|
|
332
|
+
out[4] = Number.NaN;
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Writes the identity record into `out`: no translation, the identity rotation,
|
|
337
|
+
* unit scale.
|
|
338
|
+
*/
|
|
339
|
+
export function transform3Identity(out) {
|
|
340
|
+
out[0] = 0;
|
|
341
|
+
out[1] = 0;
|
|
342
|
+
out[2] = 0;
|
|
343
|
+
out[3] = 0;
|
|
344
|
+
out[4] = 0;
|
|
345
|
+
out[5] = 0;
|
|
346
|
+
out[6] = 1;
|
|
347
|
+
out[7] = 1;
|
|
348
|
+
out[8] = 1;
|
|
349
|
+
out[9] = 1;
|
|
350
|
+
return out;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Writes the interpolation from `a` to `b` into `out`: the translation and the
|
|
354
|
+
* scale linearly (`@ac-kit/math-scalar`'s `lerp`, but exactly `a` at `t = 0`
|
|
355
|
+
* and exactly `b` at `t = 1`, which `lerp` is not where `a` and `b` differ
|
|
356
|
+
* greatly in magnitude: a translation of `1e16` to `1` would end at `0`), the
|
|
357
|
+
* rotation by {@link quaternionSlerp} along the shorter arc (the quaternions
|
|
358
|
+
* must be unit length). A `t` outside `[0, 1]` extrapolates. `out` may be `a`
|
|
359
|
+
* or `b`.
|
|
360
|
+
*/
|
|
361
|
+
export function transform3Lerp(out, a, b, t) {
|
|
362
|
+
quaternionSet(FROM_ROTATION_, a[3], a[4], a[5], a[6]);
|
|
363
|
+
quaternionSet(TO_ROTATION_, b[3], b[4], b[5], b[6]);
|
|
364
|
+
quaternionSlerp(MIDDLE_ROTATION_, FROM_ROTATION_, TO_ROTATION_, t);
|
|
365
|
+
out[0] = lerpExact_(a[0], b[0], t);
|
|
366
|
+
out[1] = lerpExact_(a[1], b[1], t);
|
|
367
|
+
out[2] = lerpExact_(a[2], b[2], t);
|
|
368
|
+
out[3] = MIDDLE_ROTATION_[0];
|
|
369
|
+
out[4] = MIDDLE_ROTATION_[1];
|
|
370
|
+
out[5] = MIDDLE_ROTATION_[2];
|
|
371
|
+
out[6] = MIDDLE_ROTATION_[3];
|
|
372
|
+
out[7] = lerpExact_(a[7], b[7], t);
|
|
373
|
+
out[8] = lerpExact_(a[8], b[8], t);
|
|
374
|
+
out[9] = lerpExact_(a[9], b[9], t);
|
|
375
|
+
return out;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Writes the affine transform `T · R · S` of `transform` into `out`:
|
|
379
|
+
* {@link affine3Compose} of its three parts, the rotation a unit quaternion.
|
|
380
|
+
*/
|
|
381
|
+
export function affine3FromTransform3(out, transform) {
|
|
382
|
+
vec3Set(PART_TRANSLATION_, transform[0], transform[1], transform[2]);
|
|
383
|
+
quaternionSet(FROM_ROTATION_, transform[3], transform[4], transform[5], transform[6]);
|
|
384
|
+
vec3Set(PART_SCALE_, transform[7], transform[8], transform[9]);
|
|
385
|
+
return affine3Compose(out, PART_TRANSLATION_, FROM_ROTATION_, PART_SCALE_);
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Splits the affine transform `a` into the record that
|
|
389
|
+
* {@link affine3FromTransform3} composes it from, by {@link affine3Decompose}:
|
|
390
|
+
* the translation is the last column, the scale the length of each of the
|
|
391
|
+
* others (the x scale negative for a reflection) and the rotation their unit
|
|
392
|
+
* quaternion.
|
|
393
|
+
*
|
|
394
|
+
* Returns `false` when there is no such split (a column of zero length or not
|
|
395
|
+
* finite, a shear, a translation that is not finite): `out` then holds `NaN`,
|
|
396
|
+
* never a stale or partial record, and nothing throws.
|
|
397
|
+
*/
|
|
398
|
+
export function transform3FromAffine3(out, a) {
|
|
399
|
+
const split = affine3Decompose(PART_TRANSLATION_, FROM_ROTATION_, PART_SCALE_, a);
|
|
400
|
+
out[0] = PART_TRANSLATION_[0];
|
|
401
|
+
out[1] = PART_TRANSLATION_[1];
|
|
402
|
+
out[2] = PART_TRANSLATION_[2];
|
|
403
|
+
out[3] = FROM_ROTATION_[0];
|
|
404
|
+
out[4] = FROM_ROTATION_[1];
|
|
405
|
+
out[5] = FROM_ROTATION_[2];
|
|
406
|
+
out[6] = FROM_ROTATION_[3];
|
|
407
|
+
out[7] = PART_SCALE_[0];
|
|
408
|
+
out[8] = PART_SCALE_[1];
|
|
409
|
+
out[9] = PART_SCALE_[2];
|
|
410
|
+
return split;
|
|
411
|
+
}
|
|
412
|
+
//# sourceMappingURL=transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EACN,gBAAgB,EAChB,aAAa,GAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAEN,cAAc,EACd,gBAAgB,GAEhB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,OAAO,GACP,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AA6E9D;;;;GAIG;AACH,MAAM,WAAW,GAAsB,CAAC,GAAG,EAA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