@woosh/meep-engine 2.119.14 → 2.119.15
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/README.md +9 -0
- package/package.json +1 -1
- package/src/core/geom/3d/sphere/sphere_project.d.ts +10 -0
- package/src/core/geom/3d/sphere/sphere_project.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_project.js +39 -0
- package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.d.ts +9 -0
- package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.js +45 -0
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +8 -17
- package/src/core/graph/layout/box/position_box_next_to_box.d.ts.map +1 -1
- package/src/core/graph/layout/box/position_box_next_to_box.js +0 -23
- package/src/core/parser/simple/readArrayLiteral.d.ts +9 -0
- package/src/core/parser/simple/readArrayLiteral.d.ts.map +1 -0
- package/src/core/parser/simple/readArrayLiteral.js +73 -0
- package/src/core/parser/simple/readLiteralToken.d.ts.map +1 -1
- package/src/core/parser/simple/readLiteralToken.js +1 -53
- package/src/core/parser/simple/skipWhitespace.d.ts +2 -2
- package/src/core/parser/simple/skipWhitespace.d.ts.map +1 -1
- package/src/core/parser/simple/skipWhitespace.js +4 -4
- package/src/engine/ecs/components/Tag.d.ts.map +1 -1
- package/src/engine/ecs/components/Tag.js +0 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.js +14 -19
- package/src/engine/ecs/systems/AnimationSystem.d.ts.map +1 -1
- package/src/engine/ecs/systems/AnimationSystem.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/AnimationGraphSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/AnimationGraphSystem.js +2 -2
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts +0 -8
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.js +0 -32
- package/src/engine/graphics/sh3/lpv/util/lpv_visualise_probes.d.ts +10 -0
- package/src/engine/graphics/sh3/lpv/util/lpv_visualise_probes.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/util/lpv_visualise_probes.js +33 -0
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +3 -2
- package/src/engine/graphics/texture/atlas/AtlasPatch.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/AtlasPatch.js +62 -63
- package/src/engine/graphics/texture/virtual/NOTES.md +11 -2
- package/src/engine/graphics/texture/virtual/VirtualTextureMaterial.d.ts +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureMaterial.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureMaterial.js +1 -12
- package/src/engine/graphics/texture/virtual/VirtualTexturePage.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTexturePage.js +0 -10
- package/src/engine/graphics/texture/virtual/VirtualTextureSystem.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureSystem.js +0 -2
- package/src/engine/graphics/trail/x/RibbonXMaterialSpec.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/RibbonXMaterialSpec.js +6 -7
- package/src/engine/save/GameStateLoader.d.ts.map +1 -1
- package/src/engine/save/GameStateLoader.js +6 -9
- package/src/engine/save/StorageBackedList.d.ts.map +1 -1
- package/src/engine/save/StorageBackedList.js +16 -19
- package/src/generation/grid/generation/GridTaskApplyActionToCells.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskApplyActionToCells.js +12 -16
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.js +6 -6
- package/src/generation/grid/generation/GridTaskSequence.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskSequence.js +5 -5
- package/src/generation/grid/generation/discrete/GridTaskActionRuleSet.d.ts +2 -6
- package/src/generation/grid/generation/discrete/GridTaskActionRuleSet.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskActionRuleSet.js +1 -1
- package/src/generation/grid/generation/road/RoadConnection.d.ts.map +1 -1
- package/src/generation/grid/generation/road/RoadConnection.js +17 -15
- package/src/engine/graphics/util/projectSphere.d.ts +0 -24
- package/src/engine/graphics/util/projectSphere.d.ts.map +0 -1
- package/src/engine/graphics/util/projectSphere.js +0 -103
|
@@ -2,23 +2,23 @@ import { assert } from "../../../../core/assert.js";
|
|
|
2
2
|
|
|
3
3
|
export class RoadConnection {
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @type {PathEndPoint}
|
|
8
|
+
*/
|
|
9
|
+
source = null;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @type {PathEndPoint}
|
|
14
|
+
*/
|
|
15
|
+
target = null;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @type {number[]}
|
|
20
|
+
*/
|
|
21
|
+
indices = [];
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -88,6 +88,8 @@ export class RoadConnection {
|
|
|
88
88
|
return true;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
return false;
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
/**
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Computations of screen-space pixel area covered by a sphere
|
|
3
|
-
* NOTE: Port of GLSL code by Ingo Quilez. Source: http://www.iquilezles.org/www/articles/sphereproj/sphereproj.htm
|
|
4
|
-
* @param {Vector4} sph Sphere in world space
|
|
5
|
-
* @param {Matrix4} cam camera transform matrix (world to camera)(inverse world matrix of camera)
|
|
6
|
-
* @param {number} fl focal length (fov in Radians)
|
|
7
|
-
* @returns {number} area on the screen as a fraction, 1=entire screen, 0=zero area
|
|
8
|
-
*/
|
|
9
|
-
export function projectSphere(sph: Vector4, cam: Matrix4, fl: number): number;
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @param {number[]} v3
|
|
13
|
-
* @param {number[]} matrix
|
|
14
|
-
*/
|
|
15
|
-
export function v3_compute_perspective_divide(v3: number[], matrix: number[]): number;
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @param {number} fl
|
|
19
|
-
* @param {number[]} matrix
|
|
20
|
-
* @param {number[]} sph
|
|
21
|
-
* @returns {number}
|
|
22
|
-
*/
|
|
23
|
-
export function compute_projected_sphere_radius_sqr(fl: number, matrix: number[], sph: number[]): number;
|
|
24
|
-
//# sourceMappingURL=projectSphere.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projectSphere.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/util/projectSphere.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,8DAHW,MAAM,GACJ,MAAM,CA0BlB;AAED;;;;GAIG;AACH,kDAHW,MAAM,EAAE,UACR,MAAM,EAAE,UAgBlB;AAED;;;;;;GAMG;AACH,wDALW,MAAM,UACN,MAAM,EAAE,OACR,MAAM,EAAE,GACN,MAAM,CAoClB"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { assert } from "../../../core/assert.js";
|
|
2
|
-
import { v3_dot } from "../../../core/geom/vec3/v3_dot.js";
|
|
3
|
-
import { v4_multiply_mat4 } from "../../../core/geom/vec4/v4_multiply_mat4.js";
|
|
4
|
-
|
|
5
|
-
const v4 = [];
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Computations of screen-space pixel area covered by a sphere
|
|
9
|
-
* NOTE: Port of GLSL code by Ingo Quilez. Source: http://www.iquilezles.org/www/articles/sphereproj/sphereproj.htm
|
|
10
|
-
* @param {Vector4} sph Sphere in world space
|
|
11
|
-
* @param {Matrix4} cam camera transform matrix (world to camera)(inverse world matrix of camera)
|
|
12
|
-
* @param {number} fl focal length (fov in Radians)
|
|
13
|
-
* @returns {number} area on the screen as a fraction, 1=entire screen, 0=zero area
|
|
14
|
-
*/
|
|
15
|
-
export function projectSphere(sph, cam, fl) {
|
|
16
|
-
assert.notEqual(null, cam, 'camera matrix is null');
|
|
17
|
-
|
|
18
|
-
v4[0] = sph.x;
|
|
19
|
-
v4[1] = sph.y;
|
|
20
|
-
v4[2] = sph.z;
|
|
21
|
-
v4[3] = 1;
|
|
22
|
-
|
|
23
|
-
//transform to camera space
|
|
24
|
-
v4_multiply_mat4(v4, v4, cam.elements);
|
|
25
|
-
|
|
26
|
-
const r2 = sph.w * sph.w;
|
|
27
|
-
|
|
28
|
-
const v4_x = v4[0];
|
|
29
|
-
const v4_y = v4[1];
|
|
30
|
-
const v4_z = v4[2];
|
|
31
|
-
|
|
32
|
-
const z2 = v4_z * v4_z;
|
|
33
|
-
|
|
34
|
-
const l2 = v3_dot(v4_x, v4_y, v4_z, v4_x, v4_y, v4_z);
|
|
35
|
-
|
|
36
|
-
const area = -Math.PI * fl * fl * r2 * Math.sqrt(Math.abs((l2 - r2) / (r2 - z2))) / (r2 - z2);
|
|
37
|
-
|
|
38
|
-
return area;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* @param {number[]} v3
|
|
44
|
-
* @param {number[]} matrix
|
|
45
|
-
*/
|
|
46
|
-
export function v3_compute_perspective_divide(v3, matrix) {
|
|
47
|
-
v4[0] = v3[0];
|
|
48
|
-
v4[1] = v3[1];
|
|
49
|
-
v4[2] = v3[2];
|
|
50
|
-
v4[3] = 1;
|
|
51
|
-
|
|
52
|
-
//transform sphere center to camera space
|
|
53
|
-
v4_multiply_mat4(v4, v4, matrix);
|
|
54
|
-
|
|
55
|
-
const v4_w = v4[3];
|
|
56
|
-
|
|
57
|
-
const d = 0.5 / Math.abs(v4_w);
|
|
58
|
-
|
|
59
|
-
return d;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
* @param {number} fl
|
|
65
|
-
* @param {number[]} matrix
|
|
66
|
-
* @param {number[]} sph
|
|
67
|
-
* @returns {number}
|
|
68
|
-
*/
|
|
69
|
-
export function compute_projected_sphere_radius_sqr(fl, matrix, sph) {
|
|
70
|
-
v4[0] = sph[0];
|
|
71
|
-
v4[1] = sph[1];
|
|
72
|
-
v4[2] = sph[2];
|
|
73
|
-
v4[3] = 1;
|
|
74
|
-
|
|
75
|
-
//transform sphere center to camera space
|
|
76
|
-
v4_multiply_mat4(v4, v4, matrix);
|
|
77
|
-
|
|
78
|
-
const r2 = sph[3] * sph[3];
|
|
79
|
-
|
|
80
|
-
const v4_x = v4[0];
|
|
81
|
-
const v4_y = v4[1];
|
|
82
|
-
const v4_z = v4[2];
|
|
83
|
-
const v4_w = v4[3];
|
|
84
|
-
|
|
85
|
-
const d = 0.5 / Math.abs(v4_w);
|
|
86
|
-
|
|
87
|
-
const x = v4_x;
|
|
88
|
-
const y = v4_y;
|
|
89
|
-
const z = v4_z;
|
|
90
|
-
|
|
91
|
-
const z2 = z * x;
|
|
92
|
-
|
|
93
|
-
const l2 = v3_dot(x, y, z, x, y, z);
|
|
94
|
-
|
|
95
|
-
const sigma = Math.abs(r2 - z2);
|
|
96
|
-
const alpha = Math.sqrt(Math.abs(l2 - r2) / sigma);
|
|
97
|
-
|
|
98
|
-
const beta = fl * fl * r2 * alpha / sigma;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return beta*d;
|
|
103
|
-
}
|