@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.
- package/package.json +1 -1
- package/src/core/geom/2d/aabb/aabb2_intersects_ray.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/aabb2_intersects_ray.js +5 -7
- package/src/core/geom/2d/hash-grid/shg_query_elements_circle.d.ts.map +1 -1
- package/src/core/geom/2d/hash-grid/shg_query_elements_circle.js +2 -3
- package/src/core/geom/3d/aabb/aabb3_intersects_line_segment.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_intersects_line_segment.js +9 -11
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.js +6 -4
- package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.js +1 -2
- package/src/core/geom/Quaternion.d.ts +26 -39
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +124 -136
- package/src/core/geom/Vector2.d.ts +28 -14
- package/src/core/geom/Vector2.d.ts.map +1 -1
- package/src/core/geom/Vector2.js +114 -97
- package/src/core/geom/Vector3.d.ts +21 -34
- package/src/core/geom/Vector3.d.ts.map +1 -1
- package/src/core/geom/Vector3.js +131 -142
- package/src/core/geom/Vector4.d.ts +21 -30
- package/src/core/geom/Vector4.d.ts.map +1 -1
- package/src/core/geom/Vector4.js +80 -93
- package/src/core/geom/packing/computeBoundingSphereOfSpheres.d.ts.map +1 -1
- package/src/core/geom/packing/computeBoundingSphereOfSpheres.js +23 -6
- package/src/core/geom/packing/miniball/Miniball.d.ts.map +1 -1
- package/src/core/geom/packing/miniball/Miniball.js +4 -11
- package/src/core/geom/packing/miniball/Subspan.d.ts +14 -39
- package/src/core/geom/packing/miniball/Subspan.d.ts.map +1 -1
- package/src/core/geom/packing/miniball/Subspan.js +105 -158
- package/src/core/geom/packing/miniball/miniball_compute_quality.d.ts.map +1 -1
- package/src/core/geom/packing/miniball/miniball_compute_quality.js +2 -6
- package/src/core/geom/vec/vector_axpy.d.ts +12 -0
- package/src/core/geom/vec/vector_axpy.d.ts.map +1 -0
- package/src/core/geom/vec/vector_axpy.js +15 -0
- package/src/core/geom/vec/vector_axpy_offset.d.ts +17 -0
- package/src/core/geom/vec/vector_axpy_offset.d.ts.map +1 -0
- package/src/core/geom/vec/vector_axpy_offset.js +20 -0
- package/src/core/geom/vec/vector_dot_offset.d.ts +18 -0
- package/src/core/geom/vec/vector_dot_offset.d.ts.map +1 -0
- package/src/core/geom/vec/vector_dot_offset.js +25 -0
- package/src/core/math/complex/complex_horner_eval.d.ts +16 -0
- package/src/core/math/complex/complex_horner_eval.d.ts.map +1 -0
- package/src/core/math/complex/complex_horner_eval.js +31 -0
- package/src/core/math/fabsf.d.ts +2 -3
- package/src/core/math/fabsf.d.ts.map +1 -1
- package/src/core/math/fabsf.js +3 -5
- package/src/core/math/linalg/cubic_residual_times_derivative_accumulate.d.ts +26 -0
- package/src/core/math/linalg/cubic_residual_times_derivative_accumulate.d.ts.map +1 -0
- package/src/core/math/linalg/cubic_residual_times_derivative_accumulate.js +43 -0
- package/src/core/math/linalg/eigen/matrix_eigenvalues_in_place.d.ts +2 -1
- package/src/core/math/linalg/eigen/matrix_eigenvalues_in_place.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_eigenvalues_in_place.js +2 -1
- package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts +10 -4
- package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_householder_in_place.js +122 -98
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts +2 -2
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_qr_in_place.js +144 -124
- package/src/core/math/linalg/givens/givens_apply_rows.d.ts +22 -0
- package/src/core/math/linalg/givens/givens_apply_rows.d.ts.map +1 -0
- package/src/core/math/linalg/givens/givens_apply_rows.js +28 -0
- package/src/core/math/linalg/givens/givens_apply_rows_offset.d.ts +24 -0
- package/src/core/math/linalg/givens/givens_apply_rows_offset.d.ts.map +1 -0
- package/src/core/math/linalg/givens/givens_apply_rows_offset.js +30 -0
- package/src/core/math/linalg/givens/givens_rotation_coefficients.d.ts +25 -0
- package/src/core/math/linalg/givens/givens_rotation_coefficients.d.ts.map +1 -0
- package/src/core/math/linalg/givens/givens_rotation_coefficients.js +39 -0
- package/src/core/math/linalg/lu_factor_linear_system.d.ts +1 -1
- package/src/core/math/linalg/lu_factor_linear_system.d.ts.map +1 -1
- package/src/core/math/linalg/lu_factor_linear_system.js +108 -117
- package/src/core/math/linalg/lu_solve_linear_system.d.ts +1 -1
- package/src/core/math/linalg/lu_solve_linear_system.js +53 -53
- package/src/core/math/linalg/polynomial_add_into.d.ts +18 -0
- package/src/core/math/linalg/polynomial_add_into.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_add_into.js +29 -0
- package/src/core/math/linalg/polynomial_complex_roots_aberth_ehrlich.d.ts +6 -1
- package/src/core/math/linalg/polynomial_complex_roots_aberth_ehrlich.d.ts.map +1 -1
- package/src/core/math/linalg/polynomial_complex_roots_aberth_ehrlich.js +48 -50
- package/src/core/math/linalg/polynomial_cubic_derivative_eval.d.ts +15 -0
- package/src/core/math/linalg/polynomial_cubic_derivative_eval.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_cubic_derivative_eval.js +16 -0
- package/src/core/math/linalg/polynomial_cubic_horner_eval.d.ts +18 -0
- package/src/core/math/linalg/polynomial_cubic_horner_eval.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_cubic_horner_eval.js +19 -0
- package/src/core/math/linalg/polynomial_cubic_second_derivative_eval.d.ts +13 -0
- package/src/core/math/linalg/polynomial_cubic_second_derivative_eval.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_cubic_second_derivative_eval.js +14 -0
- package/src/core/math/linalg/polynomial_multiply.d.ts +21 -0
- package/src/core/math/linalg/polynomial_multiply.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_multiply.js +41 -0
- package/src/core/math/linalg/polynomial_real_roots_in_interval.d.ts +6 -1
- package/src/core/math/linalg/polynomial_real_roots_in_interval.d.ts.map +1 -1
- package/src/core/math/linalg/polynomial_real_roots_in_interval.js +29 -18
- package/src/core/math/linalg/polynomial_root_bound_cauchy.d.ts +17 -0
- package/src/core/math/linalg/polynomial_root_bound_cauchy.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_root_bound_cauchy.js +30 -0
- package/src/core/math/linalg/polynomial_scale_into.d.ts +14 -0
- package/src/core/math/linalg/polynomial_scale_into.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_scale_into.js +17 -0
- package/src/core/math/linalg/polynomial_sub_into.d.ts +18 -0
- package/src/core/math/linalg/polynomial_sub_into.d.ts.map +1 -0
- package/src/core/math/linalg/polynomial_sub_into.js +29 -0
- package/src/core/math/linalg/solve_linear_system.d.ts +1 -1
- package/src/core/math/linalg/solve_linear_system.js +1 -1
- package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts +4 -4
- package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts.map +1 -1
- package/src/core/math/linalg/solve_linear_system_GEPP_2x2.js +96 -91
- package/src/core/math/solveQuadratic.d.ts +2 -2
- package/src/core/math/solveQuadratic.d.ts.map +1 -1
- package/src/core/math/solveQuadratic.js +1 -1
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.d.ts +18 -10
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite.js +18 -10
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_1d.d.ts +13 -6
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_1d.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_1d.js +16 -11
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.d.ts +25 -3
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_2d.js +97 -142
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.d.ts +30 -4
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_intersection_spline3_hermite_nd.js +188 -132
- package/src/core/math/spline/spline3_hermite_intersects_spline3_hermite.d.ts +7 -3
- package/src/core/math/spline/spline3_hermite_intersects_spline3_hermite.d.ts.map +1 -1
- package/src/core/math/spline/spline3_hermite_intersects_spline3_hermite.js +35 -6
- package/src/core/science/units/MEASUREMENT_UNITS_SCIENTIFIC.d.ts +17 -0
- package/src/core/science/units/MEASUREMENT_UNITS_SCIENTIFIC.d.ts.map +1 -0
- package/src/core/science/units/MEASUREMENT_UNITS_SCIENTIFIC.js +87 -0
- package/src/core/science/units/MEASUREMENT_UNITS_SI.d.ts +13 -0
- package/src/core/science/units/MEASUREMENT_UNITS_SI.d.ts.map +1 -0
- package/src/core/science/units/MEASUREMENT_UNITS_SI.js +28 -0
- package/src/core/science/units/NamedUnit.d.ts +38 -0
- package/src/core/science/units/NamedUnit.d.ts.map +1 -0
- package/src/core/science/units/NamedUnit.js +48 -0
- package/src/core/science/units/UNIT_DIMENSION_MAPPING.d.ts +14 -0
- package/src/core/science/units/UNIT_DIMENSION_MAPPING.d.ts.map +1 -0
- package/src/core/science/units/UNIT_DIMENSION_MAPPING.js +29 -0
- package/src/core/science/units/UnitDimension.d.ts +26 -0
- package/src/core/science/units/UnitDimension.d.ts.map +1 -0
- package/src/core/science/units/UnitDimension.js +28 -0
- package/src/core/science/units/UnitMatrix.d.ts +117 -0
- package/src/core/science/units/UnitMatrix.d.ts.map +1 -0
- package/src/core/science/units/UnitMatrix.js +251 -0
- package/src/core/science/units/format_quantity.d.ts +25 -0
- package/src/core/science/units/format_quantity.d.ts.map +1 -0
- package/src/core/science/units/format_quantity.js +74 -0
- package/src/core/science/units/magnitude_prefix.d.ts +57 -0
- package/src/core/science/units/magnitude_prefix.d.ts.map +1 -0
- package/src/core/science/units/magnitude_prefix.js +127 -0
- package/src/core/science/units/si/AMPERE.d.ts +7 -0
- package/src/core/science/units/si/AMPERE.d.ts.map +1 -0
- package/src/core/science/units/si/AMPERE.js +13 -0
- package/src/core/science/units/si/CANDELA.d.ts +7 -0
- package/src/core/science/units/si/CANDELA.d.ts.map +1 -0
- package/src/core/science/units/si/CANDELA.js +13 -0
- package/src/core/science/units/si/DIMENSIONLESS.d.ts +8 -0
- package/src/core/science/units/si/DIMENSIONLESS.d.ts.map +1 -0
- package/src/core/science/units/si/DIMENSIONLESS.js +14 -0
- package/src/core/science/units/si/KELVIN.d.ts +7 -0
- package/src/core/science/units/si/KELVIN.d.ts.map +1 -0
- package/src/core/science/units/si/KELVIN.js +13 -0
- package/src/core/science/units/si/KILOGRAM.d.ts +7 -0
- package/src/core/science/units/si/KILOGRAM.d.ts.map +1 -0
- package/src/core/science/units/si/KILOGRAM.js +13 -0
- package/src/core/science/units/si/METER.d.ts +7 -0
- package/src/core/science/units/si/METER.d.ts.map +1 -0
- package/src/core/science/units/si/METER.js +13 -0
- package/src/core/science/units/si/MOLE.d.ts +7 -0
- package/src/core/science/units/si/MOLE.d.ts.map +1 -0
- package/src/core/science/units/si/MOLE.js +13 -0
- package/src/core/science/units/si/SECOND.d.ts +7 -0
- package/src/core/science/units/si/SECOND.d.ts.map +1 -0
- package/src/core/science/units/si/SECOND.js +13 -0
- package/src/core/science/units/si/derived/BECQUEREL.d.ts +10 -0
- package/src/core/science/units/si/derived/BECQUEREL.d.ts.map +1 -0
- package/src/core/science/units/si/derived/BECQUEREL.js +16 -0
- package/src/core/science/units/si/derived/COULOMB.d.ts +7 -0
- package/src/core/science/units/si/derived/COULOMB.d.ts.map +1 -0
- package/src/core/science/units/si/derived/COULOMB.js +13 -0
- package/src/core/science/units/si/derived/FARAD.d.ts +7 -0
- package/src/core/science/units/si/derived/FARAD.d.ts.map +1 -0
- package/src/core/science/units/si/derived/FARAD.js +13 -0
- package/src/core/science/units/si/derived/GRAY.d.ts +10 -0
- package/src/core/science/units/si/derived/GRAY.d.ts.map +1 -0
- package/src/core/science/units/si/derived/GRAY.js +16 -0
- package/src/core/science/units/si/derived/HENRY.d.ts +7 -0
- package/src/core/science/units/si/derived/HENRY.d.ts.map +1 -0
- package/src/core/science/units/si/derived/HENRY.js +13 -0
- package/src/core/science/units/si/derived/HERTZ.d.ts +10 -0
- package/src/core/science/units/si/derived/HERTZ.d.ts.map +1 -0
- package/src/core/science/units/si/derived/HERTZ.js +16 -0
- package/src/core/science/units/si/derived/JOULE.d.ts +7 -0
- package/src/core/science/units/si/derived/JOULE.d.ts.map +1 -0
- package/src/core/science/units/si/derived/JOULE.js +13 -0
- package/src/core/science/units/si/derived/KATAL.d.ts +7 -0
- package/src/core/science/units/si/derived/KATAL.d.ts.map +1 -0
- package/src/core/science/units/si/derived/KATAL.js +13 -0
- package/src/core/science/units/si/derived/LUMEN.d.ts +8 -0
- package/src/core/science/units/si/derived/LUMEN.d.ts.map +1 -0
- package/src/core/science/units/si/derived/LUMEN.js +14 -0
- package/src/core/science/units/si/derived/LUX.d.ts +7 -0
- package/src/core/science/units/si/derived/LUX.d.ts.map +1 -0
- package/src/core/science/units/si/derived/LUX.js +13 -0
- package/src/core/science/units/si/derived/NEWTON.d.ts +7 -0
- package/src/core/science/units/si/derived/NEWTON.d.ts.map +1 -0
- package/src/core/science/units/si/derived/NEWTON.js +13 -0
- package/src/core/science/units/si/derived/OHM.d.ts +7 -0
- package/src/core/science/units/si/derived/OHM.d.ts.map +1 -0
- package/src/core/science/units/si/derived/OHM.js +13 -0
- package/src/core/science/units/si/derived/PASCAL.d.ts +7 -0
- package/src/core/science/units/si/derived/PASCAL.d.ts.map +1 -0
- package/src/core/science/units/si/derived/PASCAL.js +13 -0
- package/src/core/science/units/si/derived/SIEMENS.d.ts +7 -0
- package/src/core/science/units/si/derived/SIEMENS.d.ts.map +1 -0
- package/src/core/science/units/si/derived/SIEMENS.js +13 -0
- package/src/core/science/units/si/derived/SIEVERT.d.ts +10 -0
- package/src/core/science/units/si/derived/SIEVERT.d.ts.map +1 -0
- package/src/core/science/units/si/derived/SIEVERT.js +16 -0
- package/src/core/science/units/si/derived/TESLA.d.ts +7 -0
- package/src/core/science/units/si/derived/TESLA.d.ts.map +1 -0
- package/src/core/science/units/si/derived/TESLA.js +13 -0
- package/src/core/science/units/si/derived/VOLT.d.ts +7 -0
- package/src/core/science/units/si/derived/VOLT.d.ts.map +1 -0
- package/src/core/science/units/si/derived/VOLT.js +13 -0
- package/src/core/science/units/si/derived/WATT.d.ts +7 -0
- package/src/core/science/units/si/derived/WATT.d.ts.map +1 -0
- package/src/core/science/units/si/derived/WATT.js +13 -0
- package/src/core/science/units/si/derived/WEBER.d.ts +7 -0
- package/src/core/science/units/si/derived/WEBER.d.ts.map +1 -0
- package/src/core/science/units/si/derived/WEBER.js +13 -0
- package/src/core/science/units/unit_matrix_to_string.d.ts +29 -0
- package/src/core/science/units/unit_matrix_to_string.d.ts.map +1 -0
- package/src/core/science/units/unit_matrix_to_string.js +403 -0
- package/src/engine/graphics/geometry/MikkT/CalcTexArea.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/CalcTexArea.js +1 -2
- package/src/engine/graphics/geometry/MikkT/InitTriInfo.d.ts.map +1 -1
- 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
|
-
|
|
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
|
|
54
|
+
set x(arg: number);
|
|
63
55
|
/**
|
|
64
56
|
*
|
|
65
57
|
* @returns {number}
|
|
66
58
|
*/
|
|
67
|
-
get
|
|
59
|
+
get x(): number;
|
|
68
60
|
/**
|
|
69
61
|
*
|
|
70
62
|
* @param {number} v
|
|
71
63
|
*/
|
|
72
|
-
set
|
|
64
|
+
set y(arg: number);
|
|
73
65
|
/**
|
|
74
66
|
*
|
|
75
67
|
* @returns {number}
|
|
76
68
|
*/
|
|
77
|
-
get
|
|
69
|
+
get y(): number;
|
|
78
70
|
/**
|
|
79
71
|
*
|
|
80
72
|
* @param {number} v
|
|
81
73
|
*/
|
|
82
|
-
set
|
|
74
|
+
set z(arg: number);
|
|
83
75
|
/**
|
|
84
76
|
*
|
|
85
77
|
* @returns {number}
|
|
86
78
|
*/
|
|
87
|
-
get
|
|
79
|
+
get z(): number;
|
|
88
80
|
/**
|
|
89
81
|
*
|
|
90
82
|
* @param {number} v
|
|
91
83
|
*/
|
|
92
|
-
set
|
|
84
|
+
set w(arg: number);
|
|
93
85
|
/**
|
|
94
86
|
*
|
|
95
87
|
* @returns {number}
|
|
96
88
|
*/
|
|
97
|
-
get
|
|
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
|
|
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"}
|
package/src/core/geom/Vector4.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
70
|
-
return this
|
|
65
|
+
get x() {
|
|
66
|
+
return this[0];
|
|
71
67
|
}
|
|
72
68
|
|
|
73
69
|
/**
|
|
74
70
|
*
|
|
75
71
|
* @param {number} v
|
|
76
72
|
*/
|
|
77
|
-
set
|
|
78
|
-
this
|
|
73
|
+
set x(v) {
|
|
74
|
+
this[0] = v;
|
|
79
75
|
}
|
|
80
76
|
|
|
81
77
|
/**
|
|
82
78
|
*
|
|
83
79
|
* @returns {number}
|
|
84
80
|
*/
|
|
85
|
-
get
|
|
86
|
-
return this
|
|
81
|
+
get y() {
|
|
82
|
+
return this[1];
|
|
87
83
|
}
|
|
88
84
|
|
|
89
85
|
/**
|
|
90
86
|
*
|
|
91
87
|
* @param {number} v
|
|
92
88
|
*/
|
|
93
|
-
set
|
|
94
|
-
this
|
|
89
|
+
set y(v) {
|
|
90
|
+
this[1] = v;
|
|
95
91
|
}
|
|
96
92
|
|
|
97
93
|
/**
|
|
98
94
|
*
|
|
99
95
|
* @returns {number}
|
|
100
96
|
*/
|
|
101
|
-
get
|
|
102
|
-
return this
|
|
97
|
+
get z() {
|
|
98
|
+
return this[2];
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
/**
|
|
106
102
|
*
|
|
107
103
|
* @param {number} v
|
|
108
104
|
*/
|
|
109
|
-
set
|
|
110
|
-
this
|
|
105
|
+
set z(v) {
|
|
106
|
+
this[2] = v;
|
|
111
107
|
}
|
|
112
108
|
|
|
113
109
|
/**
|
|
114
110
|
*
|
|
115
111
|
* @returns {number}
|
|
116
112
|
*/
|
|
117
|
-
get
|
|
118
|
-
return this
|
|
113
|
+
get w() {
|
|
114
|
+
return this[3];
|
|
119
115
|
}
|
|
120
116
|
|
|
121
117
|
/**
|
|
122
118
|
*
|
|
123
119
|
* @param {number} v
|
|
124
120
|
*/
|
|
125
|
-
set
|
|
126
|
-
this
|
|
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
|
|
150
|
-
array[offset + 1] = this
|
|
151
|
-
array[offset + 2] = this
|
|
152
|
-
array[offset + 3] = this
|
|
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
|
|
175
|
-
const _y = this
|
|
176
|
-
const _z = this
|
|
177
|
-
const _w = this
|
|
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
|
|
182
|
-
this
|
|
183
|
-
this
|
|
184
|
-
this
|
|
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
|
|
203
|
-
const y = this
|
|
204
|
-
const z = this
|
|
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
|
|
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
|
|
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
|
|
249
|
-
const _y = this
|
|
250
|
-
const _z = this
|
|
251
|
-
const _w = this
|
|
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
|
|
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
|
|
278
|
-
this
|
|
279
|
-
this
|
|
280
|
-
this
|
|
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
|
|
334
|
-
const y = this
|
|
335
|
-
const z = this
|
|
336
|
-
const w = this
|
|
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
|
|
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
|
|
373
|
-
computeHashFloat(this
|
|
374
|
-
computeHashFloat(this
|
|
375
|
-
computeHashFloat(this
|
|
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
|
|
394
|
-
result[1] = this
|
|
395
|
-
result[2] = this
|
|
396
|
-
result[3] = this
|
|
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
|
|
422
|
-
y: this
|
|
423
|
-
z: this
|
|
424
|
-
w: this
|
|
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
|
|
438
|
-
buffer.writeFloat64(this
|
|
439
|
-
buffer.writeFloat64(this
|
|
440
|
-
buffer.writeFloat64(this
|
|
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":"
|
|
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
|
|
39
|
+
const sphere_component_count = dimensions + 1;
|
|
40
|
+
|
|
41
|
+
let center;
|
|
42
|
+
let sphere;
|
|
35
43
|
|
|
36
|
-
|
|
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 *
|
|
56
|
+
const sphere_offset = offset + i * sphere_component_count;
|
|
40
57
|
|
|
41
58
|
//read sphere
|
|
42
|
-
for (let j = 0; 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
|
|
78
|
+
const sphere_offset = offset + i*sphere_component_count;
|
|
62
79
|
|
|
63
80
|
//read sphere
|
|
64
|
-
for (let j = 0; 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":"
|
|
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
|
-
|
|
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
|
-
|
|
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 -
|
|
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
|
-
*
|
|
30
|
-
* @type {number[][]}
|
|
29
|
+
* @type {SquareMatrix}
|
|
31
30
|
*/
|
|
32
|
-
Q:
|
|
31
|
+
Q: SquareMatrix;
|
|
33
32
|
/**
|
|
34
|
-
*
|
|
35
|
-
* @type {number[][]}
|
|
33
|
+
* @type {SquareMatrix}
|
|
36
34
|
*/
|
|
37
|
-
R:
|
|
35
|
+
R: SquareMatrix;
|
|
38
36
|
/**
|
|
39
37
|
* D sized vector
|
|
40
|
-
* @type {
|
|
38
|
+
* @type {Float64Array}
|
|
41
39
|
*/
|
|
42
|
-
u:
|
|
40
|
+
u: Float64Array;
|
|
43
41
|
/**
|
|
44
42
|
* D sized vector
|
|
45
|
-
* @type {
|
|
43
|
+
* @type {Float64Array}
|
|
46
44
|
*/
|
|
47
|
-
w:
|
|
45
|
+
w: Float64Array;
|
|
48
46
|
r: number;
|
|
49
47
|
/**
|
|
50
|
-
* Givens
|
|
51
|
-
*
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
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":"
|
|
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"}
|