@woosh/meep-engine 2.124.2 → 2.124.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/package.json +1 -1
- package/src/core/geom/3d/topology/util/tm_edges_cleanup_empty.d.ts +7 -0
- package/src/core/geom/3d/topology/util/tm_edges_cleanup_empty.d.ts.map +1 -0
- package/src/core/geom/3d/topology/util/tm_edges_cleanup_empty.js +33 -0
- package/src/core/geom/3d/topology/util/tm_mesh_cleanup.d.ts +8 -0
- package/src/core/geom/3d/topology/util/tm_mesh_cleanup.d.ts.map +1 -0
- package/src/core/geom/3d/topology/util/tm_mesh_cleanup.js +15 -0
- package/src/core/geom/3d/topology/util/tm_vertices_cleanup_empty.d.ts +7 -0
- package/src/core/geom/3d/topology/util/tm_vertices_cleanup_empty.d.ts.map +1 -0
- package/src/core/geom/3d/topology/util/tm_vertices_cleanup_empty.js +32 -0
- package/src/engine/graphics/render/frame_graph/RenderPassResources.d.ts +10 -0
- package/src/engine/graphics/render/frame_graph/RenderPassResources.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/RenderPassResources.js +23 -2
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"description": "Pure JavaScript game engine. Fully featured and production ready.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "Alexander Goldring",
|
|
8
|
-
"version": "2.124.
|
|
8
|
+
"version": "2.124.4",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removed edges from the mesh that are not connected to any faces
|
|
3
|
+
* @param {TopoMesh} mesh
|
|
4
|
+
* @returns {number} number of edges removed
|
|
5
|
+
*/
|
|
6
|
+
export function tm_edges_cleanup_empty(mesh: TopoMesh): number;
|
|
7
|
+
//# sourceMappingURL=tm_edges_cleanup_empty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tm_edges_cleanup_empty.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/util/tm_edges_cleanup_empty.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,6CAHW,QAAQ,GACN,MAAM,CA2BlB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { tm_edge_kill } from "../tm_edge_kill.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Removed edges from the mesh that are not connected to any faces
|
|
5
|
+
* @param {TopoMesh} mesh
|
|
6
|
+
* @returns {number} number of edges removed
|
|
7
|
+
*/
|
|
8
|
+
export function tm_edges_cleanup_empty(mesh) {
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @type {TopoEdge[]}
|
|
12
|
+
*/
|
|
13
|
+
const garbage = [];
|
|
14
|
+
|
|
15
|
+
// collect garbage
|
|
16
|
+
for (const edge of mesh.getEdges()) {
|
|
17
|
+
|
|
18
|
+
if (edge.faces.length === 0) {
|
|
19
|
+
garbage.push(edge);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// dispose
|
|
25
|
+
|
|
26
|
+
const edge_count = garbage.length;
|
|
27
|
+
for (let i = 0; i < edge_count; i++) {
|
|
28
|
+
const edge = garbage[i];
|
|
29
|
+
tm_edge_kill(mesh, edge);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return edge_count;
|
|
33
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove parts of the mesh that are not connected to any of the faces.
|
|
3
|
+
* This is typically used after filtering or reduction operation to get rid of dangling references.
|
|
4
|
+
* @param {TopoMesh} mesh
|
|
5
|
+
* @return {number} number of structures removed (vertices + edges), if this is 0 - no changes were done
|
|
6
|
+
*/
|
|
7
|
+
export function tm_mesh_cleanup(mesh: TopoMesh): number;
|
|
8
|
+
//# sourceMappingURL=tm_mesh_cleanup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tm_mesh_cleanup.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/util/tm_mesh_cleanup.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,sCAHW,QAAQ,GACP,MAAM,CAOjB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { tm_edges_cleanup_empty } from "./tm_edges_cleanup_empty.js";
|
|
2
|
+
import { tm_vertices_cleanup_empty } from "./tm_vertices_cleanup_empty.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Remove parts of the mesh that are not connected to any of the faces.
|
|
6
|
+
* This is typically used after filtering or reduction operation to get rid of dangling references.
|
|
7
|
+
* @param {TopoMesh} mesh
|
|
8
|
+
* @return {number} number of structures removed (vertices + edges), if this is 0 - no changes were done
|
|
9
|
+
*/
|
|
10
|
+
export function tm_mesh_cleanup(mesh) {
|
|
11
|
+
const removed_edges = tm_edges_cleanup_empty(mesh);
|
|
12
|
+
const removed_vertices = tm_vertices_cleanup_empty(mesh);
|
|
13
|
+
|
|
14
|
+
return removed_edges + removed_vertices;
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes vertices from the mesh not attached to any edges
|
|
3
|
+
* @param {TopoMesh} mesh
|
|
4
|
+
* @returns {number} number of vertices removed
|
|
5
|
+
*/
|
|
6
|
+
export function tm_vertices_cleanup_empty(mesh: TopoMesh): number;
|
|
7
|
+
//# sourceMappingURL=tm_vertices_cleanup_empty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tm_vertices_cleanup_empty.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/util/tm_vertices_cleanup_empty.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,gDAHW,QAAQ,GACN,MAAM,CA4BlB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes vertices from the mesh not attached to any edges
|
|
3
|
+
* @param {TopoMesh} mesh
|
|
4
|
+
* @returns {number} number of vertices removed
|
|
5
|
+
*/
|
|
6
|
+
export function tm_vertices_cleanup_empty(mesh) {
|
|
7
|
+
|
|
8
|
+
// collect garbage
|
|
9
|
+
const vertices = mesh.vertices;
|
|
10
|
+
let vertex_count = vertices.length;
|
|
11
|
+
|
|
12
|
+
// remember for later
|
|
13
|
+
const initial_vertex_count = vertex_count;
|
|
14
|
+
|
|
15
|
+
for (let i = 0; i < vertex_count; i++) {
|
|
16
|
+
const v = vertices[i];
|
|
17
|
+
|
|
18
|
+
if (v.edges.length === 0) {
|
|
19
|
+
// not connected
|
|
20
|
+
vertices.splice(i, 1);
|
|
21
|
+
|
|
22
|
+
// update iterator
|
|
23
|
+
i--;
|
|
24
|
+
vertex_count--;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const removed_vertex_count = initial_vertex_count - vertex_count;
|
|
30
|
+
|
|
31
|
+
return removed_vertex_count;
|
|
32
|
+
}
|
|
@@ -14,6 +14,16 @@ export class RenderPassResources {
|
|
|
14
14
|
* @private
|
|
15
15
|
*/
|
|
16
16
|
private __pass;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @return {string}
|
|
20
|
+
*/
|
|
21
|
+
get pass_name(): string;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @return {number}
|
|
25
|
+
*/
|
|
26
|
+
get pass_id(): number;
|
|
17
27
|
/**
|
|
18
28
|
*
|
|
19
29
|
* @param {RenderGraph} graph
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderPassResources.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassResources.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RenderPassResources.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassResources.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IACI;;;;OAIG;IACH,gBAAe;IACf;;;;OAIG;IACH,eAAc;IAEd;;;OAGG;IACH,iBAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,eAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,YAHW,WAAW,QACX,cAAc,QAQxB;IAED;;;;OAIG;IACH,IAJa,CAAC,MACH,MAAM,GACJ,CAAC,CAcb;IAED;;;;OAIG;IACH,cAJa,CAAC,MACH,MAAM,GACJ,CAAC,CAcb;CACJ"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
1
|
import { assert } from "../../../../core/assert.js";
|
|
4
2
|
|
|
5
3
|
/**
|
|
@@ -19,12 +17,31 @@ export class RenderPassResources {
|
|
|
19
17
|
*/
|
|
20
18
|
__pass = null;
|
|
21
19
|
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @return {string}
|
|
23
|
+
*/
|
|
24
|
+
get pass_name() {
|
|
25
|
+
return this.__pass.name;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @return {number}
|
|
31
|
+
*/
|
|
32
|
+
get pass_id() {
|
|
33
|
+
return this.__pass.id;
|
|
34
|
+
}
|
|
35
|
+
|
|
22
36
|
/**
|
|
23
37
|
*
|
|
24
38
|
* @param {RenderGraph} graph
|
|
25
39
|
* @param {RenderPassNode} node
|
|
26
40
|
*/
|
|
27
41
|
init(graph, node) {
|
|
42
|
+
assert.defined(graph, 'graph');
|
|
43
|
+
assert.defined(node, 'node');
|
|
44
|
+
|
|
28
45
|
this.__graph = graph;
|
|
29
46
|
this.__pass = node;
|
|
30
47
|
}
|
|
@@ -35,6 +52,8 @@ export class RenderPassResources {
|
|
|
35
52
|
* @returns {T}
|
|
36
53
|
*/
|
|
37
54
|
get(id) {
|
|
55
|
+
assert.isNonNegativeInteger(id, 'id');
|
|
56
|
+
|
|
38
57
|
assert.ok(
|
|
39
58
|
this.__pass.reads(id)
|
|
40
59
|
|| this.__pass.writes(id)
|
|
@@ -52,6 +71,8 @@ export class RenderPassResources {
|
|
|
52
71
|
* @returns {T}
|
|
53
72
|
*/
|
|
54
73
|
getDescriptor(id) {
|
|
74
|
+
assert.isNonNegativeInteger(id, 'id');
|
|
75
|
+
|
|
55
76
|
assert.ok(
|
|
56
77
|
this.__pass.reads(id)
|
|
57
78
|
|| this.__pass.writes(id)
|