@woosh/meep-engine 2.118.3 → 2.118.4
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/build/meep.cjs +86 -105
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +86 -105
- package/package.json +5 -5
- package/src/core/binary/EndianType.d.ts +3 -0
- package/src/core/binary/EndianType.d.ts.map +1 -1
- package/src/core/binary/EndianType.js +2 -1
- package/src/core/binary/uint8_to_float.d.ts.map +1 -1
- package/src/core/binary/uint8_to_float.js +5 -0
- package/src/core/collection/queue/Deque.d.ts.map +1 -1
- package/src/core/collection/queue/Deque.js +32 -32
- package/src/core/color/Color.js +3 -3
- package/src/core/color/kelvin/rgb_to_kelvin.d.ts.map +1 -1
- package/src/core/color/kelvin/rgb_to_kelvin.js +16 -7
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_attached_to_vertex.d.ts.map +1 -0
- package/src/core/geom/Vector3.d.ts.map +1 -1
- package/src/core/geom/Vector3.js +5 -19
- package/src/core/geom/packing/computeBoundingSphereOfSpheres.js +1 -1
- package/src/core/math/compute_legendre_polynomial.d.ts +1 -1
- package/src/core/math/compute_legendre_polynomial.d.ts.map +1 -1
- package/src/core/math/compute_legendre_polynomial.js +6 -1
- package/src/core/math/max3.d.ts.map +1 -1
- package/src/core/math/max3.js +4 -0
- package/src/core/math/solveQuadratic.d.ts.map +1 -1
- package/src/core/math/solveQuadratic.js +5 -1
- package/src/core/primitives/boolean/compareBooleans.js +2 -0
- package/src/core/primitives/boolean/computeBooleanHash.d.ts +7 -0
- package/src/core/primitives/boolean/computeBooleanHash.d.ts.map +1 -0
- package/src/core/primitives/boolean/computeBooleanHash.js +8 -0
- package/src/core/primitives/numbers/computeHashFloat.d.ts.map +1 -1
- package/src/core/primitives/numbers/computeHashFloat.js +4 -2
- package/src/engine/ecs/gui/position/ViewportPosition.d.ts +0 -5
- package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
- package/src/engine/ecs/gui/position/ViewportPosition.js +42 -53
- package/src/engine/ecs/speaker/VoiceSystem.d.ts +2 -3
- package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/find_max_depth_radius_for_point.js +2 -2
- package/src/core/geometry/3d/tetrahedra/tetrahedral_mesh_find_tets_attached_to_vertex.d.ts.map +0 -1
- /package/src/core/{geometry → geom}/3d/tetrahedra/tetrahedral_mesh_find_tets_attached_to_vertex.d.ts +0 -0
- /package/src/core/{geometry → geom}/3d/tetrahedra/tetrahedral_mesh_find_tets_attached_to_vertex.js +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Useful in Spherical Harmonics coefficient computation
|
|
4
4
|
* @param {number} l band
|
|
5
5
|
* @param {number} m
|
|
6
|
-
* @param {number} x
|
|
6
|
+
* @param {number} x must be between 0 and 1
|
|
7
7
|
* @returns {number}
|
|
8
8
|
*/
|
|
9
9
|
export function compute_legendre_polynomial(l: number, m: number, x: number): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute_legendre_polynomial.d.ts","sourceRoot":"","sources":["../../../../src/core/math/compute_legendre_polynomial.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compute_legendre_polynomial.d.ts","sourceRoot":"","sources":["../../../../src/core/math/compute_legendre_polynomial.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,+CALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CA0ClB"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { assert } from "../assert.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Computes associated Legendre Polynomial P(l,m,x) at x
|
|
3
5
|
* Useful in Spherical Harmonics coefficient computation
|
|
4
6
|
* @param {number} l band
|
|
5
7
|
* @param {number} m
|
|
6
|
-
* @param {number} x
|
|
8
|
+
* @param {number} x must be between 0 and 1
|
|
7
9
|
* @returns {number}
|
|
8
10
|
*/
|
|
9
11
|
export function compute_legendre_polynomial(l, m, x) {
|
|
12
|
+
assert.lessThanOrEqual(x,1,'only valid for X <= 1');
|
|
13
|
+
|
|
14
|
+
// TODO we might be able to do better, see https://github.com/halueda/wavy-orbitals/blob/fe738b0f8de8783cb7886d2c6ee616c2befb363b/legendre.js#L16
|
|
10
15
|
// based on code from https://github.com/jan-van-bergen/SphericalHarmonicLighting/blob/2b214b3451859ded07ea4e41fb2aa8d2a44ab579/SphericalHarmonicsLighting/SphericalHarmonics.cpp#L61
|
|
11
16
|
|
|
12
17
|
// Apply rule 2; P m m
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"max3.d.ts","sourceRoot":"","sources":["../../../../src/core/math/max3.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,
|
|
1
|
+
{"version":3,"file":"max3.d.ts","sourceRoot":"","sources":["../../../../src/core/math/max3.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CAgBlB"}
|
package/src/core/math/max3.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solveQuadratic.d.ts","sourceRoot":"","sources":["../../../../src/core/math/solveQuadratic.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,uCAJW,MAAM,EAAE,iBACR,MAAM,KAJN,MAAM,KACN,MAAM,KACN,MAAM,GAGJ,MAAM,
|
|
1
|
+
{"version":3,"file":"solveQuadratic.d.ts","sourceRoot":"","sources":["../../../../src/core/math/solveQuadratic.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,uCAJW,MAAM,EAAE,iBACR,MAAM,KAJN,MAAM,KACN,MAAM,KACN,MAAM,GAGJ,MAAM,CAoDlB"}
|
|
@@ -10,7 +10,11 @@ import { EPSILON } from "./EPSILON.js";
|
|
|
10
10
|
* @param {number} result_offset offset into result array where solutions are written to
|
|
11
11
|
* @returns {number} number of found solutions (roots)
|
|
12
12
|
*/
|
|
13
|
-
export function solveQuadratic(
|
|
13
|
+
export function solveQuadratic(
|
|
14
|
+
result, result_offset,
|
|
15
|
+
a, b, c
|
|
16
|
+
) {
|
|
17
|
+
|
|
14
18
|
assert.isNumber(a, 'a');
|
|
15
19
|
assert.isNumber(b, 'b');
|
|
16
20
|
assert.isNumber(c, 'c');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeBooleanHash.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/boolean/computeBooleanHash.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,sCAHW,OAAO,GACL,MAAM,CAIlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeHashFloat.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/numbers/computeHashFloat.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"computeHashFloat.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/numbers/computeHashFloat.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,oCAHW,MAAM,GACJ,MAAM,CAalB"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { UINT32_MAX } from "../../binary/UINT32_MAX.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
*
|
|
3
5
|
* @param {number} v
|
|
@@ -5,12 +7,12 @@
|
|
|
5
7
|
*/
|
|
6
8
|
export function computeHashFloat(v) {
|
|
7
9
|
//we break the number up into fractional and whole parts
|
|
8
|
-
const whole = v
|
|
10
|
+
const whole = v >> 0;
|
|
9
11
|
|
|
10
12
|
const fraction = v - whole;
|
|
11
13
|
|
|
12
14
|
//fractional part is scaled up into int32 range, this inexact method, as it will produce 0 hash for values below a certain threshold
|
|
13
|
-
const fractionHash = fraction *
|
|
15
|
+
const fractionHash = fraction * UINT32_MAX;
|
|
14
16
|
|
|
15
17
|
//take XOR of both parts
|
|
16
18
|
return fractionHash ^ whole;
|
|
@@ -6,11 +6,6 @@ export namespace ViewportPositionFlags {
|
|
|
6
6
|
export default ViewportPosition;
|
|
7
7
|
declare class ViewportPosition {
|
|
8
8
|
static fromJSON(opt: any): ViewportPosition;
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @constructor
|
|
12
|
-
*/
|
|
13
|
-
constructor(options: any);
|
|
14
9
|
/**
|
|
15
10
|
* Clip-scale position, on-screen values are in range of 0 to 1
|
|
16
11
|
* @type {Vector2}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportPosition.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/gui/position/ViewportPosition.js"],"names":[],"mappings":"oCAOU,MAAM;;;;;;AAOhB;
|
|
1
|
+
{"version":3,"file":"ViewportPosition.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/gui/position/ViewportPosition.js"],"names":[],"mappings":"oCAOU,MAAM;;;;;;AAOhB;IAuGI,4CAMC;IA5GD;;;OAGG;IACH,UAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,QAFU,OAAO,CAEM;IACvB;;;OAGG;IACH,QAFU,OAAO,CAEU;IAG3B;;;;OAIG;IACH,sBAFU,OAAO,CAEY;IAE7B;;;;OAIG;IACH,iBAFU,MAAM,CAEK;IAGrB;;;OAGG;IACH,mBAFU,OAAO,CAES;IAE1B;;;OAGG;IACH,SAFU,eAAe,CAEW;IAEpC;;;;OAIG;IACH,cAHW,gBAAgB,GACd,OAAO,CAWnB;IAED,eAUC;IAED;;;;;;;aAgBC;IAED;;;;;;;MASC;CASJ;;;;;oBA3HmB,kCAAkC;4BAC1B,2CAA2C"}
|
|
@@ -14,60 +14,49 @@ export const ViewportPositionFlags = {
|
|
|
14
14
|
|
|
15
15
|
class ViewportPosition {
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @
|
|
17
|
+
* Clip-scale position, on-screen values are in range of 0 to 1
|
|
18
|
+
* @type {Vector2}
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Can be used to enable and disable positioning
|
|
62
|
-
* @type {ObservedBoolean}
|
|
63
|
-
*/
|
|
64
|
-
this.enabled = new ObservedBoolean(true);
|
|
65
|
-
|
|
66
|
-
if (options !== undefined) {
|
|
67
|
-
console.warn("ViewportPosition constructor options is deprecated, please use static fromJSON method instead if you need similar functionality");
|
|
68
|
-
this.fromJSON(options);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
20
|
+
position = new Vector2();
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Fixed offset in pixels
|
|
24
|
+
* @type {Vector2}
|
|
25
|
+
*/
|
|
26
|
+
offset = new Vector2();
|
|
27
|
+
/**
|
|
28
|
+
* ranges from 0..1 in both X and Y, controls anchor point of element positioning
|
|
29
|
+
* @type {Vector2}
|
|
30
|
+
*/
|
|
31
|
+
anchor = new Vector2(0, 0);
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Makes display element avoid overlap with GUI elements
|
|
36
|
+
* @see GUIElement
|
|
37
|
+
* @type {boolean}
|
|
38
|
+
*/
|
|
39
|
+
resolveGuiCollisions = false;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* How far should the HUD stay away from the edge if it's sticky
|
|
43
|
+
* @see stickToScreenEdge
|
|
44
|
+
* @type {number}
|
|
45
|
+
*/
|
|
46
|
+
screenEdgeWidth = 10;
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Controls whenever or not HUD should remain on the screen when it gets to the edge
|
|
51
|
+
* @type {boolean}
|
|
52
|
+
*/
|
|
53
|
+
stickToScreenEdge = false;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Can be used to enable and disable positioning
|
|
57
|
+
* @type {ObservedBoolean}
|
|
58
|
+
*/
|
|
59
|
+
enabled = new ObservedBoolean(true);
|
|
71
60
|
|
|
72
61
|
/**
|
|
73
62
|
*
|
|
@@ -9,7 +9,7 @@ export class VoiceSystem extends AbstractContextSystem<any> {
|
|
|
9
9
|
font_size: number;
|
|
10
10
|
});
|
|
11
11
|
dependencies: (typeof Voice)[];
|
|
12
|
-
components_used:
|
|
12
|
+
components_used: ResourceAccessSpecification<typeof BehaviorComponent>[];
|
|
13
13
|
/**
|
|
14
14
|
*
|
|
15
15
|
* @type {Localization}
|
|
@@ -100,7 +100,6 @@ export class VoiceSystem extends AbstractContextSystem<any> {
|
|
|
100
100
|
}
|
|
101
101
|
import { AbstractContextSystem } from "../system/AbstractContextSystem.js";
|
|
102
102
|
import { Voice } from "./Voice.js";
|
|
103
|
-
import ViewportPosition from "../gui/position/ViewportPosition.js";
|
|
104
|
-
import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
|
|
105
103
|
import { BehaviorComponent } from "../../intelligence/behavior/ecs/BehaviorComponent.js";
|
|
104
|
+
import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
|
|
106
105
|
//# sourceMappingURL=VoiceSystem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/speaker/VoiceSystem.js"],"names":[],"mappings":"AA2JA;IACI;;;;OAIG;IACH;;;OA2FC;IArFG,+BAA2B;IAE3B,
|
|
1
|
+
{"version":3,"file":"VoiceSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/speaker/VoiceSystem.js"],"names":[],"mappings":"AA2JA;IACI;;;;OAIG;IACH;;;OA2FC;IArFG,+BAA2B;IAE3B,yEAQC;IAGD;;;OAGG;IACH,0BAAuB;IAEvB;;;OAGG;IACH,eAAe;IAEf;;;OAGG;IACH,4BAAiB;IAEjB;;;OAGG;IACH,8BAAgB;IAEhB;;;OAGG;IACH,eAAoB;IAEpB;;;;OAIG;IACH,iCAAyC;IAEzC;;;;OAIG;IACH,kBAAkC;IAIlC;;;;OAIG;IACH,eAAkB;IAElB;;;;OAIG;IACH,oBAAgC;IAEhC;;;OAGG;IACH,oBAAqC;IAErC;;;;OAIG;IACH,gBAAoB;IAGxB;;;OAGG;IACH,kBAFY,MAAM,CAIjB;IAED,0EAuBC;IAED;;;;;OAKG;IACH,uBAJW,MAAM,UACN,MAAM,SACN,KAAK,QAsBf;IAED;;;;;OAKG;IACH,wBAoBC;IAED;;;;;OAKG;IACH,gBAJW,MAAM,WACN,MAAM,SACN,KAAK,QAuHf;CACJ;sCAxbqC,oCAAoC;sBAIpD,YAAY;kCAlBA,sDAAsD;4CAR5C,oDAAoD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { v3_distance_sqr } from "../../../../core/geom/vec3/v3_distance_sqr.js";
|
|
2
1
|
import {
|
|
3
2
|
tetrahedral_mesh_find_tets_attached_to_vertex
|
|
4
|
-
} from "../../../../core/
|
|
3
|
+
} from "../../../../core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_attached_to_vertex.js";
|
|
4
|
+
import { v3_distance_sqr } from "../../../../core/geom/vec3/v3_distance_sqr.js";
|
|
5
5
|
import { max2 } from "../../../../core/math/max2.js";
|
|
6
6
|
|
|
7
7
|
/**
|
package/src/core/geometry/3d/tetrahedra/tetrahedral_mesh_find_tets_attached_to_vertex.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tetrahedral_mesh_find_tets_attached_to_vertex.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geometry/3d/tetrahedra/tetrahedral_mesh_find_tets_attached_to_vertex.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,sEANW,MAAM,EAAE,iBACR,MAAM,uCAEN,MAAM,GACJ,MAAM,CAyBlB"}
|
/package/src/core/{geometry → geom}/3d/tetrahedra/tetrahedral_mesh_find_tets_attached_to_vertex.d.ts
RENAMED
|
File without changes
|
/package/src/core/{geometry → geom}/3d/tetrahedra/tetrahedral_mesh_find_tets_attached_to_vertex.js
RENAMED
|
File without changes
|