@woosh/meep-engine 2.128.22 → 2.128.23
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/struct/binary/BinaryTopology.d.ts +6 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.js +10 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_get_neighbour_faces.d.ts +10 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_get_neighbour_faces.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_get_neighbour_faces.js +44 -0
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.128.
|
|
8
|
+
"version": "2.128.23",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -294,6 +294,12 @@ export class BinaryTopology {
|
|
|
294
294
|
* @param {number} id face ID
|
|
295
295
|
*/
|
|
296
296
|
face_write_loop(id: number, value: number): void;
|
|
297
|
+
/**
|
|
298
|
+
* Useful for type checking
|
|
299
|
+
* @readonly
|
|
300
|
+
* @type {boolean}
|
|
301
|
+
*/
|
|
302
|
+
readonly isBinaryTopology: boolean;
|
|
297
303
|
}
|
|
298
304
|
import { BinaryElementPool } from "./BinaryElementPool.js";
|
|
299
305
|
//# sourceMappingURL=BinaryTopology.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BinaryTopology.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/topology/struct/binary/BinaryTopology.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,2BAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH;IACI;;;;;;;;OAQG;IACH,sBAA4F;
|
|
1
|
+
{"version":3,"file":"BinaryTopology.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/topology/struct/binary/BinaryTopology.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,2BAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH;IACI;;;;;;;;OAQG;IACH,sBAA4F;IAE5F;;;;;;;;;OASG;IACH,oBAAsD;IAEtD;;;;;;;;;;;;OAYG;IACH,oBAAsD;IAEtD;;;;;;OAMG;IACH,oBAAsE;IAGtE;;;OAGG;IACH,uBAMC;IAED,aAKC;IAED;;;OAGG;IACH,kCAEC;IAED;;;OAGG;IACH,+BAEC;IAED;;;OAGG;IACH,+BAEC;IAED,+BAEC;IAGD;;OAEG;IACH,cAKC;IAED;;;;;OAKG;IACH,+BAJW,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,iBACvC,MAAM,MACN,MAAM,QAQhB;IAED;;;;;OAKG;IACH,4BAJW,MAAM,SACN,MAAM,EAAE,gBACR,MAAM,QAQhB;IAED;;;;;OAKG;IACH,2BAJW,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,iBACvC,MAAM,MACN,MAAM,QAQhB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,SACN,MAAM,EAAE,gBACR,MAAM,QAQhB;IAED;;;OAGG;IACH,qBAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;OAIG;IACH,sBAFW,MAAM,WADN,MAAM,QAQhB;IAED;;;OAGG;IACH,sBAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;OAIG;IACH,uBAFW,MAAM,SADN,MAAM,QAQhB;IAED;;;OAGG;IACH,sBAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;OAIG;IACH,uBAFW,MAAM,SADN,MAAM,QAQhB;IAGD;;;OAGG;IACH,mBAHW,MAAM,GACJ,MAAM,CA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AIG;IACH,mBAHW,MAAM,GACJ,MAAM,CAOlB;IAED;;;;OAIG;IACH,oBAFW,MAAM,SADN,MAAM,QAQhB;IAGL;;;;OAIG;IACH,2BAFU,OAAO,CAEwB;CAPxC;kCA7mBiC,wBAAwB"}
|
|
@@ -37,6 +37,7 @@ export class BinaryTopology {
|
|
|
37
37
|
* @private
|
|
38
38
|
*/
|
|
39
39
|
__vertex_pool = new BinaryElementPool(3 * FLOAT_32_SIZE + 3 * FLOAT_32_SIZE + UINT_32_SIZE);
|
|
40
|
+
|
|
40
41
|
/**
|
|
41
42
|
* structure:
|
|
42
43
|
* v1: uint32 // Vertices (unordered)
|
|
@@ -48,6 +49,7 @@ export class BinaryTopology {
|
|
|
48
49
|
* @private
|
|
49
50
|
*/
|
|
50
51
|
__edge_pool = new BinaryElementPool(UINT_32_SIZE * 7);
|
|
52
|
+
|
|
51
53
|
/**
|
|
52
54
|
* Loop represents a corner of the face
|
|
53
55
|
* structure:
|
|
@@ -62,6 +64,7 @@ export class BinaryTopology {
|
|
|
62
64
|
* @private
|
|
63
65
|
*/
|
|
64
66
|
__loop_pool = new BinaryElementPool(UINT_32_SIZE * 7);
|
|
67
|
+
|
|
65
68
|
/**
|
|
66
69
|
* structure:
|
|
67
70
|
* l_first: uint32 // first loop pointer
|
|
@@ -619,3 +622,10 @@ export class BinaryTopology {
|
|
|
619
622
|
pool.data_view.setUint32(address, value);
|
|
620
623
|
}
|
|
621
624
|
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Useful for type checking
|
|
628
|
+
* @readonly
|
|
629
|
+
* @type {boolean}
|
|
630
|
+
*/
|
|
631
|
+
BinaryTopology.prototype.isBinaryTopology = true;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number[]} output
|
|
4
|
+
* @param {number} output_offset
|
|
5
|
+
* @param {BinaryTopology} mesh
|
|
6
|
+
* @param {number} face_id
|
|
7
|
+
* @returns {number} number of faces written to output
|
|
8
|
+
*/
|
|
9
|
+
export function bt_mesh_face_get_neighbour_faces(output: number[], output_offset: number, mesh: BinaryTopology, face_id: number): number;
|
|
10
|
+
//# sourceMappingURL=bt_mesh_face_get_neighbour_faces.d.ts.map
|
package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_get_neighbour_faces.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bt_mesh_face_get_neighbour_faces.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_get_neighbour_faces.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,yDANW,MAAM,EAAE,iBACR,MAAM,iCAEN,MAAM,GACJ,MAAM,CAmClB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { assert } from "../../../../../../assert.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {number[]} output
|
|
6
|
+
* @param {number} output_offset
|
|
7
|
+
* @param {BinaryTopology} mesh
|
|
8
|
+
* @param {number} face_id
|
|
9
|
+
* @returns {number} number of faces written to output
|
|
10
|
+
*/
|
|
11
|
+
export function bt_mesh_face_get_neighbour_faces(
|
|
12
|
+
output,
|
|
13
|
+
output_offset,
|
|
14
|
+
mesh,
|
|
15
|
+
face_id
|
|
16
|
+
) {
|
|
17
|
+
assert.isArrayLike(output, "output");
|
|
18
|
+
assert.isNonNegativeInteger(output_offset, "output_offset");
|
|
19
|
+
assert.isNonNegativeInteger(face_id, "face_id");
|
|
20
|
+
assert.defined(mesh, "mesh");
|
|
21
|
+
assert.notNull(mesh, "mesh");
|
|
22
|
+
assert.isObject(mesh, "mesh");
|
|
23
|
+
assert.equal(mesh.isBinaryTopology, true, "mesh.isBinaryTopology !== true");
|
|
24
|
+
|
|
25
|
+
const initial_loop_id = mesh.face_read_loop(face_id);
|
|
26
|
+
|
|
27
|
+
let result_offset = output_offset;
|
|
28
|
+
let loop_id;
|
|
29
|
+
|
|
30
|
+
// TODO can we skip the first loop?
|
|
31
|
+
|
|
32
|
+
do {
|
|
33
|
+
let face = mesh.loop_read_face(initial_loop_id)
|
|
34
|
+
|
|
35
|
+
loop_id = mesh.loop_read_next(initial_loop_id);
|
|
36
|
+
|
|
37
|
+
if (face !== face_id) {
|
|
38
|
+
output[result_offset++] = face;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
} while (loop_id !== initial_loop_id);
|
|
42
|
+
|
|
43
|
+
return result_offset - output_offset;
|
|
44
|
+
}
|