@woosh/meep-engine 2.121.8 → 2.121.11

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.
Files changed (41) hide show
  1. package/package.json +1 -1
  2. package/src/core/binary/to_half_float_uint16.d.ts +1 -2
  3. package/src/core/binary/to_half_float_uint16.d.ts.map +1 -1
  4. package/src/core/binary/to_half_float_uint16.js +1 -2
  5. package/src/core/geom/ConicRay.d.ts +8 -0
  6. package/src/core/geom/ConicRay.d.ts.map +1 -1
  7. package/src/core/geom/ConicRay.js +11 -0
  8. package/src/core/geom/Quaternion.d.ts.map +1 -1
  9. package/src/core/geom/Quaternion.js +102 -49
  10. package/src/core/geom/Vector1.d.ts.map +1 -1
  11. package/src/core/geom/Vector1.js +11 -8
  12. package/src/core/geom/Vector2.d.ts.map +1 -1
  13. package/src/core/geom/Vector2.js +89 -59
  14. package/src/core/geom/Vector3.d.ts.map +1 -1
  15. package/src/core/geom/Vector3.js +108 -68
  16. package/src/core/geom/Vector4.d.ts +230 -40
  17. package/src/core/geom/Vector4.d.ts.map +1 -1
  18. package/src/core/geom/Vector4.js +36 -1
  19. package/src/core/geom/packing/max-rect/cutArea.d.ts.map +1 -1
  20. package/src/core/geom/packing/max-rect/cutArea.js +7 -8
  21. package/src/core/geom/packing/miniball/Miniball.d.ts +188 -11
  22. package/src/core/geom/packing/miniball/PointSet.d.ts +46 -3
  23. package/src/core/geom/vec3/v3_slerp.d.ts.map +1 -1
  24. package/src/core/geom/vec3/v3_slerp.js +2 -0
  25. package/src/core/math/EPSILON.d.ts.map +1 -1
  26. package/src/core/math/EPSILON.js +1 -1
  27. package/src/engine/ecs/EntityManager.d.ts +181 -35
  28. package/src/engine/ecs/EntityManager.d.ts.map +1 -1
  29. package/src/engine/ecs/EntityManager.js +11 -9
  30. package/src/engine/graphics/ecs/trail2d/Trail2D.d.ts +6 -1
  31. package/src/engine/graphics/ecs/trail2d/Trail2D.d.ts.map +1 -1
  32. package/src/engine/graphics/impostors/octahedral/bake/compute_bounding_sphere.d.ts +1 -1
  33. package/src/engine/graphics/impostors/octahedral/bake/compute_bounding_sphere.d.ts.map +1 -1
  34. package/src/engine/graphics/texture/sampler/sampler2d_to_f16.d.ts.map +1 -1
  35. package/src/generation/markers/transform/MarkerNodeTransformRotateRandom.js +1 -1
  36. package/editor/tools/GridPaintTool.d.ts +0 -17
  37. package/editor/tools/GridPaintTool.d.ts.map +0 -1
  38. package/editor/tools/SelectionTool.d.ts +0 -27
  39. package/editor/tools/SelectionTool.d.ts.map +0 -1
  40. package/editor/tools/TopDownCameraControlTool.d.ts +0 -13
  41. package/editor/tools/TopDownCameraControlTool.d.ts.map +0 -1
@@ -1,40 +1,230 @@
1
- import Signal from "../events/signal/Signal";
2
- import {Matrix4} from "three";
3
-
4
- interface Vector4Like {
5
- x: number
6
- y: number
7
- z: number
8
- w: number
9
- }
10
-
11
- export default class Vector4 {
12
-
13
- x: number
14
- y: number
15
- z: number
16
- w: number
17
-
18
- 0: number
19
- 1: number
20
- 2: number
21
- 3: number
22
-
23
- public readonly onChanged: Signal<number, number, number, number, number, number, number, number>;
24
-
25
- constructor()
26
-
27
- constructor(x: number, y: number, z: number, w: number)
28
-
29
- set(x: number, y: number, z: number, w: number): void
30
-
31
- copy(other: Vector4Like): void
32
-
33
- readFromArray(array:ArrayLike<number>, offset?:number):void
34
-
35
- writeToArray(array:ArrayLike<number>, offset?:number):void
36
-
37
- asArray(): number[]
38
-
39
- threeApplyMatrix4(matrix: Matrix4): void
40
- }
1
+ export class Vector4 {
2
+ /**
3
+ *
4
+ * @param {Vector4} v0
5
+ * @param {Vector4} v1
6
+ * @param {Number} f interpolation fraction
7
+ * @param {Vector4} result
8
+ */
9
+ static lerp(v0: Vector4, v1: Vector4, f: number, result: Vector4): void;
10
+ /**
11
+ *
12
+ * @param {number} [x=0]
13
+ * @param {number} [y=0]
14
+ * @param {number} [z=0]
15
+ * @param {number} [w=0]
16
+ * @constructor
17
+ * @class
18
+ */
19
+ constructor(x?: number, y?: number, z?: number, w?: number);
20
+ /**
21
+ *
22
+ * @type {number}
23
+ */
24
+ x: number;
25
+ /**
26
+ *
27
+ * @type {number}
28
+ */
29
+ y: number;
30
+ /**
31
+ *
32
+ * @type {number}
33
+ */
34
+ z: number;
35
+ /**
36
+ *
37
+ * @type {number}
38
+ */
39
+ w: number;
40
+ /**
41
+ * Dispatched when the value changes
42
+ * @readonly
43
+ * @type {Signal<number,number,number,number,number,number,number,number>}
44
+ */
45
+ readonly onChanged: Signal<number, number, number, number, number, number, number, number>;
46
+ /**
47
+ *
48
+ * @param {number} v
49
+ */
50
+ set 0(v: number);
51
+ /**
52
+ *
53
+ * @returns {number}
54
+ */
55
+ get 0(): number;
56
+ /**
57
+ *
58
+ * @param {number} v
59
+ */
60
+ set 1(v: number);
61
+ /**
62
+ *
63
+ * @returns {number}
64
+ */
65
+ get 1(): number;
66
+ /**
67
+ *
68
+ * @param {number} v
69
+ */
70
+ set 2(v: number);
71
+ /**
72
+ *
73
+ * @returns {number}
74
+ */
75
+ get 2(): number;
76
+ /**
77
+ *
78
+ * @param {number} v
79
+ */
80
+ set 3(v: number);
81
+ /**
82
+ *
83
+ * @returns {number}
84
+ */
85
+ get 3(): number;
86
+ /**
87
+ *
88
+ * @param {number[]} array
89
+ * @param {number} offset
90
+ */
91
+ readFromArray(array: number[], offset?: number): void;
92
+ /**
93
+ *
94
+ * @param {number[]} array
95
+ * @param {number} offset
96
+ */
97
+ writeToArray(array: number[], offset?: number): void;
98
+ /**
99
+ *
100
+ * @param {Number} x
101
+ * @param {Number} y
102
+ * @param {Number} z
103
+ * @param {Number} w
104
+ * @returns {Vector4}
105
+ */
106
+ set(x: number, y: number, z: number, w: number): Vector4;
107
+ /**
108
+ *
109
+ * @param {Vector3} v3
110
+ */
111
+ multiplyVector3(v3: Vector3): void;
112
+ /**
113
+ *
114
+ * @param {Number} value
115
+ * @returns {Vector4}
116
+ */
117
+ multiplyScalar(value: number): Vector4;
118
+ /**
119
+ *
120
+ * @param {number} a0
121
+ * @param {number} a1
122
+ * @param {number} a2
123
+ * @param {number} a3
124
+ * @param {number} b0
125
+ * @param {number} b1
126
+ * @param {number} b2
127
+ * @param {number} b3
128
+ * @param {number} c0
129
+ * @param {number} c1
130
+ * @param {number} c2
131
+ * @param {number} c3
132
+ * @param {number} d0
133
+ * @param {number} d1
134
+ * @param {number} d2
135
+ * @param {number} d3
136
+ * @returns {Vector4} this
137
+ */
138
+ _applyMatrix4(a0: number, a1: number, a2: number, a3: number, b0: number, b1: number, b2: number, b3: number, c0: number, c1: number, c2: number, c3: number, d0: number, d1: number, d2: number, d3: number): Vector4;
139
+ /**
140
+ *
141
+ * @param {Vector4} other
142
+ * @returns {number}
143
+ */
144
+ dot(other: Vector4): number;
145
+ /**
146
+ * Add XYZ components from another vector
147
+ * @param {Vector3|Vector4} v3
148
+ * @returns {Vector4}
149
+ */
150
+ add3(v3: Vector3 | Vector4): Vector4;
151
+ /**
152
+ *
153
+ * @param {Matrix4} m
154
+ * @returns {Vector4} this
155
+ */
156
+ threeApplyMatrix4(m: Matrix4): Vector4;
157
+ /**
158
+ *
159
+ * @param {Vector4} vec4
160
+ * @returns {Vector4}
161
+ */
162
+ copy(vec4: Vector4): Vector4;
163
+ /**
164
+ *
165
+ * @returns {Vector4}
166
+ */
167
+ clone(): Vector4;
168
+ /**
169
+ *
170
+ * @param {Quaternion} q
171
+ */
172
+ applyQuaternion(q: Quaternion): void;
173
+ /**
174
+ *
175
+ * @param {Vector4} vec4
176
+ * @returns {boolean}
177
+ */
178
+ equals(vec4: Vector4): boolean;
179
+ /**
180
+ *
181
+ * @return {number}
182
+ */
183
+ hash(): number;
184
+ /**
185
+ * @param {Vector4} v0
186
+ * @param {Vector4} v1
187
+ * @param {Number} f interpolation fraction
188
+ */
189
+ lerpVectors(v0: Vector4, v1: Vector4, f: number): void;
190
+ toArray: (result: number[]) => void;
191
+ /**
192
+ * @returns {number[]}
193
+ */
194
+ asArray(): number[];
195
+ /**
196
+ *
197
+ * @param {number[]} data
198
+ * @param {number} offset
199
+ */
200
+ setFromArray(data: number[], offset: number): void;
201
+ toJSON(): {
202
+ x: number;
203
+ y: number;
204
+ z: number;
205
+ w: number;
206
+ };
207
+ fromJSON(json: any): void;
208
+ /**
209
+ *
210
+ * @param {BinaryBuffer} buffer
211
+ */
212
+ toBinaryBuffer(buffer: BinaryBuffer): void;
213
+ /**
214
+ *
215
+ * @param {BinaryBuffer} buffer
216
+ */
217
+ fromBinaryBuffer(buffer: BinaryBuffer): void;
218
+ /**
219
+ * @readonly
220
+ * @type {boolean}
221
+ */
222
+ readonly isVector4: boolean;
223
+ fromArray: (array: number[], offset?: number) => void;
224
+ [Symbol.iterator](): Generator<number, void, unknown>;
225
+ }
226
+ export namespace Vector4 {
227
+ let typeName: string;
228
+ }
229
+ export default Vector4;
230
+ //# sourceMappingURL=Vector4.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Vector4.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector4.js"],"names":[],"mappings":";AAMA;IAiaI;;;;;;OAMG;IACH,gBALW,OAAO,MACP,OAAO,qBAEP,OAAO,QASjB;IA9aD;;;;;;;;OAQG;IACH,gBAPW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,EAiBhB;IANG,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IAEV,eAA6B;IAWjC;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAkBD;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAkBD;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAkBD;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAUD;;;;OAIG;IACH,qBAHW,MAAM,EAAE,WACR,MAAM,QAShB;IAED;;;;OAIG;IACH,oBAHW,MAAM,EAAE,WACR,MAAM,QAOhB;IAED;;;;;;;OAOG;IACH,iDAFa,OAAO,CAkCnB;IAED;;;OAGG;IACH,oBAFW,OAAO,QAQjB;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAOnB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,kBAlBW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,OAAO,CAoBnB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,MAAM,CAIlB;IAED;;;;OAIG;IACH,SAHW,OAAO,GAAC,OAAO,GACb,OAAO,CASnB;IAED;;;;OAIG;IACH,qBAHW,OAAO,GACL,OAAO,CAUnB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,SAFa,OAAO,CAQnB;IAED;;;OAGG;IACH,mBAFW,UAAU,QAyBpB;IAED;;;;OAIG;IACH,aAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,QAFY,MAAM,CASjB;IAED;;;;OAIG;IACH,gBAJW,OAAO,MACP,OAAO,mBAKjB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAOlB;IAED;;OAEG;IACH,WAFa,MAAM,EAAE,CAQpB;IAED;;;;OAIG;IACH,mBAHW,MAAM,EAAE,UACR,MAAM,QAIhB;IAED;;;;;MAOC;IAED,0BAEC;IAED;;;OAGG;IACH,uBAFW,YAAY,QAOtB;IAED;;;OAGG;IACH,yBAFW,YAAY,QAStB;IAED,sDAOC;CAiBJ"}
1
+ {"version":3,"file":"Vector4.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector4.js"],"names":[],"mappings":"AAMA;IAsbI;;;;;;OAMG;IACH,gBALW,OAAO,MACP,OAAO,qBAEP,OAAO,QASjB;IAncD;;;;;;;;OAQG;IACH,gBAPW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,EAsChB;IA3BG;;;OAGG;IACH,GAFU,MAAM,CAEN;IACV;;;OAGG;IACH,GAFU,MAAM,CAEN;IACV;;;OAGG;IACH,GAFU,MAAM,CAEN;IACV;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,oBAFU,MAAM,CAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,CAAC,CAE5C;IAWjC;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAkBD;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAkBD;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAkBD;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAUD;;;;OAIG;IACH,qBAHW,MAAM,EAAE,WACR,MAAM,QAShB;IAED;;;;OAIG;IACH,oBAHW,MAAM,EAAE,WACR,MAAM,QAOhB;IAED;;;;;;;OAOG;IACH,iDAFa,OAAO,CAkCnB;IAED;;;OAGG;IACH,oBAFW,OAAO,QAQjB;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAOnB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,kBAlBW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,OAAO,CAoBnB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,MAAM,CAIlB;IAED;;;;OAIG;IACH,SAHW,OAAO,GAAC,OAAO,GACb,OAAO,CASnB;IAED;;;;OAIG;IACH,qBAHW,OAAO,GACL,OAAO,CAUnB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,SAFa,OAAO,CAQnB;IAED;;;OAGG;IACH,mBAFW,UAAU,QAyBpB;IAED;;;;OAIG;IACH,aAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,QAFY,MAAM,CASjB;IAED;;;;OAIG;IACH,gBAJW,OAAO,MACP,OAAO,mBAKjB;IAuGL,kBAnGe,MAAM,EAAE,UAmGE;IA1FrB;;OAEG;IACH,WAFa,MAAM,EAAE,CAQpB;IAED;;;;OAIG;IACH,mBAHW,MAAM,EAAE,UACR,MAAM,QAIhB;IAED;;;;;MAOC;IAED,0BAEC;IAED;;;OAGG;IACH,uBAFW,YAAY,QAOtB;IAED;;;OAGG;IACH,yBAFW,YAAY,QAStB;IA4BL;;;OAGG;IACH,oBAFU,OAAO,CAEU;IAE3B,mBA7Ve,MAAM,EAAE,WACR,MAAM,UA4VM;IAhCvB,sDAOC;CAiBJ;;kBAaS,MAAM"}
@@ -4,7 +4,7 @@ import { Signal } from "../events/signal/Signal.js";
4
4
  import { lerp } from "../math/lerp.js";
5
5
  import { computeHashFloat } from "../primitives/numbers/computeHashFloat.js";
6
6
 
7
- class Vector4 {
7
+ export class Vector4 {
8
8
  /**
9
9
  *
10
10
  * @param {number} [x=0]
@@ -21,11 +21,32 @@ class Vector4 {
21
21
  w = 0
22
22
  ) {
23
23
 
24
+ /**
25
+ *
26
+ * @type {number}
27
+ */
24
28
  this.x = x;
29
+ /**
30
+ *
31
+ * @type {number}
32
+ */
25
33
  this.y = y;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ */
26
38
  this.z = z;
39
+ /**
40
+ *
41
+ * @type {number}
42
+ */
27
43
  this.w = w;
28
44
 
45
+ /**
46
+ * Dispatched when the value changes
47
+ * @readonly
48
+ * @type {Signal<number,number,number,number,number,number,number,number>}
49
+ */
29
50
  this.onChanged = new Signal();
30
51
  }
31
52
 
@@ -438,5 +459,19 @@ class Vector4 {
438
459
  }
439
460
  }
440
461
 
462
+ /**
463
+ * @readonly
464
+ * @type {boolean}
465
+ */
466
+ Vector4.prototype.isVector4 = true;
467
+
468
+ Vector4.prototype.fromArray = Vector4.prototype.readFromArray;
469
+ Vector4.prototype.toArray = Vector4.prototype.writeToArray;
470
+
471
+ /**
472
+ * @readonly
473
+ * @type {string}
474
+ */
475
+ Vector4.typeName = "Vector4";
441
476
 
442
477
  export default Vector4;
@@ -1 +1 @@
1
- {"version":3,"file":"cutArea.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/max-rect/cutArea.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,iCAHW,KAAK,SACL,YAAY,QA4EtB"}
1
+ {"version":3,"file":"cutArea.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/max-rect/cutArea.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,iCAHW,KAAK,SACL,YAAY,QA0EtB"}
@@ -1,6 +1,7 @@
1
1
  import { assert } from "../../../assert.js";
2
2
  import { max2 } from "../../../math/max2.js";
3
3
  import { min2 } from "../../../math/min2.js";
4
+ import { qt_collect_by_box } from "../../2d/quad-tree/qt_collect_by_box.js";
4
5
  import { QuadTreeDatum } from "../../2d/quad-tree/QuadTreeDatum.js";
5
6
  import { removeRedundantBoxesArray } from "./removeRedundantBoxesArray.js";
6
7
 
@@ -29,13 +30,10 @@ export function cutArea(
29
30
  */
30
31
  const removals = [];
31
32
 
32
- /**
33
- *
34
- * @param {QuadTreeDatum} box
35
- */
36
- function visitOverlap(box) {
37
- removals.push(box);
33
+ const overlap_box_count = qt_collect_by_box(removals,0,boxes,scissor.x0, scissor.y0, scissor.x1, scissor.y1);
38
34
 
35
+ for (let j = 0; j < overlap_box_count; j++) {
36
+ const box = removals[j];
39
37
 
40
38
  //compute overlap region
41
39
  const x0 = max2(scissor.x0, box.x0);
@@ -50,14 +48,17 @@ export function cutArea(
50
48
  //add left box
51
49
  additions.push(new QuadTreeDatum(box.x0, box.y0, x0, box.y1));
52
50
  }
51
+
53
52
  if (x1 < box.x1) {
54
53
  //add right box
55
54
  additions.push(new QuadTreeDatum(x1, box.y0, box.x1, box.y1));
56
55
  }
56
+
57
57
  if (y0 > box.y0) {
58
58
  //add top box
59
59
  additions.push(new QuadTreeDatum(box.x0, box.y0, box.x1, y0));
60
60
  }
61
+
61
62
  if (y1 < box.y1) {
62
63
  //add bottom box
63
64
  additions.push(new QuadTreeDatum(box.x0, y1, box.x1, box.y1));
@@ -65,8 +66,6 @@ export function cutArea(
65
66
 
66
67
  }
67
68
 
68
- boxes.traverseRectangleIntersections(scissor.x0, scissor.y0, scissor.x1, scissor.y1, visitOverlap);
69
-
70
69
  let i, l;
71
70
  //perform removals
72
71
  for (i = 0, l = removals.length; i < l; i++) {
@@ -1,11 +1,188 @@
1
- import {PointSet} from "./PointSet";
2
-
3
- export declare class Miniball {
4
- constructor(points: PointSet)
5
-
6
- size(): number
7
-
8
- radius(): number
9
-
10
- center(): ArrayLike<number>
11
- }
1
+ /**
2
+ * Computes the miniball of the given point set.
3
+ * @class
4
+ */
5
+ export class Miniball {
6
+ /**
7
+ * Notice that the point set `points` is assumed to be immutable during the computation.
8
+ * That is, if you add, remove, or change points in the point set, you have to create a new instance of {@link Miniball}.
9
+ *
10
+ * @param {PointSet} points the point set
11
+ */
12
+ constructor(points: PointSet);
13
+ /**
14
+ *
15
+ * @type {number}
16
+ */
17
+ iteration: number;
18
+ /**
19
+ *
20
+ * @type {number}
21
+ */
22
+ distToAff: number;
23
+ /**
24
+ *
25
+ * @type {number}
26
+ */
27
+ distToAffSquare: number;
28
+ /**
29
+ *
30
+ * The squared radius of the miniball.
31
+ *
32
+ * This is equivalent to `radius() * radius()`.
33
+ *
34
+ * Precondition: `!isEmpty()`
35
+ *
36
+ * @type {number}
37
+ * @private
38
+ */
39
+ private __squaredRadius;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @private
44
+ */
45
+ private __radius;
46
+ /**
47
+ *
48
+ * @type {number}
49
+ */
50
+ stopper: number;
51
+ /**
52
+ * @type {PointSet}
53
+ */
54
+ S: PointSet;
55
+ /**
56
+ *
57
+ * @type {number}
58
+ * @private
59
+ */
60
+ private __size;
61
+ /**
62
+ * Number of dimensions (2 for 2d, 3 for 3d etc.)
63
+ * @type {number}
64
+ */
65
+ dim: number;
66
+ /**
67
+ *
68
+ * @type {number[]|Float64Array}
69
+ * @private
70
+ */
71
+ private __center;
72
+ /**
73
+ *
74
+ * @type {number[]|Float64Array}
75
+ */
76
+ centerToAff: number[] | Float64Array;
77
+ /**
78
+ *
79
+ * @type {number[]|Float64Array}
80
+ */
81
+ centerToPoint: number[] | Float64Array;
82
+ /**
83
+ *
84
+ * @type {number[]|Float64Array}
85
+ */
86
+ lambdas: number[] | Float64Array;
87
+ /**
88
+ *
89
+ * @type {Subspan}
90
+ * @private
91
+ */
92
+ private __support;
93
+ /**
94
+ * Whether the miniball is the empty set, equivalently, whether `points.size() == 0`
95
+ * was true when this miniball instance was constructed.
96
+ *
97
+ * Notice that the miniball of a point set <i>S</i> is empty if and only if <i>S={}</i>.
98
+ *
99
+ * @return {boolean} true iff
100
+ */
101
+ isEmpty(): boolean;
102
+ /**
103
+ * The radius of the miniball.
104
+ *
105
+ * Precondition: `!isEmpty()`
106
+ *
107
+ * @return {number} the radius of the miniball, a number ≥ 0
108
+ */
109
+ radius(): number;
110
+ /**
111
+ * The Euclidean coordinates of the center of the miniball.
112
+ *
113
+ * Precondition: `!isEmpty()`
114
+ *
115
+ * @return {number[]} an array holding the coordinates of the center of the miniball
116
+ */
117
+ center(): number[];
118
+ /**
119
+ *
120
+ * @returns {Subspan}
121
+ */
122
+ get support(): Subspan;
123
+ /**
124
+ * The number of input points.
125
+ *
126
+ * @return {number} the number of points in the original point set, i.e., `pts.size()` where
127
+ * `pts` was the {@link PointSet} instance passed to the constructor of this
128
+ * instance
129
+ */
130
+ size(): number;
131
+ /**
132
+ * Sets up the search ball with an arbitrary point of <i>S</i> as center and with exactly one of
133
+ * the points farthest from center in the support. So the current ball contains all points of
134
+ * <i>S</i> and has radius at most twice as large as the minball.
135
+ *
136
+ * Precondition: `size > 0`
137
+ * @return {Subspan}
138
+ * @private
139
+ */
140
+ private initBall;
141
+ /**
142
+ * @private
143
+ */
144
+ private computeDistToAff;
145
+ /**
146
+ * @private
147
+ */
148
+ private updateRadius;
149
+ /**
150
+ * The main function containing the main loop.
151
+ *
152
+ * Iteratively, we compute the point in support that is closest to the current center and then
153
+ * walk towards this target as far as we can, i.e., we move until some new point touches the
154
+ * boundary of the ball and must thus be inserted into support. In each of these two alternating
155
+ * phases, we always have to check whether some point must be dropped from support, which is the
156
+ * case when the center lies in <i>aff(support)</i>. If such an attempt to drop fails, we are
157
+ * done; because then the center lies even <i>conv(support)</i>.
158
+ * @private
159
+ */
160
+ private compute;
161
+ /**
162
+ * If center doesn't already lie in <i>conv(support)</i> and is thus not optimal yet,
163
+ * {@link #successfulDrop()} elects a suitable point <i>k</i> to be removed from the support and
164
+ * returns true. If the center lies in the convex hull, however, false is returned (and the
165
+ * support remains unaltered).
166
+ *
167
+ * Precondition: center lies in <i>aff(support)</i>.
168
+ * @return {boolean}
169
+ */
170
+ successfulDrop(): boolean;
171
+ /**
172
+ * Given the center of the current enclosing ball and the walking direction `centerToAff`,
173
+ * determine how much we can walk into this direction without losing a point from <i>S</i>. The
174
+ * (positive) factor by which we can walk along `centerToAff` is returned. Further,
175
+ * `stopper` is set to the index of the most restricting point and to -1 if no such point
176
+ * was found.
177
+ * @return {number}
178
+ * @private
179
+ */
180
+ private findStopFraction;
181
+ /**
182
+ * Outputs information about the miniball
183
+ * @return {string}
184
+ */
185
+ toString(): string;
186
+ }
187
+ import { Subspan } from "./Subspan.js";
188
+ //# sourceMappingURL=Miniball.d.ts.map
@@ -1,3 +1,46 @@
1
- export declare class PointSet {
2
- constructor(size: number, dimensions: number, data: ArrayLike<number>)
3
- }
1
+ export class PointSet {
2
+ /**
3
+ *
4
+ * @param {number} size number of points
5
+ * @param {number} dimensions number of dimensions per point
6
+ * @param {Array|Float32Array|Float64Array} data
7
+ * @constructor
8
+ */
9
+ constructor(size: number, dimensions: number, data: any[] | Float32Array | Float64Array);
10
+ /**
11
+ *
12
+ * @type {Array|Float32Array|Float64Array}
13
+ * @private
14
+ */
15
+ private __data;
16
+ /**
17
+ *
18
+ * @type {number}
19
+ * @private
20
+ */
21
+ private __size;
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @private
26
+ */
27
+ private __dimensions;
28
+ /**
29
+ * Number of points in the set
30
+ * @returns {number}
31
+ */
32
+ size(): number;
33
+ /**
34
+ * Number of dimensions for each point
35
+ * @returns {number}
36
+ */
37
+ dimension(): number;
38
+ /**
39
+ * get coordinate for a point
40
+ * @param {number} i point index
41
+ * @param {number} j dimension
42
+ * @returns {number}
43
+ */
44
+ coord(i: number, j: number): number;
45
+ }
46
+ //# sourceMappingURL=PointSet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"v3_slerp.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_slerp.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,iCATW,OAAO,GAAC;IAAC,GAAG,CAAC,CAAC,EAAC,MAAM,EAAC,CAAC,EAAC,MAAM,EAAC,CAAC,EAAC,MAAM,OAAC;CAAC,OACzC,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,YACN,MAAM,QAsChB"}
1
+ {"version":3,"file":"v3_slerp.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_slerp.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,iCATW,OAAO,GAAC;IAAC,GAAG,CAAC,CAAC,EAAC,MAAM,EAAC,CAAC,EAAC,MAAM,EAAC,CAAC,EAAC,MAAM,OAAC;CAAC,OACzC,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,YACN,MAAM,QAwChB"}
@@ -22,6 +22,8 @@ export function v3_slerp(
22
22
  fraction
23
23
  ) {
24
24
  assert.isNumber(fraction, 'fraction');
25
+ assert.notNaN(fraction, "fraction");
26
+ assert.greaterThanOrEqual(fraction, 0, "fraction");
25
27
 
26
28
  const dot = v3_dot(
27
29
  a_x, a_y, a_z,
@@ -1 +1 @@
1
- {"version":3,"file":"EPSILON.d.ts","sourceRoot":"","sources":["../../../../src/core/math/EPSILON.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sBAFU,MAAM,CAEgB"}
1
+ {"version":3,"file":"EPSILON.d.ts","sourceRoot":"","sources":["../../../../src/core/math/EPSILON.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sBAFU,MAAM,CAEY"}
@@ -2,4 +2,4 @@
2
2
  * Very small value, used for comparison when compensation for rounding error is required
3
3
  * @type {number}
4
4
  */
5
- export const EPSILON = 0.000001;
5
+ export const EPSILON = 1e-7;