@woosh/meep-engine 2.118.13 → 2.119.0

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 (97) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/package.json +1 -5
  3. package/src/core/geom/3d/compute_triangle_normal.d.ts +16 -4
  4. package/src/core/geom/3d/compute_triangle_normal.d.ts.map +1 -1
  5. package/src/core/geom/3d/compute_triangle_normal.js +3 -3
  6. package/src/core/geom/3d/mat4/m4_multiply.d.ts +4 -4
  7. package/src/core/geom/3d/mat4/m4_multiply.d.ts.map +1 -1
  8. package/src/core/geom/3d/mat4/m4_multiply.js +3 -3
  9. package/src/core/geom/3d/topology/computeTopoMeshVertexDuplicates.d.ts.map +1 -1
  10. package/src/core/geom/3d/topology/computeTopoMeshVertexDuplicates.js +10 -5
  11. package/src/core/geom/3d/topology/query/query_edge_is_boundary.d.ts +1 -0
  12. package/src/core/geom/3d/topology/query/query_edge_is_boundary.d.ts.map +1 -1
  13. package/src/core/geom/3d/topology/query/query_edge_is_boundary.js +1 -0
  14. package/src/core/geom/3d/topology/{isVertexConnectedToOutline.d.ts → query/query_vertex_is_boundary.d.ts} +2 -2
  15. package/src/core/geom/3d/topology/query/query_vertex_is_boundary.d.ts.map +1 -0
  16. package/src/core/geom/3d/topology/{isVertexConnectedToOutline.js → query/query_vertex_is_boundary.js} +2 -2
  17. package/src/core/geom/3d/topology/samples/prototypeFloodFill.d.ts +2 -0
  18. package/src/core/geom/3d/topology/samples/prototypeFloodFill.d.ts.map +1 -0
  19. package/src/core/geom/3d/topology/samples/{sampleFloodFill.js → prototypeFloodFill.js} +3 -3
  20. package/src/core/geom/3d/topology/simplify/EdgeCollapseCandidate.d.ts.map +1 -1
  21. package/src/core/geom/3d/topology/simplify/EdgeCollapseCandidate.js +2 -32
  22. package/src/core/geom/3d/topology/simplify/computeEdgeCollapseCost.js +3 -3
  23. package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.d.ts.map +1 -1
  24. package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.js +9 -15
  25. package/src/core/geom/3d/topology/simplify/edge_collapse_quadratic.d.ts.map +1 -1
  26. package/src/core/geom/3d/topology/simplify/edge_collapse_quadratic.js +2 -57
  27. package/src/core/geom/3d/topology/simplify/prototypeMeshSimplification.js +2 -2
  28. package/src/core/geom/3d/topology/simplify/quadratic/Quadratic3.d.ts.map +1 -1
  29. package/src/core/geom/3d/topology/simplify/quadratic/Quadratic3.js +18 -18
  30. package/src/core/geom/3d/topology/simplify/simplifyTopoMesh.d.ts.map +1 -1
  31. package/src/core/geom/3d/topology/simplify/simplifyTopoMesh.js +1 -0
  32. package/src/core/geom/3d/topology/simplify/tm_edge_collapse_is_degenerate_flip.d.ts.map +1 -1
  33. package/src/core/geom/3d/topology/simplify/tm_edge_collapse_is_degenerate_flip.js +2 -18
  34. package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts +17 -1
  35. package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts.map +1 -1
  36. package/src/core/geom/3d/topology/struct/TopoTriangle.js +60 -1
  37. package/src/core/geom/3d/topology/struct/TopoVertex.d.ts +8 -0
  38. package/src/core/geom/3d/topology/struct/TopoVertex.d.ts.map +1 -1
  39. package/src/core/geom/3d/topology/struct/TopoVertex.js +22 -1
  40. package/src/core/geom/3d/topology/{three_buffer_geometry_to_topo_mesh.d.ts → three/three_buffer_geometry_to_topo_mesh.d.ts} +1 -1
  41. package/src/core/geom/3d/topology/three/three_buffer_geometry_to_topo_mesh.d.ts.map +1 -0
  42. package/src/core/geom/3d/topology/{three_buffer_geometry_to_topo_mesh.js → three/three_buffer_geometry_to_topo_mesh.js} +1 -1
  43. package/src/core/geom/3d/topology/three/topo_mesh_to_three_buffer_geometry.d.ts.map +1 -0
  44. package/src/core/geom/3d/topology/tm_weld_duplicate_vertices.d.ts +9 -0
  45. package/src/core/geom/3d/topology/tm_weld_duplicate_vertices.d.ts.map +1 -0
  46. package/src/core/geom/3d/topology/{weld_duplicate_vertices.js → tm_weld_duplicate_vertices.js} +4 -5
  47. package/src/core/math/GOLDEN_RATIO.d.ts +1 -0
  48. package/src/core/math/GOLDEN_RATIO.d.ts.map +1 -1
  49. package/src/core/math/GOLDEN_RATIO.js +1 -0
  50. package/src/core/math/matrix/mat4x4_transpose_copy_to_mat4x3.d.ts +9 -0
  51. package/src/core/math/matrix/mat4x4_transpose_copy_to_mat4x3.d.ts.map +1 -0
  52. package/src/core/math/matrix/mat4x4_transpose_copy_to_mat4x3.js +26 -0
  53. package/src/engine/graphics/ecs/light/LightContext.d.ts.map +1 -1
  54. package/src/engine/graphics/ecs/light/LightContext.js +7 -10
  55. package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.d.ts.map +1 -1
  56. package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js +4 -6
  57. package/src/engine/graphics/ecs/light/shadow/ShadowManager.d.ts.map +1 -1
  58. package/src/engine/graphics/ecs/light/shadow/ShadowManager.js +14 -15
  59. package/src/engine/graphics/geometry/AttributeGroupSpec.d.ts.map +1 -1
  60. package/src/engine/graphics/geometry/AttributeGroupSpec.js +15 -6
  61. package/src/engine/graphics/geometry/skining/computeSkinnedMeshVertices.d.ts.map +1 -1
  62. package/src/engine/graphics/geometry/skining/computeSkinnedMeshVertices.js +23 -109
  63. package/src/engine/graphics/geometry/skining/mesh_apply_skeletal_vertex_skinning.d.ts +15 -0
  64. package/src/engine/graphics/geometry/skining/mesh_apply_skeletal_vertex_skinning.d.ts.map +1 -0
  65. package/src/engine/graphics/geometry/skining/mesh_apply_skeletal_vertex_skinning.js +85 -0
  66. package/src/engine/graphics/trail/x/RibbonXPlugin.d.ts +1 -1
  67. package/src/engine/graphics/trail/x/RibbonXPlugin.d.ts.map +1 -1
  68. package/src/engine/graphics/trail/x/RibbonXPlugin.js +2 -14
  69. package/src/engine/intelligence/blackboard/BlackboardValue.d.ts +2 -2
  70. package/src/engine/intelligence/blackboard/BlackboardValue.d.ts.map +1 -1
  71. package/build/meep.cjs +0 -118569
  72. package/build/meep.min.js +0 -1
  73. package/build/meep.module.js +0 -118534
  74. package/src/__module.d.ts +0 -3
  75. package/src/__module.d.ts.map +0 -1
  76. package/src/__module.js +0 -6
  77. package/src/core/__module.d.ts +0 -21
  78. package/src/core/__module.d.ts.map +0 -1
  79. package/src/core/__module.js +0 -22
  80. package/src/core/geom/3d/topology/isEdgeConnectedToOutline.d.ts +0 -7
  81. package/src/core/geom/3d/topology/isEdgeConnectedToOutline.d.ts.map +0 -1
  82. package/src/core/geom/3d/topology/isEdgeConnectedToOutline.js +0 -13
  83. package/src/core/geom/3d/topology/isVertexConnectedToOutline.d.ts.map +0 -1
  84. package/src/core/geom/3d/topology/samples/sampleFloodFill.d.ts +0 -2
  85. package/src/core/geom/3d/topology/samples/sampleFloodFill.d.ts.map +0 -1
  86. package/src/core/geom/3d/topology/three_buffer_geometry_to_topo_mesh.d.ts.map +0 -1
  87. package/src/core/geom/3d/topology/topo_mesh_to_three_buffer_geometry.d.ts.map +0 -1
  88. package/src/core/geom/3d/topology/weld_duplicate_vertices.d.ts +0 -9
  89. package/src/core/geom/3d/topology/weld_duplicate_vertices.d.ts.map +0 -1
  90. package/src/engine/__module.d.ts +0 -18
  91. package/src/engine/__module.d.ts.map +0 -1
  92. package/src/engine/__module.js +0 -20
  93. package/src/engine/intelligence/__module.d.ts +0 -7
  94. package/src/engine/intelligence/__module.d.ts.map +0 -1
  95. package/src/engine/intelligence/__module.js +0 -6
  96. /package/src/core/geom/3d/topology/{topo_mesh_to_three_buffer_geometry.d.ts → three/topo_mesh_to_three_buffer_geometry.d.ts} +0 -0
  97. /package/src/core/geom/3d/topology/{topo_mesh_to_three_buffer_geometry.js → three/topo_mesh_to_three_buffer_geometry.js} +0 -0
@@ -1,7 +1,7 @@
1
- import { v3_dot } from "../../../../vec3/v3_dot.js";
2
- import { fabsf } from "../../../../../math/fabsf.js";
3
1
  import { vec3 } from "gl-matrix";
4
2
  import { EPSILON } from "../../../../../math/EPSILON.js";
3
+ import { fabsf } from "../../../../../math/fabsf.js";
4
+ import { v3_dot } from "../../../../vec3/v3_dot.js";
5
5
  import { compute_triangle_normal } from "../../../compute_triangle_normal.js";
6
6
 
7
7
  const scratch_v3 = new Float32Array(3);
@@ -11,25 +11,25 @@ const scratch_v3 = new Float32Array(3);
11
11
  * Triangular 4x4 matrix, see https://en.wikipedia.org/wiki/Triangular_matrix
12
12
  */
13
13
  export class Quadratic3 {
14
- constructor() {
15
- // Row 0
16
- this.a2 = 0;
17
- this.ab = 0;
18
- this.ac = 0;
19
- this.ad = 0;
20
14
 
21
- // Row 1
22
- this.b2 = 0;
23
- this.bc = 0;
24
- this.bd = 0;
15
+ // Row 0
16
+ a2 = 0;
17
+ ab = 0;
18
+ ac = 0;
19
+ ad = 0;
25
20
 
26
- // Row 2
27
- this.c2 = 0;
28
- this.cd = 0;
21
+ // Row 1
22
+ b2 = 0;
23
+ bc = 0;
24
+ bd = 0;
25
+
26
+ // Row 2
27
+ c2 = 0;
28
+ cd = 0;
29
+
30
+ // Row 3
31
+ d2 = 0;
29
32
 
30
- // Row 3
31
- this.d2 = 0;
32
- }
33
33
 
34
34
  /**
35
35
  *
@@ -1 +1 @@
1
- {"version":3,"file":"simplifyTopoMesh.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/simplify/simplifyTopoMesh.js"],"names":[],"mappings":"AAaA;;;GAGG;AACH,wCAFW,qBAAqB,UAI/B;AAGD;;;;;;;GAOG;AACH,uDAPW,MAAM,QACN,WAAW,qBAAqB,CAAC,wCAEjC,cAAc,qBAAqB,CAAC,qBACpC,IAAI,MAAM,aAAa,uBACvB,IAAI,MAAM,CAAC,QAyKrB;AAED;;;;;;;GAOG;AACH,sEAHW,MAAM,wBACN,IAAI,MAAM,CAAC,QAwDrB;sCAhQqC,4BAA4B;uBAJ3C,2CAA2C"}
1
+ {"version":3,"file":"simplifyTopoMesh.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/simplify/simplifyTopoMesh.js"],"names":[],"mappings":"AAcA;;;GAGG;AACH,wCAFW,qBAAqB,UAI/B;AAGD;;;;;;;GAOG;AACH,uDAPW,MAAM,QACN,WAAW,qBAAqB,CAAC,wCAEjC,cAAc,qBAAqB,CAAC,qBACpC,IAAI,MAAM,aAAa,uBACvB,IAAI,MAAM,CAAC,QAyKrB;AAED;;;;;;;GAOG;AACH,sEAHW,MAAM,wBACN,IAAI,MAAM,CAAC,QAwDrB;sCAhQqC,4BAA4B;uBAL3C,2CAA2C"}
@@ -1,5 +1,6 @@
1
1
  import { array_copy_unique } from "../../../../collection/array/array_copy_unique.js";
2
2
  import BinaryHeap from "../../../../collection/heap/BinaryHeap.js";
3
+ import { update_topo_face_normals } from "../update_topo_face_normals.js";
3
4
  import { build_edge_collapse_candidates } from "./build_edge_collapse_candidates.js";
4
5
  import { collapse_all_degenerate_edges } from "./collapse_all_degenerate_edges.js";
5
6
  import { collapse_degenerate_edge } from "./collapse_degenerate_edge.js";
@@ -1 +1 @@
1
- {"version":3,"file":"tm_edge_collapse_is_degenerate_flip.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/simplify/tm_edge_collapse_is_degenerate_flip.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,yFAFa,OAAO,CAsEnB"}
1
+ {"version":3,"file":"tm_edge_collapse_is_degenerate_flip.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/simplify/tm_edge_collapse_is_degenerate_flip.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,yFAFa,OAAO,CAsDnB"}
@@ -1,8 +1,8 @@
1
+ import { v3_dot } from "../../../vec3/v3_dot.js";
2
+ import { v3_length_sqr } from "../../../vec3/v3_length_sqr.js";
1
3
  import { query_edge_other_vertex } from "../query/query_edge_other_vertex.js";
2
4
  import { query_face_next_vertex } from "../query/query_face_next_vertex.js";
3
5
  import { query_face_prev_vertex } from "../query/query_face_prev_vertex.js";
4
- import { v3_length_sqr } from "../../../vec3/v3_length_sqr.js";
5
- import { v3_dot } from "../../../vec3/v3_dot.js";
6
6
 
7
7
  /**
8
8
  * @see https://github.com/blender/blender/blob/594f47ecd2d5367ca936cf6fc6ec8168c2b360d0/source/blender/bmesh/tools/bmesh_decimate_collapse.c#L164
@@ -55,22 +55,6 @@ export function tm_edge_collapse_is_degenerate_flip(edge, target) {
55
55
  const squared_distance_sum = v3_length_sqr(vx_ov_x, vx_ov_y, vx_ov_z)
56
56
  + v3_length_sqr(vx_ot_x, vx_ot_y, vx_ot_z);
57
57
 
58
- /*
59
-
60
- vec3.sub(vec_other, prev_vertex, next_vertex);
61
- vec3.sub(vec_exist, prev_vertex, victim);
62
- vec3.sub(vec_optim, prev_vertex, target);
63
-
64
- vec3.cross(vec_exist, vec_other, vec_exist);
65
- vec3.cross(vec_optim, vec_other, vec_optim);
66
-
67
-
68
- // avoid normalization
69
- const dot = vec3.dot(vec_exist, vec_optim);
70
- const squared_distance_sum = vec3.squaredLength(vec_exist) + vec3.squaredLength(vec_other);
71
- */
72
-
73
- // if (dot <= squared_distance_sum * 0.000001) {
74
58
  if (dot <= squared_distance_sum * 0.000001) {
75
59
  return true;
76
60
  }
@@ -1,5 +1,19 @@
1
1
  /// <reference types="gl-matrix/index.js" />
2
2
  export class TopoTriangle {
3
+ /**
4
+ * Utility constructor
5
+ * @param {number} ax
6
+ * @param {number} ay
7
+ * @param {number} az
8
+ * @param {number} bx
9
+ * @param {number} by
10
+ * @param {number} bz
11
+ * @param {number} cx
12
+ * @param {number} cy
13
+ * @param {number} cz
14
+ * @return {TopoTriangle}
15
+ */
16
+ static fromPoints(ax: number, ay: number, az: number, bx: number, by: number, bz: number, cx: number, cy: number, cz: number): TopoTriangle;
3
17
  /**
4
18
  * Identifying index, can be used to link back to buffer-geometry face by index or any other useful ID purposes
5
19
  * @type {number}
@@ -51,7 +65,7 @@ export class TopoTriangle {
51
65
  */
52
66
  replaceVertex(existing: TopoVertex, replacement: TopoVertex): void;
53
67
  /**
54
- * Some all all vertices are the same, resulting in line or point representation
68
+ * Some or all vertices are the same, resulting in line or point representation
55
69
  */
56
70
  isDegenerateTopology(): boolean;
57
71
  /**
@@ -106,5 +120,7 @@ export class TopoTriangle {
106
120
  */
107
121
  readonly isTopoFace: boolean;
108
122
  }
123
+ import { TopoVertex } from "./TopoVertex.js";
124
+ import { TopoEdge } from "./TopoEdge.js";
109
125
  import { vec3 } from "gl-matrix";
110
126
  //# sourceMappingURL=TopoTriangle.d.ts.map
@@ -1 +1 @@
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
+ {"version":3,"file":"TopoTriangle.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoTriangle.js"],"names":[],"mappings":";AAWA;IAmRI;;;;;;;;;;;;OAYG;IACH,sBAXW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACL,YAAY,CA4CvB;IAzUD;;;OAGG;IACH,OAFU,MAAM,CAEQ;IACxB;;;OAGG;IACH,UAFU,UAAU,EAAE,CAER;IACd;;;OAGG;IACH,OAFU,QAAQ,EAAE,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,sBAHW,QAAQ,eACR,QAAQ,QAIlB;IAED;;;;OAIG;IACH,wBAHW,UAAU,eACV,UAAU,QAMpB;IAED;;OAEG;IACH,gCASC;IAED;;OAEG;IACH,eAmBC;IAED;;;OAGG;IACH,WAFW,QAAQ,QAMlB;IAED;;;;OAIG;IACH,iBAHW,QAAQ,GACP,OAAO,CAIlB;IAED;;;OAGG;IACH,cAFW,QAAQ,QAQlB;IAED;;;;OAIG;IACH,mBAHW,QAAQ,GACN,OAAO,CAKnB;IAED,sBAaC;IAGD;;;;OAIG;IACH,mBAHW,MAAM,UACN,UAAU,QAOpB;IAED;;;;OAIG;IACH,uBAHW,UAAU,GACT,OAAO,CAIlB;IAED;;;;;OAKG;IACH,0BAJW,YAAY,EAAE,iBACd,MAAM,GACJ,MAAM,CA8BlB;IA4DL;;;OAGG;IACH,qBAFU,OAAO,CAEgB;CANhC;2BA/U0B,iBAAiB;yBADnB,eAAe;qBANnB,WAAW"}
@@ -4,6 +4,8 @@ import { array_push_if_unique } from "../../../../collection/array/array_push_if
4
4
  import { array_remove_first } from "../../../../collection/array/array_remove_first.js";
5
5
  import { array_replace_all } from "../../../../collection/array/array_replace_all.js";
6
6
  import { compute_triangle_normal } from "../../compute_triangle_normal.js";
7
+ import { TopoEdge } from "./TopoEdge.js";
8
+ import { TopoVertex } from "./TopoVertex.js";
7
9
 
8
10
  let index_counter = 0;
9
11
 
@@ -131,7 +133,7 @@ export class TopoTriangle {
131
133
  }
132
134
 
133
135
  /**
134
- * Some all all vertices are the same, resulting in line or point representation
136
+ * Some or all vertices are the same, resulting in line or point representation
135
137
  */
136
138
  isDegenerateTopology() {
137
139
 
@@ -281,6 +283,63 @@ export class TopoTriangle {
281
283
 
282
284
  return additions;
283
285
  }
286
+
287
+ /**
288
+ * Utility constructor
289
+ * @param {number} ax
290
+ * @param {number} ay
291
+ * @param {number} az
292
+ * @param {number} bx
293
+ * @param {number} by
294
+ * @param {number} bz
295
+ * @param {number} cx
296
+ * @param {number} cy
297
+ * @param {number} cz
298
+ * @return {TopoTriangle}
299
+ */
300
+ static fromPoints(
301
+ ax, ay, az,
302
+ bx, by, bz,
303
+ cx, cy, cz
304
+ ) {
305
+
306
+ const v0 = TopoVertex.from(ax, ay, az);
307
+ const v1 = TopoVertex.from(bx, by, bz);
308
+ const v2 = TopoVertex.from(cx, cy, cz);
309
+
310
+ const e0 = new TopoEdge();
311
+ const e1 = new TopoEdge();
312
+ const e2 = new TopoEdge();
313
+
314
+ e0.v0 = v0;
315
+ e0.v1 = v1;
316
+
317
+ e1.v0 = v1;
318
+ e1.v1 = v2;
319
+
320
+ e2.v0 = v2;
321
+ e2.v1 = v0;
322
+
323
+ const triangle = new TopoTriangle();
324
+
325
+ triangle.edges.push(e0, e1, e2);
326
+ triangle.vertices.push(v0, v1, v2);
327
+
328
+ // link
329
+ v0.faces.push(triangle);
330
+ v1.faces.push(triangle);
331
+ v2.faces.push(triangle);
332
+
333
+ e0.faces.push(triangle);
334
+ e1.faces.push(triangle);
335
+ e2.faces.push(triangle);
336
+
337
+ v0.edges.push(e0, e2);
338
+ v1.edges.push(e0, e1);
339
+ v2.edges.push(e1, e2);
340
+
341
+ return triangle;
342
+ }
284
343
  }
285
344
 
286
345
  /**
@@ -1,4 +1,12 @@
1
1
  export class TopoVertex {
2
+ /**
3
+ *
4
+ * @param {number} x
5
+ * @param {number} y
6
+ * @param {number} z
7
+ * @return {TopoVertex}
8
+ */
9
+ static from(x: number, y: number, z: number): TopoVertex;
2
10
  /**
3
11
  * Identification number, expected to be unique within a given topology
4
12
  * @type {number}
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"TopoVertex.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoVertex.js"],"names":[],"mappings":"AAQA;IA2RI;;;;;;OAMG;IACH,eALW,MAAM,KACN,MAAM,KACN,MAAM,GACL,UAAU,CAYrB;IA1SD;;;OAGG;IACH,OAFU,MAAM,CAEe;IAE/B;;;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;IAsBL;;;OAGG;IACH,uBAFU,OAAO,CAEgB;CANhC"}
@@ -4,13 +4,15 @@ import { array_remove_first } from "../../../../collection/array/array_remove_fi
4
4
  import { v3_distance } from "../../../vec3/v3_distance.js";
5
5
  import { query_vertex_in_edge } from "../query/query_vertex_in_edge.js";
6
6
 
7
+ let vertex_index_counter = 0;
8
+
7
9
  export class TopoVertex {
8
10
 
9
11
  /**
10
12
  * Identification number, expected to be unique within a given topology
11
13
  * @type {number}
12
14
  */
13
- index = 0;
15
+ index = vertex_index_counter++;
14
16
 
15
17
  /**
16
18
  *
@@ -286,6 +288,25 @@ export class TopoVertex {
286
288
 
287
289
  return additions;
288
290
  }
291
+
292
+ /**
293
+ *
294
+ * @param {number} x
295
+ * @param {number} y
296
+ * @param {number} z
297
+ * @return {TopoVertex}
298
+ */
299
+ static from(x, y, z) {
300
+
301
+ const r = new TopoVertex();
302
+
303
+ r.x = x;
304
+ r.y = y;
305
+ r.z = z;
306
+
307
+ return r;
308
+
309
+ }
289
310
  }
290
311
 
291
312
  /**
@@ -4,5 +4,5 @@
4
4
  * @return {TopoMesh}
5
5
  */
6
6
  export function three_buffer_geometry_to_topo_mesh(geo: THREE.BufferGeometry): TopoMesh;
7
- import { TopoMesh } from "./struct/TopoMesh.js";
7
+ import { TopoMesh } from "../struct/TopoMesh.js";
8
8
  //# sourceMappingURL=three_buffer_geometry_to_topo_mesh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"three_buffer_geometry_to_topo_mesh.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/three/three_buffer_geometry_to_topo_mesh.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wDAHW,MAAM,cAAc,GACnB,QAAQ,CAwBnB;yBA7BwB,uBAAuB"}
@@ -1,4 +1,4 @@
1
- import { TopoMesh } from "./struct/TopoMesh.js";
1
+ import { TopoMesh } from "../struct/TopoMesh.js";
2
2
 
3
3
  /**
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topo_mesh_to_three_buffer_geometry.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/three/topo_mesh_to_three_buffer_geometry.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,oEAFa,oBAAoB,CA0DhC;+BA/D+C,OAAO"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ *
3
+ * @param {TopoMesh} mesh
4
+ * @param {AABB3} bounds
5
+ * @param {number} tolerance
6
+ * @returns {number} removed vertices
7
+ */
8
+ export function tm_weld_duplicate_vertices(mesh: TopoMesh, bounds: AABB3, tolerance?: number): number;
9
+ //# sourceMappingURL=tm_weld_duplicate_vertices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tm_weld_duplicate_vertices.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/topology/tm_weld_duplicate_vertices.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,sFAHW,MAAM,GACJ,MAAM,CAoDlB"}
@@ -1,7 +1,6 @@
1
+ import { EPSILON } from "../../../math/EPSILON.js";
1
2
  import { computeTopoMeshVertexDuplicates } from "./computeTopoMeshVertexDuplicates.js";
2
3
  import { tm_vert_splice } from "./tm_vert_splice.js";
3
- import { debugValidateMesh } from "./debugValidateMesh.js";
4
- import { EPSILON } from "../../../math/EPSILON.js";
5
4
 
6
5
  /**
7
6
  *
@@ -10,9 +9,9 @@ import { EPSILON } from "../../../math/EPSILON.js";
10
9
  * @param {number} tolerance
11
10
  * @returns {number} removed vertices
12
11
  */
13
- export function weld_duplicate_vertices(mesh, bounds, tolerance = EPSILON) {
12
+ export function tm_weld_duplicate_vertices(mesh, bounds, tolerance = EPSILON) {
14
13
 
15
- debugValidateMesh(mesh);
14
+ // debugValidateMesh(mesh);
16
15
 
17
16
  const duplicates = computeTopoMeshVertexDuplicates(mesh, bounds, tolerance);
18
17
 
@@ -56,7 +55,7 @@ export function weld_duplicate_vertices(mesh, bounds, tolerance = EPSILON) {
56
55
  }
57
56
  }
58
57
 
59
- debugValidateMesh(mesh);
58
+ // debugValidateMesh(mesh);
60
59
 
61
60
  return removal_count;
62
61
 
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * See https://en.wikipedia.org/wiki/Golden_ratio
3
+ * = (1 + sqrt(5)) / 2
3
4
  * @type {number}
4
5
  */
5
6
  export const GOLDEN_RATIO: number;
@@ -1 +1 @@
1
- {"version":3,"file":"GOLDEN_RATIO.d.ts","sourceRoot":"","sources":["../../../../src/core/math/GOLDEN_RATIO.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,2BAFU,MAAM,CAE8B"}
1
+ {"version":3,"file":"GOLDEN_RATIO.d.ts","sourceRoot":"","sources":["../../../../src/core/math/GOLDEN_RATIO.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,2BAFU,MAAM,CAE8B"}
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * See https://en.wikipedia.org/wiki/Golden_ratio
3
+ * = (1 + sqrt(5)) / 2
3
4
  * @type {number}
4
5
  */
5
6
  export const GOLDEN_RATIO = 1.618033988749895;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Transpose and extract 3 rows from mat4x4
3
+ * @param {number[]|Float32Array} destination
4
+ * @param {number} destination_offset
5
+ * @param {number[]|Float32Array} source
6
+ * @param {number} source_offset
7
+ */
8
+ export function mat4x4_transpose_copy_to_mat4x3(destination: number[] | Float32Array, destination_offset: number, source: number[] | Float32Array, source_offset: number): void;
9
+ //# sourceMappingURL=mat4x4_transpose_copy_to_mat4x3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mat4x4_transpose_copy_to_mat4x3.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/matrix/mat4x4_transpose_copy_to_mat4x3.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,6DALW,MAAM,EAAE,GAAC,YAAY,sBACrB,MAAM,UACN,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,QAoBhB"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Transpose and extract 3 rows from mat4x4
3
+ * @param {number[]|Float32Array} destination
4
+ * @param {number} destination_offset
5
+ * @param {number[]|Float32Array} source
6
+ * @param {number} source_offset
7
+ */
8
+ export function mat4x4_transpose_copy_to_mat4x3(destination, destination_offset, source, source_offset) {
9
+ // row 0
10
+ destination[destination_offset] = source[source_offset];
11
+ destination[destination_offset + 1] = source[source_offset + 4];
12
+ destination[destination_offset + 2] = source[source_offset + 8];
13
+ destination[destination_offset + 3] = source[source_offset + 12];
14
+
15
+ // row 1
16
+ destination[destination_offset + 4] = source[source_offset + 1];
17
+ destination[destination_offset + 5] = source[source_offset + 5];
18
+ destination[destination_offset + 6] = source[source_offset + 9];
19
+ destination[destination_offset + 7] = source[source_offset + 13];
20
+
21
+ // row 2
22
+ destination[destination_offset + 8] = source[source_offset + 2];
23
+ destination[destination_offset + 9] = source[source_offset + 6];
24
+ destination[destination_offset + 10] = source[source_offset + 10];
25
+ destination[destination_offset + 11] = source[source_offset + 14];
26
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"LightContext.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/light/LightContext.js"],"names":[],"mappings":"AAKA;IAIQ;;;;OAIG;IACH,kBAAqB;IAGzB;;;OAGG;IACH,kBAEC;IAED;;;OAGG;IACH,0BAEC;IAED,kBAIC;IAED,gBASC;IAED,sBAEC;CAgBJ;oCApEmC,4CAA4C"}
1
+ {"version":3,"file":"LightContext.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/light/LightContext.js"],"names":[],"mappings":"AAKA;IAEI;;;;OAIG;IACH,kBAAiB;IAEjB;;;OAGG;IACH,kBAEC;IAED;;;OAGG;IACH,0BAEC;IAED,kBAIC;IAED,gBASC;IAED,sBAEC;CAgBJ;oCAjEmC,4CAA4C"}
@@ -1,19 +1,16 @@
1
1
  import { SystemEntityContext } from "../../../ecs/system/SystemEntityContext.js";
2
- import { LightType } from "./LightType.js";
3
2
  import { FPLightBinding } from "./binding/fp/FPLightBinding.js";
4
3
  import { ThreeLightBinding } from "./binding/three/ThreeLightBinding.js";
4
+ import { LightType } from "./LightType.js";
5
5
 
6
6
  export class LightContext extends SystemEntityContext {
7
- constructor() {
8
- super();
9
7
 
10
- /**
11
- *
12
- * @type {LightBinding|null}
13
- * @private
14
- */
15
- this.__binding = null;
16
- }
8
+ /**
9
+ *
10
+ * @type {LightBinding|null}
11
+ * @private
12
+ */
13
+ __binding = null;
17
14
 
18
15
  /**
19
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ThreeLightBinding.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js"],"names":[],"mappings":"AAwEA;;;;GAIG;AACH,6EAFW,MAAM,QAgBhB;AAED;IAKQ;;;;OAIG;IACH,iBAAoB;IAEpB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,qBAAiC;IAGrC,qBAYC;IAED,uBAcC;IAED;;;;OAIG;IACH,yBAEC;IAYD,+BAEC;IAUD,yBAuBC;IAED,2BAgBC;IAED,iCA0BC;IAGD,2BA0CC;IA8CD,mCAmBC;CAEJ;6BApW4B,oBAAoB"}
1
+ {"version":3,"file":"ThreeLightBinding.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js"],"names":[],"mappings":"AAwEA;;;;GAIG;AACH,6EAFW,MAAM,QAgBhB;AAED;IAGQ;;;;OAIG;IACH,iBAAgB;IAEhB;;;;OAIG;IACH,qBAAoB;IAEpB;;;;OAIG;IACH,qBAA6B;IAGjC,qBAYC;IAED,uBAcC;IAED;;;;OAIG;IACH,yBAEC;IAYD,+BAEC;IAUD,yBAuBC;IAED,2BAgBC;IAED,iCA0BC;IAGD,2BA0CC;IA8CD,mCAmBC;CAEJ;6BAlW4B,oBAAoB"}
@@ -93,30 +93,28 @@ export function three_set_shadow_resolution(shadow, resolution) {
93
93
 
94
94
  export class ThreeLightBinding extends LightBinding {
95
95
 
96
- constructor() {
97
- super();
98
96
 
99
97
  /**
100
98
  *
101
99
  * @type {LightSystem|null}
102
100
  * @private
103
101
  */
104
- this.__system = null;
102
+ __system = null;
105
103
 
106
104
  /**
107
105
  *
108
106
  * @type {ShadowMap|null}
109
107
  * @private
110
108
  */
111
- this.__shadow_map = null;
109
+ __shadow_map = null;
112
110
 
113
111
  /**
114
112
  *
115
113
  * @type {WeakMap<THREE.Object3D, THREE.Object3D>}
116
114
  * @private
117
115
  */
118
- this.__object_map = new WeakMap();
119
- }
116
+ __object_map = new WeakMap();
117
+
120
118
 
121
119
  link(ctx) {
122
120
  this.__system = ctx.system;
@@ -1 +1 @@
1
- {"version":3,"file":"ShadowManager.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/light/shadow/ShadowManager.js"],"names":[],"mappings":"AAEA;IAEQ;;;;OAIG;IACH,mBAAsB;IAEtB;;;;OAIG;IACH,eAAwB;IAG5B,uBAEC;IAED;;;OAGG;IACH,6BAUC;IAED;;;;OAIG;IACH,wBAFY,OAAO,CAUlB;CACJ"}
1
+ {"version":3,"file":"ShadowManager.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/light/shadow/ShadowManager.js"],"names":[],"mappings":"AAEA;IAEI;;;;OAIG;IACH,mBAAkB;IAElB;;;;OAIG;IACH,eAAoB;IAEpB,uBAEC;IAED;;;OAGG;IACH,6BAUC;IAED;;;;OAIG;IACH,wBAFY,OAAO,CAUlB;CACJ"}
@@ -1,21 +1,20 @@
1
1
  import List from "../../../../../core/collection/list/List.js";
2
2
 
3
3
  export class ShadowManager {
4
- constructor() {
5
- /**
6
- *
7
- * @type {GraphicsEngine}
8
- * @private
9
- */
10
- this.__graphics = null;
11
-
12
- /**
13
- *
14
- * @type {List<ShadowMap>}
15
- * @private
16
- */
17
- this.__maps = new List();
18
- }
4
+
5
+ /**
6
+ *
7
+ * @type {GraphicsEngine}
8
+ * @private
9
+ */
10
+ __graphics = null;
11
+
12
+ /**
13
+ *
14
+ * @type {List<ShadowMap>}
15
+ * @private
16
+ */
17
+ __maps = new List();
19
18
 
20
19
  set graphics(v) {
21
20
  this.__graphics = v;
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeGroupSpec.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/AttributeGroupSpec.js"],"names":[],"mappings":"AAYA;;;GAGG;AACH;IAeI;;;;OAIG;IACH,2BAHW,aAAa,GACX,kBAAkB,CAQ9B;IAxBD;;;OAGG;IACH,YAFU,aAAa,EAAE,CAET;IAsBhB;;;;OAIG;IACH,yBAHW,MAAM,GACL,aAAa,GAAC,SAAS,CAgBlC;IAED;;;OAGG;IACH,8BAFW,MAAM,GADJ,MAAM,CAiBlB;IAED;;;OAGG;IACH,oBAFW,aAAa,EAAE,QAOzB;IAED;;;;OAIG;IACH,eAHW,aAAa,GACZ,kBAAkB,CAkB7B;IAED;;;OAGG;IACH,0BAFW,aAAa,EAAE,QAQzB;IAED,cAMC;IAED;;;;OAIG;IACH,cAHW,kBAAkB,GAChB,OAAO,CAQnB;IAED,sBASC;IAED,eAMC;IAED;;MAIC;IAED;;aAkBC;IAED;;;OAGG;IACH,eAFa,MAAM,CAelB;IAIL;;;OAGG;IACH,+BAFU,OAAO,CAEgC;;CAPhD;8BAnN6B,oBAAoB"}
1
+ {"version":3,"file":"AttributeGroupSpec.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/AttributeGroupSpec.js"],"names":[],"mappings":"AAaA;;;GAGG;AACH;IAeI;;;;OAIG;IACH,2BAHW,aAAa,GACX,kBAAkB,CAQ9B;IAxBD;;;OAGG;IACH,qBAFU,aAAa,EAAE,CAET;IAsBhB;;;;OAIG;IACH,yBAHW,MAAM,GACL,aAAa,GAAC,SAAS,CAgBlC;IAED;;;OAGG;IACH,8BAFW,MAAM,GADJ,MAAM,CAiBlB;IAED;;;;OAIG;IACH,oBAHW,aAAa,EAAE,QAUzB;IAED;;;;;OAKG;IACH,eAJW,aAAa,GACZ,kBAAkB,CAoB7B;IAED;;;OAGG;IACH,0BAFW,aAAa,EAAE,QAQzB;IAED,cAQC;IAED;;;;OAIG;IACH,cAHW,kBAAkB,GAChB,OAAO,CAQnB;IAED,sBASC;IAED,eAMC;IAED;;MAIC;IAED;;aAkBC;IAED;;;;OAIG;IACH,eAFa,MAAM,CAelB;IAIL;;;OAGG;IACH,+BAFU,OAAO,CAEgC;;CAPhD;8BA3N6B,oBAAoB"}
@@ -2,6 +2,7 @@ import { assert } from "../../../core/assert.js";
2
2
  import { computeHashArray } from "../../../core/collection/array/computeHashArray.js";
3
3
  import { isArrayEqual } from "../../../core/collection/array/isArrayEqual.js";
4
4
  import { invokeObjectHash } from "../../../core/model/object/invokeObjectHash.js";
5
+ import { invokeObjectToJSON } from "../../../core/model/object/invokeObjectToJSON.js";
5
6
  import { AttributeSpec } from "./AttributeSpec.js";
6
7
 
7
8
  /**
@@ -17,7 +18,7 @@ const RESERVED_HASH = 1234567;
17
18
  export class AttributeGroupSpec {
18
19
 
19
20
  /**
20
- *
21
+ * @readonly
21
22
  * @type {AttributeSpec[]}
22
23
  */
23
24
  attributes = [];
@@ -80,27 +81,32 @@ export class AttributeGroupSpec {
80
81
  }
81
82
  }
82
83
 
83
- return undefined;
84
+ return -1;
84
85
  }
85
86
 
86
87
  /**
87
88
  *
88
89
  * @param {AttributeSpec[]} attributes
90
+ * @throws {Error} if any there are any name collisions
89
91
  */
90
92
  addMany(attributes) {
91
93
  const n = attributes.length;
94
+
92
95
  for (let i = 0; i < n; i++) {
93
96
  this.add(attributes[i]);
94
97
  }
98
+
95
99
  }
96
100
 
97
101
  /**
98
102
  *
99
103
  * @param {AttributeSpec} attribute
100
104
  * @return {AttributeGroupSpec}
105
+ * @throws {Error} if attribute with that name is already present
101
106
  */
102
107
  add(attribute) {
103
108
 
109
+ assert.defined(attribute, 'attribute');
104
110
  assert.equal(attribute.isAttributeSpec, true, 'attribute.isAttributeSpec !== true');
105
111
 
106
112
  //check uniqueness of name
@@ -130,8 +136,10 @@ export class AttributeGroupSpec {
130
136
  }
131
137
 
132
138
  clear() {
133
- const count = this.attributes.length;
134
- this.attributes.splice(0, count);
139
+ const attributes = this.attributes;
140
+
141
+ const count = attributes.length;
142
+ attributes.splice(0, count);
135
143
 
136
144
  // reset hash to trigger hash update
137
145
  this.#hash = RESERVED_HASH;
@@ -171,7 +179,7 @@ export class AttributeGroupSpec {
171
179
 
172
180
  toJSON() {
173
181
  return {
174
- attributes: JSON.stringify(this.attributes)
182
+ attributes: this.attributes.map(invokeObjectToJSON)
175
183
  };
176
184
  }
177
185
 
@@ -196,7 +204,8 @@ export class AttributeGroupSpec {
196
204
  }
197
205
 
198
206
  /**
199
- *
207
+ * Size of a single element of all attributes.
208
+ * @example 2 attributes float32 and uin8 will produce result of 5 ( = (32 + 8) / 8 )
200
209
  * @returns {number}
201
210
  */
202
211
  getByteSize() {
@@ -1 +1 @@
1
- {"version":3,"file":"computeSkinnedMeshVertices.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/geometry/skining/computeSkinnedMeshVertices.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wDAJW,YAAY,0CAEZ,MAAM,QAqIhB"}
1
+ {"version":3,"file":"computeSkinnedMeshVertices.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/geometry/skining/computeSkinnedMeshVertices.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wDAJW,YAAY,0CAEZ,MAAM,QA6ChB"}