@woosh/meep-engine 2.101.0 → 2.103.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/build/meep.cjs +149 -127
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +149 -127
- package/package.json +1 -1
- package/src/core/__module.d.ts +4 -0
- package/src/core/__module.js +4 -0
- package/src/core/geom/2d/circle/Circle.d.ts +0 -8
- package/src/core/geom/2d/circle/Circle.d.ts.map +1 -1
- package/src/core/geom/2d/circle/Circle.js +85 -85
- package/src/core/geom/3d/cone/computeConePlaneSide.js +1 -1
- package/src/core/geom/3d/mat4/{allocate_transform_m4.d.ts → allocate_m4.d.ts} +2 -2
- package/src/core/geom/3d/mat4/allocate_m4.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/{allocate_transform_m4.js → allocate_m4.js} +1 -1
- package/src/core/geom/ConicRay.d.ts +3 -1
- package/src/core/geom/ConicRay.d.ts.map +1 -1
- package/src/core/geom/ConicRay.js +7 -5
- package/src/core/geom/Vector1.d.ts.map +1 -1
- package/src/core/geom/Vector1.js +3 -0
- package/src/core/geom/Vector2.d.ts.map +1 -1
- package/src/core/geom/Vector2.js +6 -3
- package/src/core/geom/Vector3.js +1 -1
- package/src/core/geom/Vector4.d.ts.map +1 -1
- package/src/core/geom/Vector4.js +13 -92
- package/src/core/geom/vec3/v3_angle_cos_between.spec.d.ts +2 -0
- package/src/core/geom/vec3/v3_angle_cos_between.spec.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_angle_cos_between.spec.js +124 -0
- package/src/core/geom/vec3/v3_distance_above_plane.d.ts +13 -4
- package/src/core/geom/vec3/v3_distance_sqr.d.ts +12 -1
- package/src/core/geom/vec3/v3_length.d.ts +9 -1
- package/src/core/geom/vec4/v4_distance_sqr.d.ts +14 -0
- package/src/core/geom/vec4/v4_distance_sqr.d.ts.map +1 -0
- package/src/core/geom/vec4/v4_distance_sqr.js +20 -0
- package/src/core/geom/vec4/v4_dot.d.ts +14 -0
- package/src/core/geom/vec4/v4_dot.d.ts.map +1 -0
- package/src/core/geom/vec4/v4_dot.js +19 -0
- package/src/core/geom/vec4/v4_length_sqr.d.ts +10 -0
- package/src/core/geom/vec4/v4_length_sqr.d.ts.map +1 -0
- package/src/core/geom/vec4/v4_length_sqr.js +11 -0
- package/src/core/geom/vec4/v4_multiply_mat4.d.ts +8 -0
- package/src/core/geom/vec4/v4_multiply_mat4.d.ts.map +1 -0
- package/src/core/geom/vec4/v4_multiply_mat4.js +42 -0
- package/src/core/lang/reactive/compileReactiveExpression.d.ts.map +1 -1
- package/src/core/lang/reactive/compileReactiveExpression.js +1 -3
- package/src/core/lang/reactive/pegjs/ReactivePegCompiler.d.ts.map +1 -1
- package/src/core/lang/reactive/pegjs/ReactivePegCompiler.js +11 -5
- package/src/core/math/PI_RECIPROCAL.d.ts +6 -0
- package/src/core/math/PI_RECIPROCAL.d.ts.map +1 -0
- package/src/core/math/PI_RECIPROCAL.js +5 -0
- package/src/core/math/newton_solver_1d.d.ts +4 -3
- package/src/core/math/newton_solver_1d.d.ts.map +1 -1
- package/src/core/math/newton_solver_1d.js +4 -3
- package/src/core/math/physics/brdf/D_GGX.d.ts.map +1 -1
- package/src/core/math/physics/brdf/D_GGX.js +4 -1
- package/src/core/math/physics/brdf/brdf_burley.d.ts.map +1 -1
- package/src/core/math/physics/brdf/brdf_burley.js +5 -1
- package/src/core/math/physics/irradiance/interpolate_irradiance_smith.d.ts.map +1 -1
- package/src/core/math/physics/irradiance/interpolate_irradiance_smith.js +3 -3
- package/src/core/primitives/strings/insert_after.spec.d.ts +2 -0
- package/src/core/primitives/strings/insert_after.spec.d.ts.map +1 -0
- package/src/core/primitives/strings/insert_after.spec.js +16 -0
- package/src/core/primitives/strings/insert_before.spec.d.ts +2 -0
- package/src/core/primitives/strings/insert_before.spec.d.ts.map +1 -0
- package/src/core/primitives/strings/insert_before.spec.js +16 -0
- package/src/core/process/executor/ConcurrentExecutor.d.ts.map +1 -1
- package/src/core/process/executor/ConcurrentExecutor.js +10 -4
- package/src/core/time/current_time_in_seconds.d.ts.map +1 -1
- package/src/core/time/current_time_in_seconds.js +1 -1
- package/src/engine/animation/curve/compute_curve_aabb.d.ts.map +1 -1
- package/src/engine/animation/curve/compute_curve_aabb.js +19 -16
- package/src/engine/ecs/fow/FogOfWar.d.ts.map +1 -1
- package/src/engine/ecs/fow/FogOfWar.js +12 -12
- package/src/engine/ecs/fow/FogOfWar.spec.js +5 -6
- package/src/engine/ecs/transform/Transform.d.ts.map +1 -1
- package/src/engine/ecs/transform/Transform.js +2 -2
- package/src/engine/google/loadGTAG.d.ts +7 -0
- package/src/engine/google/loadGTAG.d.ts.map +1 -0
- package/src/engine/google/loadGTAG.js +32 -0
- package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField.js +6 -1
- package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField_Chamfer.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField_Chamfer.js +17 -1
- package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts +4 -0
- package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.js +4 -0
- package/src/engine/graphics/trail/x/NOTES.md +3 -0
- package/src/engine/graphics/trail/x/RibbonMaterialX.d.ts +11 -2
- package/src/engine/graphics/trail/x/RibbonMaterialX.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/RibbonMaterialX.js +28 -13
- package/src/engine/graphics/util/projectSphere.js +4 -4
- package/src/engine/metrics/GoogleAnalyticsMetrics.d.ts +2 -1
- package/src/engine/metrics/GoogleAnalyticsMetrics.d.ts.map +1 -1
- package/src/engine/metrics/GoogleAnalyticsMetrics.js +4 -39
- package/src/engine/notify/NotificationLog.d.ts +1 -2
- package/src/engine/notify/NotificationLog.d.ts.map +1 -1
- package/src/engine/notify/NotificationLog.js +33 -32
- package/src/core/geom/3d/mat4/allocate_transform_m4.d.ts.map +0 -1
- package/src/core/lang/reactive/nearley/Reactive.ne +0 -87
- package/src/engine/compression/CompressionService.d.ts +0 -19
- package/src/engine/compression/CompressionService.d.ts.map +0 -1
- package/src/engine/compression/CompressionService.js +0 -144
- package/src/engine/graphics/trail/CodeflowTrailMaterial.d.ts +0 -4
- package/src/engine/graphics/trail/CodeflowTrailMaterial.d.ts.map +0 -1
- package/src/engine/graphics/trail/CodeflowTrailMaterial.js +0 -134
- package/src/engine/graphics/trail/TemporalPath.d.ts +0 -39
- package/src/engine/graphics/trail/TemporalPath.d.ts.map +0 -1
- package/src/engine/graphics/trail/TemporalPath.js +0 -129
- package/src/engine/graphics/trail/TemporalPath.spec.d.ts +0 -2
- package/src/engine/graphics/trail/TemporalPath.spec.d.ts.map +0 -1
- package/src/engine/graphics/trail/TemporalPath.spec.js +0 -5
- package/src/engine/graphics/util/composeMatrix4RotationScale.d.ts +0 -9
- package/src/engine/graphics/util/composeMatrix4RotationScale.d.ts.map +0 -1
- package/src/engine/graphics/util/composeMatrix4RotationScale.js +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PI_RECIPROCAL.d.ts","sourceRoot":"","sources":["../../../../src/core/math/PI_RECIPROCAL.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,4BAFU,MAAM,CAEyB"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Newtonian solver, works by moving along the curve in the direction of gradient
|
|
2
|
+
* Newtonian solver, works by moving along the curve in the direction of gradient.
|
|
3
|
+
* Solving for f(x) = 0
|
|
3
4
|
* @param {function(number):number} f Function for which we are trying to solve
|
|
4
|
-
* @param {number} xStart
|
|
5
|
+
* @param {number} xStart initial guess for input value
|
|
5
6
|
* @param {number} [max_steps]
|
|
6
7
|
* @param {number} [eps]
|
|
7
|
-
* @returns {number}
|
|
8
|
+
* @returns {number} value for X where function is close to 0 or exactly at 0
|
|
8
9
|
*/
|
|
9
10
|
export function newton_solver_1d(f: (arg0: number) => number, xStart: number, max_steps?: number, eps?: number): number;
|
|
10
11
|
//# sourceMappingURL=newton_solver_1d.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"newton_solver_1d.d.ts","sourceRoot":"","sources":["../../../../src/core/math/newton_solver_1d.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"newton_solver_1d.d.ts","sourceRoot":"","sources":["../../../../src/core/math/newton_solver_1d.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,2CANoB,MAAM,KAAE,MAAM,UACvB,MAAM,cACN,MAAM,QACN,MAAM,GACJ,MAAM,CAuBlB"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Newtonian solver, works by moving along the curve in the direction of gradient
|
|
2
|
+
* Newtonian solver, works by moving along the curve in the direction of gradient.
|
|
3
|
+
* Solving for f(x) = 0
|
|
3
4
|
* @param {function(number):number} f Function for which we are trying to solve
|
|
4
|
-
* @param {number} xStart
|
|
5
|
+
* @param {number} xStart initial guess for input value
|
|
5
6
|
* @param {number} [max_steps]
|
|
6
7
|
* @param {number} [eps]
|
|
7
|
-
* @returns {number}
|
|
8
|
+
* @returns {number} value for X where function is close to 0 or exactly at 0
|
|
8
9
|
*/
|
|
9
10
|
export function newton_solver_1d(
|
|
10
11
|
f,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D_GGX.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/brdf/D_GGX.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"D_GGX.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/brdf/D_GGX.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,2BAJW,MAAM,aACN,MAAM,GACJ,MAAM,CAQlB"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PI_RECIPROCAL } from "../../PI_RECIPROCAL.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* GGX diffuse distribution function
|
|
3
5
|
* @see https://google.github.io/filament/Filament.md.html#listing_diffusebrdf
|
|
@@ -7,7 +9,8 @@
|
|
|
7
9
|
*/
|
|
8
10
|
export function D_GGX(NoH, roughness) {
|
|
9
11
|
const a = NoH * roughness;
|
|
12
|
+
|
|
10
13
|
const k = roughness / (1 - NoH * NoH + a * a);
|
|
11
14
|
|
|
12
|
-
return k * k *
|
|
15
|
+
return k * k * PI_RECIPROCAL;
|
|
13
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brdf_burley.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/brdf/brdf_burley.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brdf_burley.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/brdf/brdf_burley.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,iCANW,MAAM,OACN,MAAM,OACN,MAAM,aACN,MAAM,GACJ,MAAM,CASlB"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PI_RECIPROCAL } from "../../PI_RECIPROCAL.js";
|
|
2
|
+
|
|
1
3
|
function F_Schlick(u, f0, f90) {
|
|
2
4
|
|
|
3
5
|
return f0 + (f90 - f0) * Math.pow(1.0 - u, 5.0);
|
|
@@ -19,7 +21,9 @@ function F_Schlick(u, f0, f90) {
|
|
|
19
21
|
*/
|
|
20
22
|
export function brdf_burley(NoV, NoL, LoH, roughness) {
|
|
21
23
|
const f90 = 0.5 + 2.0 * roughness * LoH * LoH;
|
|
24
|
+
|
|
22
25
|
const lightScatter = F_Schlick(NoL, 1.0, f90);
|
|
23
26
|
const viewScatter = F_Schlick(NoV, 1.0, f90);
|
|
24
|
-
|
|
27
|
+
|
|
28
|
+
return lightScatter * viewScatter * PI_RECIPROCAL;
|
|
25
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpolate_irradiance_smith.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/irradiance/interpolate_irradiance_smith.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interpolate_irradiance_smith.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/irradiance/interpolate_irradiance_smith.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,uDALW,MAAM,OACN,MAAM,OACN,MAAM,GACL,MAAM,CA4BjB"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// const k = Math.sqrt( (2*0.1*0.1)/Math.PI);
|
|
2
|
+
const k = 0.07978845608028655;
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Using Smith inverse-square bounded approximation
|
|
3
6
|
* @see "An Inexpensive BRDF Model for Physically-based Rendering" by Christophe Schlick
|
|
@@ -24,14 +27,11 @@ export function interpolate_irradiance_smith(distance, min, max) {
|
|
|
24
27
|
where G is the fall-off
|
|
25
28
|
*/
|
|
26
29
|
|
|
27
|
-
// const k = Math.sqrt( (2*0.1*0.1)/Math.PI);
|
|
28
30
|
|
|
29
31
|
const range = max - min;
|
|
30
32
|
|
|
31
33
|
const v = (distance - min) / range;
|
|
32
34
|
|
|
33
|
-
const k = 0.07978845608028655;
|
|
34
|
-
|
|
35
35
|
const fall_off = v / (v - k * v + k);
|
|
36
36
|
|
|
37
37
|
return 1 - fall_off;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert_after.spec.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/strings/insert_after.spec.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { insert_after } from "./insert_after.js";
|
|
2
|
+
|
|
3
|
+
test("basics", () => {
|
|
4
|
+
|
|
5
|
+
expect(insert_after("aba", "b", "c")).toBe("abca");
|
|
6
|
+
expect(insert_after("a", "a", "c")).toBe("ac");
|
|
7
|
+
expect(insert_after("ba", "a", "c")).toBe("bac");
|
|
8
|
+
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test("non-occurrence", () => {
|
|
12
|
+
|
|
13
|
+
expect(insert_after("", "a", "c")).toBe("");
|
|
14
|
+
expect(insert_after("b", "a", "c")).toBe("b");
|
|
15
|
+
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert_before.spec.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/strings/insert_before.spec.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { insert_before } from "./insert_before.js";
|
|
2
|
+
|
|
3
|
+
test("basics", () => {
|
|
4
|
+
|
|
5
|
+
expect(insert_before("aba", "b", "c")).toBe("acba");
|
|
6
|
+
expect(insert_before("a", "a", "c")).toBe("ca");
|
|
7
|
+
expect(insert_before("ba", "a", "c")).toBe("bca");
|
|
8
|
+
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test("non-occurrence", () => {
|
|
12
|
+
|
|
13
|
+
expect(insert_before("", "a", "c")).toBe("");
|
|
14
|
+
expect(insert_before("b", "a", "c")).toBe("b");
|
|
15
|
+
|
|
16
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConcurrentExecutor.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/executor/ConcurrentExecutor.js"],"names":[],"mappings":";AAmBA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"ConcurrentExecutor.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/executor/ConcurrentExecutor.js"],"names":[],"mappings":";AAmBA;;GAEG;AACH;IAaI;;;;;OAKG;IACH,wBAJW,MAAM,aACN,MAAM,EAwChB;IApCG;;;OAGG;IACH,WAFU,MAAM,CAEU;IAC1B;;;OAGG;IACH,UAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,iBAFU,MAAM,CAES;IAEzB;;;OAGG;IACH,YAFU,MAAM,CAEI;IAEpB;;;;MAIC;IAED,cAAiB;IAEjB;;;OAGG;IACH,QAFU,MAAM,GAAC,gBAAgB,CAES;IAG9C;;;OAGG;IACH,qCAmEC;IAED;;;OAGG;IACH,oCAaC;IAED;;;;OAIG;IACH,wBAFY,OAAO,CAwBlB;IAED;;;OAGG;IACH,sBAGC;IAED;;;OAGG;IACH,eAFW,MAAM,QAMhB;IAED;;;;OAIG;IACH,kBAkCC;IAED;;OAEG;IACH,qBA8BC;IAED;;;;OAIG;IACH,sBAFa,OAAO,CAYnB;IA+KD;;;OAGG;IACH,aAQC;IAED,0BAMC;;CACJ;;;;mBAvfkB,+BAA+B;wBA2fxC,MAAM"}
|
|
@@ -13,7 +13,7 @@ import TaskState from "../task/TaskState.js";
|
|
|
13
13
|
* @param {TaskGroup|Task} t
|
|
14
14
|
* @returns {boolean}
|
|
15
15
|
*/
|
|
16
|
-
function
|
|
16
|
+
function isGroupTask(t) {
|
|
17
17
|
return t.children instanceof Array;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -21,7 +21,12 @@ function isGroup(t) {
|
|
|
21
21
|
* @class
|
|
22
22
|
*/
|
|
23
23
|
class ConcurrentExecutor {
|
|
24
|
+
/**
|
|
25
|
+
* How many time-slice cycles have been executed this far. This is a monotonically increasing counter
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
24
28
|
#cycle_count = 0;
|
|
29
|
+
|
|
25
30
|
/**
|
|
26
31
|
* Handle of the last scheduled `setTimeout`
|
|
27
32
|
* @type {number}
|
|
@@ -134,7 +139,7 @@ class ConcurrentExecutor {
|
|
|
134
139
|
const child = children[i];
|
|
135
140
|
child.on.completed.add(subTaskCompleted);
|
|
136
141
|
child.on.failed.add(subTaskFailed);
|
|
137
|
-
if (
|
|
142
|
+
if (isGroupTask(child)) {
|
|
138
143
|
this.runGroup(child);
|
|
139
144
|
} else {
|
|
140
145
|
this.run(child);
|
|
@@ -157,7 +162,7 @@ class ConcurrentExecutor {
|
|
|
157
162
|
for (let i = 0; i < n; i++) {
|
|
158
163
|
const child = children[i];
|
|
159
164
|
|
|
160
|
-
if (
|
|
165
|
+
if (isGroupTask(child)) {
|
|
161
166
|
this.removeGroup(child);
|
|
162
167
|
} else {
|
|
163
168
|
this.removeTask(child);
|
|
@@ -255,7 +260,7 @@ class ConcurrentExecutor {
|
|
|
255
260
|
}
|
|
256
261
|
|
|
257
262
|
/**
|
|
258
|
-
* Go through unresolved queue and move tasks
|
|
263
|
+
* Go through unresolved queue and move tasks whose dependencies have been completed to ready queue or fail them
|
|
259
264
|
*/
|
|
260
265
|
resolveTasks() {
|
|
261
266
|
const queueUnresolved = this.queueUnresolved;
|
|
@@ -292,6 +297,7 @@ class ConcurrentExecutor {
|
|
|
292
297
|
/**
|
|
293
298
|
*
|
|
294
299
|
* @param {Task} task
|
|
300
|
+
* @returns {boolean}
|
|
295
301
|
*/
|
|
296
302
|
contains(task) {
|
|
297
303
|
if (this.queueUnresolved.indexOf(task) !== -1) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current_time_in_seconds.d.ts","sourceRoot":"","sources":["../../../../src/core/time/current_time_in_seconds.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"current_time_in_seconds.d.ts","sourceRoot":"","sources":["../../../../src/core/time/current_time_in_seconds.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,2CAFa,MAAM,CAKlB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
//Use highest available resolution time source
|
|
3
2
|
const source = typeof performance === "undefined" ? Date : performance;
|
|
4
3
|
|
|
@@ -7,5 +6,6 @@ const source = typeof performance === "undefined" ? Date : performance;
|
|
|
7
6
|
* @returns {number}
|
|
8
7
|
*/
|
|
9
8
|
export function current_time_in_seconds() {
|
|
9
|
+
// time source produces value in milliseconds, we need to scale to seconds
|
|
10
10
|
return source.now() * 1e-3;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute_curve_aabb.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/compute_curve_aabb.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"compute_curve_aabb.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/compute_curve_aabb.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,4EAsCC"}
|
|
@@ -18,29 +18,32 @@ export function compute_curve_aabb(out, curve) {
|
|
|
18
18
|
const keys = curve.keys;
|
|
19
19
|
const key_count = keys.length;
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
x0 = x1 = previous.time;
|
|
23
|
-
y0 = y1 = previous.value;
|
|
21
|
+
if (key_count > 0) {
|
|
24
22
|
|
|
23
|
+
let previous = keys[0];
|
|
24
|
+
x0 = x1 = previous.time;
|
|
25
|
+
y0 = y1 = previous.value;
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
for (let i = 1; i < key_count; i++) {
|
|
28
|
+
const keyframe = keys[i];
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
const time_delta = keyframe.time - previous.time;
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
spline_hermite3_bounds(temp_bounds, 0, 1,
|
|
33
|
+
previous.value, keyframe.value,
|
|
34
|
+
previous.outTangent * time_delta,
|
|
35
|
+
keyframe.inTangent * time_delta
|
|
36
|
+
);
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
x0 = min2(x0, keyframe.time)
|
|
39
|
+
x1 = max2(x1, keyframe.time)
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
y0 = min2(y0, temp_bounds[0]);
|
|
42
|
+
y1 = max2(y1, temp_bounds[1]);
|
|
43
|
+
|
|
44
|
+
previous = keyframe;
|
|
45
|
+
}
|
|
42
46
|
|
|
43
|
-
previous = keyframe;
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
out.set(x0, y0, x1, y1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FogOfWar.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/fow/FogOfWar.js"],"names":[],"mappings":"AA+CA;;GAEG;AACH;IAEI;;;OAGG;IACH,oBAFU,OAAO,CAES;IAC1B;;;OAGG;IACH,0BAFU,OAAO,CAEgB;IAEjC;;;OAGG;IACH,SAFU,WAAW,GAAC,IAAI,CAEX;IAEf;;;OAGG;IACH,OAFU,OAAO,CAEM;IAEvB;;;OAGG;IACH,MAFU,OAAO,CAEQ;IAEzB,eAAsC;IAEtC;;;OAGG;IACH,UAFU,aAAa,CAE2B;IAElD;;MAEE;IAEF;;;OAGG;IACH,SAFU,SAAS,CAEgB;IAEnC;;;OAGG;IACH,iBAFU,SAAS,CAEwB;IAE3C;;;OAGG;IACH,sBAFW,MAAM,QAqDhB;IAED;;;;OAIG;IACH,eAHW,MAAM,KACN,MAAM,QAyBhB;IAED,cAOC;IAED,kBAOC;IAED,mBAEC;IAED;;;;;OAKG;IACH,UAJW,MAAM,KACN,MAAM,UACN,MAAM,QA+ChB;IAED;;;;;OAKG;IACH,WAJW,MAAM,KACN,MAAM,UACN,MAAM,QAgDhB;IAED,gBAIC;IAED,sBAqCC;IAED;;;OAGG;IACH,kBAFW,MAAM,QAYhB;IAED;;;OAGG;IACH,0DA+BC;IAED;;;;;OAKG;IACH,yBAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,QAelB;IAED;;;;;OAKG;IACH,yEAFW,MAAM,WA+EhB;IAED;;;;;OAKG;IACH,qBAJW,MAAM,KACN,MAAM,GACJ,MAAM,CASlB;IAED,6BAKC;IAED,+BASC;IAED,uBAyBC;IAGD;;;;;OAKG;IACH,UAJW,MAAM,KACN,MAAM,oBAUhB;CACJ;;;;
|
|
1
|
+
{"version":3,"file":"FogOfWar.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/fow/FogOfWar.js"],"names":[],"mappings":"AA+CA;;GAEG;AACH;IAEI;;;OAGG;IACH,oBAFU,OAAO,CAES;IAC1B;;;OAGG;IACH,0BAFU,OAAO,CAEgB;IAEjC;;;OAGG;IACH,SAFU,WAAW,GAAC,IAAI,CAEX;IAEf;;;OAGG;IACH,OAFU,OAAO,CAEM;IAEvB;;;OAGG;IACH,MAFU,OAAO,CAEQ;IAEzB,eAAsC;IAEtC;;;OAGG;IACH,UAFU,aAAa,CAE2B;IAElD;;MAEE;IAEF;;;OAGG;IACH,SAFU,SAAS,CAEgB;IAEnC;;;OAGG;IACH,iBAFU,SAAS,CAEwB;IAE3C;;;OAGG;IACH,sBAFW,MAAM,QAqDhB;IAED;;;;OAIG;IACH,eAHW,MAAM,KACN,MAAM,QAyBhB;IAED,cAOC;IAED,kBAOC;IAED,mBAEC;IAED;;;;;OAKG;IACH,UAJW,MAAM,KACN,MAAM,UACN,MAAM,QA+ChB;IAED;;;;;OAKG;IACH,WAJW,MAAM,KACN,MAAM,UACN,MAAM,QAgDhB;IAED,gBAIC;IAED,sBAqCC;IAED;;;OAGG;IACH,kBAFW,MAAM,QAYhB;IAED;;;OAGG;IACH,0DA+BC;IAED;;;;;OAKG;IACH,yBAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,QAelB;IAED;;;;;OAKG;IACH,yEAFW,MAAM,WA+EhB;IAED;;;;;OAKG;IACH,qBAJW,MAAM,KACN,MAAM,GACJ,MAAM,CASlB;IAED,6BAKC;IAED,+BASC;IAED,uBAyBC;IAGD;;;;;OAKG;IACH,UAJW,MAAM,KACN,MAAM,oBAUhB;CACJ;;;;4BAxlB2F,OAAO;oBAM/E,+BAA+B;oBAC/B,+BAA+B;oBAC/B,+BAA+B;8BALrB,iDAAiD;mBAE5D,uCAAuC;0BAQhC,6CAA6C"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { clamp } from "../../../core/math/clamp.js";
|
|
2
|
-
import { max2 } from "../../../core/math/max2.js";
|
|
3
|
-
import { min2 } from "../../../core/math/min2.js";
|
|
4
|
-
import { Sampler2D } from "../../graphics/texture/sampler/Sampler2D.js";
|
|
5
1
|
import { ClampToEdgeWrapping, DataTexture, LinearFilter, RedFormat, UnsignedByteType } from "three";
|
|
6
|
-
import Vector1 from "../../../core/geom/Vector1.js";
|
|
7
|
-
import Vector2 from "../../../core/geom/Vector2.js";
|
|
8
2
|
import { assert } from "../../../core/assert.js";
|
|
9
|
-
import
|
|
10
|
-
import Signal from "../../../core/events/signal/Signal.js";
|
|
3
|
+
import { BinaryDataType } from "../../../core/binary/type/BinaryDataType.js";
|
|
11
4
|
import { RowFirstTable } from "../../../core/collection/table/RowFirstTable.js";
|
|
12
5
|
import { RowFirstTableSpec } from "../../../core/collection/table/RowFirstTableSpec.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
6
|
+
import Signal from "../../../core/events/signal/Signal.js";
|
|
7
|
+
import Vector1 from "../../../core/geom/Vector1.js";
|
|
8
|
+
import Vector2 from "../../../core/geom/Vector2.js";
|
|
9
|
+
import Vector4 from "../../../core/geom/Vector4.js";
|
|
10
|
+
import { clamp } from "../../../core/math/clamp.js";
|
|
11
|
+
import { max2 } from "../../../core/math/max2.js";
|
|
12
|
+
import { min2 } from "../../../core/math/min2.js";
|
|
15
13
|
import { computeUnsignedDistanceField } from "../../graphics/texture/sampler/distance/computeUnsignedDistanceField.js";
|
|
14
|
+
import { Sampler2D } from "../../graphics/texture/sampler/Sampler2D.js";
|
|
15
|
+
import { writeSample2DDataToDataTexture } from "../../graphics/texture/sampler/writeSampler2DDataToDataTexture.js";
|
|
16
16
|
|
|
17
17
|
const samplePosition = [];
|
|
18
18
|
|
|
@@ -539,9 +539,9 @@ export class FogOfWar {
|
|
|
539
539
|
}
|
|
540
540
|
|
|
541
541
|
rebuildDistanceField() {
|
|
542
|
-
console.time('computeSignedDistanceField');
|
|
542
|
+
// console.time('computeSignedDistanceField');
|
|
543
543
|
computeUnsignedDistanceField(this.sampler, this.distanceSampler, 255);
|
|
544
|
-
console.timeEnd('computeSignedDistanceField');
|
|
544
|
+
// console.timeEnd('computeSignedDistanceField');
|
|
545
545
|
this.distanceFieldNeedsUpdate = false;
|
|
546
546
|
}
|
|
547
547
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { FogOfWar } from "./FogOfWar.js";
|
|
2
2
|
|
|
3
3
|
test('getWorldClearance', () => {
|
|
4
|
-
const
|
|
4
|
+
const fog = new FogOfWar();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
fog.resize(1, 1, 2);
|
|
7
7
|
|
|
8
|
+
expect(fog.getWorldClearance(1, 1)).toBe(255);
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
fog.reveal(0, 0, 0.5);
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
expect(sut.getWorldClearance(1, 1)).toBe(0);
|
|
12
|
+
expect(fog.getWorldClearance(1, 1)).toBe(0);
|
|
14
13
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/transform/Transform.js"],"names":[],"mappings":"AA0BA;;;GAGG;AACH;IAwQI;;;;OAIG;IACH,4BAFa,SAAS,CAQrB;IAqDD;;;;;OAKG;IACH,wCAJW,UAAU,gBACV,OAAO,wBAajB;IAtVD;;;OAGG;IACH,mBAHU,OAAO,CAGe;IAEhC;;;OAGG;IACH,mBAHU,UAAU,CAGkB;IAEtC;;;OAGG;IACH,gBAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,iBAFU,YAAY,
|
|
1
|
+
{"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/transform/Transform.js"],"names":[],"mappings":"AA0BA;;;GAGG;AACH;IAwQI;;;;OAIG;IACH,4BAFa,SAAS,CAQrB;IAqDD;;;;;OAKG;IACH,wCAJW,UAAU,gBACV,OAAO,wBAajB;IAtVD;;;OAGG;IACH,mBAHU,OAAO,CAGe;IAEhC;;;OAGG;IACH,mBAHU,UAAU,CAGkB;IAEtC;;;OAGG;IACH,gBAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,iBAFU,YAAY,CAEC;IAEvB;;;;OAIG;IACH,OAFU,MAAM,CAEM;IAOtB;;;;OAIG;IACH,uBAMC;IAED;;;OAGG;IACH,kBAMC;IAED;;;OAGG;IACH,qBAMC;IAED;;;;OAIG;IACH,kDAIC;IAED;;;;OAIG;IACH,oDAIC;IAYD;;;;OAIG;IACH,cAHW,MAAM,GAAC,cAAc,GACnB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,cAAc,GACnB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,cAAc,SACrB,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,cAAc,GACnB,OAAO,CAInB;IAED;;OAEG;IACH,qBAEC;IAED;;;;OAIG;IACH,eAHW,OAAO,OACP,OAAO,QAmBjB;IAED,0BAwBC;IAED;;;;MAMC;IAED;;;OAGG;IACH,YAFW,SAAS,QAenB;IAED;;;OAGG;IACH,SAFa,SAAS,CAQrB;IAED;;;;OAIG;IACH,cAHW,SAAS,GACP,OAAO,CAMnB;IAED;;;OAGG;IACH,QAFa,MAAM,CAKlB;IAeD;;;;OAIG;IACH,sBAHW,SAAS,KACT,SAAS,QAMnB;IAED;;;OAGG;IACH,eAFW,OAAK,MAAM,EAAE,GAAC,YAAY,QAcpC;IAED;;;OAGG;IACH,kBAFW,MAAM,EAAE,GAAC,YAAY,QAI/B;IAED;;;;;OAKG;IACH,qBAEC;IAED,mBAEC;IA2BL;;;OAGG;IACH,sBAFU,OAAO,CAEc;;CAZ9B;;kBAIS,MAAM;;oBAhXI,+BAA+B;uBAD5B,kCAAkC;+BAE1B,qBAAqB"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { assert } from "../../../core/assert.js";
|
|
6
6
|
import { compose_matrix4_array } from "../../../core/geom/3d/compose_matrix4_array.js";
|
|
7
7
|
import { decompose_matrix_4_array } from "../../../core/geom/3d/decompose_matrix_4_array.js";
|
|
8
|
-
import {
|
|
8
|
+
import { allocate_m4 } from "../../../core/geom/3d/mat4/allocate_m4.js";
|
|
9
9
|
import { m4_multiply } from "../../../core/geom/3d/mat4/m4_multiply.js";
|
|
10
10
|
import { MATRIX_4_IDENTITY } from "../../../core/geom/3d/mat4/MATRIX_4_IDENTITY.js";
|
|
11
11
|
import Quaternion from "../../../core/geom/Quaternion.js";
|
|
@@ -53,7 +53,7 @@ export class Transform {
|
|
|
53
53
|
* @readonly
|
|
54
54
|
* @type {Float32Array}
|
|
55
55
|
*/
|
|
56
|
-
matrix =
|
|
56
|
+
matrix = allocate_m4();
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Various bit flags, see {@link TransformFlags}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadGTAG.d.ts","sourceRoot":"","sources":["../../../../src/engine/google/loadGTAG.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,6BAHW,MAAM,YA6BhB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google tracker initialization
|
|
3
|
+
* @param {string} id measurement ID
|
|
4
|
+
* @return {function} tracker function
|
|
5
|
+
*/
|
|
6
|
+
export function loadGTAG(id) {
|
|
7
|
+
|
|
8
|
+
(function (target, s, domTag, sourceURL) {
|
|
9
|
+
|
|
10
|
+
const a = s.createElement(domTag);
|
|
11
|
+
const m = s.getElementsByTagName(domTag)[0];
|
|
12
|
+
|
|
13
|
+
a.async = 1;
|
|
14
|
+
a.src = sourceURL;
|
|
15
|
+
|
|
16
|
+
m.parentNode.insertBefore(a, m)
|
|
17
|
+
})(document, document, 'script', `https://www.googletagmanager.com/gtag/js?id=${id}`);
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
window.dataLayer = window.dataLayer || [];
|
|
21
|
+
|
|
22
|
+
function gtag() {
|
|
23
|
+
dataLayer.push(arguments);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
gtag('js', new Date());
|
|
27
|
+
|
|
28
|
+
gtag('config', id);
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
return gtag;
|
|
32
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeUnsignedDistanceField.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,sGAFW,MAAM,
|
|
1
|
+
{"version":3,"file":"computeUnsignedDistanceField.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,sGAFW,MAAM,QAShB"}
|
|
@@ -5,6 +5,11 @@ import { computeUnsignedDistanceField_Chamfer } from "./computeUnsignedDistanceF
|
|
|
5
5
|
* @param {Sampler2D} distanceField
|
|
6
6
|
* @param {number} emptyValue
|
|
7
7
|
*/
|
|
8
|
-
export function computeUnsignedDistanceField(
|
|
8
|
+
export function computeUnsignedDistanceField(
|
|
9
|
+
source,
|
|
10
|
+
distanceField,
|
|
11
|
+
emptyValue
|
|
12
|
+
) {
|
|
13
|
+
|
|
9
14
|
computeUnsignedDistanceField_Chamfer(source, distanceField, emptyValue, 1, 1, 255);
|
|
10
15
|
}
|
package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField_Chamfer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeUnsignedDistanceField_Chamfer.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField_Chamfer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"computeUnsignedDistanceField_Chamfer.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField_Chamfer.js"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,8GALW,MAAM,MACN,MAAM,MACN,MAAM,QACN,MAAM,QAyIhB"}
|
package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField_Chamfer.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assert } from "../../../../../core/assert.js";
|
|
1
2
|
import { max2 } from "../../../../../core/math/max2.js";
|
|
2
3
|
import { min2 } from "../../../../../core/math/min2.js";
|
|
3
4
|
|
|
@@ -10,7 +11,22 @@ import { min2 } from "../../../../../core/math/min2.js";
|
|
|
10
11
|
* @param {number} d2 distance between two diagonally adjacent pixels
|
|
11
12
|
* @param {number} maxD highest value that distance field can hold
|
|
12
13
|
*/
|
|
13
|
-
export function computeUnsignedDistanceField_Chamfer(
|
|
14
|
+
export function computeUnsignedDistanceField_Chamfer(
|
|
15
|
+
source,
|
|
16
|
+
distanceField,
|
|
17
|
+
emptyValue,
|
|
18
|
+
d1,
|
|
19
|
+
d2,
|
|
20
|
+
maxD
|
|
21
|
+
) {
|
|
22
|
+
|
|
23
|
+
assert.defined(source, 'source');
|
|
24
|
+
assert.defined(distanceField, 'distanceField');
|
|
25
|
+
assert.isNumber(emptyValue, 'emptyValue');
|
|
26
|
+
assert.isNumber(d1, 'd1');
|
|
27
|
+
assert.isNumber(d2, 'd2');
|
|
28
|
+
assert.isNumber(maxD, 'maxD');
|
|
29
|
+
|
|
14
30
|
const sourceData = source.data;
|
|
15
31
|
const distanceFieldData = distanceField.data;
|
|
16
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualTextureTile.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/texture/virtual/tile/VirtualTextureTile.js"],"names":[],"mappings":"AAAA;IAEI;;;OAGG;IACH,cAFU,MAAM,CAEC;IAEjB,
|
|
1
|
+
{"version":3,"file":"VirtualTextureTile.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/texture/virtual/tile/VirtualTextureTile.js"],"names":[],"mappings":"AAAA;IAEI;;;OAGG;IACH,cAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,gBAFU,MAAM,CAEG;IAEnB;;;OAGG;IACH,WAFU,MAAM,CAED;IAEf;;;OAGG;IACH,MAFU,YAAU,IAAI,CAEZ;IAEZ;;;;OAIG;IACH,cAHW,kBAAkB,GAChB,OAAO,CAInB;IAED,eAEC;CACJ"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
export class RibbonMaterialX extends ShaderMaterial {
|
|
2
2
|
constructor(params: any);
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {Vector2} v2
|
|
6
|
+
*/
|
|
7
|
+
set resolution(arg: Vector2);
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @return {Vector2}
|
|
11
|
+
*/
|
|
12
|
+
get resolution(): Vector2;
|
|
5
13
|
}
|
|
6
14
|
import { ShaderMaterial } from "three";
|
|
15
|
+
import { Vector2 } from "three";
|
|
7
16
|
//# sourceMappingURL=RibbonMaterialX.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RibbonMaterialX.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/trail/x/RibbonMaterialX.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RibbonMaterialX.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/trail/x/RibbonMaterialX.js"],"names":[],"mappings":"AAuGA;IACI,yBAwBC;IAED;;;OAGG;IACH,6BAEC;IAED;;;OAGG;IACH,0BAEC;CACJ;+BAjJmE,OAAO;wBAAP,OAAO"}
|