@woosh/meep-engine 2.112.0 → 2.113.1
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/bundle-worker-image-decoder.js +1 -1
- package/build/bundle-worker-terrain.js +1 -1
- package/editor/Editor.js +2 -0
- package/package.json +1 -1
- package/src/core/binary/BinaryBuffer.d.ts +1 -1
- package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
- package/src/core/binary/BinaryBuffer.js +2 -2
- package/src/core/binary/platform_compute_endianness.d.ts +8 -0
- package/src/core/binary/platform_compute_endianness.d.ts.map +1 -0
- package/src/core/binary/platform_compute_endianness.js +29 -0
- package/src/core/collection/table/RowFirstTableSpec.d.ts +5 -5
- package/src/core/collection/table/RowFirstTableSpec.d.ts.map +1 -1
- package/src/core/collection/table/RowFirstTableSpec.js +9 -5
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +8 -3
- package/src/core/geom/3d/topology/simplify/collapseEdge.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/collapseEdge.js +8 -23
- package/src/core/geom/3d/topology/struct/TopoEdge.d.ts +1 -0
- package/src/core/geom/3d/topology/struct/TopoEdge.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/TopoEdge.js +35 -36
- package/src/core/geom/3d/topology/struct/TopoMesh.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/TopoMesh.js +18 -21
- package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/TopoTriangle.js +24 -26
- package/src/core/geom/3d/topology/struct/TopoVertex.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/TopoVertex.js +37 -70
- package/src/engine/graphics/geometry/AttributeGroupSpec.d.ts +3 -3
- package/src/engine/graphics/particles/particular/engine/emitter/PARTICULAR_PARTICLE_SPECIFICATION.d.ts +2 -1
- package/src/engine/graphics/particles/particular/engine/emitter/PARTICULAR_PARTICLE_SPECIFICATION.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/renderers/billboard/BILLBOARD_PARTICLE_SPECIFICATION.d.ts +2 -1
- package/src/engine/graphics/particles/particular/engine/renderers/billboard/BILLBOARD_PARTICLE_SPECIFICATION.d.ts.map +1 -1
- package/src/engine/scene/SerializedScene.d.ts.map +1 -1
- package/src/engine/scene/SerializedScene.js +7 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EndianType } from "./EndianType.js";
|
|
2
|
+
|
|
3
|
+
let platform_endianness = EndianType.LittleEndian;
|
|
4
|
+
let platform_endianness_inferred = false;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Determines underlying native endianness type
|
|
8
|
+
* Useful for knowing byte order in TypedArrays
|
|
9
|
+
* @returns {EndianType}
|
|
10
|
+
*/
|
|
11
|
+
export function platform_compute_endianness() {
|
|
12
|
+
|
|
13
|
+
if (platform_endianness_inferred) {
|
|
14
|
+
return platform_endianness;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const buffer = new ArrayBuffer(2);
|
|
18
|
+
|
|
19
|
+
const uint8 = new Uint8Array(buffer);
|
|
20
|
+
const uint16 = new Uint16Array(buffer);
|
|
21
|
+
|
|
22
|
+
uint8[0] = 0x13;
|
|
23
|
+
|
|
24
|
+
platform_endianness = ((uint16[0] & 0xFF) === 0x13) ? EndianType.LittleEndian : EndianType.BigEndian;
|
|
25
|
+
|
|
26
|
+
platform_endianness_inferred = true;
|
|
27
|
+
|
|
28
|
+
return platform_endianness;
|
|
29
|
+
}
|
|
@@ -49,11 +49,6 @@ export class RowFirstTableSpec {
|
|
|
49
49
|
readonly writeRowMethod: (arg0: DataView, arg1: number, arg2: number[]) => void;
|
|
50
50
|
cellWriters: any[];
|
|
51
51
|
cellReaders: any[];
|
|
52
|
-
/**
|
|
53
|
-
* @readonly
|
|
54
|
-
* @type {boolean}
|
|
55
|
-
*/
|
|
56
|
-
readonly isRowFirstTableSpec: boolean;
|
|
57
52
|
/**
|
|
58
53
|
*
|
|
59
54
|
* @return {number}
|
|
@@ -70,6 +65,11 @@ export class RowFirstTableSpec {
|
|
|
70
65
|
* @returns {boolean}
|
|
71
66
|
*/
|
|
72
67
|
equals(other: RowFirstTableSpec): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* @readonly
|
|
70
|
+
* @type {boolean}
|
|
71
|
+
*/
|
|
72
|
+
readonly isRowFirstTableSpec: boolean;
|
|
73
73
|
}
|
|
74
74
|
import { BinaryDataType } from "../../binary/type/BinaryDataType.js";
|
|
75
75
|
import { EndianType } from "../../binary/EndianType.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowFirstTableSpec.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/table/RowFirstTableSpec.js"],"names":[],"mappings":"AA+HA;;;GAGG;AACH;
|
|
1
|
+
{"version":3,"file":"RowFirstTableSpec.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/table/RowFirstTableSpec.js"],"names":[],"mappings":"AA+HA;;;GAGG;AACH;IAwGI;;;;;OAKG;IACH,kBAJW,cAAc,EAAE,eAChB,UAAU,GACR,iBAAiB,CAmB7B;IA9HD;;;;;OAKG;IACH,mBAJW,cAAc,EAAE,eAChB,UAAU,EAiEpB;IAzDG;;;OAGG;IACH,gBAFU,cAAc,EAAE,CAER;IAElB;;;OAGG;IACH,qBAFU,UAAU,CAEQ;IAE5B;;;OAGG;IACH,wBAFU,WAAW,CAEyB;IAc9C;;;OAGG;IACH,yBAFU,MAAM,CAEgB;IAEhC;;;OAGG;IACH,+BAFmB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAEA;IAEpD;;;OAGG;IACH,gCAFmB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAEC;IAIrD,mBAAsC;IACtC,mBAAsC;IAQ1C;;;OAGG;IACH,kBAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,QAFY,MAAM,CAQjB;IAED;;;;OAIG;IACH,cAHW,iBAAiB,GACf,OAAO,CAQnB;IA4BL;;;OAGG;IACH,8BAFU,OAAO,CAE8B;CAN9C;+BA3P8B,qCAAqC;2BADzC,4BAA4B"}
|
|
@@ -198,11 +198,6 @@ export class RowFirstTableSpec {
|
|
|
198
198
|
this.cellReaders[i] = compileDataViewValueReader(types[i], this.columnOffsets[i], endianType);
|
|
199
199
|
this.cellWriters[i] = compileDataViewValueWriter(types[i], this.columnOffsets[i], endianType);
|
|
200
200
|
}
|
|
201
|
-
/**
|
|
202
|
-
* @readonly
|
|
203
|
-
* @type {boolean}
|
|
204
|
-
*/
|
|
205
|
-
this.isRowFirstTableSpec = true;
|
|
206
201
|
}
|
|
207
202
|
|
|
208
203
|
/**
|
|
@@ -245,6 +240,9 @@ export class RowFirstTableSpec {
|
|
|
245
240
|
* @returns {RowFirstTableSpec}
|
|
246
241
|
*/
|
|
247
242
|
static get(types, endianType = EndianType.BigEndian) {
|
|
243
|
+
assert.isArray(types, 'types');
|
|
244
|
+
assert.enum(endianType, EndianType, 'endianType');
|
|
245
|
+
|
|
248
246
|
//compute hash
|
|
249
247
|
const hash = types.join('.') + ':' + endianType;
|
|
250
248
|
|
|
@@ -261,6 +259,12 @@ export class RowFirstTableSpec {
|
|
|
261
259
|
}
|
|
262
260
|
}
|
|
263
261
|
|
|
262
|
+
/**
|
|
263
|
+
* @readonly
|
|
264
|
+
* @type {boolean}
|
|
265
|
+
*/
|
|
266
|
+
RowFirstTableSpec.prototype.isRowFirstTableSpec = true;
|
|
267
|
+
|
|
264
268
|
|
|
265
269
|
/**
|
|
266
270
|
* @readonly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TetrahedralMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/TetrahedralMesh.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TetrahedralMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/TetrahedralMesh.js"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,qCAFU,MAAM,CAEkD;AAElE;;;GAGG;AACH,gCAFU,MAAM,CAE4B;AAE5C;;;GAGG;AACH,4BAFU,MAAM,CAEwB;AAoBxC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IACI;;;OAGG;IACH,2BAFW,MAAM,EAqDhB;IAhDG;;;;OAIG;IACH,iBAAsE;IAEtE;;;;OAIG;IACH,sBAAmD;IAEnD;;;;OAIG;IACH,eAAyC;IAEzC;;;;OAIG;IACH,mBAA8B;IAE9B;;;;OAIG;IACH,mBAAmB;IAEnB;;;;OAIG;IACH,eAAgB;IAEhB;;;;OAIG;IACH,uBAAuB;IAG3B;;;;;OAKG;IACH,2BAEC;IAED;;;;OAIG;IACH,2CAUC;IAED;;;;OAIG;IACH,WAFY,MAAM,EAAE,CAYnB;IAED;;;OAGG;IACH,cAWC;IAED;;;OAGG;IACH,sBAFW,MAAM,QA8BhB;IAED;;;OAGG;IACH,eAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,QAFY,MAAM,CAMjB;IAED;;;;OAIG;IACH,oBAEC;IAGD;;;;OAIG;IACH,qBAYC;IAED;;;OAGG;IACH,yBAFW,MAAM,QAWhB;IAED;;;;OAIG;IACH,YAHW,MAAM,GACL,OAAO,CAiBlB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,mBACN,MAAM,GACJ,MAAM,CAYlB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,mBACN,MAAM,aACN,MAAM,QAchB;IAGD;;;;;OAKG;IACH,0BAJW,MAAM,eACN,MAAM,GACJ,MAAM,CAYlB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,eACN,MAAM,UACN,MAAM,QAiBhB;IAED;;;;;OAKG;IACH,uBAJW,MAAM,UACN,MAAM,GACL,OAAO,CAUlB;IAGD;;;;OAIG;IACH,YAFY,MAAM,CA4BjB;IAED;;;;;;;;OAQG;IACH,eAPW,MAAM,EAAE,GAAC,YAAY,KACrB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CAqBlB;IAED;;;;OAIG;IACH,wBAFW,MAAM,QAmBhB;IAED;;;;OAIG;IACH,oBAFW,MAAM,QAmBhB;IAED;;;;;OAKG;IACH,2CAHW,MAAM,aACN,MAAM,QAwBhB;IAED;;;;;;;;OAQG;IACH,8BAPW,MAAM,KACN,MAAM,KACN,MAAM,UACN,MAAM,EAAE,sBACR,MAAM,GACJ,MAAM,CA8DlB;IAGD;;;;;OAKG;IACH,uBAHW,MAAM,qBACN,MAAM,QA0ChB;IAED;;;;OAIG;IACH,WAFa,MAAM,CA2ClB;IAED;;;OAGG;IACH,kBAFW,YAAY,QAUtB;IAED;;;OAGG;IACH,oBAFW,YAAY,QAiBtB;IAED;;;OAGG;IACH,oBAFY,MAAM,CAYjB;IAED;;;OAGG;IACH,wBAFW,MAAM,QAUhB;IAGL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAN1C;6BA/wB4B,iCAAiC"}
|
|
@@ -2,6 +2,7 @@ import { orient3d } from "robust-predicates";
|
|
|
2
2
|
import { assert } from "../../../assert.js";
|
|
3
3
|
import { Base64 } from "../../../binary/Base64.js";
|
|
4
4
|
import { BinaryBuffer } from "../../../binary/BinaryBuffer.js";
|
|
5
|
+
import { EndianType } from "../../../binary/EndianType.js";
|
|
5
6
|
import { array_copy } from "../../../collection/array/array_copy.js";
|
|
6
7
|
import { array_quick_sort_by_comparator } from "../../../collection/array/array_quick_sort_by_comparator.js";
|
|
7
8
|
import { typed_array_copy } from "../../../collection/array/typed/typed_array_copy.js";
|
|
@@ -761,6 +762,8 @@ export class TetrahedralMesh {
|
|
|
761
762
|
serialize_base64() {
|
|
762
763
|
const buffer = new BinaryBuffer();
|
|
763
764
|
|
|
765
|
+
buffer.endianness = EndianType.LittleEndian;
|
|
766
|
+
|
|
764
767
|
this.serialize(buffer);
|
|
765
768
|
|
|
766
769
|
buffer.trim();
|
|
@@ -773,11 +776,13 @@ export class TetrahedralMesh {
|
|
|
773
776
|
* @param {string} str
|
|
774
777
|
*/
|
|
775
778
|
deserialize_base64(str) {
|
|
776
|
-
const
|
|
779
|
+
const array_buffer = Base64.decode(str);
|
|
780
|
+
|
|
781
|
+
const buffer = BinaryBuffer.fromArrayBuffer(array_buffer);
|
|
777
782
|
|
|
778
|
-
|
|
783
|
+
buffer.endianness = EndianType.LittleEndian;
|
|
779
784
|
|
|
780
|
-
this.deserialize(
|
|
785
|
+
this.deserialize(buffer);
|
|
781
786
|
}
|
|
782
787
|
}
|
|
783
788
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapseEdge.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/simplify/collapseEdge.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collapseEdge.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/simplify/collapseEdge.js"],"names":[],"mappings":"AAwFA;;;;;;;;GAQG;AACH,uHAmDC;AAED;;;;;;;;GAQG;AACH,gHAOC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
//
|
|
2
2
|
|
|
3
3
|
import { assert } from "../../../../assert.js";
|
|
4
|
+
import { tm_face_kill } from "../tm_face_kill.js";
|
|
5
|
+
import { tm_kill_only_edge } from "../tm_kill_only_edge.js";
|
|
6
|
+
import { tm_vert_splice } from "../tm_vert_splice.js";
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
*
|
|
@@ -19,23 +22,13 @@ function cleanupDanglingEdges(face, mesh) {
|
|
|
19
22
|
if (edge.faces.length === 0) {
|
|
20
23
|
// dangling edge, remove
|
|
21
24
|
edge.unlink();
|
|
22
|
-
mesh
|
|
25
|
+
tm_kill_only_edge(mesh, edge);
|
|
23
26
|
|
|
24
27
|
//TODO consider to clean up dangling vertices as well
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @param {TopoTriangle} face
|
|
32
|
-
* @param {TopoMesh} mesh
|
|
33
|
-
*/
|
|
34
|
-
function removeFace(face, mesh) {
|
|
35
|
-
face.unlink();
|
|
36
|
-
mesh.removeFace(face);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
32
|
/**
|
|
40
33
|
*
|
|
41
34
|
* @param {TopoMesh} mesh
|
|
@@ -74,7 +67,7 @@ function collapseFaceToEdge(mesh, victim_face, vertex_victim, vertex_successor)
|
|
|
74
67
|
}
|
|
75
68
|
|
|
76
69
|
victim_edge.unlink();
|
|
77
|
-
mesh
|
|
70
|
+
tm_kill_only_edge(mesh, victim_edge);
|
|
78
71
|
// debugValidateMesh(mesh);
|
|
79
72
|
|
|
80
73
|
// migrate faces
|
|
@@ -113,7 +106,7 @@ export function partialEdgeCollapse(mesh, edge, victim, replacement) {
|
|
|
113
106
|
// unlink the edge
|
|
114
107
|
edge.unlink();
|
|
115
108
|
// remove the edge
|
|
116
|
-
mesh
|
|
109
|
+
tm_kill_only_edge(mesh, edge);
|
|
117
110
|
|
|
118
111
|
// debugValidateMesh(mesh);
|
|
119
112
|
|
|
@@ -123,7 +116,7 @@ export function partialEdgeCollapse(mesh, edge, victim, replacement) {
|
|
|
123
116
|
// get the other two edges
|
|
124
117
|
const remaining_edges = edge_face.edges;
|
|
125
118
|
// remove the face
|
|
126
|
-
|
|
119
|
+
tm_face_kill(mesh, edge_face);
|
|
127
120
|
|
|
128
121
|
// topology_find_broken_links(mesh);
|
|
129
122
|
|
|
@@ -170,13 +163,5 @@ export function collapseEdge(mesh, edge, victim, replacement) {
|
|
|
170
163
|
partialEdgeCollapse(mesh, edge, victim, replacement);
|
|
171
164
|
|
|
172
165
|
// replace the victim vertex with the replacer
|
|
173
|
-
replacement
|
|
174
|
-
//remove replaced vertex
|
|
175
|
-
|
|
176
|
-
/*
|
|
177
|
-
NOTE we're not removing vertex because doing so is costly and resulting mesh can be parsed later to remove dangling vertices
|
|
178
|
-
*/
|
|
179
|
-
// mesh.removeVertex(victim);
|
|
180
|
-
|
|
181
|
-
// validateMesh(mesh);
|
|
166
|
+
tm_vert_splice(mesh,replacement,victim);
|
|
182
167
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopoEdge.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoEdge.js"],"names":[],"mappings":"AAUA;
|
|
1
|
+
{"version":3,"file":"TopoEdge.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoEdge.js"],"names":[],"mappings":"AAUA;IACI;;;OAGG;IACH,OAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,eAAU;IACV;;;OAGG;IACH,eAAU;IAGV;;;OAGG;IACH,OAFU,cAAc,CAEb;IAEX;;;OAGG;IACH,WAFU,MAAM,CAED;IAEf,uBAEC;IAED;;;;OAIG;IACH,oBAHW,MAAM,cAWhB;IAED;;;OAGG;IACH,YAFW,QAAQ,QASlB;IAED,kBAMC;IAED;;;;OAIG;IACH,+BAFY,OAAO,CAiClB;IAED;;;OAGG;IACH,YAFY,OAAO,CAIlB;IAED;;OAEG;IACH,eAkBC;IAED;;;OAGG;IACH,oBAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,oBAFY,OAAO,CAKlB;IAED;;;OAGG;IACH,qBAMC;IAED,6BAiBC;IAED;;;;OAIG;IACH,mEASC;IAED;;;;OAIG;IACH,aAFW,QAAQ,QA0ClB;IAED;;;;OAIG;IACH,kCAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,kCAKC;IAED;;;OAGG;IACH,wCAIC;IAED;;;OAGG;IACH,kCAIC;IAED;;;;OAIG;IACH,0CAEC;IAED;;;;OAIG;IACH,+BAFY,OAAO,CAIlB;IAED;;;;;OAKG;IACH,oDAFY,OAAO,CAIlB;IAED;;;;OAIG;IACH,8BAHW,QAAQ,GACN,OAAO,CAInB;IAGL;;;OAGG;IACH,qBAFU,OAAO,CAEY;CAN5B"}
|
|
@@ -1,48 +1,46 @@
|
|
|
1
1
|
import { assert } from "../../../../assert.js";
|
|
2
|
-
import { array_remove_first } from "../../../../collection/array/array_remove_first.js";
|
|
3
2
|
import { array_push_if_unique } from "../../../../collection/array/array_push_if_unique.js";
|
|
4
|
-
import {
|
|
3
|
+
import { array_remove_first } from "../../../../collection/array/array_remove_first.js";
|
|
4
|
+
import { query_edge_is_boundary } from "../query/query_edge_is_boundary.js";
|
|
5
5
|
import { query_edge_other_vertex } from "../query/query_edge_other_vertex.js";
|
|
6
|
+
import { query_vertex_in_edge } from "../query/query_vertex_in_edge.js";
|
|
6
7
|
import { query_vertices_in_edge } from "../query/query_vertices_in_edge.js";
|
|
7
|
-
import { query_edge_is_boundary } from "../query/query_edge_is_boundary.js";
|
|
8
8
|
|
|
9
9
|
let index_counter = 0;
|
|
10
10
|
|
|
11
11
|
export class TopoEdge {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
this.lengthSqr = -1;
|
|
42
|
-
}
|
|
12
|
+
/**
|
|
13
|
+
* Unique ID
|
|
14
|
+
* @type {number}
|
|
15
|
+
*/
|
|
16
|
+
index = index_counter++;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {TopoVertex}
|
|
21
|
+
*/
|
|
22
|
+
v0 = null;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @type {TopoVertex}
|
|
26
|
+
*/
|
|
27
|
+
v1 = null;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {TopoTriangle[]}
|
|
33
|
+
*/
|
|
34
|
+
faces = [];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {number}
|
|
39
|
+
*/
|
|
40
|
+
lengthSqr = -1;
|
|
43
41
|
|
|
44
42
|
get byteSize() {
|
|
45
|
-
return 80+5*4 + 4 + 8 + 8 + 8 + this.faces.length * 8 + 10;
|
|
43
|
+
return 80 + 5 * 4 + 4 + 8 + 8 + 8 + this.faces.length * 8 + 10;
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
/**
|
|
@@ -333,9 +331,10 @@ export class TopoEdge {
|
|
|
333
331
|
/**
|
|
334
332
|
*
|
|
335
333
|
* @param {TopoEdge} other
|
|
334
|
+
* @returns {boolean}
|
|
336
335
|
*/
|
|
337
336
|
containsSameVerticesAs(other) {
|
|
338
|
-
return this
|
|
337
|
+
return query_vertices_in_edge(this, other.v0, other.v1);
|
|
339
338
|
}
|
|
340
339
|
}
|
|
341
340
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopoMesh.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoMesh.js"],"names":[],"mappings":"AAcA;
|
|
1
|
+
{"version":3,"file":"TopoMesh.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoMesh.js"],"names":[],"mappings":"AAcA;IAEI;;;OAGG;IACH,UAFU,UAAU,EAAE,CAER;IAEd;;;;OAIG;IACH,gBAAoB;IAGpB;;;;OAIG;IACH,gBAAoB;IAEpB;;;;OAIG;IACH,uBAkBC;IAED;;;OAGG;IACH,YAFa,IAAI,QAAQ,CAAC,CAIzB;IAED;;;OAGG;IACH,YAFa,IAAI,YAAY,CAAC,CAI7B;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACL,SAAS,GAAC,YAAY,CAYjC;IAED;;;;OAIG;IACH,wCAFa,OAAO,CA0GnB;IAED,kBAMC;IAED;;;OAGG;IACH,sBAFa,IAAI,MAAM,EAAE,UAAU,CAAC,CAoBnC;IAED;;;;OAIG;IACH,yBAHW,QAAQ,cACR,IAAI,MAAM,EAAE,UAAU,CAAC,QAYjC;IAED;;;;OAIG;IACH,kBAHW,YAAY,cACZ,IAAI,MAAM,EAAC,UAAU,CAAC,QAqChC;IAED;;;;OAIG;IACH,qBAFW,YAAY,QAsBtB;IAED;;;OAGG;IACH,WAFW,QAAQ,QAclB;IAED;;;OAGG;IACH,aAFW,UAAU,QAKpB;IAED;;;OAGG;IACH,mBAFW,UAAU,QAMpB;IAED;;;OAGG;IACH,gBAFW,UAAU,QAIpB;IAED;;;;OAIG;IACH,kBAHW,UAAU,GACR,OAAO,CAKnB;IAGD;;;OAGG;IACH,WAFW,QAAQ,QAKlB;IAED;;;OAGG;IACH,iBAFW,QAAQ,QAMlB;IAED;;;OAGG;IACH,cAFW,QAAQ,QAIlB;IAED;;;;OAIG;IACH,gBAHW,QAAQ,GACN,OAAO,CAKnB;IAED;;;OAGG;IACH,WAFW,YAAY,QAUtB;IAED;;;OAGG;IACH,uBAFW,SAAS,YAAY,CAAC,QAMhC;IAED;;;OAGG;IACH,cAFW,YAAY,QAwBtB;IAED;;;OAGG;IACH,cAFW,YAAY,QAItB;IAED;;;;OAIG;IACH,gBAHW,YAAY,GACV,OAAO,CAKnB;IAED;;;;;;OAMG;IACH,cALW,UAAU,KACV,UAAU,GAER,QAAQ,CAoCpB;IAED,mBAsCC;IAED,kCAQC;IAED;;;;OAIG;IACH,gBAHW,YAAY,SACZ,WAAW,GAAC,WAAW,GAAC,UAAU,GAAC,MAAM,EAAE,QAmErD;IAED,mBAEC;IAIL;;;OAGG;IACH,qBAFU,OAAO,CAEY;CAP5B;2BAnoB0B,iBAAiB;yBAFnB,eAAe;6BACX,mBAAmB;qBAR3B,8BAA8B"}
|
|
@@ -13,29 +13,27 @@ import { TopoTriangle } from "./TopoTriangle.js";
|
|
|
13
13
|
import { TopoVertex } from "./TopoVertex.js";
|
|
14
14
|
|
|
15
15
|
export class TopoMesh {
|
|
16
|
-
constructor() {
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @type {TopoVertex[]}
|
|
20
|
+
*/
|
|
21
|
+
vertices = [];
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @type {Set<TopoEdge>}
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
__edges = new Set();
|
|
30
29
|
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @type {Set<TopoTriangle>}
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
__faces = new Set();
|
|
39
37
|
|
|
40
38
|
/**
|
|
41
39
|
* Approximation of memory footprint of this object
|
|
@@ -562,7 +560,7 @@ export class TopoMesh {
|
|
|
562
560
|
}
|
|
563
561
|
|
|
564
562
|
//cut the second edge
|
|
565
|
-
this
|
|
563
|
+
tm_kill_only_edge(this, e1);
|
|
566
564
|
|
|
567
565
|
//absorb edge
|
|
568
566
|
e0.merge(e1);
|
|
@@ -644,7 +642,6 @@ export class TopoMesh {
|
|
|
644
642
|
f.vertices.push(vA, vB, vC);
|
|
645
643
|
f.edges.push(eAB, eBC, eCA);
|
|
646
644
|
|
|
647
|
-
|
|
648
645
|
vA.faces.push(f);
|
|
649
646
|
vB.faces.push(f);
|
|
650
647
|
vC.faces.push(f);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopoTriangle.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoTriangle.js"],"names":[],"mappings":";AASA;
|
|
1
|
+
{"version":3,"file":"TopoTriangle.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoTriangle.js"],"names":[],"mappings":";AASA;IACI;;;OAGG;IACH,OAFU,MAAM,CAEQ;IACxB;;;OAGG;IACH,UAFU,YAAY,CAER;IACd;;;OAGG;IACH,OAFU,UAAU,CAET;IAEX;;;OAGG;IACH,QAFU,MAAM,EAAE,GAAC,IAAI,CAEJ;IAEnB,uBAEC;IAED;;;OAGG;IACH,YAFW,YAAY,QAQtB;IAED,sBAMC;IAED;;;;OAIG;IACH,+BAFY,OAAO,CA0ClB;IAED;;;OAGG;IACH,YAFY,OAAO,CAKlB;IAED;;;;OAIG;IACH,6DAEC;IAED;;;;OAIG;IACH,mEAIC;IAED;;OAEG;IACH,gCASC;IAED;;OAEG;IACH,eAmBC;IAED;;;OAGG;IACH,2BAIC;IAED;;;;OAIG;IACH,4BAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,8BAMC;IAED;;;;OAIG;IACH,8BAFa,OAAO,CAKnB;IAED,sBAaC;IAGD;;;;OAIG;IACH,mBAHW,MAAM,4BAQhB;IAED;;;;OAIG;IACH,oCAFY,OAAO,CAIlB;IAED;;;;;OAKG;IACH,0BAJW,YAAY,EAAE,iBACd,MAAM,GACJ,MAAM,CA8BlB;IAGL;;;OAGG;IACH,qBAFU,OAAO,CAEgB;CANhC;qBA3RoB,WAAW"}
|
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { array_push_if_unique } from "../../../../collection/array/array_push_if_unique.js";
|
|
1
|
+
import { vec3 } from "gl-matrix";
|
|
3
2
|
import { assert } from "../../../../assert.js";
|
|
3
|
+
import { array_push_if_unique } from "../../../../collection/array/array_push_if_unique.js";
|
|
4
4
|
import { array_remove_first } from "../../../../collection/array/array_remove_first.js";
|
|
5
|
-
import {
|
|
5
|
+
import { array_replace_all } from "../../../../collection/array/array_replace_all.js";
|
|
6
6
|
import { compute_triangle_normal } from "../../compute_triangle_normal.js";
|
|
7
7
|
|
|
8
8
|
let index_counter = 0;
|
|
9
9
|
|
|
10
10
|
export class TopoTriangle {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
this.normal = [0, 0, 0];
|
|
33
|
-
}
|
|
11
|
+
/**
|
|
12
|
+
* Identifying index, can be used to link back to buffer-geometry face by index or any other useful ID purposes
|
|
13
|
+
* @type {number}
|
|
14
|
+
*/
|
|
15
|
+
index = index_counter++;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @type {TopoVertex[]}
|
|
19
|
+
*/
|
|
20
|
+
vertices = [];
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @type {TopoEdge[]}
|
|
24
|
+
*/
|
|
25
|
+
edges = [];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @type {number[]|vec3}
|
|
30
|
+
*/
|
|
31
|
+
normal = [0, 0, 0];
|
|
34
32
|
|
|
35
33
|
get byteSize() {
|
|
36
34
|
return 80 + 4 * 4 + 4 + this.vertices.length * 8 + 10 + this.edges.length * 8 + 10 + 8 * 3 + 10;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopoVertex.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoVertex.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TopoVertex.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoVertex.js"],"names":[],"mappings":"AAMA;IAEI;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,OAFU,UAAU,CAET;IAEX;;;OAGG;IACH,OAFU,cAAc,CAEb;IAEX;;;OAGG;IACH,GAFU,MAAM,CAEV;IACN;;;OAGG;IACH,GAFU,MAAM,CAEV;IACN;;;OAGG;IACH,GAFU,MAAM,CAEV;IAEN,gBAEC;IAED,gBAEC;IAED,gBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;OAGG;IACH,YAFW,UAAU,QAYpB;IAED;;OAEG;IACH,SAFa,UAAU,CAQtB;IAED;;;;OAIG;IACH,+BAFY,OAAO,CA8BlB;IAED;;;;OAIG;IACH,kBAHW,UAAU,GACT,MAAM,CAWjB;IAED;;;OAGG;IACH,+BAKC;IAED;;;;OAIG;IACH,gCAFY,OAAO,CAMlB;IAED;;;;OAIG;IACH,kCAFY,OAAO,CAKlB;IAED;;;OAGG;IACH,kCAKC;IAED;;;OAGG;IACH,2BAMC;IAED;;;;OAIG;IACH,4BAFY,OAAO,CAOlB;IAED;;;;OAIG;IACH,2DAaC;IAED;;;;OAIG;IACH,8BAFa,OAAO,CAMnB;IAED;;;;OAIG;IACH,yBAFa,OAAO,CAWnB;IAED;;;;OAIG;IACH,6BAFW,UAAU,QAIpB;IAED;;;;;OAKG;IACH,iCAJW,UAAU,EAAE,iBACZ,MAAM,GACJ,MAAM,CAoBlB;IAGL;;;OAGG;IACH,uBAFU,OAAO,CAEgB;CANhC"}
|
|
@@ -2,43 +2,43 @@ import { assert } from "../../../../assert.js";
|
|
|
2
2
|
import { array_push_if_unique } from "../../../../collection/array/array_push_if_unique.js";
|
|
3
3
|
import { array_remove_first } from "../../../../collection/array/array_remove_first.js";
|
|
4
4
|
import { v3_distance } from "../../../vec3/v3_distance.js";
|
|
5
|
+
import { query_vertex_in_edge } from "../query/query_vertex_in_edge.js";
|
|
5
6
|
|
|
6
7
|
export class TopoVertex {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Identification number, expected to be unique within a given topology
|
|
11
|
+
* @type {number}
|
|
12
|
+
*/
|
|
13
|
+
index = 0;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @type {TopoEdge[]}
|
|
18
|
+
*/
|
|
19
|
+
edges = [];
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @type {TopoTriangle[]}
|
|
24
|
+
*/
|
|
25
|
+
faces = [];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @type {number}
|
|
30
|
+
*/
|
|
31
|
+
x = 0;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @type {number}
|
|
35
|
+
*/
|
|
36
|
+
y = 0;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {number}
|
|
40
|
+
*/
|
|
41
|
+
z = 0;
|
|
42
42
|
|
|
43
43
|
get 0() {
|
|
44
44
|
return this.x;
|
|
@@ -113,7 +113,7 @@ export class TopoVertex {
|
|
|
113
113
|
for (let i = 0; i < edge_count; i++) {
|
|
114
114
|
const edge = edges[i];
|
|
115
115
|
|
|
116
|
-
if (!edge
|
|
116
|
+
if (!query_vertex_in_edge(edge, this)) {
|
|
117
117
|
error_consumer(`Missing back-link from edge[${i}]`);
|
|
118
118
|
valid = false;
|
|
119
119
|
}
|
|
@@ -258,40 +258,7 @@ export class TopoVertex {
|
|
|
258
258
|
* @param {TopoVertex} victim
|
|
259
259
|
*/
|
|
260
260
|
replaceAnotherVertex(victim) {
|
|
261
|
-
|
|
262
|
-
assert.notNull(victim, 'victim');
|
|
263
|
-
assert.equal(victim.isTopoVertex, true, "victim.isTopoVertex !== true");
|
|
264
|
-
assert.notEqual(this, victim, "cannot replace self");
|
|
265
|
-
|
|
266
|
-
const faces = victim.faces;
|
|
267
|
-
const face_count = faces.length;
|
|
268
|
-
|
|
269
|
-
let i = 0;
|
|
270
|
-
|
|
271
|
-
for (; i < face_count; i++) {
|
|
272
|
-
// take over the victim's faces
|
|
273
|
-
const face = faces[i];
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
// face.computeNormal(); // DEBUG
|
|
277
|
-
face.replaceVertex(victim, this);
|
|
278
|
-
|
|
279
|
-
this.addUniqueFace(face);
|
|
280
|
-
|
|
281
|
-
// face.computeNormal(); // DEBUG
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
const edges = victim.edges;
|
|
285
|
-
const edge_count = edges.length;
|
|
286
|
-
|
|
287
|
-
for (i = 0; i < edge_count; i++) {
|
|
288
|
-
// take over the victim's edges
|
|
289
|
-
const edge = edges[i];
|
|
290
|
-
|
|
291
|
-
edge.replaceVertex(victim, this);
|
|
292
|
-
|
|
293
|
-
this.addUniqueEdge(edge);
|
|
294
|
-
}
|
|
261
|
+
throw new Error(`deprecated, use "tm_vert_splice" instead`)
|
|
295
262
|
}
|
|
296
263
|
|
|
297
264
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {AttributeSpec} from "./AttributeSpec";
|
|
2
2
|
|
|
3
|
-
export class
|
|
3
|
+
export class AttributeGroupSpec {
|
|
4
4
|
readonly attributes: AttributeSpec[]
|
|
5
5
|
|
|
6
|
-
static from(...attributes: AttributeSpec[]):
|
|
6
|
+
static from(...attributes: AttributeSpec[]): AttributeGroupSpec
|
|
7
7
|
|
|
8
8
|
getAttributeByName(name: string): AttributeSpec | undefined
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ export class VertexDataSpec {
|
|
|
11
11
|
|
|
12
12
|
setAttributes(attributes: AttributeSpec[]): void
|
|
13
13
|
|
|
14
|
-
equals(other:
|
|
14
|
+
equals(other: AttributeGroupSpec): boolean
|
|
15
15
|
|
|
16
16
|
hash(): number
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PARTICULAR_PARTICLE_SPECIFICATION.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/particles/particular/engine/emitter/PARTICULAR_PARTICLE_SPECIFICATION.js"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"PARTICULAR_PARTICLE_SPECIFICATION.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/particles/particular/engine/emitter/PARTICULAR_PARTICLE_SPECIFICATION.js"],"names":[],"mappings":"AAKA,mEAA0E;mCAJvC,4CAA4C"}
|