@woosh/meep-engine 2.110.9 → 2.110.11
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 +23 -1
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +23 -1
- package/editor/ecs/component/editors/Sampler2DEditor.js +9 -9
- package/editor/ecs/component/editors/three/BufferGeometryEditor.js +4 -4
- package/editor/ecs/component/editors/three/MaterialEditor.js +3 -3
- package/editor/ecs/component/editors/three/MeshEditor.js +4 -4
- package/editor/ecs/component/editors/three/TextureEditor.js +1 -1
- package/editor/tools/paint/TerrainPaintTool.js +7 -7
- package/editor/tools/paint/TerrainTexturePaintTool.js +5 -5
- package/editor/view/ecs/components/GridObstacleController.js +6 -6
- package/editor/view/ecs/components/TerrainController.js +2 -2
- package/package.json +1 -1
- package/samples/terrain/editor.js +2 -2
- package/src/core/UUID.js +1 -1
- package/src/core/color/kelvin/prototype_kelvin_to_rgb.js +3 -3
- package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/AABB2.js +27 -1
- package/src/core/geom/3d/normal/octahedron/prototype.js +1 -1
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_volume.d.ts +9 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_volume.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_volume.js +18 -0
- package/src/core/geom/3d/tetrahedra/delaunay/compute_delaunay_tetrahedral_mesh.spec.js +17 -3
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.spec.js +25 -2
- package/src/core/geom/3d/tetrahedra/is_tetrahedron_degenerate.d.ts +9 -0
- package/src/core/geom/3d/tetrahedra/is_tetrahedron_degenerate.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/is_tetrahedron_degenerate.js +21 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.d.ts +2 -1
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.js +2 -1
- package/src/core/geom/3d/tetrahedra/triangle/prototype.js +1 -1
- package/src/core/geom/3d/tetrahedra/validate_tetrahedral_mesh.d.ts +2 -10
- package/src/core/geom/3d/tetrahedra/validate_tetrahedral_mesh.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/validate_tetrahedral_mesh.js +24 -31
- package/src/core/geom/mat3/m3_cm_invert.d.ts +7 -0
- package/src/core/geom/mat3/m3_cm_invert.d.ts.map +1 -0
- package/src/core/geom/mat3/m3_cm_invert.js +45 -0
- package/src/core/geom/vec2/v2_matrix3_cm_multiply.d.ts +10 -0
- package/src/core/geom/vec2/v2_matrix3_cm_multiply.d.ts.map +1 -0
- package/src/core/geom/vec2/v2_matrix3_cm_multiply.js +20 -0
- package/src/core/geom/vec2/v2_matrix3_rm_multiply.d.ts +10 -0
- package/src/core/geom/vec2/v2_matrix3_rm_multiply.d.ts.map +1 -0
- package/src/core/geom/vec2/v2_matrix3_rm_multiply.js +21 -0
- package/src/core/math/spline/spline_hermite3.js +2 -1
- package/src/core/math/spline/spline_hermite3_to_bezier.d.ts +12 -0
- package/src/core/math/spline/spline_hermite3_to_bezier.d.ts.map +1 -0
- package/src/core/math/spline/spline_hermite3_to_bezier.js +24 -0
- package/src/core/process/task/Task.d.ts.map +1 -1
- package/src/core/process/task/Task.js +2 -0
- package/src/core/process/task/util/actionTask.d.ts +2 -2
- package/src/core/process/task/util/actionTask.d.ts.map +1 -1
- package/src/core/process/task/util/actionTask.js +5 -2
- package/src/core/process/task/util/ignoreFailureTask.d.ts +8 -0
- package/src/core/process/task/util/ignoreFailureTask.d.ts.map +1 -0
- package/src/core/process/task/util/{wrapTaskIgnoreFailure.js → ignoreFailureTask.js} +9 -4
- package/src/core/process/task/util/task_tree_compute_leaf_tasks.d.ts +1 -1
- package/src/core/process/task/util/task_tree_compute_leaf_tasks.js +1 -1
- package/src/engine/animation/clip/AnimationTrack.js +1 -1
- package/src/engine/animation/curve/AnimationCurve.d.ts +11 -0
- package/src/engine/animation/curve/AnimationCurve.d.ts.map +1 -1
- package/src/engine/animation/curve/AnimationCurve.js +51 -4
- package/src/engine/animation/curve/draw/build_curve_editor.d.ts.map +1 -1
- package/src/engine/animation/curve/draw/build_curve_editor.js +15 -9
- package/src/engine/animation/curve/view/AnimationCurveView.d.ts +47 -0
- package/src/engine/animation/curve/view/AnimationCurveView.d.ts.map +1 -0
- package/src/engine/animation/curve/view/AnimationCurveView.js +343 -0
- package/src/engine/animation/curve/view/prototype.d.ts +2 -0
- package/src/engine/animation/curve/view/prototype.d.ts.map +1 -0
- package/src/engine/animation/curve/view/prototype.js +86 -0
- package/src/engine/asset/loaders/image/png/prototypePNG.js +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +1 -1
- package/src/engine/ecs/guid/UUID.d.ts +10 -3
- package/src/engine/ecs/guid/UUID.d.ts.map +1 -1
- package/src/engine/ecs/guid/UUID.js +17 -5
- package/src/engine/ecs/guid/UUID.spec.js +7 -0
- package/src/engine/ecs/guid/UUIDSerializationAdapter.spec.d.ts +2 -0
- package/src/engine/ecs/guid/UUIDSerializationAdapter.spec.d.ts.map +1 -0
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +2 -2
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +1 -1
- package/src/engine/graphics/sh3/sky/hosek/prototype_hosek.js +3 -3
- package/src/engine/graphics/texture/sampler/debug/debug_draw_sampler.js +1 -1
- package/src/engine/graphics/texture/sampler/downloadSamplerAsPNG.js +2 -2
- package/src/engine/graphics/texture/sampler/sampler2d_to_data_url.d.ts +8 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_data_url.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_data_url.js +22 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_data_url.spec.d.ts +2 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_data_url.spec.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/{convertSampler2D2DataURL.spec.js → sampler2d_to_data_url.spec.js} +2 -2
- package/src/engine/graphics/texture/sampler/{Sampler2D2Canvas.d.ts → sampler2d_to_html_canvas.d.ts} +3 -3
- package/src/engine/graphics/texture/sampler/sampler2d_to_html_canvas.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/{Sampler2D2Canvas.js → sampler2d_to_html_canvas.js} +7 -7
- package/src/engine/graphics/texture/sampler/util/drawSamplerHTML.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/util/drawSamplerHTML.js +3 -3
- package/src/engine/graphics/texture/sprite/prototypeSpriteCutoutGeometry.js +1 -1
- package/src/engine/scene/transitionToScene.js +3 -3
- package/src/generation/filtering/numeric/util/visualise_filters_as_grid.js +3 -3
- package/src/misc/makeMatcapSelectionOption.js +2 -2
- package/src/view/elements/DropDownSelectionView.js +1 -1
- package/src/view/elements/tiles2d/Tile.d.ts +1 -1
- package/src/view/elements/tiles2d/Tile.d.ts.map +1 -1
- package/src/view/elements/tiles2d/Tile.js +2 -1
- package/src/core/process/task/util/wrapTaskIgnoreFailure.d.ts +0 -8
- package/src/core/process/task/util/wrapTaskIgnoreFailure.d.ts.map +0 -1
- package/src/engine/ecs/guid/GUIDSerializationAdapter.spec.d.ts +0 -2
- package/src/engine/ecs/guid/GUIDSerializationAdapter.spec.d.ts.map +0 -1
- package/src/engine/graphics/texture/sampler/Sampler2D2Canvas.d.ts.map +0 -1
- package/src/engine/graphics/texture/sampler/convertSampler2D2DataURL.d.ts +0 -7
- package/src/engine/graphics/texture/sampler/convertSampler2D2DataURL.d.ts.map +0 -1
- package/src/engine/graphics/texture/sampler/convertSampler2D2DataURL.js +0 -23
- package/src/engine/graphics/texture/sampler/convertSampler2D2DataURL.spec.d.ts +0 -2
- package/src/engine/graphics/texture/sampler/convertSampler2D2DataURL.spec.d.ts.map +0 -1
- /package/src/engine/ecs/guid/{GUIDSerializationAdapter.spec.js → UUIDSerializationAdapter.spec.js} +0 -0
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import { noop } from "../../../function/noop.js";
|
|
2
|
+
import { compute_tetrahedron_volume } from "./compute_tetrahedron_volume.js";
|
|
3
|
+
import { is_tetrahedron_degenerate } from "./is_tetrahedron_degenerate.js";
|
|
2
4
|
import { INVALID_NEIGHBOUR } from "./TetrahedralMesh.js";
|
|
3
|
-
import { tetrahedron_compute_signed_volume } from "./tetrahedron_compute_signed_volume.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* @param {TetrahedralMesh} mesh
|
|
8
|
-
* @param {ArrayLike<number>|number[]} points
|
|
9
|
-
* @param {number} tet
|
|
10
|
-
* @return {number}
|
|
11
|
-
*/
|
|
12
|
-
export function get_tetrahedron_volume(mesh, points, tet) {
|
|
13
|
-
|
|
14
|
-
const a = mesh.getVertexIndex(tet, 0);
|
|
15
|
-
const b = mesh.getVertexIndex(tet, 1);
|
|
16
|
-
const c = mesh.getVertexIndex(tet, 2);
|
|
17
|
-
const d = mesh.getVertexIndex(tet, 3);
|
|
18
|
-
|
|
19
|
-
return tetrahedron_compute_signed_volume(points, a, b, c, d);
|
|
20
|
-
}
|
|
21
5
|
|
|
22
6
|
/**
|
|
23
7
|
*
|
|
@@ -113,36 +97,45 @@ export function validate_tetrahedron_neighbourhood(mesh, tet, consumer = noop) {
|
|
|
113
97
|
*
|
|
114
98
|
* @param {TetrahedralMesh} mesh
|
|
115
99
|
* @param {number} tet
|
|
116
|
-
* @
|
|
100
|
+
* @param {number} max_index
|
|
101
|
+
* @param {function(problem:string):*} consumer
|
|
117
102
|
*/
|
|
118
|
-
function
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
103
|
+
function validate_tetrahedron_point_index_range(mesh, tet, max_index, consumer) {
|
|
104
|
+
let valid = true;
|
|
105
|
+
|
|
106
|
+
for (let i = 0; i < 4; i++) {
|
|
107
|
+
|
|
108
|
+
const vertex_index = mesh.getVertexIndex(tet, i);
|
|
109
|
+
|
|
110
|
+
if (vertex_index > max_index) {
|
|
111
|
+
consumer(`Tetrahedron ${tet} points to non-existing vertex ${vertex_index} as it's ordinal vertex ${i}. Maximum allowed vertex index is ${max_index}`);
|
|
112
|
+
valid = false;
|
|
127
113
|
}
|
|
114
|
+
|
|
128
115
|
}
|
|
129
116
|
|
|
130
|
-
return
|
|
117
|
+
return valid;
|
|
131
118
|
}
|
|
132
119
|
|
|
133
120
|
/**
|
|
134
121
|
*
|
|
135
122
|
* @param {TetrahedralMesh} mesh
|
|
136
|
-
* @param {ArrayLike<number
|
|
123
|
+
* @param {ArrayLike<number>|number[]|Float32Array} points
|
|
137
124
|
* @param {function(problem:string):*} [consumer]
|
|
138
125
|
* @returns {boolean}
|
|
139
126
|
*/
|
|
140
127
|
export function validate_tetrahedral_mesh(mesh, points, consumer = noop) {
|
|
141
128
|
let is_valid = true;
|
|
142
129
|
|
|
130
|
+
const max_point_index = (points.length / 3) - 1;
|
|
131
|
+
|
|
143
132
|
mesh.forEach((tet, mesh) => {
|
|
144
133
|
|
|
145
|
-
|
|
134
|
+
if (!validate_tetrahedron_point_index_range(mesh, tet, max_point_index, consumer)) {
|
|
135
|
+
is_valid = false;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const volume = compute_tetrahedron_volume(mesh, points, tet);
|
|
146
139
|
if (volume < 0) {
|
|
147
140
|
is_valid = false;
|
|
148
141
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"m3_cm_invert.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/mat3/m3_cm_invert.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,kCAHW,YAAY,KACZ,YAAY,WAyCtB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {Float32Array} out
|
|
4
|
+
* @param {Float32Array} a
|
|
5
|
+
*/
|
|
6
|
+
export function m3_cm_invert(out, a) {
|
|
7
|
+
// adapted from gl-matrix
|
|
8
|
+
|
|
9
|
+
const a00 = a[0],
|
|
10
|
+
a01 = a[1],
|
|
11
|
+
a02 = a[2];
|
|
12
|
+
|
|
13
|
+
const a10 = a[3],
|
|
14
|
+
a11 = a[4],
|
|
15
|
+
a12 = a[5];
|
|
16
|
+
|
|
17
|
+
const a20 = a[6],
|
|
18
|
+
a21 = a[7],
|
|
19
|
+
a22 = a[8];
|
|
20
|
+
|
|
21
|
+
const b01 = a22 * a11 - a12 * a21;
|
|
22
|
+
const b11 = -a22 * a10 + a12 * a20;
|
|
23
|
+
const b21 = a21 * a10 - a11 * a20;
|
|
24
|
+
|
|
25
|
+
// Calculate the determinant
|
|
26
|
+
let det = a00 * b01 + a01 * b11 + a02 * b21;
|
|
27
|
+
|
|
28
|
+
if (!det) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
det = 1.0 / det;
|
|
33
|
+
|
|
34
|
+
out[0] = b01 * det;
|
|
35
|
+
out[1] = (-a22 * a01 + a02 * a21) * det;
|
|
36
|
+
out[2] = (a12 * a01 - a02 * a11) * det;
|
|
37
|
+
out[3] = b11 * det;
|
|
38
|
+
out[4] = (a22 * a00 - a02 * a20) * det;
|
|
39
|
+
out[5] = (-a12 * a00 + a02 * a10) * det;
|
|
40
|
+
out[6] = b21 * det;
|
|
41
|
+
out[7] = (-a21 * a00 + a01 * a20) * det;
|
|
42
|
+
out[8] = (a11 * a00 - a01 * a10) * det;
|
|
43
|
+
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column-major ( OpenGL style) matrix multiplication
|
|
3
|
+
* @param {Float32Array|number[]} out
|
|
4
|
+
* @param {number} out_offset
|
|
5
|
+
* @param {number} x
|
|
6
|
+
* @param {number} y
|
|
7
|
+
* @param {Float32Array|number[]} m3
|
|
8
|
+
*/
|
|
9
|
+
export function v2_matrix3_cm_multiply(out: Float32Array | number[], out_offset: number, x: number, y: number, m3: Float32Array | number[]): void;
|
|
10
|
+
//# sourceMappingURL=v2_matrix3_cm_multiply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2_matrix3_cm_multiply.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec2/v2_matrix3_cm_multiply.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,4CANW,YAAY,GAAC,MAAM,EAAE,cACrB,MAAM,KACN,MAAM,KACN,MAAM,MACN,YAAY,GAAC,MAAM,EAAE,QAa/B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column-major ( OpenGL style) matrix multiplication
|
|
3
|
+
* @param {Float32Array|number[]} out
|
|
4
|
+
* @param {number} out_offset
|
|
5
|
+
* @param {number} x
|
|
6
|
+
* @param {number} y
|
|
7
|
+
* @param {Float32Array|number[]} m3
|
|
8
|
+
*/
|
|
9
|
+
export function v2_matrix3_cm_multiply(
|
|
10
|
+
out, out_offset,
|
|
11
|
+
x, y,
|
|
12
|
+
m3
|
|
13
|
+
) {
|
|
14
|
+
|
|
15
|
+
const tx = m3[0] * x + m3[1] * y + m3[2];
|
|
16
|
+
const ty = m3[3] * x + m3[4] * y + m3[5];
|
|
17
|
+
|
|
18
|
+
out[out_offset] = tx;
|
|
19
|
+
out[out_offset + 1] = ty;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Row-major ( OpenGL style) matrix multiplication
|
|
3
|
+
* @param {Float32Array|number[]} out
|
|
4
|
+
* @param {number} out_offset
|
|
5
|
+
* @param {number} x
|
|
6
|
+
* @param {number} y
|
|
7
|
+
* @param {Float32Array|number[]} m3
|
|
8
|
+
*/
|
|
9
|
+
export function v2_matrix3_rm_multiply(out: Float32Array | number[], out_offset: number, x: number, y: number, m3: Float32Array | number[]): void;
|
|
10
|
+
//# sourceMappingURL=v2_matrix3_rm_multiply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2_matrix3_rm_multiply.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec2/v2_matrix3_rm_multiply.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,4CANW,YAAY,GAAC,MAAM,EAAE,cACrB,MAAM,KACN,MAAM,KACN,MAAM,MACN,YAAY,GAAC,MAAM,EAAE,QAa/B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Row-major ( OpenGL style) matrix multiplication
|
|
3
|
+
* @param {Float32Array|number[]} out
|
|
4
|
+
* @param {number} out_offset
|
|
5
|
+
* @param {number} x
|
|
6
|
+
* @param {number} y
|
|
7
|
+
* @param {Float32Array|number[]} m3
|
|
8
|
+
*/
|
|
9
|
+
export function v2_matrix3_rm_multiply(
|
|
10
|
+
out, out_offset,
|
|
11
|
+
x, y,
|
|
12
|
+
m3
|
|
13
|
+
) {
|
|
14
|
+
|
|
15
|
+
const tx = m3[0] * x + m3[3] * y + m3[6];
|
|
16
|
+
const ty = m3[1] * x + m3[4] * y + m3[7];
|
|
17
|
+
|
|
18
|
+
out[out_offset] = tx;
|
|
19
|
+
out[out_offset + 1] = ty;
|
|
20
|
+
}
|
|
21
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TODO: not tested
|
|
3
|
+
* @param {Float32Array|number[]} result
|
|
4
|
+
* @param {number} result_offset
|
|
5
|
+
* @param {number} result_stride
|
|
6
|
+
* @param {number} p0
|
|
7
|
+
* @param {number} p1
|
|
8
|
+
* @param {number} m0
|
|
9
|
+
* @param {number} m1
|
|
10
|
+
*/
|
|
11
|
+
export function spline_hermite3_to_bezier(result: Float32Array | number[], result_offset: number, result_stride: number, p0: number, p1: number, m0: number, m1: number): void;
|
|
12
|
+
//# sourceMappingURL=spline_hermite3_to_bezier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spline_hermite3_to_bezier.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/spline/spline_hermite3_to_bezier.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,kDARW,YAAY,GAAC,MAAM,EAAE,iBACrB,MAAM,iBACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAehB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TODO: not tested
|
|
3
|
+
* @param {Float32Array|number[]} result
|
|
4
|
+
* @param {number} result_offset
|
|
5
|
+
* @param {number} result_stride
|
|
6
|
+
* @param {number} p0
|
|
7
|
+
* @param {number} p1
|
|
8
|
+
* @param {number} m0
|
|
9
|
+
* @param {number} m1
|
|
10
|
+
*/
|
|
11
|
+
export function spline_hermite3_to_bezier(result, result_offset, result_stride, p0, p1, m0, m1) {
|
|
12
|
+
|
|
13
|
+
// see https://stackoverflow.com/questions/42574940/draw-hermite-curve-on-browser-canvas-javascript
|
|
14
|
+
// see https://pomax.github.io/bezierinfo/#catmullconv
|
|
15
|
+
|
|
16
|
+
const tension = 1;
|
|
17
|
+
const tension_factor = 2 * tension;
|
|
18
|
+
|
|
19
|
+
result[result_offset + 0 * result_stride] = p0;
|
|
20
|
+
result[result_offset + 1 * result_stride] = p0 + m0 / tension_factor;
|
|
21
|
+
result[result_offset + 2 * result_stride] = p1 - m1 / tension_factor;
|
|
22
|
+
result[result_offset + 3 * result_stride] = p1;
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/task/Task.js"],"names":[],"mappings":";AAeA;
|
|
1
|
+
{"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/task/Task.js"],"names":[],"mappings":";AAeA;IA+MI;;;;OAIG;IACH,yBAHW,MAAM,CAAC,IAAI,YAAU,CAAC,CAAC,gBAOjC;IAED;;;OAGG;IACH,qBAFW,IAAI,YAAU,gBAIxB;IAED;;;;;OAKG;IACH,kBAJW,IAAI,6CAkBd;IAED;;;;;OAKG;IACH,sBAJW,IAAI,EAAE,6CAgChB;IA1PD;;;;;;;;;OASG;IACH,qGARW,MAAM,EA6DhB;IA9FD;;;OAGG;IACH,aAFU,MAAM,CAEE;IAElB;;;;MAIE;IAEF;;;OAGG;IACH,OAFU,eAAe,CAEsB;IAE/C;;;;OAIG;IACH,0BAHU,MAAM,CAGM;IACtB;;;;OAIG;IACH,6BAHU,MAAM,CAGS;IA4BrB;;;OAGG;IACH,cAFU,IAAI,EAAE,CAEgB;IAEhC;;;OAGG;IACH,mBAFU,MAAM,CAE0B;IAE1C;;;OAGG;IACH,MAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,aAFsB,UAAU,CAEN;IAE1B;;;OAGG;IACH,mBAFmB,IAAI,wCAEM;IAWjC,0BAUC;IAED;;;OAGG;IACH,sBAFa,MAAM,CAIlB;IAED,+BAEC;IAED;;;;OAIG;IACH,oBAHW,IAAI,YAAU,QAuBxB;IAED;;;OAGG;IACH,uBAFW,MAAM,CAAC,IAAI,YAAU,CAAC,CAAC,QAWjC;IAED,mBAEC;IAED;;;;OAIG;IACH,gDAEC;IAED;;OAEG;IACH,6DAkBC;IAED;;;OAGG;IACH,wBAEC;IAgFL;;;OAGG;IACH,iBAFU,OAAO,CAEI;CANpB;mBAxSkB,+BAA+B;4BAGtB,gCAAgC;2BACjC,iBAAiB"}
|
|
@@ -65,8 +65,10 @@ class Task {
|
|
|
65
65
|
estimatedDuration = 1
|
|
66
66
|
}
|
|
67
67
|
) {
|
|
68
|
+
assert.isString(name, 'name');
|
|
68
69
|
|
|
69
70
|
assert.isFunction(cycleFunction, 'cycleFunction');
|
|
71
|
+
assert.isFunction(initializer, 'initializer');
|
|
70
72
|
assert.isNumber(estimatedDuration, 'estimatedDuration');
|
|
71
73
|
|
|
72
74
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionTask.d.ts","sourceRoot":"","sources":["../../../../../../src/core/process/task/util/actionTask.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actionTask.d.ts","sourceRoot":"","sources":["../../../../../../src/core/process/task/util/actionTask.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,oDAHW,MAAM,GACL,IAAI,CAaf;iBApBgB,YAAY"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { assert } from "../../../assert.js";
|
|
1
2
|
import Task from "../Task.js";
|
|
2
3
|
import { TaskSignal } from "../TaskSignal.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Single-shot task. Executes supplied function once and resolved so success
|
|
6
7
|
* @param {function} action
|
|
7
|
-
* @param {string} name
|
|
8
|
+
* @param {string} [name]
|
|
8
9
|
* @return {Task}
|
|
9
10
|
*/
|
|
10
11
|
export function actionTask(action, name = "unnamed") {
|
|
12
|
+
assert.isString(name, 'name');
|
|
13
|
+
|
|
11
14
|
return new Task({
|
|
12
15
|
name,
|
|
13
16
|
cycleFunction() {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Produces a new task that wraps input, will execute input task but if input task fails - this wrapper task will still resolve in success
|
|
3
|
+
* @param {Task} task
|
|
4
|
+
* @returns {Task}
|
|
5
|
+
*/
|
|
6
|
+
export function ignoreFailureTask(task: Task): Task;
|
|
7
|
+
import Task from "../Task.js";
|
|
8
|
+
//# sourceMappingURL=ignoreFailureTask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignoreFailureTask.d.ts","sourceRoot":"","sources":["../../../../../../src/core/process/task/util/ignoreFailureTask.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wCAHW,IAAI,GACF,IAAI,CA4ChB;iBAlDgB,YAAY"}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
+
import { assert } from "../../../assert.js";
|
|
1
2
|
import Task from "../Task.js";
|
|
2
3
|
import { TaskSignal } from "../TaskSignal.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Produces a new task that wraps input, will execute input task but if input task fails - this wrapper task will still resolve in success
|
|
6
7
|
* @param {Task} task
|
|
7
8
|
* @returns {Task}
|
|
8
9
|
*/
|
|
9
|
-
export function
|
|
10
|
+
export function ignoreFailureTask(task) {
|
|
11
|
+
assert.defined(task, 'task');
|
|
12
|
+
assert.isObject(task, 'task');
|
|
13
|
+
assert.equal(task.isTask, true, 'task.isTask !== true');
|
|
14
|
+
|
|
10
15
|
let initializationFailed = false;
|
|
11
16
|
|
|
12
17
|
const wrapper = new Task({
|
|
13
18
|
name: `Ignore Failure of [${task.name}]`,
|
|
14
|
-
initializer() {
|
|
19
|
+
initializer(me, executor) {
|
|
15
20
|
try {
|
|
16
|
-
task.initialize();
|
|
21
|
+
task.initialize(task, executor);
|
|
17
22
|
} catch (e) {
|
|
18
23
|
initializationFailed = true;
|
|
19
24
|
console.warn(e);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
3
|
* @param {TaskGroup|Task} root
|
|
4
|
-
* @return {number}
|
|
4
|
+
* @return {number} number of leaf tasks below supplied root
|
|
5
5
|
*/
|
|
6
6
|
export function task_tree_compute_leaf_tasks(root: TaskGroup | Task): number;
|
|
7
7
|
//# sourceMappingURL=task_tree_compute_leaf_tasks.d.ts.map
|
|
@@ -66,10 +66,20 @@ export class AnimationCurve {
|
|
|
66
66
|
* @returns {number}
|
|
67
67
|
*/
|
|
68
68
|
get length(): number;
|
|
69
|
+
/**
|
|
70
|
+
* Time of the first keyframe, returns 0 if there are no keys
|
|
71
|
+
* @returns {number}
|
|
72
|
+
*/
|
|
73
|
+
get start_time(): number;
|
|
69
74
|
/**
|
|
70
75
|
* Time of the last chronological key in the curve
|
|
71
76
|
* @return {number}
|
|
72
77
|
*/
|
|
78
|
+
get end_time(): number;
|
|
79
|
+
/**
|
|
80
|
+
* Time difference between first and last frame
|
|
81
|
+
* @returns {number}
|
|
82
|
+
*/
|
|
73
83
|
get duration(): number;
|
|
74
84
|
/**
|
|
75
85
|
*
|
|
@@ -79,6 +89,7 @@ export class AnimationCurve {
|
|
|
79
89
|
evaluate(time: number): number;
|
|
80
90
|
/**
|
|
81
91
|
* Set tangents of a key to match surrounding keys
|
|
92
|
+
* Produces a smoother looking curve
|
|
82
93
|
* @param {number} index index of keyframe
|
|
83
94
|
*/
|
|
84
95
|
alignTangents(index: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationCurve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/AnimationCurve.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH;IAkFI;;;;OAIG;IACH,kBAHW,QAAQ,EAAE,GACR,cAAc,CAQ1B;
|
|
1
|
+
{"version":3,"file":"AnimationCurve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/AnimationCurve.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH;IAkFI;;;;OAIG;IACH,kBAHW,QAAQ,EAAE,GACR,cAAc,CAQ1B;IA0ND;;;;;;;OAOG;IACH,6BANW,MAAM,eACN,MAAM,YACN,MAAM,aACN,MAAM,GACL,cAAc,CAUzB;IAED;;;;;;OAMG;IACH,4BALW,MAAM,YACN,MAAM,UACN,MAAM,GACL,cAAc,CAOzB;IAED;;;;;;;OAOG;IACH,0BANW,MAAM,eACN,MAAM,YACN,MAAM,aACN,MAAM,GACL,cAAc,CAYzB;IAxWD;;;OAGG;IACH,eAFU,QAAQ,EAAE,CAEV;IAEV;;;;OAIG;IACH,SAHW,QAAQ,GACN,MAAM,CAgClB;IAED;;;OAGG;IACH,cAFW,QAAQ,EAAE,QAUpB;IAED;;;;OAIG;IACH,YAHW,QAAQ,GACN,OAAO,CAYnB;IAED;;OAEG;IACH,cAEC;IAeD;;;OAGG;IACH,qBAEC;IAED;;;OAGG;IACH,yBAUC;IAED;;;OAGG;IACH,uBAUC;IAED;;;OAGG;IACH,uBAaC;IAED;;;;OAIG;IACH,eAHW,MAAM,GACL,MAAM,CAiCjB;IAED;;;;OAIG;IACH,qBAFW,MAAM,QA+BhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAWhB;IAED,0BAKC;IAED;;;;OAIG;IACH,cAHW,cAAc,GACb,OAAO,CAIlB;IAED;;;OAGG;IACH,YAFW,cAAc,QAIxB;IAED;;;OAGG;IACH,SAFY,cAAc,CAQzB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;MAIC;IAED;;aAeC;CAqDJ;yBA1XwB,eAAe"}
|
|
@@ -126,11 +126,27 @@ export class AnimationCurve {
|
|
|
126
126
|
return this.keys.length;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Time of the first keyframe, returns 0 if there are no keys
|
|
131
|
+
* @returns {number}
|
|
132
|
+
*/
|
|
133
|
+
get start_time() {
|
|
134
|
+
const keys = this.keys;
|
|
135
|
+
|
|
136
|
+
if (keys.length === 0) {
|
|
137
|
+
return 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const first = keys[0];
|
|
141
|
+
|
|
142
|
+
return first.time;
|
|
143
|
+
}
|
|
144
|
+
|
|
129
145
|
/**
|
|
130
146
|
* Time of the last chronological key in the curve
|
|
131
147
|
* @return {number}
|
|
132
148
|
*/
|
|
133
|
-
get
|
|
149
|
+
get end_time() {
|
|
134
150
|
const keys = this.keys;
|
|
135
151
|
const key_count = keys.length;
|
|
136
152
|
|
|
@@ -142,6 +158,25 @@ export class AnimationCurve {
|
|
|
142
158
|
return keys[key_count - 1].time;
|
|
143
159
|
}
|
|
144
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Time difference between first and last frame
|
|
163
|
+
* @returns {number}
|
|
164
|
+
*/
|
|
165
|
+
get duration() {
|
|
166
|
+
|
|
167
|
+
const keys = this.keys;
|
|
168
|
+
const key_count = keys.length;
|
|
169
|
+
|
|
170
|
+
if (key_count < 2) {
|
|
171
|
+
return 0;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const first = keys[0];
|
|
175
|
+
const last = keys[key_count - 1];
|
|
176
|
+
|
|
177
|
+
return last.time - first.time;
|
|
178
|
+
}
|
|
179
|
+
|
|
145
180
|
/**
|
|
146
181
|
*
|
|
147
182
|
* @param {number} time time in seconds
|
|
@@ -182,10 +217,15 @@ export class AnimationCurve {
|
|
|
182
217
|
|
|
183
218
|
/**
|
|
184
219
|
* Set tangents of a key to match surrounding keys
|
|
220
|
+
* Produces a smoother looking curve
|
|
185
221
|
* @param {number} index index of keyframe
|
|
186
222
|
*/
|
|
187
223
|
alignTangents(index) {
|
|
188
224
|
const keys = this.keys;
|
|
225
|
+
const last_index = keys.length - 1;
|
|
226
|
+
|
|
227
|
+
assert.isNonNegativeInteger(index, "index");
|
|
228
|
+
assert.lessThanOrEqual(index, last_index, "index overflow");
|
|
189
229
|
|
|
190
230
|
const key_main = keys[index];
|
|
191
231
|
|
|
@@ -193,14 +233,21 @@ export class AnimationCurve {
|
|
|
193
233
|
if (has_previous) {
|
|
194
234
|
const key_previous = keys[index - 1];
|
|
195
235
|
|
|
196
|
-
|
|
236
|
+
const time_span = key_main.time - key_previous.time;
|
|
237
|
+
const value_span = key_main.value - key_previous.value;
|
|
238
|
+
|
|
239
|
+
key_main.inTangent = value_span / time_span;
|
|
197
240
|
}
|
|
198
241
|
|
|
199
|
-
const has_next = index <
|
|
242
|
+
const has_next = index < last_index;
|
|
243
|
+
|
|
200
244
|
if (has_next) {
|
|
201
245
|
const key_next = keys[index + 1];
|
|
202
246
|
|
|
203
|
-
|
|
247
|
+
const time_span = key_next.time - key_main.time;
|
|
248
|
+
const value_span = key_next.value - key_main.value;
|
|
249
|
+
|
|
250
|
+
key_main.outTangent = value_span / time_span;
|
|
204
251
|
}
|
|
205
252
|
}
|
|
206
253
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_curve_editor.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/animation/curve/draw/build_curve_editor.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build_curve_editor.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/animation/curve/draw/build_curve_editor.js"],"names":[],"mappings":"AAiEA;;;;;;GAMG;AACH,kFAiSC"}
|
|
@@ -14,6 +14,7 @@ import { DraggableAspect } from "../../../ui/DraggableAspect.js";
|
|
|
14
14
|
import { animation_curve_compute_aabb } from "../animation_curve_compute_aabb.js";
|
|
15
15
|
import { sample_animation_curve_to_float_array } from "../compression/sample_animation_curve_to_float_array.js";
|
|
16
16
|
import { Keyframe } from "../Keyframe.js";
|
|
17
|
+
import { build_tangent_editor } from "./build_tangent_editor.js";
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
*
|
|
@@ -133,6 +134,10 @@ export function build_curve_editor({
|
|
|
133
134
|
|
|
134
135
|
const keyframe_views = new Map();
|
|
135
136
|
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* @param {Keyframe} keyframe
|
|
140
|
+
*/
|
|
136
141
|
function add_keyframe(keyframe) {
|
|
137
142
|
const vContainerMarker = new EmptyView({
|
|
138
143
|
css: {
|
|
@@ -202,7 +207,8 @@ export function build_curve_editor({
|
|
|
202
207
|
|
|
203
208
|
const previous = new Vector2();
|
|
204
209
|
const draggable = new DraggableAspect({
|
|
205
|
-
el: marker_el,
|
|
210
|
+
el: marker_el,
|
|
211
|
+
drag(position) {
|
|
206
212
|
const delta = new Vector2();
|
|
207
213
|
delta.subVectors(position, previous);
|
|
208
214
|
|
|
@@ -300,14 +306,14 @@ export function build_curve_editor({
|
|
|
300
306
|
marker.bindSignal(frame_updated, updatePosition);
|
|
301
307
|
marker.bindSignal(active_keyframe.onChanged, updateActiveState);
|
|
302
308
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
309
|
+
const vTangentEditor = build_tangent_editor({
|
|
310
|
+
keyframe: keyframe,
|
|
311
|
+
size: graph.size,
|
|
312
|
+
ctx: graph.context2d,
|
|
313
|
+
frame,
|
|
314
|
+
margin
|
|
315
|
+
});
|
|
316
|
+
vContainerMarker.addChild(vTangentEditor);
|
|
311
317
|
|
|
312
318
|
vContainerMarker.addChild(marker);
|
|
313
319
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export class AnimationCurveView extends EmptyView {
|
|
2
|
+
constructor();
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {AnimationCurve} v
|
|
6
|
+
*/
|
|
7
|
+
set curve(arg: AnimationCurve);
|
|
8
|
+
auto_set_frame(): void;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {Float32Array|number[]} out
|
|
12
|
+
* @param {number} x
|
|
13
|
+
* @param {number} y
|
|
14
|
+
*/
|
|
15
|
+
point_curve_to_canvas(out: Float32Array | number[], x: number, y: number): void;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param {Float32Array|number[]} out
|
|
19
|
+
* @param {number} x
|
|
20
|
+
* @param {number} y
|
|
21
|
+
*/
|
|
22
|
+
point_canvas_to_curve(out: Float32Array | number[], x: number, y: number): void;
|
|
23
|
+
update(): void;
|
|
24
|
+
draw(): void;
|
|
25
|
+
draw_grid(): void;
|
|
26
|
+
draw_key_knots(): void;
|
|
27
|
+
draw_key_knot(key: any): void;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {Keyframe} keyframe
|
|
31
|
+
*/
|
|
32
|
+
draw_key_tangents(keyframe: Keyframe): void;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param {CanvasRenderingContext2D} ctx
|
|
36
|
+
* @param {Keyframe} keyframe
|
|
37
|
+
* @param {number} angle
|
|
38
|
+
* @param {number} handle_length in pixels
|
|
39
|
+
*/
|
|
40
|
+
draw_tangent(ctx: CanvasRenderingContext2D, keyframe: Keyframe, angle: number, handle_length: number): void;
|
|
41
|
+
draw_tangents(): void;
|
|
42
|
+
draw_curve(): void;
|
|
43
|
+
#private;
|
|
44
|
+
}
|
|
45
|
+
import EmptyView from "../../../../view/elements/EmptyView.js";
|
|
46
|
+
import { AnimationCurve } from "../AnimationCurve.js";
|
|
47
|
+
//# sourceMappingURL=AnimationCurveView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimationCurveView.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/animation/curve/view/AnimationCurveView.js"],"names":[],"mappings":"AAeA;IAoCI,cAWC;IAtBD;;;OAGG;IACH,+BAIC;IAgBD,uBA6BC;IAoBD;;;;;OAKG;IACH,2BAJW,YAAY,GAAC,MAAM,EAAE,KACrB,MAAM,KACN,MAAM,QAWhB;IAED;;;;;OAKG;IACH,2BAJW,YAAY,GAAC,MAAM,EAAE,KACrB,MAAM,KACN,MAAM,QAQhB;IAED,eASC;IAED,aAsBC;IAED,kBAwBC;IAED,uBAQC;IAED,8BAiBC;IAGD;;;OAGG;IACH,4BAFW,QAAQ,QAelB;IAED;;;;;;OAMG;IACH,kBALW,wBAAwB,YACxB,QAAQ,SACR,MAAM,iBACN,MAAM,QA+BhB;IAED,sBASC;IAED,mBAqCC;;CAEJ;sBA/UqB,wCAAwC;+BAG/B,sBAAsB"}
|