@woosh/meep-engine 2.48.22 → 2.49.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 (230) hide show
  1. package/editor/ecs/component/editors/three/BufferGeometryEditor.js +1 -1
  2. package/editor/ecs/component/editors/three/MeshEditor.js +1 -1
  3. package/editor/tools/GridPaintTool.js +1 -1
  4. package/editor/tools/SelectionTool.js +1 -1
  5. package/editor/tools/paint/TerrainPaintTool.js +1 -1
  6. package/editor/view/GridPickCoordinateView.js +1 -1
  7. package/editor/view/library/MeshLibraryView.js +1 -1
  8. package/package.json +1 -1
  9. package/src/core/UUID.js +2 -0
  10. package/src/core/assert.js +4 -1
  11. package/src/core/binary/32BitEncoder.js +1 -1
  12. package/src/core/binary/ctz32.js +1 -1
  13. package/src/core/binary/operations/bitCount.spec.js +19 -0
  14. package/src/core/binary/uint82float.spec.js +7 -0
  15. package/src/core/bvh2/LeafNode.js +2 -2
  16. package/src/core/bvh2/Node.d.ts +1 -1
  17. package/src/core/bvh2/Node.js +1 -1
  18. package/src/core/bvh2/NodeValidator.js +1 -1
  19. package/src/core/bvh2/bvh3/EBBVHLeafProxy.js +3 -0
  20. package/src/core/bvh2/bvh3/query/compute_tight_near_far_clipping_planes.js +5 -4
  21. package/src/core/bvh2/serialization/deserializeBinaryNode.js +1 -1
  22. package/src/core/bvh2/serialization/deserializeBinaryNodeFromBinaryBuffer.js +2 -2
  23. package/src/core/bvh2/serialization/serializeBinaryNode.js +1 -1
  24. package/src/core/bvh2/serialization/serializeBinaryNodeToBinaryBuffer.js +2 -2
  25. package/src/core/bvh2/transform/RotationOptimizer.spec.js +161 -155
  26. package/src/core/cache/Cache.js +4 -2
  27. package/src/core/codegen/LineBuilder.js +15 -3
  28. package/src/core/codegen/LineBuilder.spec.js +7 -0
  29. package/src/core/collection/HashMap.js +491 -236
  30. package/src/core/collection/HashMap.spec.js +110 -1
  31. package/src/core/collection/array/{typedArrayToDataType.js → typed/typedArrayToDataType.js} +1 -1
  32. package/src/core/collection/array/weightedRandomFromArray.spec.js +20 -0
  33. package/src/core/collection/heap/Uint32Heap.js +1 -0
  34. package/src/core/debug/matchers/AnyOf.js +1 -2
  35. package/src/core/events/signal/Signal.js +7 -5
  36. package/src/core/events/signal/SignalBinding.js +56 -54
  37. package/src/core/events/signal/SignalFlags.js +7 -0
  38. package/src/core/function/Functions.js +1 -1
  39. package/src/core/geom/{Rectangle.js → 2d/Rectangle.js} +5 -5
  40. package/src/core/geom/{AABB2.js → 2d/aabb/AABB2.js} +10 -78
  41. package/src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.js +19 -0
  42. package/src/core/geom/2d/aabb/aabb2_compute_overlap.js +42 -0
  43. package/src/core/geom/2d/aabb/aabb2_contains.js +23 -0
  44. package/src/core/geom/2d/aabb/aabb2_distance_sqr_to_point.js +25 -0
  45. package/src/core/geom/2d/aabb/aabb2_distance_to_point.js +17 -0
  46. package/src/core/geom/2d/aabb/aabb2_distance_to_point.spec.js +17 -0
  47. package/src/core/geom/2d/aabb/aabb2_overlap_exists.js +18 -0
  48. package/src/core/geom/2d/aabb/aabb2_signed_distance_sqr_to_point.js +45 -0
  49. package/src/core/geom/2d/aabb/aabb2_signed_distance_sqr_to_point.spec.js +40 -0
  50. package/src/core/geom/2d/aabb/aabb2_signed_distance_to_point.js +27 -0
  51. package/src/core/geom/2d/convex-hull/fixed_convex_hull_humus.js +4 -0
  52. package/src/core/geom/2d/quad-tree/PointQuadTree.js +3 -0
  53. package/src/core/geom/2d/quad-tree/QuadTreeDatum.js +1 -1
  54. package/src/core/geom/2d/quad-tree/QuadTreeNode.js +3 -3
  55. package/src/core/geom/2d/quad-tree/qt_collect_by_circle.js +6 -8
  56. package/src/core/geom/2d/quad-tree/qt_match_data_by_circle.js +3 -3
  57. package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.js +8 -10
  58. package/src/core/{bvh2/aabb3 → geom/3d/aabb}/AABB3.d.ts +1 -1
  59. package/src/core/{bvh2/aabb3 → geom/3d/aabb}/AABB3.js +13 -13
  60. package/src/core/{bvh2/aabb3 → geom/3d/aabb}/AABB3.spec.js +1 -1
  61. package/src/core/geom/3d/aabb/aabb3_compute_plane_side.js +17 -15
  62. package/src/core/geom/3d/aabb/aabb3_compute_plane_side.spec.js +25 -0
  63. package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.js +1 -1
  64. package/src/core/geom/3d/aabb/aabb3_from_v3_array.js +3 -0
  65. package/src/core/geom/3d/aabb/aabb3_from_v3_array.spec.js +32 -0
  66. package/src/core/geom/3d/aabb/aabb3_intersects_aabb3.spec.js +115 -0
  67. package/src/core/geom/3d/aabb/aabb3_raycast.js +6 -1
  68. package/src/core/geom/3d/aabb/aabb3_signed_distance_sqr_to_point.js +13 -9
  69. package/src/core/{bvh2/aabb3 → geom/3d/aabb}/serializeAABB3Encoded_v0.js +6 -6
  70. package/src/core/geom/3d/{CircleMath.js → compute_circle_bounding_box.js} +1 -1
  71. package/src/core/geom/3d/decompose_matrix_4_array.js +18 -19
  72. package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +1 -1
  73. package/src/{engine/graphics/ecs/mesh-v2 → core/geom/3d/matrix}/allocate_transform_m4.js +1 -1
  74. package/src/core/geom/3d/normal/hemioct/decode_hemioct_to_unit.js +26 -0
  75. package/src/core/geom/3d/normal/hemioct/encode_unit3_hemioct.js +0 -26
  76. package/src/core/geom/3d/normal/hemioct/unit_hemioct.spec.js +2 -1
  77. package/src/core/geom/3d/plane/computePlaneLineIntersection.js +51 -0
  78. package/src/core/geom/3d/plane/computePlanePlaneIntersection.js +77 -0
  79. package/src/core/geom/3d/plane/computePlaneRayIntersection.js +55 -0
  80. package/src/core/geom/3d/plane/plane3_computeLineSegmentIntersection.js +50 -0
  81. package/src/core/geom/3d/plane/planeRayIntersection.js +14 -0
  82. package/src/core/geom/3d/{tetrahedra/in_sphere_fast.js → sphere/in_sphere3d_fast.js} +1 -1
  83. package/src/core/geom/3d/{tetrahedra/in_sphere_robust.js → sphere/in_sphere3d_robust.js} +1 -1
  84. package/src/core/geom/3d/sphere/sphere_array_intersects_point.js +2 -2
  85. package/src/core/geom/3d/sphere/{sphereIntersectsPoint.js → sphere_intersects_point.js} +7 -4
  86. package/src/core/geom/3d/sphere/sphere_intersects_point.spec.js +134 -0
  87. package/src/core/geom/3d/sphere/sphere_intersects_ray.spec.js +49 -0
  88. package/src/core/geom/3d/sphere/sphere_radius_sqr_from_v3_array_transformed.js +11 -7
  89. package/src/core/geom/3d/tetrahedra/delaunay/{debug_validate_mesh.js → debug/debug_validate_mesh.js} +1 -1
  90. package/src/core/geom/3d/tetrahedra/delaunay/{push_boundary_with_validation.js → debug/push_boundary_with_validation.js} +1 -1
  91. package/src/core/geom/3d/tetrahedra/delaunay/{validate_cavity_boundary.js → debug/validate_cavity_boundary.js} +2 -2
  92. package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_compute_cavity.js +2 -2
  93. package/src/core/geom/3d/triangle/computeTriangleRayIntersection.js +0 -164
  94. package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentric.js +87 -0
  95. package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricEdge.js +81 -0
  96. package/src/core/geom/{GeometryMath.js → 3d/triangle/rayTriangleIntersection.js} +7 -3
  97. package/src/core/geom/ConicRay.js +160 -152
  98. package/src/core/geom/Matrix4.js +2 -0
  99. package/src/core/geom/Quaternion.js +19 -1
  100. package/src/core/geom/packing/max-rect/MaxRectangles.js +5 -215
  101. package/src/core/geom/packing/max-rect/cost/costByBestShortSide.js +11 -0
  102. package/src/core/geom/packing/max-rect/cost/costByRemainingArea.js +14 -0
  103. package/src/core/geom/packing/max-rect/cutArea.js +79 -0
  104. package/src/core/geom/packing/max-rect/findBestContainer.js +58 -0
  105. package/src/core/geom/packing/max-rect/packOneBox.js +49 -0
  106. package/src/core/geom/v3_dot.js +1 -1
  107. package/src/core/graph/GraphUtils.js +1 -1
  108. package/src/core/graph/build_face_graph_from_mesh.js +1 -3
  109. package/src/core/graph/layout/CircleLayout.js +3 -3
  110. package/src/core/graph/layout/{BoxLayouter.js → box/BoxLayouter.js} +6 -50
  111. package/src/core/graph/layout/box/applyCentralGravityAABB2.js +29 -0
  112. package/src/core/json/resolvePath.spec.js +14 -0
  113. package/src/core/land/reactive/{compiler/ReactiveCompiler.spec.js → compileReactiveExpression.spec.js} +17 -17
  114. package/src/core/math/random/MersenneTwister.spec.js +19 -0
  115. package/src/core/math/random/randomGaussian.spec.js +9 -0
  116. package/src/core/math/statistics/computeStatisticalMean.js +2 -2
  117. package/src/core/model/node-graph/visual/NodeVisualData.js +1 -1
  118. package/src/core/model/reactive/model/arithmetic/ReactiveAdd.js +1 -1
  119. package/src/core/model/reactive/model/arithmetic/ReactiveDivide.js +3 -1
  120. package/src/core/model/reactive/model/arithmetic/ReactiveMultiply.js +1 -1
  121. package/src/core/model/reactive/model/arithmetic/ReactiveNegate.js +3 -1
  122. package/src/core/model/reactive/model/arithmetic/ReactiveSubtract.js +1 -1
  123. package/src/core/model/reactive/model/comparative/ReactiveEquals.js +1 -1
  124. package/src/core/model/reactive/model/comparative/ReactiveGreaterThan.js +3 -1
  125. package/src/core/model/reactive/model/comparative/ReactiveGreaterThanOrEqual.js +3 -1
  126. package/src/core/model/reactive/model/comparative/ReactiveLessThan.js +3 -1
  127. package/src/core/model/reactive/model/comparative/ReactiveLessThanOrEqual.js +3 -1
  128. package/src/core/model/reactive/model/comparative/ReactiveNotEquals.js +1 -1
  129. package/src/core/model/reactive/model/logic/ReactiveAnd.js +1 -1
  130. package/src/core/model/reactive/model/logic/ReactiveNot.js +3 -1
  131. package/src/core/model/reactive/model/logic/ReactiveOr.js +1 -1
  132. package/src/core/primitives/numbers/computeHashFloat.spec.js +7 -0
  133. package/src/core/process/task/util/iteratorTask.js +3 -1
  134. package/src/engine/animation/curve/AnimationCurve.js +34 -5
  135. package/src/engine/animation/curve/AnimationCurve.spec.js +100 -0
  136. package/src/engine/asset/AssetTransformer.js +1 -0
  137. package/src/engine/asset/loaders/GLTFAssetLoader.js +1 -1
  138. package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +2 -2
  139. package/src/engine/asset/preloader/Preloader.js +3 -3
  140. package/src/engine/computeStridedIntegerArrayHash.js +4 -2
  141. package/src/engine/ecs/components/Renderable.d.ts +2 -2
  142. package/src/engine/ecs/components/Renderable.js +1 -1
  143. package/src/{ecs → engine/ecs}/grid/pick.js +4 -4
  144. package/src/engine/ecs/gui/position/ViewportPositionSystem.js +1 -1
  145. package/src/engine/ecs/parent/entity_node_compute_bounding_box.js +1 -1
  146. package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.js +1 -18
  147. package/src/engine/ecs/systems/MotionSystem.js +7 -1
  148. package/src/engine/ecs/systems/SynchronizePositionSystem.js +8 -2
  149. package/src/engine/ecs/terrain/tiles/TerrainTile.js +1 -1
  150. package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +2 -2
  151. package/src/engine/ecs/tooltip/TooltipComponentSystem.js +1 -1
  152. package/src/engine/ecs/transform/Transform.js +1 -1
  153. package/src/engine/graphics/camera/makeScreenScissorFrustum.d.ts +1 -1
  154. package/src/engine/graphics/camera/makeScreenScissorFrustum.js +3 -3
  155. package/src/engine/graphics/camera/testClippingPlaneComputation.js +13 -13
  156. package/src/engine/graphics/ecs/camera/Camera.js +1 -1
  157. package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
  158. package/src/engine/graphics/ecs/mesh/Mesh.d.ts +1 -1
  159. package/src/engine/graphics/ecs/mesh/Mesh.js +1 -1
  160. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.d.ts +1 -1
  161. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +1 -1
  162. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.d.ts +1 -1
  163. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.js +1 -1
  164. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.js +9 -0
  165. package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.d.ts +1 -1
  166. package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +1 -1
  167. package/src/engine/graphics/geometry/MikkT/STSpace.js +1 -1
  168. package/src/engine/graphics/geometry/bvh/buffered/BVHGeometryRaycaster.js +1 -1
  169. package/src/engine/graphics/geometry/skining/computeSkinnedMeshBoundingVolumes.js +1 -1
  170. package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +1 -1
  171. package/src/engine/graphics/particles/particular/engine/MovingBoundingBox.js +1 -1
  172. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +1 -1
  173. package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.js +1 -1
  174. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js +1 -0
  175. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +1 -1
  176. package/src/engine/graphics/postprocess/threejs/postprocessing/TexturePass.js +2 -2
  177. package/src/engine/graphics/render/forward_plus/debug/createScreenGrid.js +1 -1
  178. package/src/engine/graphics/render/view/CameraView.js +1 -1
  179. package/src/engine/graphics/sh3/path_tracer/GeometryBVHBatched.js +2 -2
  180. package/src/engine/graphics/texture/atlas/AtlasPatch.js +2 -2
  181. package/src/engine/graphics/texture/atlas/TextureAtlas.spec.js +2 -2
  182. package/src/engine/graphics/texture/sampler/Sampler2D.js +1 -1
  183. package/src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.js +1 -1
  184. package/src/engine/graphics/util/makeMeshPreviewScene.js +1 -1
  185. package/src/engine/graphics/util/renderObjectToSampler2D.js +1 -1
  186. package/src/engine/intelligence/behavior/Behavior.spec.js +15 -0
  187. package/src/engine/intelligence/mcts/MoveEdge.js +1 -1
  188. package/src/engine/reference/v1/ReferenceManager.js +3 -0
  189. package/src/engine/reference/v2/Reference.js +33 -37
  190. package/src/engine/sound/sopra/README.md +6 -0
  191. package/src/engine/ui/tiles2d/computeTileGridMove.js +3 -2
  192. package/src/engine/ui/tiles2d/computeTileGridMove.spec.js +1 -1
  193. package/src/generation/automata/CaveGeneratorCellularAutomata.js +10 -7
  194. package/src/generation/automata/CaveGeneratorCellularAutomata.spec.js +12 -0
  195. package/src/generation/automata/CellularAutomata.js +5 -4
  196. package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.js +25 -9
  197. package/src/generation/theme/AreaMask.js +1 -1
  198. package/src/view/View.js +1 -1
  199. package/src/view/elements/progress/RectangularPieProgressView.js +1 -1
  200. package/src/view/minimap/Minimap.js +1 -1
  201. package/src/view/minimap/dom/MinimapCameraView.js +1 -1
  202. package/src/view/minimap/gl/MinimapFogOfWar.js +1 -1
  203. package/src/view/tooltip/DomTooltipObserver.js +1 -1
  204. package/src/view/tooltip/TooltipManager.js +1 -1
  205. package/src/view/tooltip/TooltipView.js +1 -1
  206. package/src/view/util/DomSizeObserver.js +2 -2
  207. package/src/core/geom/2d/AABB2Math.js +0 -40
  208. package/src/core/geom/2d/AABB2Math.spec.js +0 -17
  209. package/src/core/geom/Plane.js +0 -250
  210. package/src/core/land/reactive/ReactiveLexer.js +0 -158
  211. package/src/core/land/reactive/ReactiveLexer.ts +0 -181
  212. package/src/core/land/reactive/ReactiveListener.ts +0 -323
  213. package/src/core/land/reactive/ReactiveParser.js +0 -1573
  214. package/src/core/land/reactive/ReactiveParser.ts +0 -1776
  215. package/src/core/land/reactive/ReactiveVisitor.js +0 -1
  216. package/src/core/land/reactive/ReactiveVisitor.ts +0 -218
  217. package/src/core/land/reactive/compiler/ReactiveCompiler.js +0 -350
  218. package/src/core/land/reactive/compiler/ReactiveNearlyCompiler.js +0 -166
  219. package/src/core/land/reactive/compiler/ReactiveParser.js +0 -34
  220. package/src/core/land/reactive/nearley/ReactiveNearley.js +0 -187
  221. /package/src/core/geom/{LineSegment2.js → 2d/LineSegment2.js} +0 -0
  222. /package/src/core/geom/{Rectangle.spec.js → 2d/Rectangle.spec.js} +0 -0
  223. /package/src/core/geom/{AABB2.d.ts → 2d/aabb/AABB2.d.ts} +0 -0
  224. /package/src/core/geom/{AABB2.spec.js → 2d/aabb/AABB2.spec.js} +0 -0
  225. /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/deserializeAABB3.js +0 -0
  226. /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/deserializeAABB3Encoded_v0.js +0 -0
  227. /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/deserializeAABB3Quantized16Uint.js +0 -0
  228. /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/serializeAABB3.js +0 -0
  229. /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/serializeAABB3Quantized16Uint.js +0 -0
  230. /package/src/{engine/graphics/ecs/mesh-v2 → core/geom/3d/vector}/allocate_v3.js +0 -0
@@ -2,6 +2,7 @@ import { inverseLerp } from "../../../core/math/inverseLerp.js";
2
2
  import { lerp } from "../../../core/math/lerp.js";
3
3
  import { invokeObjectToJSON } from "../../../core/model/object/invokeObjectToJSON.js";
4
4
  import { Keyframe } from "./Keyframe.js";
5
+ import { binarySearchHighIndex } from "../../../core/collection/array/binarySearchHighIndex.js";
5
6
 
6
7
  /**
7
8
  *
@@ -28,6 +29,16 @@ function evaluate(t, keyframe0, keyframe1) {
28
29
  return a * keyframe0.value + b * m0 + c * m1 + d * keyframe1.value;
29
30
  }
30
31
 
32
+ /**
33
+ *
34
+ * @param {number} time
35
+ * @param {Keyframe} keyframe
36
+ * @return {number}
37
+ */
38
+ function compareKeyframeToTime(time, keyframe) {
39
+ return time - keyframe.time;
40
+ }
41
+
31
42
  /**
32
43
  * Modelled on unity's AnimationCurve
33
44
  * @see https://github.com/nothke/ThreadableCurve/blob/master/ThreadableCurve.cs
@@ -46,8 +57,26 @@ export class AnimationCurve {
46
57
  * @param {Keyframe} key
47
58
  */
48
59
  add(key) {
49
- // TODO figure out the right place to insert the key
50
- this.keys.push(key);
60
+ const keys = this.keys;
61
+
62
+ const last_key_index = keys.length - 1;
63
+
64
+ if (
65
+ last_key_index < 0
66
+ || keys[last_key_index].time <= key.time
67
+ ) {
68
+
69
+ // inserted key goes at the end
70
+ keys.push(key);
71
+
72
+ } else {
73
+
74
+ // figure out the right place to insert the key
75
+ const i = binarySearchHighIndex(keys, key.time, compareKeyframeToTime, 0, last_key_index);
76
+
77
+ // insert key at the right place
78
+ keys.splice(i, 0, key);
79
+ }
51
80
  }
52
81
 
53
82
  /**
@@ -144,7 +173,7 @@ export class AnimationCurve {
144
173
  /**
145
174
  *
146
175
  * @param {number} index
147
- * @param {number} weight
176
+ * @param {number} weight value between 0 and 1
148
177
  */
149
178
  smoothTangents(index, weight) {
150
179
  const keys = this.keys;
@@ -173,10 +202,10 @@ export class AnimationCurve {
173
202
 
174
203
  }
175
204
 
176
- smoothAllTangents(){
205
+ smoothAllTangents() {
177
206
  const n = this.length;
178
207
  for (let i = 0; i < n; i++) {
179
- this.smoothTangents(i,0);
208
+ this.smoothTangents(i, 0);
180
209
  }
181
210
  }
182
211
 
@@ -0,0 +1,100 @@
1
+ import { AnimationCurve } from "./AnimationCurve.js";
2
+ import { Keyframe } from "./Keyframe.js";
3
+
4
+ test("constructor does not throw", () => {
5
+ expect(() => new AnimationCurve()).not.toThrow();
6
+ });
7
+
8
+ test("adding key increases length", () => {
9
+ const curve = new AnimationCurve();
10
+
11
+ curve.add(Keyframe.from(1, 7));
12
+
13
+ expect(curve.length).toBe(1);
14
+ });
15
+
16
+ test("removing non-existent key", () => {
17
+ const curve = new AnimationCurve();
18
+
19
+ expect(curve.remove(Keyframe.from(1, 7))).toBe(false);
20
+
21
+ expect(curve.length).toBe(0);
22
+
23
+ });
24
+
25
+ test("clear removes all keys", () => {
26
+
27
+ const curve = new AnimationCurve();
28
+
29
+ curve.add(Keyframe.from(0, 0));
30
+ curve.add(Keyframe.from(0, 0));
31
+
32
+ curve.clear();
33
+
34
+ expect(curve.length).toBe(0);
35
+ });
36
+
37
+ test("removing exising key", () => {
38
+ const curve = new AnimationCurve();
39
+
40
+ const key = Keyframe.from(1, 7);
41
+
42
+ curve.add(key);
43
+
44
+ expect(curve.remove(key)).toBe(true);
45
+
46
+ expect(curve.length).toBe(0);
47
+ });
48
+
49
+
50
+ test("sample linear curve with 2 points", () => {
51
+ const curve = new AnimationCurve();
52
+ curve.add(Keyframe.from(0, -3, 6, 6));
53
+ curve.add(Keyframe.from(1, 3, 6, 6));
54
+
55
+ expect(curve.evaluate(0)).toBeCloseTo(-3);
56
+ expect(curve.evaluate(1)).toBeCloseTo(3);
57
+ expect(curve.evaluate(0.5)).toBeCloseTo(0);
58
+ });
59
+
60
+ test("insert key out of order, should end up ordered", () => {
61
+
62
+ const curve = new AnimationCurve();
63
+
64
+ curve.add(Keyframe.from(0, 3));
65
+ curve.add(Keyframe.from(5, 7));
66
+
67
+ const out_of_order_key = Keyframe.from(1, 11);
68
+ curve.add(out_of_order_key);
69
+
70
+ expect(curve.keys[1]).toBe(out_of_order_key);
71
+
72
+ });
73
+
74
+ test("smooth tangents with a single keyframe does not throw", () => {
75
+ const curve = new AnimationCurve();
76
+
77
+ curve.add(Keyframe.from(0, 7));
78
+
79
+ expect(() => curve.smoothTangents(0, 1)).not.toThrow()
80
+ });
81
+
82
+ test("to/from JSON consistency", () => {
83
+
84
+ const curve = new AnimationCurve();
85
+
86
+ curve.add(Keyframe.from(3, -7, 13, -17));
87
+
88
+ const c2 = new AnimationCurve();
89
+
90
+ c2.fromJSON(curve.toJSON());
91
+
92
+ expect(c2.length).toBe(1);
93
+
94
+ const first_key = c2.keys[0];
95
+
96
+ expect(first_key.time).toBe(3);
97
+ expect(first_key.value).toBe(-7);
98
+ expect(first_key.inTangent).toBe(13);
99
+ expect(first_key.outTangent).toBe(-17);
100
+ });
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Applies a transformation to an asset. Such as performing mesh simplification for example.
3
3
  * Transformation is executed by the {@link AssetManager}
4
+ * Useful for modifying/extending post-processing done on various asset types
4
5
  * @template {Asset<T>} A
5
6
  * @template T
6
7
  */
@@ -2,7 +2,7 @@ import { Transform } from "../../ecs/transform/Transform.js";
2
2
  import { Asset } from "../Asset.js";
3
3
  import { prepareMaterial, prepareObject } from "../../graphics/three/ThreeFactory.js";
4
4
  import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
5
- import { AABB3 } from "../../../core/bvh2/aabb3/AABB3.js";
5
+ import { AABB3 } from "../../../core/geom/3d/aabb/AABB3.js";
6
6
  import { StaticMaterialCache } from "./material/StaticMaterialCache.js";
7
7
  import { DDSLoader } from "three/examples/jsm/loaders/DDSLoader.js";
8
8
  import { AnimationOptimizer } from "../../ecs/animation/AnimationOptimizer.js";
@@ -23,10 +23,10 @@ export class ImageRGBADataLoader extends AssetLoader {
23
23
  async link(assetManager, engine) {
24
24
 
25
25
  if (assetManager.getLoaderByType(ASSET_TYPE_ARRAY_BUFFER) === undefined) {
26
- assetManager.registerLoader(ASSET_TYPE_ARRAY_BUFFER, new ArrayBufferLoader());
26
+ await assetManager.registerLoader(ASSET_TYPE_ARRAY_BUFFER, new ArrayBufferLoader());
27
27
  }
28
28
 
29
- super.link(assetManager, engine);
29
+ await super.link(assetManager, engine);
30
30
  }
31
31
 
32
32
  /**
@@ -86,7 +86,7 @@ Preloader.prototype.add = function (uri, type, level, priority) {
86
86
  }
87
87
  assets[level].push(def);
88
88
  this.totalAssetCount++;
89
- this.on.added.dispatch(def, level);
89
+ this.on.added.send2(def, level);
90
90
  return this;
91
91
  };
92
92
 
@@ -108,7 +108,7 @@ Preloader.prototype.load = function (assetManager) {
108
108
  count: batch.length
109
109
  };
110
110
  });
111
- on.loadStart.dispatch(initEvent);
111
+ on.loadStart.send1(initEvent);
112
112
  const numAssets = this.totalAssetCount;
113
113
  let numAssetsLoaded = 0;
114
114
 
@@ -178,7 +178,7 @@ Preloader.prototype.load = function (assetManager) {
178
178
  // console.log("requesting load of level ",levelToLoad);
179
179
  loadBatch(levelToLoad);
180
180
  } else {
181
- on.completed.dispatch();
181
+ on.completed.send0();
182
182
  }
183
183
  }
184
184
 
@@ -1,12 +1,14 @@
1
1
  /**
2
- *
2
+ * Useful for computing hashes of large arrays, can pick a relevant stride and skip large chunks of memory while still capturing good amount of unique information from evenly-spaced areas of the array
3
3
  * @param {number[]|Uint32Array|Uint16Array|Uint8Array} array
4
4
  * @param {number} offset
5
5
  * @param {number} length
6
6
  * @param {number} stride
7
7
  * @return {number}
8
8
  */
9
- export function computeStridedIntegerArrayHash(array, offset, length, stride) {
9
+ export function computeStridedIntegerArrayHash(
10
+ array, offset, length, stride
11
+ ) {
10
12
  let result = length;
11
13
 
12
14
  for (let i = offset; i < length; i += stride) {
@@ -1,5 +1,5 @@
1
1
  import {Object3D} from "three";
2
- import {AABB3} from "../../../core/bvh2/aabb3/AABB3";
2
+ import {AABB3} from "../../../core/geom/3d/aabb/AABB3";
3
3
  import {LeafNode} from "../../../core/bvh2/LeafNode";
4
4
 
5
5
  export default class Renderable {
@@ -8,7 +8,7 @@ export default class Renderable {
8
8
  matrixAutoUpdate: boolean
9
9
  boundingBoxNeedsUpdate: boolean
10
10
 
11
- bvh: LeafNode
11
+ bvh: LeafNode<Object3D>
12
12
 
13
13
  constructor(object: Object3D)
14
14
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
  import { LeafNode } from "../../../core/bvh2/LeafNode.js";
7
- import { AABB3 } from "../../../core/bvh2/aabb3/AABB3.js";
7
+ import { AABB3 } from "../../../core/geom/3d/aabb/AABB3.js";
8
8
  import { Vector3 as ThreeVector3 } from "three";
9
9
  import { max2 } from "../../../core/math/max2.js";
10
10
  import { min2 } from "../../../core/math/min2.js";
@@ -1,7 +1,7 @@
1
- import { assert } from "../../core/assert.js";
2
- import Vector3 from "../../core/geom/Vector3.js";
3
- import { SurfacePoint3 } from "../../core/geom/3d/SurfacePoint3.js";
4
- import Vector2 from "../../core/geom/Vector2.js";
1
+ import { assert } from "../../../core/assert.js";
2
+ import Vector3 from "../../../core/geom/Vector3.js";
3
+ import { SurfacePoint3 } from "../../../core/geom/3d/SurfacePoint3.js";
4
+ import Vector2 from "../../../core/geom/Vector2.js";
5
5
 
6
6
  /**
7
7
  *
@@ -6,7 +6,7 @@ import ViewportPosition from './ViewportPosition.js';
6
6
  import GUIElement from "../GUIElement.js";
7
7
  import { assert } from "../../../../core/assert.js";
8
8
  import { SignalBinding } from "../../../../core/events/signal/SignalBinding.js";
9
- import AABB2 from "../../../../core/geom/AABB2.js";
9
+ import AABB2 from "../../../../core/geom/2d/aabb/AABB2.js";
10
10
  import { GUIElementEvent } from "../GUIElementEvent.js";
11
11
  import { EPSILON } from "../../../../core/math/EPSILON.js";
12
12
  import { ResourceAccessSpecification } from "../../../../core/model/ResourceAccessSpecification.js";
@@ -1,5 +1,5 @@
1
1
  import { ShadedGeometry } from "../../graphics/ecs/mesh-v2/ShadedGeometry.js";
2
- import { AABB3 } from "../../../core/bvh2/aabb3/AABB3.js";
2
+ import { AABB3 } from "../../../core/geom/3d/aabb/AABB3.js";
3
3
 
4
4
  const scratch_aabb3 = new AABB3();
5
5
 
@@ -3,14 +3,6 @@ import { BinaryCollectionHeaderCodec, BinaryCollectionHeaderLayout } from "./Bin
3
3
  import { HashMap } from "../../../../../core/collection/HashMap.js";
4
4
  import { returnEmptyArray } from "../../../../../core/function/Functions.js";
5
5
 
6
- /**
7
- *
8
- * @returns {Array}
9
- */
10
- function makeEmptyArray() {
11
- return [];
12
- }
13
-
14
6
  export class BinaryCollectionSerializer {
15
7
  constructor() {
16
8
 
@@ -70,16 +62,7 @@ export class BinaryCollectionSerializer {
70
62
  * @type {Map<any, number>}
71
63
  */
72
64
  this.dictionary = new HashMap({
73
- keyHashFunction(key) {
74
- return key.hash();
75
- },
76
- keyEqualityFunction(k0, k1) {
77
- if (k0 === k1) {
78
- return true;
79
- } else {
80
- return k0.equals(k1);
81
- }
82
- }
65
+ capacity: 1024, //pre-allocate larger size to avoid rehashing
83
66
  });
84
67
  }
85
68
 
@@ -17,7 +17,13 @@ class MotionSystem extends System {
17
17
 
18
18
  update(timeDelta) {
19
19
  const entityManager = this.entityManager;
20
- entityManager.traverseEntities([Motion, Transform], function (motion, transform) {
20
+ const ecd = entityManager.dataset;
21
+
22
+ if (ecd === null) {
23
+ return;
24
+ }
25
+
26
+ ecd.traverseEntities([Motion, Transform], function (motion, transform) {
21
27
  const positionDelta = motion.velocity.clone().multiplyScalar(timeDelta);
22
28
  transform.position.add(positionDelta);
23
29
  });
@@ -17,9 +17,15 @@ class SynchronizePositionSystem extends System {
17
17
 
18
18
  update(timeDelta) {
19
19
  const em = this.entityManager;
20
- em.traverseEntities([SynchronizePosition, Transform], function (sync, transform) {
20
+ const ecd = em.dataset;
21
+
22
+ if (ecd === null) {
23
+ return;
24
+ }
25
+
26
+ ecd.traverseEntities([SynchronizePosition, Transform], function (sync, transform) {
21
27
  const targetEntity = sync.targetEntity;
22
- const targetTransform = em.getComponent(targetEntity, Transform);
28
+ const targetTransform = ecd.getComponent(targetEntity, Transform);
23
29
  if (sync.x) {
24
30
  transform.position.x = targetTransform.position.x;
25
31
  }
@@ -24,7 +24,7 @@ import ObservedInteger from "../../../../core/model/ObservedInteger.js";
24
24
  import { SurfacePoint3 } from "../../../../core/geom/3d/SurfacePoint3.js";
25
25
  import Signal from "../../../../core/events/signal/Signal.js";
26
26
  import { mat4 } from "gl-matrix";
27
- import { AABB3 } from "../../../../core/bvh2/aabb3/AABB3.js";
27
+ import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
28
28
  import { NumericInterval } from "../../../../core/math/interval/NumericInterval.js";
29
29
  import { array_copy } from "../../../../core/collection/array/copyArray.js";
30
30
  import { passThrough } from "../../../../core/function/Functions.js";
@@ -19,12 +19,12 @@ import { SurfacePoint3 } from "../../../../core/geom/3d/SurfacePoint3.js";
19
19
  import { RaycastBVHVisitor } from "../../../../core/bvh2/traversal/RaycastBVHVisitor.js";
20
20
  import { FirstRayIntersectionTerrainBVHVisitor } from "./FirstRayIntersectionTerrainBVHVisitor.js";
21
21
  import { traverseBinaryNodeUsingVisitor } from "../../../../core/bvh2/traversal/traverseBinaryNodeUsingVisitor.js";
22
- import { aabb2_overlapExists } from "../../../../core/geom/AABB2.js";
23
22
  import ObservedInteger from "../../../../core/model/ObservedInteger.js";
24
23
  import { NumericInterval } from "../../../../core/math/interval/NumericInterval.js";
25
24
  import { randomFloatBetween } from "../../../../core/math/random/randomFloatBetween.js";
26
25
  import { mat4, vec3 } from "gl-matrix";
27
26
  import { isArrayEqualStrict } from "../../../../core/collection/array/isArrayEqualStrict.js";
27
+ import { aabb2_overlap_exists } from "../../../../core/geom/2d/aabb/aabb2_overlap_exists.js";
28
28
 
29
29
  class TerrainTileManager {
30
30
  /**
@@ -296,7 +296,7 @@ class TerrainTileManager {
296
296
  const tx1 = tx0 + tile.size.x;
297
297
  const ty1 = ty0 + tile.size.y;
298
298
  if (
299
- aabb2_overlapExists(
299
+ aabb2_overlap_exists(
300
300
  x0, y0, x1, y1,
301
301
  tx0, ty0, tx1, ty1
302
302
  )
@@ -4,7 +4,7 @@ import Vector3 from "../../../core/geom/Vector3.js";
4
4
  import { MeshSystem } from "../../graphics/ecs/mesh/MeshSystem.js";
5
5
  import { SurfacePoint3 } from "../../../core/geom/3d/SurfacePoint3.js";
6
6
  import { VisualTip } from "../../../view/tooltip/VisualTip.js";
7
- import Rectangle from "../../../core/geom/Rectangle.js";
7
+ import Rectangle from "../../../core/geom/2d/Rectangle.js";
8
8
  import { modelHitTest } from "../../graphics/util/modelHitTest.js";
9
9
  import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
10
10
  import { ResourceAccessKind } from "../../../core/model/ResourceAccessKind.js";
@@ -7,7 +7,7 @@ import Quaternion from "../../../core/geom/Quaternion.js";
7
7
  import { decompose_matrix_4_array } from "../../../core/geom/3d/decompose_matrix_4_array.js";
8
8
  import { compose_matrix4_array } from "../../../core/geom/3d/compose_matrix4_array.js";
9
9
  import { TransformFlags } from "./TransformFlags.js";
10
- import { allocate_transform_m4 } from "../../graphics/ecs/mesh-v2/allocate_transform_m4.js";
10
+ import { allocate_transform_m4 } from "../../../core/geom/3d/matrix/allocate_transform_m4.js";
11
11
  import { assert } from "../../../core/assert.js";
12
12
  import { m4_multiply } from "../../../core/geom/3d/matrix/m4_multiply.js";
13
13
  import { MATRIX_4_IDENTITY } from "../../../core/geom/3d/matrix/MATRIX_4_IDENTITY.js";
@@ -1,4 +1,4 @@
1
1
  import {Camera, Frustum} from "three";
2
- import AABB2 from "../../../core/geom/AABB2";
2
+ import AABB2 from "../../../core/geom/2d/aabb/AABB2";
3
3
 
4
4
  export function makeScreenScissorFrustum(frustum: Frustum, box: AABB2, camera: Camera)
@@ -14,11 +14,11 @@ const nearBR = new ThreeVector3();
14
14
 
15
15
  /**
16
16
  *
17
- * @param {Frustum} frustum
17
+ * @param {Frustum} output
18
18
  * @param {AABB2} box screen-space 2d box in NDC (-1,+1)
19
19
  * @param {THREE.Camera} camera
20
20
  */
21
- export function makeScreenScissorFrustum(frustum, box, camera) {
21
+ export function makeScreenScissorFrustum(output, box, camera) {
22
22
 
23
23
  camera.updateProjectionMatrix();
24
24
  camera.updateMatrixWorld();
@@ -46,7 +46,7 @@ export function makeScreenScissorFrustum(frustum, box, camera) {
46
46
  nearBR.unproject(camera);
47
47
 
48
48
  //create frustum planes
49
- const planes = frustum.planes;
49
+ const planes = output.planes;
50
50
 
51
51
  //set planes
52
52
  planes[0].setFromCoplanarPoints(nearTL, farTL, farTR);
@@ -39,7 +39,7 @@ import { FogOfWarRevealerSystem } from "../../ecs/fow/FogOfWarRevealerSystem.js"
39
39
  import { BehaviorSystem } from "../../intelligence/behavior/ecs/BehaviorSystem.js";
40
40
  import { SerializationMetadataSystem } from "../../ecs/systems/SerializationMetadataSystem.js";
41
41
  import { InverseKinematicsSystem } from "../../ecs/animation/InverseKinematicsSystem.js";
42
- import { PathDisplaySystem } from "../../../../model/engine/visual/path/PathDisplaySystem.js";
42
+ import { PathDisplaySystem } from "../ecs/path/PathDisplaySystem.js";
43
43
  import RenderSystem from "../../ecs/systems/RenderSystem.js";
44
44
  import { makeEngineOptionsModel } from "../../../../../model/game/options/makeEngineOptionsModel.js";
45
45
  import { enableEditor } from "../../../../editor/enableEditor.js";
@@ -79,7 +79,7 @@ function makeConfig(engine) {
79
79
  const guiSystem = new GUIElementSystem(engine.gui.view, engine);
80
80
  const headsUpDisplaySystem = new HeadsUpDisplaySystem(graphics);
81
81
 
82
- config.systems.push(
82
+ config.addManySystems(
83
83
  new ScriptSystem(),
84
84
  new FacingDirectionSystem(),
85
85
  new PathFollowingSystem(),
@@ -286,16 +286,16 @@ function makeCameraClippingDebug(engine) {
286
286
  const special_hits_1 = [];
287
287
  const special_hits_2 = [];
288
288
 
289
- ThreeClippingPlaneComputingBVHVisitor.DEBUG_POINTS_0.add((x, y, z) => {
290
- special_hits_0.push(new Vector3(x, y, z));
291
- });
292
-
293
- ThreeClippingPlaneComputingBVHVisitor.DEBUG_POINTS_1.add((x, y, z) => {
294
- special_hits_1.push(new Vector3(x, y, z));
295
- });
296
- ThreeClippingPlaneComputingBVHVisitor.DEBUG_POINTS_2.add((x, y, z) => {
297
- special_hits_2.push(new Vector3(x, y, z));
298
- });
289
+ // ThreeClippingPlaneComputingBVHVisitor.DEBUG_POINTS_0.add((x, y, z) => {
290
+ // special_hits_0.push(new Vector3(x, y, z));
291
+ // });
292
+ //
293
+ // ThreeClippingPlaneComputingBVHVisitor.DEBUG_POINTS_1.add((x, y, z) => {
294
+ // special_hits_1.push(new Vector3(x, y, z));
295
+ // });
296
+ // ThreeClippingPlaneComputingBVHVisitor.DEBUG_POINTS_2.add((x, y, z) => {
297
+ // special_hits_2.push(new Vector3(x, y, z));
298
+ // });
299
299
 
300
300
  const buffer = new RingBuffer(100);
301
301
 
@@ -381,7 +381,7 @@ function main(engine) {
381
381
  enableTerrain: true,
382
382
  terrainSize: new Vector2(100, 100),
383
383
  focus: new Vector3(102, 0, 61),
384
- pitch: -0.5,
384
+ pitch: 0.5,
385
385
  yaw: 2.2,
386
386
  distance: 3
387
387
  // pitch: -0.12,
@@ -14,7 +14,7 @@ import { frustum_from_camera } from "./frustum_from_camera.js";
14
14
  import { invertQuaternionOrientation } from "./InvertQuaternionOrientation.js";
15
15
  import { v3_distance_above_plane } from "../../../../core/geom/v3_distance_above_plane.js";
16
16
  import { ProjectionType } from "./ProjectionType.js";
17
- import { computePlaneRayIntersection } from "../../../../core/geom/Plane.js";
17
+ import { computePlaneRayIntersection } from "../../../../core/geom/3d/plane/computePlaneRayIntersection.js";
18
18
 
19
19
  /**
20
20
  * @class
@@ -13,7 +13,7 @@ import { CameraClippingPlaneComputer } from "../camera/CameraClippingPlaneComput
13
13
  import { assert } from "../../../../core/assert.js";
14
14
  import { ForwardPlusRenderingPlugin } from "../../render/forward_plus/plugin/ForwardPlusRenderingPlugin.js";
15
15
  import { ThreeLightCache } from "./three/ThreeLightCache.js";
16
- import { AABB3 } from "../../../../core/bvh2/aabb3/AABB3.js";
16
+ import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
17
17
  import { ShadowManager } from "./shadow/ShadowManager.js";
18
18
  import { AbstractContextSystem } from "../../../ecs/system/AbstractContextSystem.js";
19
19
  import { LightContext } from "./LightContext.js";
@@ -1,5 +1,5 @@
1
1
  import {Object3D} from "three";
2
- import {AABB3} from "../../../../core/bvh2/aabb3/AABB3";
2
+ import {AABB3} from "../../../../core/geom/3d/aabb/AABB3";
3
3
  import {LeafNode} from "../../../../core/bvh2/LeafNode";
4
4
 
5
5
  export default class Mesh {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Created by Alex Goldring on 25.02.2015.
3
3
  */
4
- import { AABB3 } from "../../../../core/bvh2/aabb3/AABB3.js";
4
+ import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
5
5
  import { LeafNode } from "../../../../core/bvh2/LeafNode.js";
6
6
  import { getSkeletonBoneByType } from "./SkeletonUtils.js";
7
7
  import { assert } from "../../../../core/assert.js";
@@ -1,5 +1,5 @@
1
1
  import {BufferGeometry, Material} from "three";
2
- import {AABB3} from "../../../../core/bvh2/aabb3/AABB3";
2
+ import {AABB3} from "../../../../core/geom/3d/aabb/AABB3";
3
3
  import {DrawMode} from "./DrawMode";
4
4
 
5
5
  export class ShadedGeometry {
@@ -1,4 +1,4 @@
1
- import { AABB3 } from "../../../../core/bvh2/aabb3/AABB3.js";
1
+ import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
2
2
  import { DrawMode } from "./DrawMode.js";
3
3
  import { ShadedGeometryFlags } from "./ShadedGeometryFlags.js";
4
4
  import { aabb3_matrix4_project } from "../../../../core/geom/3d/aabb/aabb3_matrix4_project.js";
@@ -1,4 +1,4 @@
1
- import {AABB3} from "../../../../../core/bvh2/aabb3/AABB3";
1
+ import {AABB3} from "../../../../../core/geom/3d/aabb/AABB3";
2
2
 
3
3
  export class SGMesh {
4
4
  url: string
@@ -1,5 +1,5 @@
1
1
  import { entity_node_compute_bounding_box } from "../../../../ecs/parent/entity_node_compute_bounding_box.js";
2
- import { AABB3 } from "../../../../../core/bvh2/aabb3/AABB3.js";
2
+ import { AABB3 } from "../../../../../core/geom/3d/aabb/AABB3.js";
3
3
 
4
4
  export const SGMeshFlags = {
5
5
  CastShadow: 1,
@@ -10,6 +10,9 @@ import { ParentEntity } from "../../../../ecs/parent/ParentEntity.js";
10
10
  import { EntityNode } from "../../../../ecs/parent/EntityNode.js";
11
11
  import { min2 } from "../../../../../core/math/min2.js";
12
12
  import { TransformAttachmentSystem } from "../../../../ecs/transform-attachment/TransformAttachmentSystem.js";
13
+ import { ResourceAccessSpecification } from "../../../../../core/model/ResourceAccessSpecification.js";
14
+ import { ResourceAccessKind } from "../../../../../core/model/ResourceAccessKind.js";
15
+ import { TransformAttachment } from "../../../../ecs/transform-attachment/TransformAttachment.js";
13
16
 
14
17
 
15
18
  /**
@@ -48,6 +51,12 @@ export class SGMeshSystem extends System {
48
51
  this.__assetManager = engine.assetManager;
49
52
 
50
53
  this.dependencies = [SGMesh, Transform];
54
+ this.components_used = [
55
+ ResourceAccessSpecification.from(SGMesh, ResourceAccessKind.Read | ResourceAccessKind.Write),
56
+ ResourceAccessSpecification.from(Transform, ResourceAccessKind.Read),
57
+ ResourceAccessSpecification.from(ShadedGeometry, ResourceAccessKind.Create),
58
+ ResourceAccessSpecification.from(TransformAttachment, ResourceAccessKind.Create),
59
+ ];
51
60
 
52
61
  /**
53
62
  *
@@ -1,4 +1,4 @@
1
- import {AABB3} from "../../../../core/bvh2/aabb3/AABB3";
1
+ import {AABB3} from "../../../../core/geom/3d/aabb/AABB3";
2
2
  import {EntityComponentDataset} from "../../../ecs/EntityComponentDataset";
3
3
 
4
4
  export function sg_hierarchy_compute_bounding_box_via_parent_entity(result: AABB3, root_entity: number, ecd: EntityComponentDataset): void
@@ -8,7 +8,7 @@ import { InitTriInfo } from "./InitTriInfo.js";
8
8
  import { GenerateTSpaces } from "./GenerateTSpaces.js";
9
9
  import { DegenEpilogue } from "./DegenEpilogue.js";
10
10
  import { Build4RuleGroups } from "./Build4RuleGroups.js";
11
- import { allocate_v3 } from "../../ecs/mesh-v2/allocate_v3.js";
11
+ import { allocate_v3 } from "../../../../core/geom/3d/vector/allocate_v3.js";
12
12
  import { m_getNumFaces } from "./m_getNumFaces.js";
13
13
  import { GenerateInitialVerticesIndexList } from "./GenerateInitialVerticesIndexList.js";
14
14
  import { DegenPrologue } from "./DegenPrologue.js";
@@ -1,5 +1,5 @@
1
1
  import { vec3 } from "gl-matrix";
2
- import { allocate_v3 } from "../../ecs/mesh-v2/allocate_v3.js";
2
+ import { allocate_v3 } from "../../../../core/geom/3d/vector/allocate_v3.js";
3
3
 
4
4
  export class STSpace {
5
5
  constructor() {