@woosh/meep-engine 2.111.1 → 2.111.3

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.
Files changed (31) hide show
  1. package/package.json +1 -1
  2. package/src/core/geom/3d/Ray3.js +2 -2
  3. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts +12 -7
  4. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts.map +1 -1
  5. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +32 -13
  6. package/src/core/geom/3d/tetrahedra/cube_split_to_6_tetr.png +0 -0
  7. package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.d.ts +2 -1
  8. package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.d.ts.map +1 -1
  9. package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.js +89 -35
  10. package/src/core/geom/3d/tetrahedra/prototypeTetrahedraBuilder.js +1 -1
  11. package/src/core/geom/vec3/v3_array_immediate_add.d.ts +10 -0
  12. package/src/core/geom/vec3/v3_array_immediate_add.d.ts.map +1 -0
  13. package/src/core/geom/vec3/v3_array_immediate_add.js +19 -0
  14. package/src/core/geom/vec3/{v3_normalize_array.d.ts → v3_array_normalize.d.ts} +2 -2
  15. package/src/core/geom/vec3/v3_array_normalize.d.ts.map +1 -0
  16. package/src/core/geom/vec3/{v3_normalize_array.js → v3_array_normalize.js} +1 -1
  17. package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.js +2 -2
  18. package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals.d.ts +9 -0
  19. package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals.d.ts.map +1 -0
  20. package/src/engine/graphics/geometry/buffered/{ComputeNormals.js → geometry_compute_vertex_normals.js} +26 -16
  21. package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts +10 -0
  22. package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts.map +1 -1
  23. package/src/engine/graphics/sh3/lpv/LightProbeVolume.js +17 -2
  24. package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +1 -1
  25. package/src/engine/graphics/sh3/lpv/build_probes_for_scene.d.ts.map +1 -1
  26. package/src/engine/graphics/sh3/lpv/build_probes_for_scene.js +15 -5
  27. package/src/engine/graphics/sh3/prototypeSH3Probe.js +2 -2
  28. package/src/engine/physics/inverse_kinematics/fabrik/fabrik3d_solve_primitive.js +2 -2
  29. package/src/core/geom/vec3/v3_normalize_array.d.ts.map +0 -1
  30. package/src/engine/graphics/geometry/buffered/ComputeNormals.d.ts +0 -9
  31. package/src/engine/graphics/geometry/buffered/ComputeNormals.d.ts.map +0 -1
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.111.1",
8
+ "version": "2.111.3",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -2,9 +2,9 @@ import { assert } from "../../assert.js";
2
2
  import { array_copy } from "../../collection/array/array_copy.js";
3
3
  import { array_range_equal_strict } from "../../collection/array/array_range_equal_strict.js";
4
4
  import { computeHashFloatArray } from "../../math/hash/computeHashFloatArray.js";
5
+ import { v3_array_normalize } from "../vec3/v3_array_normalize.js";
5
6
  import { v3_matrix4_multiply } from "../vec3/v3_matrix4_multiply.js";
6
7
  import { v3_matrix4_rotate } from "../vec3/v3_matrix4_rotate.js";
7
- import { v3_normalize_array } from "../vec3/v3_normalize_array.js";
8
8
  import { ray3_interval_array_apply_matrix4 } from "./ray/ray3_interval_array_apply_matrix4.js";
9
9
 
10
10
  /**
@@ -111,7 +111,7 @@ export class Ray3 extends Float32Array {
111
111
  }
112
112
 
113
113
  normalizeDirection() {
114
- v3_normalize_array(this, 3, this, 3);
114
+ v3_array_normalize(this, 3, this, 3);
115
115
  }
116
116
 
117
117
  /**
@@ -87,12 +87,9 @@ export class TetrahedralMesh {
87
87
  */
88
88
  private __free_pointer;
89
89
  /**
90
- * Only valid when the mesh is compacted
91
- * @return {number}
92
- */
93
- get count(): number;
94
- /**
95
- *
90
+ * Exposes internal state, when this is false there are hole in the allocated memory
91
+ * Useful mainly for serialization and debugging.
92
+ * When serializing, you would want to get rid of any holes first by calling {@link compact}
96
93
  * @return {boolean}
97
94
  */
98
95
  get isCompacted(): boolean;
@@ -110,6 +107,7 @@ export class TetrahedralMesh {
110
107
  getLive(): number[];
111
108
  /**
112
109
  * Clears all data from the mesh, making it contain 0 tetrahedrons
110
+ * Ensures that consequent allocation requests will be sequential
113
111
  */
114
112
  clear(): void;
115
113
  /**
@@ -124,9 +122,16 @@ export class TetrahedralMesh {
124
122
  getCapacity(): number;
125
123
  /**
126
124
  * How many tetrahedrons are contained in the mesh, includes any unallocated tetrahedrons
125
+ * @deprecated use {@link count} instead
127
126
  * @return {number}
128
127
  */
129
128
  size(): number;
129
+ /**
130
+ * Number of currently live tetrahedrons.
131
+ * Excludes unallocated tetrahedrons.
132
+ * @return {number}
133
+ */
134
+ get count(): number;
130
135
  /**
131
136
  * Grow capacity to at least the specified size
132
137
  * @private
@@ -202,7 +207,7 @@ export class TetrahedralMesh {
202
207
  */
203
208
  disconnect(tetra_index: number): void;
204
209
  /**
205
- * Remove tetrahedron
210
+ * Remove tetrahedron, de-allocating memory
206
211
  * Please note that if there are any dangling references in the mesh neighbourhood - you will need to take care of that separately
207
212
  * @param {number} tetra_index
208
213
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TetrahedralMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/TetrahedralMesh.js"],"names":[],"mappings":"AAgBA;;;;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;;;OAGG;IACH,oBAIC;IAED;;;OAGG;IACH,2BAEC;IAED;;;;OAIG;IACH,2CAUC;IAED;;;;OAIG;IACH,WAFY,MAAM,EAAE,CAYnB;IAED;;OAEG;IACH,cAWC;IAED;;;OAGG;IACH,sBAFW,MAAM,QA8BhB;IAED;;;OAGG;IACH,eAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;;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,QA6BhB;IAED;;;;OAIG;IACH,WAFa,MAAM,CA2ClB;IAED;;;OAGG;IACH,kBAFW,YAAY,QAUtB;IAED;;;OAGG;IACH,oBAFW,YAAY,QAiBtB;IAED;;;OAGG;IACH,oBAFY,MAAM,CAUjB;IAED;;;OAGG;IACH,wBAFW,MAAM,QAQhB;IAGL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAN1C;6BAvvB4B,iCAAiC"}
1
+ {"version":3,"file":"TetrahedralMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/TetrahedralMesh.js"],"names":[],"mappings":"AAgBA;;;;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,CAUjB;IAED;;;OAGG;IACH,wBAFW,MAAM,QAQhB;IAGL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAN1C;6BA1wB4B,iCAAiC"}
@@ -134,17 +134,9 @@ export class TetrahedralMesh {
134
134
  }
135
135
 
136
136
  /**
137
- * Only valid when the mesh is compacted
138
- * @return {number}
139
- */
140
- get count() {
141
- assert.equal(this.isCompacted, true, 'must be compacted');
142
-
143
- return this.__used_end;
144
- }
145
-
146
- /**
147
- *
137
+ * Exposes internal state, when this is false there are hole in the allocated memory
138
+ * Useful mainly for serialization and debugging.
139
+ * When serializing, you would want to get rid of any holes first by calling {@link compact}
148
140
  * @return {boolean}
149
141
  */
150
142
  get isCompacted() {
@@ -187,6 +179,7 @@ export class TetrahedralMesh {
187
179
 
188
180
  /**
189
181
  * Clears all data from the mesh, making it contain 0 tetrahedrons
182
+ * Ensures that consequent allocation requests will be sequential
190
183
  */
191
184
  clear() {
192
185
 
@@ -245,12 +238,25 @@ export class TetrahedralMesh {
245
238
 
246
239
  /**
247
240
  * How many tetrahedrons are contained in the mesh, includes any unallocated tetrahedrons
241
+ * @deprecated use {@link count} instead
248
242
  * @return {number}
249
243
  */
250
244
  size() {
245
+ console.warn('Deprecated, use .count instead');
246
+
251
247
  return this.__used_end;
252
248
  }
253
249
 
250
+ /**
251
+ * Number of currently live tetrahedrons.
252
+ * Excludes unallocated tetrahedrons.
253
+ * @return {number}
254
+ */
255
+ get count() {
256
+ return this.__used_end - this.__free_pointer;
257
+ }
258
+
259
+
254
260
  /**
255
261
  * Grow capacity to at least the specified size
256
262
  * @private
@@ -492,7 +498,7 @@ export class TetrahedralMesh {
492
498
  }
493
499
 
494
500
  /**
495
- * Remove tetrahedron
501
+ * Remove tetrahedron, de-allocating memory
496
502
  * Please note that if there are any dangling references in the mesh neighbourhood - you will need to take care of that separately
497
503
  * @param {number} tetra_index
498
504
  */
@@ -624,6 +630,14 @@ export class TetrahedralMesh {
624
630
  * @param {number} destination_index new index, where the source tetrahedron is to be moved
625
631
  */
626
632
  relocate(source_index, destination_index) {
633
+ assert.isNonNegativeInteger(source_index, 'source_index');
634
+ assert.isNonNegativeInteger(destination_index, 'destination_index');
635
+
636
+ if (source_index === destination_index) {
637
+ // avoid unnecessary work
638
+ return;
639
+ }
640
+
627
641
  // validate_tetrahedron_neighbourhood(this, source_index, console.error);
628
642
 
629
643
  // patch neighbours
@@ -647,7 +661,12 @@ export class TetrahedralMesh {
647
661
 
648
662
 
649
663
  const layout_word_size = LAYOUT_TETRA_BYTE_SIZE >> 2;
650
- array_copy(this.__data_uint32, source_index * layout_word_size, this.__data_uint32, destination_index * layout_word_size, layout_word_size);
664
+
665
+ array_copy(
666
+ this.__data_uint32, source_index * layout_word_size,
667
+ this.__data_uint32, destination_index * layout_word_size,
668
+ layout_word_size
669
+ );
651
670
 
652
671
  // validate_tetrahedron_neighbourhood(this, destination_index, console.error);
653
672
  }
@@ -8,6 +8,7 @@
8
8
  * @param {number} resolution_x how many points to generate on the grid in X axis
9
9
  * @param {number} resolution_y how many points to generate on the grid in Y axis
10
10
  * @param {number} resolution_z how many points to generate on the grid in Y axis
11
+ * @returns {number} number of added points
11
12
  */
12
- export function tetrahedral_mesh_build_from_grid(mesh: TetrahedralMesh, points: number[], bounds: AABB3, resolution_x?: number, resolution_y?: number, resolution_z?: number): void;
13
+ export function tetrahedral_mesh_build_from_grid(mesh: TetrahedralMesh, points: number[], bounds: AABB3, resolution_x?: number, resolution_y?: number, resolution_z?: number): number;
13
14
  //# sourceMappingURL=tetrahedral_mesh_build_from_grid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tetrahedral_mesh_build_from_grid.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,gFANW,MAAM,EAAE,gCAER,MAAM,iBACN,MAAM,iBACN,MAAM,QA4IhB"}
1
+ {"version":3,"file":"tetrahedral_mesh_build_from_grid.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,gFAPW,MAAM,EAAE,gCAER,MAAM,iBACN,MAAM,iBACN,MAAM,GACJ,MAAM,CA+LlB"}
@@ -1,3 +1,5 @@
1
+ import { assert } from "../../../../assert.js";
2
+
1
3
  /**
2
4
  * Special case of tetrahedral mesh generation using a regular 3d grid, useful for generating light probe volumes
3
5
  * This is a special case of tetrahedral tessellation, we can handle it much easier due to regular nature of the point distribution
@@ -8,6 +10,7 @@
8
10
  * @param {number} resolution_x how many points to generate on the grid in X axis
9
11
  * @param {number} resolution_y how many points to generate on the grid in Y axis
10
12
  * @param {number} resolution_z how many points to generate on the grid in Y axis
13
+ * @returns {number} number of added points
11
14
  */
12
15
  export function tetrahedral_mesh_build_from_grid(
13
16
  mesh, points,
@@ -15,7 +18,9 @@ export function tetrahedral_mesh_build_from_grid(
15
18
  resolution_x = 2, resolution_y = 2, resolution_z = 2,
16
19
  ) {
17
20
 
18
- console.error("Implementation is incomplete"); // FIXME
21
+ assert.isNonNegativeInteger(resolution_x, 'resolution_x');
22
+ assert.isNonNegativeInteger(resolution_y, 'resolution_y');
23
+ assert.isNonNegativeInteger(resolution_z, 'resolution_z');
19
24
 
20
25
  mesh.clear();
21
26
 
@@ -40,6 +45,11 @@ export function tetrahedral_mesh_build_from_grid(
40
45
  return z * resolution_y * resolution_x + y * resolution_x + x;
41
46
  }
42
47
 
48
+ function voxel_position_to_tetrahedral(x, y, z, index) {
49
+
50
+ return (z * (resolution_y - 1) * (resolution_x - 1) + y * (resolution_x - 1) + x) * 6 + index;
51
+ }
52
+
43
53
  // generate points
44
54
  for (let z = 0; z < resolution_z; z++) {
45
55
  for (let y = 0; y < resolution_y; y++) {
@@ -83,63 +93,104 @@ export function tetrahedral_mesh_build_from_grid(
83
93
 
84
94
  // NOTE: it's possible to tessellate each box into 5 tetrahedrons instead of 6, but orientation becomes inconsistent if we do that
85
95
  // reference http://www.iue.tuwien.ac.at/phd/wessner/node32.html
86
-
87
96
  for (let z = 1; z < resolution_z; z++) {
88
97
  for (let y = 1; y < resolution_y; y++) {
89
98
  for (let x = 1; x < resolution_x; x++) {
99
+
90
100
  const A = vertex_position_to_index(x - 1, y - 1, z - 1);
91
101
  const B = vertex_position_to_index(x - 1, y - 1, z);
92
- const C = vertex_position_to_index(x - 1, y, z - 1);
93
- const D = vertex_position_to_index(x - 1, y, z);
94
- const E = vertex_position_to_index(x, y - 1, z - 1);
95
- const F = vertex_position_to_index(x, y - 1, z);
96
- const G = vertex_position_to_index(x, y, z - 1);
97
- const H = vertex_position_to_index(x, y, z);
98
-
99
- // const p000 = vertex_position_to_index(x - 1, y - 1, z - 1);
100
- // const p001 = vertex_position_to_index(x - 1, y - 1, z);
101
- // const p010 = vertex_position_to_index(x - 1, y, z - 1);
102
- // const p011 = vertex_position_to_index(x - 1, y, z);
103
- // const p100 = vertex_position_to_index(x, y - 1, z - 1);
104
- // const p101 = vertex_position_to_index(x, y - 1, z);
105
- // const p110 = vertex_position_to_index(x, y, z - 1);
106
- // const p111 = vertex_position_to_index(x, y, z);
107
-
102
+ const C = vertex_position_to_index(x, y - 1, z);
103
+ const D = vertex_position_to_index(x, y - 1, z - 1);
104
+ const E = vertex_position_to_index(x - 1, y, z - 1);
105
+ const F = vertex_position_to_index(x - 1, y, z);
106
+ const G = vertex_position_to_index(x, y, z);
107
+ const H = vertex_position_to_index(x, y, z - 1);
108
108
 
109
109
  // Tessellate the grid volume into six tetrahedra per grid cell.
110
110
 
111
111
  // prism 1
112
- const tet_0 = make_cell(E, F, G, A);
113
- const tet_1 = make_cell(A, B, F, G);
114
- const tet_2 = make_cell(A, C, B, G);
112
+ const tet_0 = make_cell(B, A, D, H); // purple
113
+ const tet_1 = make_cell(B, A, H, E); // blue
114
+ const tet_2 = make_cell(H, B, E, F); // red
115
115
 
116
116
  // prism 2
117
- const tet_3 = make_cell(E, G, H, A);
118
- const tet_4 = make_cell(A, H, D, G);
119
- const tet_5 = make_cell(A, D, C, G);
117
+ const tet_3 = make_cell(C, B, D, H); // orange
118
+ const tet_4 = make_cell(C, B, H, G); // yellow
119
+ const tet_5 = make_cell(B, H, G, F); // green
120
120
 
121
121
  // link newly created tetrahedrons
122
- mesh.setNeighbour(tet_0, 1, (tet_3 << 2) & 2);
123
- mesh.setNeighbour(tet_3, 2, (tet_0 << 2) & 1);
124
122
 
125
- mesh.setNeighbour(tet_0, 1, (tet_1 << 2) & 2);
126
- mesh.setNeighbour(tet_1, 2, (tet_0 << 2) & 1);
123
+ // purple
124
+ mesh.setNeighbour(tet_0, 1, (tet_3 << 2) | 0); // A - orange C
125
+ mesh.setNeighbour(tet_0, 2, (tet_1 << 2) | 3); // D - blue E
127
126
 
128
- // TODO implement
127
+ // blue
128
+ mesh.setNeighbour(tet_1, 1, (tet_2 << 2) | 3); // A - red F
129
+ mesh.setNeighbour(tet_1, 3, (tet_0 << 2) | 2); // E - purple D
129
130
 
131
+ // red
132
+ mesh.setNeighbour(tet_2, 2, (tet_5 << 2) | 2); // E - green G
133
+ mesh.setNeighbour(tet_2, 3, (tet_1 << 2) | 1); // F - blue A
134
+
135
+ // orange
136
+ mesh.setNeighbour(tet_3, 0, (tet_0 << 2) | 1); // C - purple A
137
+ mesh.setNeighbour(tet_3, 2, (tet_4 << 2) | 3); // D - yellow G
138
+
139
+ // yellow
140
+ mesh.setNeighbour(tet_4, 0, (tet_5 << 2) | 3); // C - green F
141
+ mesh.setNeighbour(tet_4, 3, (tet_3 << 2) | 2); // G - orange D
142
+
143
+ // green
144
+ mesh.setNeighbour(tet_5, 2, (tet_2 << 2) | 2); // G - red E
145
+ mesh.setNeighbour(tet_5, 3, (tet_4 << 2) | 0); // F - yellow C
146
+
147
+ // links to previous voxel
148
+
149
+ // prev x
130
150
  if (x > 1) {
131
- // link to previous voxel
132
- // TODO implement
151
+ const tet_3_prev_x = voxel_position_to_tetrahedral(x - 2, y - 1, z - 1, 3);// prev x orange
152
+ const tet_4_prev_x = voxel_position_to_tetrahedral(x - 2, y - 1, z - 1, 4); // prev x yellow
153
+
154
+ // blue
155
+ mesh.setNeighbour(tet_1, 2, (tet_3_prev_x << 2) | 1); // H - prev x orange B
156
+ // orange prev x
157
+ mesh.setNeighbour(tet_3_prev_x, 1, (tet_1 << 2) | 2); // B - blue H
158
+
159
+ // red
160
+ mesh.setNeighbour(tet_2, 0, (tet_4_prev_x << 2) | 1); // H - prev x yellow B
161
+ // yellow prev x
162
+ mesh.setNeighbour(tet_4_prev_x, 1, (tet_2 << 2) | 0); // B - red H
133
163
  }
134
164
 
165
+ // prev y
135
166
  if (y > 1) {
136
- // link to previous voxel
137
- // TODO implement
167
+ const tet_2_prev_y = voxel_position_to_tetrahedral(x - 1, y - 2, z - 1, 2); // prev y red
168
+ const tet_5_prev_y = voxel_position_to_tetrahedral(x - 1, y - 2, z - 1, 5); // prev y green
169
+
170
+ // purple
171
+ mesh.setNeighbour(tet_0, 3, (tet_2_prev_y << 2) | 1); // H - prev y red B
172
+ // prev y red
173
+ mesh.setNeighbour(tet_2_prev_y, 1, (tet_0 << 2) | 3); // B - blue H
174
+
175
+ // orange
176
+ mesh.setNeighbour(tet_3, 3, (tet_5_prev_y << 2) | 0); // H - prev y green B
177
+ // prev y green
178
+ mesh.setNeighbour(tet_5_prev_y, 0, (tet_3 << 2) | 3); // B - orange H
138
179
  }
139
180
 
140
181
  if (z > 1) {
141
- // link to previous voxel
142
- // TODO implement
182
+ const tet_4_prev_z = voxel_position_to_tetrahedral(x - 1, y - 1, z - 2, 4); // prev z yellow
183
+ const tet_5_prev_z = voxel_position_to_tetrahedral(x - 1, y - 1, z - 2, 5); // prev z green
184
+
185
+ // purple
186
+ mesh.setNeighbour(tet_0, 0, (tet_4_prev_z << 2) | 2); // B - prev z yellow H
187
+ // prev z yellow
188
+ mesh.setNeighbour(tet_4_prev_z, 2, (tet_0 << 2) | 0); // H - purple B
189
+
190
+ // blue
191
+ mesh.setNeighbour(tet_1, 0, (tet_5_prev_z << 2) | 1); // B - prev z green H
192
+ // prev z green
193
+ mesh.setNeighbour(tet_5_prev_z, 1, (tet_1 << 2) | 0); // H - blue B
143
194
  }
144
195
 
145
196
  }
@@ -147,4 +198,7 @@ export function tetrahedral_mesh_build_from_grid(
147
198
  }
148
199
 
149
200
  }
201
+
202
+ // number of points added
203
+ return resolution_x * resolution_y * resolution_z;
150
204
  }
@@ -76,7 +76,7 @@ async function main(engine) {
76
76
  tetrahedra,
77
77
  points,
78
78
  new AABB3(-10, 0, -10, 10, 10, 10),
79
- 8, 4, 8
79
+ 4, 4, 4
80
80
  )
81
81
  console.timeEnd('mesh build');
82
82
  console.log(`Mesh build for ${number_pretty_print(points.length / 3)} points`)
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Adds input to output
3
+ * `out += input`
4
+ * @param {number[]} out
5
+ * @param {number} out_offset
6
+ * @param {number[]} input
7
+ * @param {number} input_offset
8
+ */
9
+ export function v3_array_immediate_add(out: number[], out_offset: number, input: number[], input_offset: number): void;
10
+ //# sourceMappingURL=v3_array_immediate_add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3_array_immediate_add.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_array_immediate_add.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,4CALW,MAAM,EAAE,cACR,MAAM,SACN,MAAM,EAAE,gBACR,MAAM,QAYhB"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Adds input to output
3
+ * `out += input`
4
+ * @param {number[]|Float32Array} out
5
+ * @param {number} out_offset
6
+ * @param {number[]} input
7
+ * @param {number} input_offset
8
+ */
9
+ export function v3_array_immediate_add(out, out_offset, input, input_offset) {
10
+
11
+ const x = input[input_offset];
12
+ const y = input[input_offset + 1];
13
+ const z = input[input_offset + 2];
14
+
15
+ out[out_offset] += x;
16
+ out[out_offset + 1] += y;
17
+ out[out_offset + 2] += z;
18
+
19
+ }
@@ -5,5 +5,5 @@
5
5
  * @param {number[]|Float32Array} input
6
6
  * @param {number} input_offset
7
7
  */
8
- export function v3_normalize_array(output: number[] | Float32Array, output_offset: number, input: number[] | Float32Array, input_offset: number): void;
9
- //# sourceMappingURL=v3_normalize_array.d.ts.map
8
+ export function v3_array_normalize(output: number[] | Float32Array, output_offset: number, input: number[] | Float32Array, input_offset: number): void;
9
+ //# sourceMappingURL=v3_array_normalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3_array_normalize.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_array_normalize.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,2CALW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,SACN,MAAM,EAAE,GAAC,YAAY,gBACrB,MAAM,QAqBhB"}
@@ -7,7 +7,7 @@ import { v3_length } from "./v3_length.js";
7
7
  * @param {number[]|Float32Array} input
8
8
  * @param {number} input_offset
9
9
  */
10
- export function v3_normalize_array(
10
+ export function v3_array_normalize(
11
11
  output, output_offset,
12
12
  input, input_offset,
13
13
  ) {
@@ -1,4 +1,4 @@
1
- import { computeVertexNormals } from '../../graphics/geometry/buffered/ComputeNormals.js';
1
+ import { geometry_compute_vertex_normals } from '../../graphics/geometry/buffered/geometry_compute_vertex_normals.js';
2
2
 
3
3
  /**
4
4
  *
@@ -103,7 +103,7 @@ function buildBufferGeometry(samplerHeight, position, size, scale, totalSize, re
103
103
  }
104
104
  }
105
105
 
106
- computeVertexNormals(vertices, normals, indices);
106
+ geometry_compute_vertex_normals(vertices, normals, indices);
107
107
 
108
108
  //CleanupGeometry(geometry);
109
109
  return {
@@ -0,0 +1,9 @@
1
+ /**
2
+ * based on code from THREE.js
3
+ * Prior to calling this function, normals need to be set to 0
4
+ * @param {Array.<number>|Float32Array} positions
5
+ * @param {Array.<number>|Float32Array} normals
6
+ * @param {Array.<number>|Uint32Array} indices
7
+ */
8
+ export function geometry_compute_vertex_normals(positions: Array<number> | Float32Array, normals: Array<number> | Float32Array, indices: Array<number> | Uint32Array): void;
9
+ //# sourceMappingURL=geometry_compute_vertex_normals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry_compute_vertex_normals.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals.js"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,2DAJW,MAAO,MAAM,CAAC,GAAC,YAAY,WAC3B,MAAO,MAAM,CAAC,GAAC,YAAY,WAC3B,MAAO,MAAM,CAAC,GAAC,WAAW,QAsEpC"}
@@ -1,4 +1,4 @@
1
- import { v3_normalize_array } from "../../../../core/geom/vec3/v3_normalize_array.js";
1
+ import { v3_array_normalize } from "../../../../core/geom/vec3/v3_array_normalize.js";
2
2
 
3
3
  /**
4
4
  *
@@ -8,19 +8,23 @@ function normalizeVectors(normals) {
8
8
  const count = normals.length;
9
9
  for (let i = 0; i < count; i += 3) {
10
10
 
11
- v3_normalize_array(normals, i, normals, i);
11
+ v3_array_normalize(normals, i, normals, i);
12
12
 
13
13
  }
14
14
  }
15
15
 
16
16
  /**
17
17
  * based on code from THREE.js
18
- * normals need to be set to 0
19
- * @param {Array.<number>|Float32Array} vertices
18
+ * Prior to calling this function, normals need to be set to 0
19
+ * @param {Array.<number>|Float32Array} positions
20
20
  * @param {Array.<number>|Float32Array} normals
21
21
  * @param {Array.<number>|Uint32Array} indices
22
22
  */
23
- export function computeVertexNormals(vertices, normals, indices) {
23
+ export function geometry_compute_vertex_normals(
24
+ positions,
25
+ normals,
26
+ indices
27
+ ) {
24
28
  let vA, vB, vC;
25
29
 
26
30
  let vAx, vAy, vAz, vBx, vBy, vBz, vCx, vCy, vCz;
@@ -29,26 +33,28 @@ export function computeVertexNormals(vertices, normals, indices) {
29
33
 
30
34
  let crossX, crossY, crossZ;
31
35
  // indexed elements
36
+
32
37
  let i = 0;
33
- const il = indices.length;
34
- for (; i < il; i += 3) {
38
+
39
+ const index_length = indices.length;
40
+ for (; i < index_length; i += 3) {
35
41
 
36
42
  vA = indices[i] * 3;
37
43
  vB = indices[i + 1] * 3;
38
44
  vC = indices[i + 2] * 3;
39
45
 
40
46
  //obtain vertex coordinates
41
- vAx = vertices[vA];
42
- vAy = vertices[vA + 1];
43
- vAz = vertices[vA + 2];
47
+ vAx = positions[vA];
48
+ vAy = positions[vA + 1];
49
+ vAz = positions[vA + 2];
44
50
 
45
- vBx = vertices[vB];
46
- vBy = vertices[vB + 1];
47
- vBz = vertices[vB + 2];
51
+ vBx = positions[vB];
52
+ vBy = positions[vB + 1];
53
+ vBz = positions[vB + 2];
48
54
 
49
- vCx = vertices[vC];
50
- vCy = vertices[vC + 1];
51
- vCz = vertices[vC + 2];
55
+ vCx = positions[vC];
56
+ vCy = positions[vC + 1];
57
+ vCz = positions[vC + 2];
52
58
 
53
59
  //compute CB and AB vectors
54
60
  vCBx = vCx - vBx;
@@ -64,6 +70,8 @@ export function computeVertexNormals(vertices, normals, indices) {
64
70
  crossY = vCBz * vABx - vCBx * vABz;
65
71
  crossZ = vCBx * vABy - vCBy * vABx;
66
72
 
73
+ // accumulate normal values
74
+
67
75
  normals[vA] += crossX;
68
76
  normals[vA + 1] += crossY;
69
77
  normals[vA + 2] += crossZ;
@@ -77,5 +85,7 @@ export function computeVertexNormals(vertices, normals, indices) {
77
85
  normals[vC + 2] += crossZ;
78
86
  }
79
87
 
88
+ // restore unit magnitude
89
+
80
90
  normalizeVectors(normals);
81
91
  }
@@ -28,6 +28,16 @@ export class LightProbeVolume {
28
28
  * @param {number} z
29
29
  */
30
30
  add_point(x: number, y: number, z: number): void;
31
+ /**
32
+ *
33
+ * @param {AABB3} bounds
34
+ * @param {Vector3|{x:number, y:number, z:number}} resolution
35
+ */
36
+ build_grid(bounds: AABB3, resolution: Vector3 | {
37
+ x: number;
38
+ y: number;
39
+ z: number;
40
+ }): void;
31
41
  /**
32
42
  * Build tetrahedral mesh
33
43
  */
@@ -1 +1 @@
1
- {"version":3,"file":"LightProbeVolume.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/lpv/LightProbeVolume.js"],"names":[],"mappings":"AAUA;;;GAGG;AACH;IAiCI,sBAEC;IAED,cAkBC;IAED;;;OAGG;IACH,4BAEC;IAED,uBAEC;IAED,0BAEC;IAMD;;;OAGG;IACH,sCAIC;IAZD,mCAEC;IAYD,sBAEC;IAMD,uBAEC;IAND,oBAEC;IAMD;;;;;OAKG;IACH,aAJW,MAAM,KACN,MAAM,KACN,MAAM,QAgBhB;IAED;;OAEG;IACH,mBAaC;IAGD;;;;;OAKG;IACH,mCAJW,MAAM,GAEJ,UAAU,CAsBtB;IAGD,yBAEC;;CAEJ;gCAvL+B,wDAAwD;2BAC7D,mCAAmC"}
1
+ {"version":3,"file":"LightProbeVolume.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/lpv/LightProbeVolume.js"],"names":[],"mappings":"AAaA;;;GAGG;AACH;IAiCI,sBAEC;IAED,cAkBC;IAED;;;OAGG;IACH,4BAEC;IAED,uBAEC;IAED,0BAEC;IAMD;;;OAGG;IACH,sCAIC;IAZD,mCAEC;IAYD,sBAEC;IAMD,uBAEC;IAND,oBAEC;IAMD;;;;;OAKG;IACH,aAJW,MAAM,KACN,MAAM,KACN,MAAM,QAgBhB;IAED;;;;OAIG;IACH,sCAFW,UAAQ;QAAC,CAAC,EAAC,MAAM,CAAC;QAAC,CAAC,EAAC,MAAM,CAAC;QAAC,CAAC,EAAC,MAAM,CAAA;KAAC,QAOhD;IAED;;OAEG;IACH,mBAaC;IAGD;;;;;OAKG;IACH,mCAJW,MAAM,GAEJ,UAAU,CAsBtB;IAGD,yBAEC;;CAEJ;gCAnM+B,wDAAwD;2BAC7D,mCAAmC"}
@@ -2,6 +2,9 @@ import { assert } from "../../../../core/assert.js";
2
2
  import {
3
3
  compute_delaunay_tetrahedral_mesh
4
4
  } from "../../../../core/geom/3d/tetrahedra/delaunay/compute_delaunay_tetrahedral_mesh.js";
5
+ import {
6
+ tetrahedral_mesh_build_from_grid
7
+ } from "../../../../core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.js";
5
8
  import { TetrahedralMesh } from "../../../../core/geom/3d/tetrahedra/TetrahedralMesh.js";
6
9
  import { EntityNode } from "../../../ecs/parent/EntityNode.js";
7
10
  import { Transform } from "../../../ecs/transform/Transform.js";
@@ -35,7 +38,7 @@ export class LightProbeVolume {
35
38
  * Depth map is stored as a 2d texture of size RESOLUTION x RESOLUTION
36
39
  * @type {number}
37
40
  */
38
- #probe_depth_resolution = 16;
41
+ #probe_depth_resolution = 12;
39
42
 
40
43
  /**
41
44
  * Octahedral-encoded depth map for each probe, 2 channels for mean and mean squared for variance recovery in the shader
@@ -133,6 +136,18 @@ export class LightProbeVolume {
133
136
  this.#probe_count++;
134
137
  }
135
138
 
139
+ /**
140
+ *
141
+ * @param {AABB3} bounds
142
+ * @param {Vector3|{x:number, y:number, z:number}} resolution
143
+ */
144
+ build_grid(bounds, resolution) {
145
+ this.#probe_count = tetrahedral_mesh_build_from_grid(
146
+ this.#mesh, this.#probe_positions,
147
+ bounds, resolution.x, resolution.y, resolution.z
148
+ );
149
+ }
150
+
136
151
  /**
137
152
  * Build tetrahedral mesh
138
153
  */
@@ -148,7 +163,7 @@ export class LightProbeVolume {
148
163
 
149
164
  const t2 = performance.now();
150
165
 
151
- console.log(`Tetrahedral mesh (${this.#probe_count} points, ${this.#mesh.size()} tets) build took ${t2 - t0}ms`);
166
+ console.log(`Tetrahedral mesh (${this.#probe_count} points, ${this.#mesh.count} tets) build took ${t2 - t0}ms`);
152
167
  }
153
168
 
154
169
 
@@ -24,7 +24,7 @@ const sampled_irradiance = new Float32Array(3);
24
24
  export class PathTracerProbeRenderer extends ProbeRenderer {
25
25
  tracer = new PathTracer();
26
26
  max_bounce_count = 5;
27
- sample_count = 190;
27
+ sample_count = 256;
28
28
  // sample_count = 40960;
29
29
  random = seededRandom(0);
30
30
 
@@ -1 +1 @@
1
- {"version":3,"file":"build_probes_for_scene.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/lpv/build_probes_for_scene.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,iFAPW,gBAAgB,GAKd,QAAQ,gBAAgB,CAAC,CAoFrC;iCA9FgC,uBAAuB"}
1
+ {"version":3,"file":"build_probes_for_scene.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/sh3/lpv/build_probes_for_scene.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,iFAPW,gBAAgB,GAKd,QAAQ,gBAAgB,CAAC,CA8FrC;iCAxGgC,uBAAuB"}
@@ -1,6 +1,6 @@
1
1
  import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
2
- import { make_justified_point_grid } from "../../../../core/geom/3d/util/make_justified_point_grid.js";
3
2
  import Vector2 from "../../../../core/geom/Vector2.js";
3
+ import Vector3 from "../../../../core/geom/Vector3.js";
4
4
  import { seededRandom } from "../../../../core/math/random/seededRandom.js";
5
5
  import { delay } from "../../../../core/process/delay.js";
6
6
  import Entity from "../../../ecs/Entity.js";
@@ -60,18 +60,28 @@ export async function build_probes_for_scene(
60
60
  // );
61
61
  // }
62
62
 
63
- make_justified_point_grid(model_bounds, probe_grid_spacing, (x, y, z) => {
64
- volume.add_point(x, y, z);
65
- });
63
+ // make_justified_point_grid(model_bounds, probe_grid_spacing, (x, y, z) => {
64
+ // volume.add_point(x, y, z);
65
+ // });
66
66
 
67
67
  // lpv.add_point(10, 1, -10);
68
68
 
69
69
  await delay(1);
70
70
 
71
+
71
72
  //
72
73
  // console.profile('lpv build');
73
74
  //
74
- volume.build_mesh();
75
+ // volume.build_mesh();
76
+ console.time('Grid Build')
77
+ volume.build_grid(model_bounds, new Vector3(
78
+ Math.ceil(model_bounds.width / probe_grid_spacing),
79
+ Math.ceil(model_bounds.height / probe_grid_spacing),
80
+ Math.ceil(model_bounds.depth / probe_grid_spacing)
81
+ ));
82
+
83
+ console.timeEnd('Grid Build');
84
+
75
85
  const lpv_baker = new LightProbeVolumeBaker();
76
86
  const task = lpv_baker.bake(volume, ecd);
77
87
  // console.profileEnd('lpv build');
@@ -388,8 +388,8 @@ async function main(engine) {
388
388
  // const path = 'data/models/samples/teapot.gltf';
389
389
  // const path = 'data/models/samples/salle_de_bain/model.glb';
390
390
  // const path = 'data/models/samples/conference/model-no-curtains.glb';
391
- // const path = 'data/models/pica_pica/pica_pica.gltf';
392
- const path = 'data/models/samples/gi_box_01/model.glb';
391
+ const path = 'data/models/pica_pica/pica_pica.gltf';
392
+ // const path = 'data/models/samples/gi_box_01/model.glb';
393
393
  // const path = 'data/models/samples/low_poly_classroom/no-glass/model.gltf';
394
394
 
395
395
  const mesh_asset = await engine.assetManager.promise(path, 'model/gltf+json');
@@ -1,8 +1,8 @@
1
+ import { v3_array_normalize } from "../../../../core/geom/vec3/v3_array_normalize.js";
1
2
  import { v3_displace_in_direction_array } from "../../../../core/geom/vec3/v3_displace_in_direction_array.js";
2
3
  import { v3_distance } from "../../../../core/geom/vec3/v3_distance.js";
3
4
  import { v3_distance_sqr } from "../../../../core/geom/vec3/v3_distance_sqr.js";
4
5
  import { v3_length_sqr } from "../../../../core/geom/vec3/v3_length_sqr.js";
5
- import { v3_normalize_array } from "../../../../core/geom/vec3/v3_normalize_array.js";
6
6
 
7
7
  const scratch_direction = new Float32Array(3);
8
8
 
@@ -103,7 +103,7 @@ function reach_out(
103
103
  scratch_direction[1] = target_y - origin_y;
104
104
  scratch_direction[2] = target_z - origin_z;
105
105
 
106
- v3_normalize_array(scratch_direction, 0, scratch_direction, 0);
106
+ v3_array_normalize(scratch_direction, 0, scratch_direction, 0);
107
107
 
108
108
  for (let i = 1; i < size; i++) {
109
109
  const current_offset = i * 3;
@@ -1 +0,0 @@
1
- {"version":3,"file":"v3_normalize_array.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_normalize_array.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,2CALW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,SACN,MAAM,EAAE,GAAC,YAAY,gBACrB,MAAM,QAqBhB"}
@@ -1,9 +0,0 @@
1
- /**
2
- * based on code from THREE.js
3
- * normals need to be set to 0
4
- * @param {Array.<number>|Float32Array} vertices
5
- * @param {Array.<number>|Float32Array} normals
6
- * @param {Array.<number>|Uint32Array} indices
7
- */
8
- export function computeVertexNormals(vertices: Array<number> | Float32Array, normals: Array<number> | Float32Array, indices: Array<number> | Uint32Array): void;
9
- //# sourceMappingURL=ComputeNormals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComputeNormals.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/geometry/buffered/ComputeNormals.js"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,+CAJW,MAAO,MAAM,CAAC,GAAC,YAAY,WAC3B,MAAO,MAAM,CAAC,GAAC,YAAY,WAC3B,MAAO,MAAM,CAAC,GAAC,WAAW,QA4DpC"}