@woosh/meep-engine 2.92.9 → 2.92.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 (35) hide show
  1. package/build/meep.cjs +7 -13
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +7 -13
  4. package/package.json +1 -1
  5. package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts.map +1 -1
  6. package/src/core/bvh2/binary/2/BinaryUint32BVH.js +4 -0
  7. package/src/core/math/interval/NumericInterval.d.ts +3 -3
  8. package/src/core/math/interval/NumericInterval.d.ts.map +1 -1
  9. package/src/core/math/interval/NumericInterval.js +7 -13
  10. package/src/core/math/interval/NumericInterval.spec.js +9 -0
  11. package/src/core/math/max3.spec.js +2 -0
  12. package/src/core/math/min3.spec.js +2 -0
  13. package/src/core/math/spline/spline_bezier3_bounds.js +3 -3
  14. package/src/core/math/spline/spline_hermite3.d.ts +11 -0
  15. package/src/core/math/spline/spline_hermite3.d.ts.map +1 -0
  16. package/src/core/math/spline/spline_hermite3.js +21 -0
  17. package/src/core/math/spline/spline_hermite3_bounds.d.ts +17 -0
  18. package/src/core/math/spline/spline_hermite3_bounds.d.ts.map +1 -0
  19. package/src/core/math/spline/spline_hermite3_bounds.js +95 -0
  20. package/src/core/math/spline/spline_hermite3_bounds.spec.d.ts +2 -0
  21. package/src/core/math/spline/spline_hermite3_bounds.spec.d.ts.map +1 -0
  22. package/src/core/math/spline/spline_hermite3_bounds.spec.js +37 -0
  23. package/src/engine/animation/curve/AnimationCurve.d.ts.map +1 -1
  24. package/src/engine/animation/curve/AnimationCurve.js +10 -16
  25. package/src/engine/animation/curve/AnimationCurve.spec.js +11 -0
  26. package/src/engine/animation/curve/compression/prototypeCurveCompression.js +13 -2
  27. package/src/engine/animation/curve/compute_curve_aabb.d.ts.map +1 -1
  28. package/src/engine/animation/curve/compute_curve_aabb.js +25 -4
  29. package/src/engine/animation/curve/draw/build_plot_entity_from_array.d.ts.map +1 -1
  30. package/src/engine/animation/curve/draw/build_plot_entity_from_array.js +10 -2
  31. package/src/engine/animation/curve/prototypeGLTF.js +14 -14
  32. package/src/engine/graphics/canvas/canvas2d_draw_label.d.ts +4 -1
  33. package/src/engine/graphics/canvas/canvas2d_draw_label.d.ts.map +1 -1
  34. package/src/engine/graphics/canvas/canvas2d_draw_label.js +10 -4
  35. package/src/engine/graphics/geometry/buffered/query/GeometrySpatialQueryAccelerator.js +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"canvas2d_draw_label.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/canvas/canvas2d_draw_label.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,yDALW,wBAAwB,QAmBlC"}
1
+ {"version":3,"file":"canvas2d_draw_label.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/canvas/canvas2d_draw_label.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,mFARW,wBAAwB,QAyBlC"}
@@ -4,18 +4,24 @@
4
4
  * @param {string} text
5
5
  * @param {number} x
6
6
  * @param {number} y
7
+ * @param {string} [color] CSS color
8
+ * @param {number} [fontSize] in pixels
9
+ * @param {string} [outline] CSS color
7
10
  */
8
11
  export function canvas2d_draw_label({
9
12
  ctx,
10
13
  text,
11
14
  x,
12
- y
15
+ y,
16
+ color = 'white',
17
+ fontSize = 10,
18
+ outline = `rgba(0, 0, 0, 0.5)`
13
19
  }) {
14
20
 
15
- ctx.fillStyle = 'white';
16
- ctx.font = '10px Tahoma';
21
+ ctx.fillStyle = color;
22
+ ctx.font = `${Math.ceil(fontSize)}px Tahoma`;
17
23
 
18
- ctx.strokeStyle = `rgba(0, 0, 0, 0.5)`;
24
+ ctx.strokeStyle = outline;
19
25
  ctx.lineWidth = 2;
20
26
  ctx.strokeText(text, x, y);
21
27
  ctx.fillText(text, x, y);
@@ -232,14 +232,14 @@ export class GeometrySpatialQueryAccelerator {
232
232
  * @returns {BinaryUint32BVH}
233
233
  */
234
234
  __buildBVH(geometry) {
235
+ const bvh = new BinaryUint32BVH();
236
+
235
237
  const position_attribute = geometry.getAttribute('position');
236
238
  const index_attribute = geometry.getIndex();
237
239
 
238
240
  const de_interleaved_position_attribute = deinterleaveBufferAttribute(position_attribute);
239
241
  const vertices = de_interleaved_position_attribute.array;
240
242
 
241
- const bvh = new BinaryUint32BVH();
242
-
243
243
  if (index_attribute === undefined || index_attribute === null) {
244
244
  bvh32_from_unindexed_geometry(bvh, vertices);
245
245
  } else {