@woosh/meep-engine 2.135.0 → 2.138.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.
Files changed (238) hide show
  1. package/package.json +1 -1
  2. package/src/core/geom/2d/aabb/aabb2_intersects_ray.d.ts.map +1 -1
  3. package/src/core/geom/2d/aabb/aabb2_intersects_ray.js +5 -7
  4. package/src/core/geom/2d/hash-grid/shg_query_elements_circle.d.ts.map +1 -1
  5. package/src/core/geom/2d/hash-grid/shg_query_elements_circle.js +2 -3
  6. package/src/core/geom/3d/aabb/aabb3_intersects_line_segment.d.ts.map +1 -1
  7. package/src/core/geom/3d/aabb/aabb3_intersects_line_segment.js +9 -11
  8. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.d.ts.map +1 -1
  9. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.js +6 -4
  10. package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.d.ts.map +1 -1
  11. package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.js +1 -2
  12. package/src/core/geom/Quaternion.d.ts +26 -39
  13. package/src/core/geom/Quaternion.d.ts.map +1 -1
  14. package/src/core/geom/Quaternion.js +124 -136
  15. package/src/core/geom/Vector2.d.ts +28 -14
  16. package/src/core/geom/Vector2.d.ts.map +1 -1
  17. package/src/core/geom/Vector2.js +114 -97
  18. package/src/core/geom/Vector3.d.ts +21 -34
  19. package/src/core/geom/Vector3.d.ts.map +1 -1
  20. package/src/core/geom/Vector3.js +131 -142
  21. package/src/core/geom/Vector4.d.ts +21 -30
  22. package/src/core/geom/Vector4.d.ts.map +1 -1
  23. package/src/core/geom/Vector4.js +80 -93
  24. package/src/core/geom/packing/computeBoundingSphereOfSpheres.d.ts.map +1 -1
  25. package/src/core/geom/packing/computeBoundingSphereOfSpheres.js +23 -6
  26. package/src/core/geom/packing/miniball/Miniball.d.ts.map +1 -1
  27. package/src/core/geom/packing/miniball/Miniball.js +4 -11
  28. package/src/core/geom/packing/miniball/Subspan.d.ts +14 -39
  29. package/src/core/geom/packing/miniball/Subspan.d.ts.map +1 -1
  30. package/src/core/geom/packing/miniball/Subspan.js +105 -158
  31. package/src/core/geom/packing/miniball/miniball_compute_quality.d.ts.map +1 -1
  32. package/src/core/geom/packing/miniball/miniball_compute_quality.js +2 -6
  33. package/src/core/geom/vec/vector_axpy.d.ts +12 -0
  34. package/src/core/geom/vec/vector_axpy.d.ts.map +1 -0
  35. package/src/core/geom/vec/vector_axpy.js +15 -0
  36. package/src/core/geom/vec/vector_axpy_offset.d.ts +17 -0
  37. package/src/core/geom/vec/vector_axpy_offset.d.ts.map +1 -0
  38. package/src/core/geom/vec/vector_axpy_offset.js +20 -0
  39. package/src/core/geom/vec/vector_dot_offset.d.ts +18 -0
  40. package/src/core/geom/vec/vector_dot_offset.d.ts.map +1 -0
  41. package/src/core/geom/vec/vector_dot_offset.js +25 -0
  42. package/src/core/math/complex/complex_horner_eval.d.ts +16 -0
  43. package/src/core/math/complex/complex_horner_eval.d.ts.map +1 -0
  44. package/src/core/math/complex/complex_horner_eval.js +31 -0
  45. package/src/core/math/fabsf.d.ts +2 -3
  46. package/src/core/math/fabsf.d.ts.map +1 -1
  47. package/src/core/math/fabsf.js +3 -5
  48. package/src/core/math/linalg/cubic_residual_times_derivative_accumulate.d.ts +26 -0
  49. package/src/core/math/linalg/cubic_residual_times_derivative_accumulate.d.ts.map +1 -0
  50. package/src/core/math/linalg/cubic_residual_times_derivative_accumulate.js +43 -0
  51. package/src/core/math/linalg/eigen/matrix_eigenvalues_in_place.d.ts +2 -1
  52. package/src/core/math/linalg/eigen/matrix_eigenvalues_in_place.d.ts.map +1 -1
  53. package/src/core/math/linalg/eigen/matrix_eigenvalues_in_place.js +2 -1
  54. package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts +10 -4
  55. package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts.map +1 -1
  56. package/src/core/math/linalg/eigen/matrix_householder_in_place.js +122 -98
  57. package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts +2 -2
  58. package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts.map +1 -1
  59. package/src/core/math/linalg/eigen/matrix_qr_in_place.js +144 -124
  60. package/src/core/math/linalg/givens/givens_apply_rows.d.ts +22 -0
  61. package/src/core/math/linalg/givens/givens_apply_rows.d.ts.map +1 -0
  62. package/src/core/math/linalg/givens/givens_apply_rows.js +28 -0
  63. package/src/core/math/linalg/givens/givens_apply_rows_offset.d.ts +24 -0
  64. package/src/core/math/linalg/givens/givens_apply_rows_offset.d.ts.map +1 -0
  65. package/src/core/math/linalg/givens/givens_apply_rows_offset.js +30 -0
  66. package/src/core/math/linalg/givens/givens_rotation_coefficients.d.ts +25 -0
  67. package/src/core/math/linalg/givens/givens_rotation_coefficients.d.ts.map +1 -0
  68. package/src/core/math/linalg/givens/givens_rotation_coefficients.js +39 -0
  69. package/src/core/math/linalg/lu_factor_linear_system.d.ts +1 -1
  70. package/src/core/math/linalg/lu_factor_linear_system.d.ts.map +1 -1
  71. package/src/core/math/linalg/lu_factor_linear_system.js +108 -117
  72. package/src/core/math/linalg/lu_solve_linear_system.d.ts +1 -1
  73. package/src/core/math/linalg/lu_solve_linear_system.js +53 -53
  74. package/src/core/math/linalg/polynomial_add_into.d.ts +18 -0
  75. package/src/core/math/linalg/polynomial_add_into.d.ts.map +1 -0
  76. package/src/core/math/linalg/polynomial_add_into.js +29 -0
  77. package/src/core/math/linalg/polynomial_complex_roots_aberth_ehrlich.d.ts +6 -1
  78. package/src/core/math/linalg/polynomial_complex_roots_aberth_ehrlich.d.ts.map +1 -1
  79. package/src/core/math/linalg/polynomial_complex_roots_aberth_ehrlich.js +48 -50
  80. package/src/core/math/linalg/polynomial_cubic_derivative_eval.d.ts +15 -0
  81. package/src/core/math/linalg/polynomial_cubic_derivative_eval.d.ts.map +1 -0
  82. package/src/core/math/linalg/polynomial_cubic_derivative_eval.js +16 -0
  83. package/src/core/math/linalg/polynomial_cubic_horner_eval.d.ts +18 -0
  84. package/src/core/math/linalg/polynomial_cubic_horner_eval.d.ts.map +1 -0
  85. package/src/core/math/linalg/polynomial_cubic_horner_eval.js +19 -0
  86. package/src/core/math/linalg/polynomial_cubic_second_derivative_eval.d.ts +13 -0
  87. package/src/core/math/linalg/polynomial_cubic_second_derivative_eval.d.ts.map +1 -0
  88. package/src/core/math/linalg/polynomial_cubic_second_derivative_eval.js +14 -0
  89. package/src/core/math/linalg/polynomial_multiply.d.ts +21 -0
  90. package/src/core/math/linalg/polynomial_multiply.d.ts.map +1 -0
  91. package/src/core/math/linalg/polynomial_multiply.js +41 -0
  92. package/src/core/math/linalg/polynomial_real_roots_in_interval.d.ts +6 -1
  93. package/src/core/math/linalg/polynomial_real_roots_in_interval.d.ts.map +1 -1
  94. package/src/core/math/linalg/polynomial_real_roots_in_interval.js +29 -18
  95. package/src/core/math/linalg/polynomial_root_bound_cauchy.d.ts +17 -0
  96. package/src/core/math/linalg/polynomial_root_bound_cauchy.d.ts.map +1 -0
  97. package/src/core/math/linalg/polynomial_root_bound_cauchy.js +30 -0
  98. package/src/core/math/linalg/polynomial_scale_into.d.ts +14 -0
  99. package/src/core/math/linalg/polynomial_scale_into.d.ts.map +1 -0
  100. package/src/core/math/linalg/polynomial_scale_into.js +17 -0
  101. package/src/core/math/linalg/polynomial_sub_into.d.ts +18 -0
  102. package/src/core/math/linalg/polynomial_sub_into.d.ts.map +1 -0
  103. package/src/core/math/linalg/polynomial_sub_into.js +29 -0
  104. package/src/core/math/linalg/solve_linear_system.d.ts +1 -1
  105. package/src/core/math/linalg/solve_linear_system.js +1 -1
  106. package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts +4 -4
  107. package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts.map +1 -1
  108. package/src/core/math/linalg/solve_linear_system_GEPP_2x2.js +96 -91
  109. package/src/core/math/solveQuadratic.d.ts +2 -2
  110. package/src/core/math/solveQuadratic.d.ts.map +1 -1
  111. package/src/core/math/solveQuadratic.js +1 -1
  112. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.d.ts +18 -10
  113. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.d.ts.map +1 -1
  114. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.js +18 -10
  115. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_1d.d.ts +13 -6
  116. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_1d.d.ts.map +1 -1
  117. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_1d.js +16 -11
  118. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.d.ts +25 -3
  119. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.d.ts.map +1 -1
  120. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.js +97 -142
  121. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.d.ts +30 -4
  122. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.d.ts.map +1 -1
  123. package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.js +188 -132
  124. package/src/core/math/spline/spline3_hermite_intersects_spline3_hermite.d.ts +7 -3
  125. package/src/core/math/spline/spline3_hermite_intersects_spline3_hermite.d.ts.map +1 -1
  126. package/src/core/math/spline/spline3_hermite_intersects_spline3_hermite.js +35 -6
  127. package/src/core/science/units/MEASUREMENT_UNITS_SCIENTIFIC.d.ts +17 -0
  128. package/src/core/science/units/MEASUREMENT_UNITS_SCIENTIFIC.d.ts.map +1 -0
  129. package/src/core/science/units/MEASUREMENT_UNITS_SCIENTIFIC.js +87 -0
  130. package/src/core/science/units/MEASUREMENT_UNITS_SI.d.ts +13 -0
  131. package/src/core/science/units/MEASUREMENT_UNITS_SI.d.ts.map +1 -0
  132. package/src/core/science/units/MEASUREMENT_UNITS_SI.js +28 -0
  133. package/src/core/science/units/NamedUnit.d.ts +38 -0
  134. package/src/core/science/units/NamedUnit.d.ts.map +1 -0
  135. package/src/core/science/units/NamedUnit.js +48 -0
  136. package/src/core/science/units/UNIT_DIMENSION_MAPPING.d.ts +14 -0
  137. package/src/core/science/units/UNIT_DIMENSION_MAPPING.d.ts.map +1 -0
  138. package/src/core/science/units/UNIT_DIMENSION_MAPPING.js +29 -0
  139. package/src/core/science/units/UnitDimension.d.ts +26 -0
  140. package/src/core/science/units/UnitDimension.d.ts.map +1 -0
  141. package/src/core/science/units/UnitDimension.js +28 -0
  142. package/src/core/science/units/UnitMatrix.d.ts +117 -0
  143. package/src/core/science/units/UnitMatrix.d.ts.map +1 -0
  144. package/src/core/science/units/UnitMatrix.js +251 -0
  145. package/src/core/science/units/format_quantity.d.ts +25 -0
  146. package/src/core/science/units/format_quantity.d.ts.map +1 -0
  147. package/src/core/science/units/format_quantity.js +74 -0
  148. package/src/core/science/units/magnitude_prefix.d.ts +57 -0
  149. package/src/core/science/units/magnitude_prefix.d.ts.map +1 -0
  150. package/src/core/science/units/magnitude_prefix.js +127 -0
  151. package/src/core/science/units/si/AMPERE.d.ts +7 -0
  152. package/src/core/science/units/si/AMPERE.d.ts.map +1 -0
  153. package/src/core/science/units/si/AMPERE.js +13 -0
  154. package/src/core/science/units/si/CANDELA.d.ts +7 -0
  155. package/src/core/science/units/si/CANDELA.d.ts.map +1 -0
  156. package/src/core/science/units/si/CANDELA.js +13 -0
  157. package/src/core/science/units/si/DIMENSIONLESS.d.ts +8 -0
  158. package/src/core/science/units/si/DIMENSIONLESS.d.ts.map +1 -0
  159. package/src/core/science/units/si/DIMENSIONLESS.js +14 -0
  160. package/src/core/science/units/si/KELVIN.d.ts +7 -0
  161. package/src/core/science/units/si/KELVIN.d.ts.map +1 -0
  162. package/src/core/science/units/si/KELVIN.js +13 -0
  163. package/src/core/science/units/si/KILOGRAM.d.ts +7 -0
  164. package/src/core/science/units/si/KILOGRAM.d.ts.map +1 -0
  165. package/src/core/science/units/si/KILOGRAM.js +13 -0
  166. package/src/core/science/units/si/METER.d.ts +7 -0
  167. package/src/core/science/units/si/METER.d.ts.map +1 -0
  168. package/src/core/science/units/si/METER.js +13 -0
  169. package/src/core/science/units/si/MOLE.d.ts +7 -0
  170. package/src/core/science/units/si/MOLE.d.ts.map +1 -0
  171. package/src/core/science/units/si/MOLE.js +13 -0
  172. package/src/core/science/units/si/SECOND.d.ts +7 -0
  173. package/src/core/science/units/si/SECOND.d.ts.map +1 -0
  174. package/src/core/science/units/si/SECOND.js +13 -0
  175. package/src/core/science/units/si/derived/BECQUEREL.d.ts +10 -0
  176. package/src/core/science/units/si/derived/BECQUEREL.d.ts.map +1 -0
  177. package/src/core/science/units/si/derived/BECQUEREL.js +16 -0
  178. package/src/core/science/units/si/derived/COULOMB.d.ts +7 -0
  179. package/src/core/science/units/si/derived/COULOMB.d.ts.map +1 -0
  180. package/src/core/science/units/si/derived/COULOMB.js +13 -0
  181. package/src/core/science/units/si/derived/FARAD.d.ts +7 -0
  182. package/src/core/science/units/si/derived/FARAD.d.ts.map +1 -0
  183. package/src/core/science/units/si/derived/FARAD.js +13 -0
  184. package/src/core/science/units/si/derived/GRAY.d.ts +10 -0
  185. package/src/core/science/units/si/derived/GRAY.d.ts.map +1 -0
  186. package/src/core/science/units/si/derived/GRAY.js +16 -0
  187. package/src/core/science/units/si/derived/HENRY.d.ts +7 -0
  188. package/src/core/science/units/si/derived/HENRY.d.ts.map +1 -0
  189. package/src/core/science/units/si/derived/HENRY.js +13 -0
  190. package/src/core/science/units/si/derived/HERTZ.d.ts +10 -0
  191. package/src/core/science/units/si/derived/HERTZ.d.ts.map +1 -0
  192. package/src/core/science/units/si/derived/HERTZ.js +16 -0
  193. package/src/core/science/units/si/derived/JOULE.d.ts +7 -0
  194. package/src/core/science/units/si/derived/JOULE.d.ts.map +1 -0
  195. package/src/core/science/units/si/derived/JOULE.js +13 -0
  196. package/src/core/science/units/si/derived/KATAL.d.ts +7 -0
  197. package/src/core/science/units/si/derived/KATAL.d.ts.map +1 -0
  198. package/src/core/science/units/si/derived/KATAL.js +13 -0
  199. package/src/core/science/units/si/derived/LUMEN.d.ts +8 -0
  200. package/src/core/science/units/si/derived/LUMEN.d.ts.map +1 -0
  201. package/src/core/science/units/si/derived/LUMEN.js +14 -0
  202. package/src/core/science/units/si/derived/LUX.d.ts +7 -0
  203. package/src/core/science/units/si/derived/LUX.d.ts.map +1 -0
  204. package/src/core/science/units/si/derived/LUX.js +13 -0
  205. package/src/core/science/units/si/derived/NEWTON.d.ts +7 -0
  206. package/src/core/science/units/si/derived/NEWTON.d.ts.map +1 -0
  207. package/src/core/science/units/si/derived/NEWTON.js +13 -0
  208. package/src/core/science/units/si/derived/OHM.d.ts +7 -0
  209. package/src/core/science/units/si/derived/OHM.d.ts.map +1 -0
  210. package/src/core/science/units/si/derived/OHM.js +13 -0
  211. package/src/core/science/units/si/derived/PASCAL.d.ts +7 -0
  212. package/src/core/science/units/si/derived/PASCAL.d.ts.map +1 -0
  213. package/src/core/science/units/si/derived/PASCAL.js +13 -0
  214. package/src/core/science/units/si/derived/SIEMENS.d.ts +7 -0
  215. package/src/core/science/units/si/derived/SIEMENS.d.ts.map +1 -0
  216. package/src/core/science/units/si/derived/SIEMENS.js +13 -0
  217. package/src/core/science/units/si/derived/SIEVERT.d.ts +10 -0
  218. package/src/core/science/units/si/derived/SIEVERT.d.ts.map +1 -0
  219. package/src/core/science/units/si/derived/SIEVERT.js +16 -0
  220. package/src/core/science/units/si/derived/TESLA.d.ts +7 -0
  221. package/src/core/science/units/si/derived/TESLA.d.ts.map +1 -0
  222. package/src/core/science/units/si/derived/TESLA.js +13 -0
  223. package/src/core/science/units/si/derived/VOLT.d.ts +7 -0
  224. package/src/core/science/units/si/derived/VOLT.d.ts.map +1 -0
  225. package/src/core/science/units/si/derived/VOLT.js +13 -0
  226. package/src/core/science/units/si/derived/WATT.d.ts +7 -0
  227. package/src/core/science/units/si/derived/WATT.d.ts.map +1 -0
  228. package/src/core/science/units/si/derived/WATT.js +13 -0
  229. package/src/core/science/units/si/derived/WEBER.d.ts +7 -0
  230. package/src/core/science/units/si/derived/WEBER.d.ts.map +1 -0
  231. package/src/core/science/units/si/derived/WEBER.js +13 -0
  232. package/src/core/science/units/unit_matrix_to_string.d.ts +29 -0
  233. package/src/core/science/units/unit_matrix_to_string.d.ts.map +1 -0
  234. package/src/core/science/units/unit_matrix_to_string.js +403 -0
  235. package/src/engine/graphics/geometry/MikkT/CalcTexArea.d.ts.map +1 -1
  236. package/src/engine/graphics/geometry/MikkT/CalcTexArea.js +1 -2
  237. package/src/engine/graphics/geometry/MikkT/InitTriInfo.d.ts.map +1 -1
  238. package/src/engine/graphics/geometry/MikkT/InitTriInfo.js +6 -7
@@ -8,9 +8,11 @@
8
8
  *
9
9
  * Iterating through a Vector4 instance will yield its components (x, y, z, w) in the corresponding order.
10
10
  *
11
+ * Backed by a `Float64Array` of length 4, so instances are usable directly as typed-array views and indexed access `v[0]`..`v[3]` aliases `v.x`..`v.w`.
12
+ *
11
13
  * @implements Iterable<number>
12
14
  */
13
- export class Vector4 implements Iterable<number> {
15
+ export class Vector4 extends Float64Array implements Iterable<number> {
14
16
  /**
15
17
  *
16
18
  * @param {Vector4} v0
@@ -19,6 +21,12 @@ export class Vector4 implements Iterable<number> {
19
21
  * @param {Vector4} result
20
22
  */
21
23
  static lerp(v0: Vector4, v1: Vector4, f: number, result: Vector4): void;
24
+ /**
25
+ * Ensure that built-in `TypedArray` methods (`map`, `slice`, `subarray`, ...) do not
26
+ * try to construct a `Vector4` via the buffer-form constructor.
27
+ * @returns {Float64ArrayConstructor}
28
+ */
29
+ static get [Symbol.species](): Float64ArrayConstructor;
22
30
  /**
23
31
  *
24
32
  * @param {number} [x=0]
@@ -29,26 +37,10 @@ export class Vector4 implements Iterable<number> {
29
37
  * @class
30
38
  */
31
39
  constructor(x?: number, y?: number, z?: number, w?: number);
32
- /**
33
- *
34
- * @type {number}
35
- */
36
- x: number;
37
- /**
38
- *
39
- * @type {number}
40
- */
41
- y: number;
42
- /**
43
- *
44
- * @type {number}
45
- */
46
- z: number;
47
- /**
48
- *
49
- * @type {number}
50
- */
51
- w: number;
40
+ 0: number;
41
+ 1: number;
42
+ 2: number;
43
+ 3: number;
52
44
  /**
53
45
  * Dispatched when the value changes
54
46
  * @readonly
@@ -59,42 +51,42 @@ export class Vector4 implements Iterable<number> {
59
51
  *
60
52
  * @param {number} v
61
53
  */
62
- set 0(arg: number);
54
+ set x(arg: number);
63
55
  /**
64
56
  *
65
57
  * @returns {number}
66
58
  */
67
- get 0(): number;
59
+ get x(): number;
68
60
  /**
69
61
  *
70
62
  * @param {number} v
71
63
  */
72
- set 1(arg: number);
64
+ set y(arg: number);
73
65
  /**
74
66
  *
75
67
  * @returns {number}
76
68
  */
77
- get 1(): number;
69
+ get y(): number;
78
70
  /**
79
71
  *
80
72
  * @param {number} v
81
73
  */
82
- set 2(arg: number);
74
+ set z(arg: number);
83
75
  /**
84
76
  *
85
77
  * @returns {number}
86
78
  */
87
- get 2(): number;
79
+ get z(): number;
88
80
  /**
89
81
  *
90
82
  * @param {number} v
91
83
  */
92
- set 3(arg: number);
84
+ set w(arg: number);
93
85
  /**
94
86
  *
95
87
  * @returns {number}
96
88
  */
97
- get 3(): number;
89
+ get w(): number;
98
90
  /**
99
91
  *
100
92
  * @param {number[]} array
@@ -239,7 +231,6 @@ export class Vector4 implements Iterable<number> {
239
231
  */
240
232
  readonly isVector4: boolean;
241
233
  fromArray: (array: number[], offset?: number) => void;
242
- [Symbol.iterator](): Generator<number, void, unknown>;
243
234
  }
244
235
  export namespace Vector4 {
245
236
  let typeName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Vector4.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector4.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,yCAFwB,MAAM;IAgc1B;;;;;;OAMG;IACH,gBALW,OAAO,MACP,OAAO,qBAEP,OAAO,QASjB;IA3cD;;;;;;;;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,2FAA6B;IAWjC;;;OAGG;IACH,mBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,mBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,mBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,mBAEC;IAdD;;;OAGG;IACH,gBAEC;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,mCAMC;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,UAAQ,OAAO,GACb,OAAO,CASnB;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,gBAHW,MAAM,EAAE,GAAC,YAAY,GACpB,OAAO,CASlB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,SAFa,OAAO,CAQnB;IAED;;;OAGG;IACH,qCAuBC;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,2CAKC;IAED;;;OAGG;IACH,6CAOC;IA4BL;;;OAGG;IACH,oBAFU,OAAO,CAEU;IAE3B,mBArWe,MAAM,EAAE,WACR,MAAM,UAoWM;IAhCvB,sDAOC;CAiBJ;;kBAaS,MAAM"}
1
+ {"version":3,"file":"Vector4.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector4.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;GAaG;AACH,8DAFwB,MAAM;IAib1B;;;;;;OAMG;IACH,gBALW,OAAO,MACP,OAAO,qBAEP,OAAO,QASjB;IA9ZD;;;;OAIG;IACH,uDAEC;IArCD;;;;;;;;OAQG;IACH,gBAPW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,EAuBhB;IAXG,UAAW;IACX,UAAW;IACX,UAAW;IACX,UAAW;IAEX;;;;OAIG;IACH,2FAA6B;IAoBjC;;;OAGG;IACH,mBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,mBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,mBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,mBAEC;IAdD;;;OAGG;IACH,gBAEC;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,mCAMC;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,UAAQ,OAAO,GACb,OAAO,CASnB;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,gBAHW,MAAM,EAAE,GAAC,YAAY,GACpB,OAAO,CASlB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,SAFa,OAAO,CAQnB;IAED;;;OAGG;IACH,qCAuBC;IAED;;;;OAIG;IACH,aAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,QAFY,MAAM,CASjB;IAED;;;;OAIG;IACH,gBAJW,OAAO,MACP,OAAO,mBAKjB;IA8FL,kBA1Fe,MAAM,EAAE,UA0FE;IAjFrB;;OAEG;IACH,WAFa,MAAM,EAAE,CAQpB;IAED;;;;OAIG;IACH,mBAHW,MAAM,EAAE,UACR,MAAM,QAIhB;IAED;;;;;MAOC;IAED,0BAEC;IAED;;;OAGG;IACH,2CAKC;IAED;;;OAGG;IACH,6CAOC;IAmBL;;;OAGG;IACH,oBAFU,OAAO,CAEU;IAE3B,mBA5Ve,MAAM,EAAE,WACR,MAAM,UA2VM;CAR1B;;kBAaS,MAAM"}
@@ -14,9 +14,11 @@ import { computeHashFloat } from "../primitives/numbers/computeHashFloat.js";
14
14
  *
15
15
  * Iterating through a Vector4 instance will yield its components (x, y, z, w) in the corresponding order.
16
16
  *
17
+ * Backed by a `Float64Array` of length 4, so instances are usable directly as typed-array views and indexed access `v[0]`..`v[3]` aliases `v.x`..`v.w`.
18
+ *
17
19
  * @implements Iterable<number>
18
20
  */
19
- export class Vector4 {
21
+ export class Vector4 extends Float64Array {
20
22
  /**
21
23
  *
22
24
  * @param {number} [x=0]
@@ -32,27 +34,12 @@ export class Vector4 {
32
34
  z = 0,
33
35
  w = 0
34
36
  ) {
37
+ super(4);
35
38
 
36
- /**
37
- *
38
- * @type {number}
39
- */
40
- this.x = x;
41
- /**
42
- *
43
- * @type {number}
44
- */
45
- this.y = y;
46
- /**
47
- *
48
- * @type {number}
49
- */
50
- this.z = z;
51
- /**
52
- *
53
- * @type {number}
54
- */
55
- this.w = w;
39
+ this[0] = x;
40
+ this[1] = y;
41
+ this[2] = z;
42
+ this[3] = w;
56
43
 
57
44
  /**
58
45
  * Dispatched when the value changes
@@ -62,68 +49,77 @@ export class Vector4 {
62
49
  this.onChanged = new Signal();
63
50
  }
64
51
 
52
+ /**
53
+ * Ensure that built-in `TypedArray` methods (`map`, `slice`, `subarray`, ...) do not
54
+ * try to construct a `Vector4` via the buffer-form constructor.
55
+ * @returns {Float64ArrayConstructor}
56
+ */
57
+ static get [Symbol.species]() {
58
+ return Float64Array;
59
+ }
60
+
65
61
  /**
66
62
  *
67
63
  * @returns {number}
68
64
  */
69
- get 0() {
70
- return this.x;
65
+ get x() {
66
+ return this[0];
71
67
  }
72
68
 
73
69
  /**
74
70
  *
75
71
  * @param {number} v
76
72
  */
77
- set 0(v) {
78
- this.x = v;
73
+ set x(v) {
74
+ this[0] = v;
79
75
  }
80
76
 
81
77
  /**
82
78
  *
83
79
  * @returns {number}
84
80
  */
85
- get 1() {
86
- return this.y;
81
+ get y() {
82
+ return this[1];
87
83
  }
88
84
 
89
85
  /**
90
86
  *
91
87
  * @param {number} v
92
88
  */
93
- set 1(v) {
94
- this.y = v;
89
+ set y(v) {
90
+ this[1] = v;
95
91
  }
96
92
 
97
93
  /**
98
94
  *
99
95
  * @returns {number}
100
96
  */
101
- get 2() {
102
- return this.z;
97
+ get z() {
98
+ return this[2];
103
99
  }
104
100
 
105
101
  /**
106
102
  *
107
103
  * @param {number} v
108
104
  */
109
- set 2(v) {
110
- this.z = v;
105
+ set z(v) {
106
+ this[2] = v;
111
107
  }
112
108
 
113
109
  /**
114
110
  *
115
111
  * @returns {number}
116
112
  */
117
- get 3() {
118
- return this.w;
113
+ get w() {
114
+ return this[3];
119
115
  }
120
116
 
121
117
  /**
122
118
  *
123
119
  * @param {number} v
124
120
  */
125
- set 3(v) {
126
- this.w = v;
121
+ set w(v) {
122
+ this[3] = v;
127
123
  }
128
124
 
129
125
  /**
@@ -146,10 +142,10 @@ export class Vector4 {
146
142
  * @param {number} offset
147
143
  */
148
144
  writeToArray(array, offset = 0) {
149
- array[offset] = this.x;
150
- array[offset + 1] = this.y;
151
- array[offset + 2] = this.z;
152
- array[offset + 3] = this.w;
145
+ array[offset] = this[0];
146
+ array[offset + 1] = this[1];
147
+ array[offset + 2] = this[2];
148
+ array[offset + 3] = this[3];
153
149
  }
154
150
 
155
151
  /**
@@ -171,17 +167,17 @@ export class Vector4 {
171
167
  assert.ok(!Number.isNaN(z), `Z must be a valid number, instead was NaN`);
172
168
  assert.ok(!Number.isNaN(w), `W must be a valid number, instead was NaN`);
173
169
 
174
- const _x = this.x;
175
- const _y = this.y;
176
- const _z = this.z;
177
- const _w = this.w;
170
+ const _x = this[0];
171
+ const _y = this[1];
172
+ const _z = this[2];
173
+ const _w = this[3];
178
174
 
179
175
  if (_x !== x || _y !== y || _z !== z || _w !== w) {
180
176
 
181
- this.x = x;
182
- this.y = y;
183
- this.z = z;
184
- this.w = w;
177
+ this[0] = x;
178
+ this[1] = y;
179
+ this[2] = z;
180
+ this[3] = w;
185
181
 
186
182
  if (this.onChanged.hasHandlers()) {
187
183
  this.onChanged.send8(
@@ -199,11 +195,11 @@ export class Vector4 {
199
195
  * @param {Vector3} v3
200
196
  */
201
197
  multiplyVector3(v3) {
202
- const x = this.x * v3.x;
203
- const y = this.y * v3.y;
204
- const z = this.z * v3.z;
198
+ const x = this[0] * v3.x;
199
+ const y = this[1] * v3.y;
200
+ const z = this[2] * v3.z;
205
201
 
206
- this.set(x, y, z, this.w);
202
+ this.set(x, y, z, this[3]);
207
203
  }
208
204
 
209
205
  /**
@@ -215,7 +211,7 @@ export class Vector4 {
215
211
  assert.isNumber(value, 'value');
216
212
  assert.notNaN(value, 'value');
217
213
 
218
- return this.set(this.x * value, this.y * value, this.z * value, this.w * value);
214
+ return this.set(this[0] * value, this[1] * value, this[2] * value, this[3] * value);
219
215
  }
220
216
 
221
217
  /**
@@ -245,10 +241,10 @@ export class Vector4 {
245
241
  d0, d1, d2, d3
246
242
  ) {
247
243
 
248
- const _x = this.x;
249
- const _y = this.y;
250
- const _z = this.z;
251
- const _w = this.w;
244
+ const _x = this[0];
245
+ const _y = this[1];
246
+ const _z = this[2];
247
+ const _w = this[3];
252
248
 
253
249
  const x = a0 * _x + b0 * _y + c0 * _z + d0 * _w;
254
250
  const y = a1 * _x + b1 * _y + c1 * _z + d1 * _w;
@@ -264,7 +260,7 @@ export class Vector4 {
264
260
  * @returns {number}
265
261
  */
266
262
  dot(other) {
267
- return this.x * other.x + this.y * other.y + this.z * other.z + this.w * other.w;
263
+ return this[0] * other.x + this[1] * other.y + this[2] * other.z + this[3] * other.w;
268
264
  }
269
265
 
270
266
  /**
@@ -274,10 +270,10 @@ export class Vector4 {
274
270
  */
275
271
  add3(v3) {
276
272
  return this.set(
277
- this.x + v3.x,
278
- this.y + v3.y,
279
- this.z + v3.z,
280
- this.w
273
+ this[0] + v3.x,
274
+ this[1] + v3.y,
275
+ this[2] + v3.z,
276
+ this[3]
281
277
  );
282
278
  }
283
279
 
@@ -330,10 +326,10 @@ export class Vector4 {
330
326
  * @param {Quaternion} q
331
327
  */
332
328
  applyQuaternion(q) {
333
- const x = this.x;
334
- const y = this.y;
335
- const z = this.z;
336
- const w = this.w;
329
+ const x = this[0];
330
+ const y = this[1];
331
+ const z = this[2];
332
+ const w = this[3];
337
333
 
338
334
  const qx = q.x;
339
335
  const qy = q.y;
@@ -360,7 +356,7 @@ export class Vector4 {
360
356
  * @returns {boolean}
361
357
  */
362
358
  equals(vec4) {
363
- return this.x === vec4.x && this.y === vec4.y && this.z === vec4.z && this.w === vec4.w;
359
+ return this[0] === vec4.x && this[1] === vec4.y && this[2] === vec4.z && this[3] === vec4.w;
364
360
  }
365
361
 
366
362
  /**
@@ -369,10 +365,10 @@ export class Vector4 {
369
365
  */
370
366
  hash() {
371
367
  return combine_hash(
372
- computeHashFloat(this.x),
373
- computeHashFloat(this.y),
374
- computeHashFloat(this.z),
375
- computeHashFloat(this.w)
368
+ computeHashFloat(this[0]),
369
+ computeHashFloat(this[1]),
370
+ computeHashFloat(this[2]),
371
+ computeHashFloat(this[3])
376
372
  );
377
373
  }
378
374
 
@@ -390,10 +386,10 @@ export class Vector4 {
390
386
  * @param {number[]} result
391
387
  */
392
388
  toArray(result) {
393
- result[0] = this.x;
394
- result[1] = this.y;
395
- result[2] = this.z;
396
- result[3] = this.w;
389
+ result[0] = this[0];
390
+ result[1] = this[1];
391
+ result[2] = this[2];
392
+ result[3] = this[3];
397
393
  }
398
394
 
399
395
  /**
@@ -418,10 +414,10 @@ export class Vector4 {
418
414
 
419
415
  toJSON() {
420
416
  return {
421
- x: this.x,
422
- y: this.y,
423
- z: this.z,
424
- w: this.w
417
+ x: this[0],
418
+ y: this[1],
419
+ z: this[2],
420
+ w: this[3]
425
421
  };
426
422
  }
427
423
 
@@ -434,10 +430,10 @@ export class Vector4 {
434
430
  * @param {BinaryBuffer} buffer
435
431
  */
436
432
  toBinaryBuffer(buffer) {
437
- buffer.writeFloat64(this.x);
438
- buffer.writeFloat64(this.y);
439
- buffer.writeFloat64(this.z);
440
- buffer.writeFloat64(this.w);
433
+ buffer.writeFloat64(this[0]);
434
+ buffer.writeFloat64(this[1]);
435
+ buffer.writeFloat64(this[2]);
436
+ buffer.writeFloat64(this[3]);
441
437
  }
442
438
 
443
439
  /**
@@ -453,15 +449,6 @@ export class Vector4 {
453
449
  this.set(x, y, z, w);
454
450
  }
455
451
 
456
- * [Symbol.iterator]() {
457
-
458
- yield this.x;
459
- yield this.y;
460
- yield this.z;
461
- yield this.w;
462
-
463
- }
464
-
465
452
  /**
466
453
  *
467
454
  * @param {Vector4} v0
@@ -1 +1 @@
1
- {"version":3,"file":"computeBoundingSphereOfSpheres.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/packing/computeBoundingSphereOfSpheres.js"],"names":[],"mappings":"AAoBA;;;;;;;;;GASG;AACH,uDANW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,QAClC,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,UAClC,MAAM,SACN,MAAM,cACN,MAAM,QAwDhB"}
1
+ {"version":3,"file":"computeBoundingSphereOfSpheres.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/packing/computeBoundingSphereOfSpheres.js"],"names":[],"mappings":"AAyBA;;;;;;;;;GASG;AACH,uDANW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,QAClC,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,UAClC,MAAM,SACN,MAAM,cACN,MAAM,QAoEhB"}
@@ -18,6 +18,11 @@ function compute_point_distance(a, b, d) {
18
18
  return Math.sqrt(result);
19
19
  }
20
20
 
21
+ const SCRATCH_DIMENSIONS = 4;
22
+
23
+ const _scratch_center = new Float64Array(SCRATCH_DIMENSIONS);
24
+ const _scratch_sphere = new Float64Array(SCRATCH_DIMENSIONS + 1);
25
+
21
26
  /**
22
27
  * Computes bounding sphere of a number of spheres
23
28
  * NOTE: implementation does not produce a very tight sphere, here is a good resource for a better implementation:
@@ -31,15 +36,27 @@ function compute_point_distance(a, b, d) {
31
36
  export function computeBoundingSphereOfSpheres(result, data, offset, count, dimensions) {
32
37
  assert.isArrayLike(result, 'result');
33
38
 
34
- const center = new Float64Array(dimensions);
39
+ const sphere_component_count = dimensions + 1;
40
+
41
+ let center;
42
+ let sphere;
35
43
 
36
- const sphere = new Float64Array(dimensions + 1);
44
+ if (dimensions <= SCRATCH_DIMENSIONS) {
45
+ // avoid allocation
46
+ center = _scratch_center;
47
+ sphere = _scratch_sphere;
48
+
49
+ center.fill(0);
50
+ } else {
51
+ center = new Float64Array(dimensions);
52
+ sphere = new Float64Array(sphere_component_count);
53
+ }
37
54
 
38
55
  for (let i = 0; i < count; i++) {
39
- const sphere_offset = offset + i * dimensions;
56
+ const sphere_offset = offset + i * sphere_component_count;
40
57
 
41
58
  //read sphere
42
- for (let j = 0; j < dimensions + 1; j++) {
59
+ for (let j = 0; j < sphere_component_count; j++) {
43
60
  sphere[j] = data[sphere_offset + j];
44
61
  }
45
62
 
@@ -58,10 +75,10 @@ export function computeBoundingSphereOfSpheres(result, data, offset, count, dime
58
75
 
59
76
  for (let i = 0; i < count; i++) {
60
77
  // compute squared distance from center to each sphere
61
- const sphere_offset = offset + i * dimensions;
78
+ const sphere_offset = offset + i*sphere_component_count;
62
79
 
63
80
  //read sphere
64
- for (let j = 0; j < dimensions + 1; j++) {
81
+ for (let j = 0; j < sphere_component_count; j++) {
65
82
  sphere[j] = data[sphere_offset + j];
66
83
  }
67
84
 
@@ -1 +1 @@
1
- {"version":3,"file":"Miniball.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/miniball/Miniball.js"],"names":[],"mappings":"AAwBA;;;;;GAKG;AACH;IA8CI;;;;;OAKG;IACH,8BA4DC;IA9GD;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;;;;;;;;OAUG;IACH,wBAAoB;IAEpB;;;;OAIG;IACH,iBAAa;IAEb;;;OAGG;IACH,SAFU,MAAM,CAEJ;IAYR;;OAEG;IACH,YAAe;IAEf;;;;OAIG;IACH,eAA2B;IAI3B;;;OAGG;IACH,KAFU,MAAM,CAEU;IAM1B;;;;OAIG;IACH,iBAA4D;IAE5D;;;OAGG;IACH,aAFU,MAAM,EAAE,GAAC,YAAY,CAEkD;IAEjF;;;OAGG;IACH,eAFU,MAAM,EAAE,GAAC,YAAY,CAEwD;IAEvF;;;OAGG;IACH,SAFU,MAAM,EAAE,GAAC,YAAY,CAEsD;IAErF;;;;OAIG;IACH,kBAAgC;IAIpC;;;;;;;OAOG;IACH,WAFY,OAAO,CAIlB;IAED;;;;;;OAMG;IACH,UAFY,MAAM,CAIjB;IAED;;;;;;OAMG;IACH,UAFY,MAAM,EAAE,CAInB;IAED;;;OAGG;IACH,uBAEC;IAED;;;;;;OAMG;IACH,QAJY,MAAM,CAMjB;IAED;;;;;;;;OAQG;IACH,iBAkCC;IAED;;OAEG;IACH,yBAGC;IAED;;OAEG;IACH,qBAcC;IAED;;;;;;;;;;;OAWG;IACH,gBA4CC;IAED;;;;;;;;OAQG;IACH,kBAFY,OAAO,CA4BlB;IAED;;;;;;;;OAQG;IACH,yBA8DC;IAGD;;;OAGG;IACH,YAFY,MAAM,CA0BjB;CACJ;wBAzcuB,cAAc"}
1
+ {"version":3,"file":"Miniball.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/miniball/Miniball.js"],"names":[],"mappings":"AAyBA;;;;;GAKG;AACH;IA8CI;;;;;OAKG;IACH,8BA4DC;IA9GD;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;;;;;;;;OAUG;IACH,wBAAoB;IAEpB;;;;OAIG;IACH,iBAAa;IAEb;;;OAGG;IACH,SAFU,MAAM,CAEJ;IAYR;;OAEG;IACH,YAAe;IAEf;;;;OAIG;IACH,eAA2B;IAI3B;;;OAGG;IACH,KAFU,MAAM,CAEU;IAM1B;;;;OAIG;IACH,iBAA4D;IAE5D;;;OAGG;IACH,aAFU,MAAM,EAAE,GAAC,YAAY,CAEkD;IAEjF;;;OAGG;IACH,eAFU,MAAM,EAAE,GAAC,YAAY,CAEwD;IAEvF;;;OAGG;IACH,SAFU,MAAM,EAAE,GAAC,YAAY,CAEsD;IAErF;;;;OAIG;IACH,kBAAgC;IAIpC;;;;;;;OAOG;IACH,WAFY,OAAO,CAIlB;IAED;;;;;;OAMG;IACH,UAFY,MAAM,CAIjB;IAED;;;;;;OAMG;IACH,UAFY,MAAM,EAAE,CAInB;IAED;;;OAGG;IACH,uBAEC;IAED;;;;;;OAMG;IACH,QAJY,MAAM,CAMjB;IAED;;;;;;;;OAQG;IACH,iBAkCC;IAED;;OAEG;IACH,yBAGC;IAED;;OAEG;IACH,qBAcC;IAED;;;;;;;;;;;OAWG;IACH,gBA4CC;IAED;;;;;;;;OAQG;IACH,kBAFY,OAAO,CA4BlB;IAED;;;;;;;;OAQG;IACH,yBAsDC;IAGD;;;OAGG;IACH,YAFY,MAAM,CA0BjB;CACJ;wBAjcuB,cAAc"}
@@ -8,6 +8,7 @@
8
8
 
9
9
  import { assert } from "../../../assert.js";
10
10
  import { sqr } from "../../../math/sqr.js";
11
+ import { vector_dot } from "../../vec/vector_dot.js";
11
12
  import { Subspan } from "./Subspan.js";
12
13
 
13
14
  /**
@@ -405,23 +406,15 @@ export class Miniball {
405
406
  centerToPoint[i] = pointSet.coord(j, i) - center[i];
406
407
  }
407
408
 
408
- let dirPointProd = 0;
409
-
410
- for (i = 0; i < dim; ++i) {
411
- dirPointProd += centerToAff[i] * centerToPoint[i];
412
- }
409
+ const dirPointProd = vector_dot(centerToAff, centerToPoint, dim);
413
410
 
414
411
  if ((distToAffSquare - dirPointProd) < distance_error) {
415
412
  continue;
416
413
  }
417
414
 
418
- let bound = 0;
419
-
420
- for (i = 0; i < dim; ++i) {
421
- bound += centerToPoint[i] * centerToPoint[i];
422
- }
415
+ const bound_sq = vector_dot(centerToPoint, centerToPoint, dim);
423
416
 
424
- bound = (squaredRadius - bound) / 2 / (distToAffSquare - dirPointProd);
417
+ const bound = (squaredRadius - bound_sq) / 2 / (distToAffSquare - dirPointProd);
425
418
 
426
419
  if (bound > 0 && bound < scale) {
427
420
  //if (com.dreizak.miniball.highdim.Logging.log)
@@ -26,36 +26,31 @@ export class Subspan {
26
26
  */
27
27
  members: Int32Array;
28
28
  /**
29
- * DxD square matrix, where D is number of dimensions
30
- * @type {number[][]}
29
+ * @type {SquareMatrix}
31
30
  */
32
- Q: number[][];
31
+ Q: SquareMatrix;
33
32
  /**
34
- * DxD square matrix, where D is number of dimensions
35
- * @type {number[][]}
33
+ * @type {SquareMatrix}
36
34
  */
37
- R: number[][];
35
+ R: SquareMatrix;
38
36
  /**
39
37
  * D sized vector
40
- * @type {number[]}
38
+ * @type {Float64Array}
41
39
  */
42
- u: number[];
40
+ u: Float64Array;
43
41
  /**
44
42
  * D sized vector
45
- * @type {number[]}
43
+ * @type {Float64Array}
46
44
  */
47
- w: number[];
45
+ w: Float64Array;
48
46
  r: number;
49
47
  /**
50
- * Givens C coefficient
51
- * @type {number}
52
- */
53
- c: number;
54
- /**
55
- * Givens S coefficient
56
- * @type {number}
48
+ * Givens rotation coefficients scratch: cs[0] = c, cs[1] = s.
49
+ * Holding this as an instance field avoids per-call allocation of a
50
+ * fresh 2-element array — see givens_rotation_coefficients's contract.
51
+ * @type {Float64Array}
57
52
  */
58
- s: number;
53
+ cs: Float64Array;
59
54
  dimension(): number;
60
55
  /**
61
56
  * The size of the instance's set <i>M</i>, a number between 0 and `dim+1`.
@@ -116,27 +111,6 @@ export class Subspan {
116
111
  * @private
117
112
  */
118
113
  private origin;
119
- /**
120
- * Determine the Givens coefficients <i>(c,s)</i> satisfying
121
- *
122
- * <pre>
123
- * c * a + s * b = +/- (a^2 + b^2) c * b - s * a = 0
124
- * </pre>
125
- *
126
- * We don't care about the signs here, for efficiency, so make sure not to rely on them anywhere.
127
- *
128
- * <i>Source:</i> "Matrix Computations" (2nd edition) by Gene H. B. Golub & Charles F. B. Van Loan
129
- * (Johns Hopkins University Press, 1989), p. 216.
130
- *
131
- * Note that the code of this class sometimes does not call this method but only mentions it in a
132
- * comment. The reason for this is performance; Java does not allow an efficient way of returning
133
- * a pair of doubles, so we sometimes manually "inline" `givens()` for the sake of
134
- * performance.
135
- * @param {number} a
136
- * @param {number} b
137
- * @private
138
- */
139
- private givens;
140
114
  /**
141
115
  * Appends the new column <i>u</i> (which is a member field of this instance) to the right of <i>A
142
116
  * = QR</i>, updating <i>Q</i> and <i>R</i>. It assumes <i>r</i> to still be the old value, i.e.,
@@ -213,4 +187,5 @@ export class Subspan {
213
187
  remove(index: number): void;
214
188
  }
215
189
  import { BitSet } from "../../../binary/BitSet.js";
190
+ import { SquareMatrix } from "../../../math/matrix/SquareMatrix.js";
216
191
  //# sourceMappingURL=Subspan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Subspan.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/miniball/Subspan.js"],"names":[],"mappings":"AAUA;IACI;;;;;OAKG;IACH,iBAJW,MAAM,kBAEN,MAAM,EAuFhB;IAhFG;;OAEG;IACH,YAAU;IAEV;;;OAGG;IACH,YAFU,MAAM,CAE4B;IAE5C;;;OAGG;IACH,KAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,SAFU,UAAU,CAEkB;IAmBtC;;;OAGG;IACH,GAFU,MAAM,EAAE,EAAE,CAEV;IAEV;;;OAGG;IACH,GAFU,MAAM,EAAE,EAAE,CAEV;IAEV;;;OAGG;IACH,GAFU,MAAM,EAAE,CAEK;IACvB;;;OAGG;IACH,GAFU,MAAM,EAAE,CAEK;IAEvB,UAAU;IAEV;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,GAFU,MAAM,CAEN;IAOd,oBAEC;IAED;;;;;;OAMG;IACH,YAEC;IAED;;;;;;;;OAQG;IACH,kBAFa,OAAO,CAInB;IAED;;;;;;;OAOG;IACH,aAFa,MAAM,CAIlB;IAED;;;;;;;;;;OAUG;IACH,eAJW,MAAM,GAEL,MAAM,CAIjB;IAED;;;;;;;;;;;OAWG;IACH,YAEC;IAED;;;;;OAKG;IACH,eAEC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAaC;IAED;;;;;;;;OAQG;IACH,qBA2BC;IAED;;;;;;;;OAQG;IACH,WAFW,MAAM,QAsBhB;IAED;;;;;;;;;;;OAWG;IACH,wBAJW,MAAM,EAAE,KACR,MAAM,EAAE,GACP,MAAM,CAuCjB;IAED;;;;OAIG;IACH,uBAFY,MAAM,CA8CjB;IAED;;;;;;;;;;;;OAYG;IACH,0BAHW,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,EAAE,GAAC,YAAY,QAuC/B;IAED;;;;;OAKG;IACH,yBAkCC;IAED;;;;;;;OAOG;IACH,8BA6CC;IAED;;;OAGG;IACH,cAFW,MAAM,QAsChB;CACJ;uBA7jBsB,2BAA2B"}
1
+ {"version":3,"file":"Subspan.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/miniball/Subspan.js"],"names":[],"mappings":"AAgBA;IACI;;;;;OAKG;IACH,iBAJW,MAAM,kBAEN,MAAM,EAuEhB;IAhEG;;OAEG;IACH,YAAU;IAEV;;;OAGG;IACH,YAFU,MAAM,CAE4B;IAE5C;;;OAGG;IACH,KAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,SAFU,UAAU,CAEkB;IAQtC;;OAEG;IACH,GAFU,YAAY,CAEgC;IAGtD;;OAEG;IACH,GAFU,YAAY,CAEgC;IAEtD;;;OAGG;IACH,GAFU,YAAY,CAEQ;IAC9B;;;OAGG;IACH,GAFU,YAAY,CAEQ;IAE9B,UAAU;IAEV;;;;;OAKG;IACH,IAFU,YAAY,CAEO;IAOjC,oBAEC;IAED;;;;;;OAMG;IACH,YAEC;IAED;;;;;;;;OAQG;IACH,kBAFa,OAAO,CAInB;IAED;;;;;;;OAOG;IACH,aAFa,MAAM,CAIlB;IAED;;;;;;;;;;OAUG;IACH,eAJW,MAAM,GAEL,MAAM,CAIjB;IAED;;;;;;;;;;;OAWG;IACH,YAEC;IAED;;;;;OAKG;IACH,eAEC;IAED;;;;;;;;OAQG;IACH,qBAyBC;IAED;;;;;;;;OAQG;IACH,WAFW,MAAM,QAsBhB;IAED;;;;;;;;;;;OAWG;IACH,wBAJW,MAAM,EAAE,KACR,MAAM,EAAE,GACP,MAAM,CA4BjB;IAED;;;;OAIG;IACH,uBAFY,MAAM,CA8CjB;IAED;;;;;;;;;;;;OAYG;IACH,0BAHW,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,EAAE,GAAC,YAAY,QAuC/B;IAED;;;;;OAKG;IACH,yBAkCC;IAED;;;;;;;OAOG;IACH,8BA4CC;IAED;;;OAGG;IACH,cAFW,MAAM,QA4ChB;CACJ;uBAxgBsB,2BAA2B;6BAErB,sCAAsC"}