@woosh/meep-engine 2.33.20 → 2.33.24

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 (285) hide show
  1. package/core/assert.js +3 -1
  2. package/core/bvh2/BinaryNode.js +1 -1
  3. package/core/bvh2/aabb3/AABB3.js +18 -0
  4. package/core/bvh2/aabb3/AABB3Math.js +1 -1
  5. package/core/bvh2/binary/2/BinaryUint32BVH.js +498 -0
  6. package/core/bvh2/binary/2/BinaryUint32BVH.spec.js +54 -0
  7. package/core/bvh2/binary/IndexedBinaryBVH.js +22 -26
  8. package/core/bvh2/traversal/__detailed_box_volume_intersection.js +11 -8
  9. package/core/collection/ArrayUtils.js +1 -1
  10. package/core/collection/HashMap.js +66 -22
  11. package/core/collection/array/arrayQuickSort.js +9 -6
  12. package/core/collection/array/array_swap.js +22 -0
  13. package/core/collection/array/computeHashArray.js +22 -0
  14. package/core/collection/array/computeHashIntegerArray.js +15 -0
  15. package/core/collection/table/DataType2TypedArrayConstructorMapping.js +15 -0
  16. package/core/color/Color.js +2 -1
  17. package/core/function/FunctionCompiler.js +2 -1
  18. package/core/geom/3d/CircleMath.js +4 -4
  19. package/core/geom/3d/aabb/aabb3_computeDistanceAbovePlane.js +9 -33
  20. package/core/geom/3d/cone/computeConeBoundingBox.js +4 -4
  21. package/core/geom/3d/{compute_bounding_cone_of_2_cones.js → cone/compute_bounding_cone_of_2_cones.js} +3 -3
  22. package/core/geom/3d/{compute_bounding_cone_of_2_cones.spec.js → cone/compute_bounding_cone_of_2_cones.spec.js} +1 -1
  23. package/core/geom/3d/frustum/array_setFromProjectionMatrix.js +1 -1
  24. package/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +11 -3
  25. package/core/geom/3d/line/line3_computeSegmentPointDistance_sqr.js +41 -0
  26. package/core/geom/3d/morton/mortonEncode_magicbits.js +2 -1
  27. package/core/geom/3d/morton/reinterpret_float32_as_int32.js +13 -0
  28. package/core/geom/3d/morton/v3_morton_encode_transformed.js +33 -0
  29. package/core/geom/3d/{encode_unit3_hemioct.js → normal/hemioct/encode_unit3_hemioct.js} +0 -0
  30. package/core/geom/3d/{unit_hemioct.spec.js → normal/hemioct/unit_hemioct.spec.js} +1 -1
  31. package/core/geom/3d/normal/lamber_azimuth/transform.js +61 -0
  32. package/core/geom/3d/normal/spherical/sphere_map_transform.js +77 -0
  33. package/core/geom/3d/{lerp_planes_to_array.js → plane/lerp_planes_to_array.js} +1 -3
  34. package/core/geom/3d/plane/plane3_lerp.js +3 -1
  35. package/core/geom/3d/plane/plane3_slerp.js +4 -1
  36. package/core/geom/3d/{plane_computeConvex3PlaneIntersection.js → plane/plane_computeConvex3PlaneIntersection.js} +14 -16
  37. package/core/geom/3d/ray/ray_computeNearestPointToPoint.js +37 -0
  38. package/core/geom/3d/shape/AbstractShape3D.js +29 -0
  39. package/core/geom/3d/shape/CompositeShape.js +60 -0
  40. package/core/geom/3d/shape/TransformedShape3D.js +70 -0
  41. package/core/geom/3d/shape/UnitCubeShape3D.js +13 -0
  42. package/core/geom/3d/shape/UnitSphereShape3D.js +16 -0
  43. package/core/geom/3d/topology/TopoTriangle.js +1 -1
  44. package/core/geom/3d/topology/TopoVertex.js +1 -1
  45. package/core/geom/3d/topology/bounds/computeTraingleClusterNormalBoundingCone.js +2 -2
  46. package/core/geom/3d/topology/simplify/compute_face_normal_change_dot_product.js +1 -1
  47. package/core/geom/3d/topology/simplify/quadratic/Quadratic3.js +1 -1
  48. package/core/geom/3d/triangle/computeTrianglePlaneSide.js +1 -1
  49. package/core/geom/3d/triangle/computeTriangleRayIntersection.js +1 -1
  50. package/core/geom/3d/voxel/DenseBitVolume3D.js +87 -0
  51. package/core/geom/3d/voxel/buildVolumeFromProjectedGeometry.js +23 -0
  52. package/core/geom/AABB2.js +1 -1
  53. package/core/geom/ConicRay.js +3 -1
  54. package/core/geom/LineSegment.js +1 -77
  55. package/core/geom/Matrix4.js +8 -8
  56. package/core/geom/Plane.js +15 -10
  57. package/core/geom/Quaternion.js +2 -1
  58. package/core/geom/Rectangle.js +2 -1
  59. package/core/geom/Vector1.js +1 -1
  60. package/core/geom/Vector3.d.ts +2 -0
  61. package/core/geom/Vector3.js +35 -159
  62. package/core/geom/Vector3.spec.js +2 -1
  63. package/core/geom/Vector4.js +2 -1
  64. package/core/geom/random/randomPointInBox.js +7 -3
  65. package/core/geom/random/randomPointInPoint.js +6 -3
  66. package/core/geom/random/randomPointInSphere.js +6 -3
  67. package/core/geom/random/randomPointOnBox.js +7 -3
  68. package/core/geom/random/randomPointOnSphere.js +6 -3
  69. package/core/geom/v3_angle_between.js +31 -0
  70. package/core/geom/v3_distance.js +16 -0
  71. package/core/geom/v3_distance_sqr.js +17 -0
  72. package/core/geom/v3_dot.js +13 -0
  73. package/core/geom/v3_length.js +10 -0
  74. package/core/geom/v3_length_sqr.js +10 -0
  75. package/core/geom/v3_lerp.js +21 -0
  76. package/core/geom/v3_slerp.js +48 -0
  77. package/core/graph/graph_k_means_cluster.js +1 -1
  78. package/core/math/MathUtils.js +0 -354
  79. package/core/math/MathUtils.spec.js +7 -1
  80. package/core/math/gaussian.js +9 -0
  81. package/core/math/hash/computeHashFloat.js +17 -0
  82. package/core/math/hash/computeHashFloatArray.js +34 -0
  83. package/core/math/hash/computeObjectHash.js +54 -0
  84. package/core/math/intersects1D.js +19 -0
  85. package/core/math/interval/NumericInterval.js +2 -2
  86. package/core/math/isValueBetween.js +10 -0
  87. package/core/math/isValueBetweenInclusive.js +10 -0
  88. package/core/math/noise/curl_noise_3dt.js +1 -1
  89. package/core/math/noise/sdnoise.js +10 -10
  90. package/core/math/overlap1D.js +19 -0
  91. package/core/math/pingpong.js +17 -0
  92. package/core/math/random/makeRangedRandom.js +19 -0
  93. package/core/math/random/randomFloatBetween.js +14 -0
  94. package/core/math/random/randomFromArray.js +19 -0
  95. package/core/math/random/randomGaussian.js +15 -0
  96. package/core/math/random/randomIntegerBetween.js +14 -0
  97. package/core/math/random/roundFair.js +15 -0
  98. package/core/math/separation1D.js +21 -0
  99. package/core/math/solveQuadratic.js +25 -0
  100. package/core/model/BoundedValue.js +1 -1
  101. package/core/model/node-graph/node/NodeInstancePortReference.js +1 -1
  102. package/core/model/node-graph/node/Port.js +1 -1
  103. package/core/model/reactive/evaluation/MultiPredicateEvaluator.spec.js +3 -1
  104. package/core/model/reactive/model/ReactiveBinaryExpression.js +1 -1
  105. package/core/model/reactive/model/terminal/ReactiveLiteralNumber.js +1 -1
  106. package/core/model/reactive/model/terminal/ReactiveReference.js +1 -1
  107. package/core/model/reactive/model/util/createRandomReactiveExpression.js +1 -1
  108. package/core/model/stat/LinearModifier.js +1 -1
  109. package/core/primitives/array/computeIntegerArrayHash.js +6 -1
  110. package/engine/animation/curve/AnimationCurve.js +72 -0
  111. package/engine/animation/curve/Keyframe.js +27 -0
  112. package/engine/animation/keyed2/AnimationTrack.js +27 -3
  113. package/engine/asset/Asset.js +1 -1
  114. package/engine/asset/loaders/GLTFAssetLoader.d.ts +1 -1
  115. package/engine/asset/loaders/GLTFAssetLoader.js +10 -0
  116. package/engine/asset/loaders/image/ImageRGBADataAsset.js +8 -1
  117. package/engine/asset/loaders/material/computeImageBitmapEquality.js +11 -0
  118. package/engine/asset/loaders/material/computeImageBitmapHash.js +22 -28
  119. package/engine/asset/loaders/material/computeMaterialHash.js +4 -3
  120. package/engine/asset/loaders/material/computeTextureEquality.js +13 -5
  121. package/engine/asset/loaders/material/computeTextureHash.js +2 -1
  122. package/engine/ecs/animation/Animation.js +2 -1
  123. package/engine/ecs/animation/InverseKinematics.js +2 -1
  124. package/engine/ecs/animation/OneBoneSurfaceAlignmentSolver.js +3 -1
  125. package/engine/ecs/animation/TwoBoneInverseKinematicsSolver.js +3 -1
  126. package/engine/ecs/dynamic_actions/DynamicActorSystem.js +2 -1
  127. package/engine/ecs/dynamic_actions/DynamicRuleDescriptionTable.spec.js +3 -5
  128. package/engine/ecs/dynamic_actions/actions/definition/WeightedRandomActionDescription.js +1 -1
  129. package/engine/ecs/evaluation/complex/PointFitnessGaussianBlur.js +1 -1
  130. package/engine/ecs/foliage/ecs/Foliage2.js +1 -1
  131. package/engine/ecs/fow/FogOfWar.js +2 -3
  132. package/engine/ecs/fow/shader/FogOfWarRenderer.js +1 -1
  133. package/engine/ecs/gui/GUIElement.js +1 -1
  134. package/engine/ecs/gui/hud/HeadsUpDisplay.js +1 -1
  135. package/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +1 -1
  136. package/engine/ecs/gui/position/ViewportPosition.js +2 -1
  137. package/engine/ecs/systems/RangedAttackSystem.js +1 -1
  138. package/engine/ecs/systems/SteeringSystem.js +3 -2
  139. package/engine/ecs/terrain/ecs/Terrain.js +6 -0
  140. package/engine/ecs/terrain/ecs/layers/TerrainLayers.js +5 -0
  141. package/engine/ecs/terrain/ecs/splat/SplatMapping.js +5 -0
  142. package/engine/ecs/terrain/tiles/TerrainTileManager.js +1 -1
  143. package/engine/ecs/tooltip/TooltipComponent.js +15 -0
  144. package/engine/ecs/util/hideEntityGracefully.js +18 -0
  145. package/engine/graphics/GraphicsEngine.js +1 -0
  146. package/engine/graphics/camera/testClippingPlaneComputation.js +2 -2
  147. package/engine/graphics/ecs/animation/animator/AnimationClip.js +2 -1
  148. package/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +2 -1
  149. package/engine/graphics/ecs/animation/animator/AnimationNotification.js +2 -1
  150. package/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.js +2 -1
  151. package/engine/graphics/ecs/animation/animator/graph/AnimationGraph.js +2 -1
  152. package/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +2 -1
  153. package/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.js +1 -1
  154. package/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.js +2 -1
  155. package/engine/graphics/ecs/camera/CameraClippingPlaneComputer.js +2 -2
  156. package/engine/graphics/ecs/highlight/HighlightDefinition.js +2 -1
  157. package/engine/graphics/ecs/highlight/renderer/OutlineRenderer.js +0 -53
  158. package/engine/graphics/ecs/light/Light.d.ts +1 -1
  159. package/engine/graphics/ecs/light/Light.js +3 -0
  160. package/engine/graphics/ecs/mesh/Mesh.js +2 -1
  161. package/engine/graphics/ecs/mesh-v2/ShadedGeometry.d.ts +13 -0
  162. package/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts +6 -0
  163. package/engine/graphics/ecs/path/testPathDisplaySystem.js +98 -98
  164. package/engine/graphics/ecs/trail2d/Trail2D.js +17 -4
  165. package/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts +2 -3
  166. package/engine/graphics/ecs/trail2d/Trail2DSystem.js +34 -118
  167. package/engine/graphics/geometry/AttributeSpec.js +105 -0
  168. package/engine/graphics/{micron/format/MicronVertexDataSpec.js → geometry/VertexDataSpec.js} +56 -25
  169. package/engine/graphics/geometry/bvh/buffered/BVHGeometryRaycaster.js +2 -1
  170. package/engine/graphics/micron/build/buildMicronGeometryFromBufferGeometry.js +7 -7
  171. package/engine/graphics/micron/build/clustering/computeFaceCurvatureScore.js +1 -1
  172. package/engine/graphics/micron/build/clustering/compute_face_connection_weight.js +1 -1
  173. package/engine/graphics/micron/build/fill_patch_geometry_data.js +1 -1
  174. package/engine/graphics/micron/build/hierarchy/computePatchMergeScore.js +1 -1
  175. package/engine/graphics/micron/build/hierarchy/patch_combine.js +1 -1
  176. package/engine/graphics/micron/buildPatchwork.js +1 -1
  177. package/engine/graphics/micron/format/MicronGeometry.js +3 -3
  178. package/engine/graphics/micron/format/serialization/MicronGeometryBinarySerializationAdapter.js +2 -2
  179. package/engine/graphics/micron/format/serialization/deserialize_attribute_spec.js +1 -1
  180. package/engine/graphics/micron/format/serialization/serialize_attribute_spec.js +1 -1
  181. package/engine/graphics/micron/render/PatchCacheKey.js +1 -1
  182. package/engine/graphics/micron/render/instanced/AttributeDataTexture.js +5 -5
  183. package/engine/graphics/micron/render/refinement/is_patch_facing_back.js +2 -2
  184. package/engine/graphics/micron/render/v1/ThreeVirtualGeometryAdapter.js +1 -1
  185. package/engine/graphics/particles/particular/engine/ParticularEngine.js +4 -2
  186. package/engine/graphics/particles/particular/engine/emitter/PARTICULAR_PARTICLE_SPECIFICATION.js +84 -0
  187. package/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +92 -144
  188. package/engine/graphics/particles/particular/engine/emitter/ParticleLayer.js +14 -3
  189. package/engine/graphics/particles/particular/engine/emitter/ParticlePool.js +51 -12
  190. package/engine/graphics/particles/particular/engine/emitter/ParticlePool.spec.js +3 -2
  191. package/engine/graphics/particles/particular/engine/emitter/computeEmissionFunction.js +37 -0
  192. package/engine/graphics/particles/particular/engine/emitter/distance_to_camera.js +25 -0
  193. package/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.js +8 -2
  194. package/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js +2 -1
  195. package/engine/graphics/particles/particular/engine/parameter/ParameterTrack.js +1 -1
  196. package/engine/graphics/particles/particular/engine/parameter/ParticleParameter.js +1 -1
  197. package/engine/graphics/particles/particular/engine/renderers/billboard/BILLBOARD_PARTICLE_SPECIFICATION.js +21 -0
  198. package/engine/graphics/particles/particular/engine/renderers/billboard/ParticleBillboardMaterial.js +0 -20
  199. package/engine/graphics/particles/particular/engine/renderers/billboard/prototypeBillboardRenderer.js +9 -9
  200. package/engine/graphics/particles/particular/engine/shader/ShaderManager.js +7 -25
  201. package/engine/graphics/particles/particular/engine/simulator/SimulationStepApplyForce.js +2 -5
  202. package/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseAcceleration.js +2 -6
  203. package/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseVelocity.js +2 -7
  204. package/engine/graphics/particles/particular/engine/simulator/SimulationStepFixedPhysics.js +2 -5
  205. package/engine/graphics/particles/particular/engine/simulator/update_parameters.js +1 -1
  206. package/engine/graphics/particles/particular/engine/utils/distributeParticlesOnObject3D.js +1 -1
  207. package/engine/graphics/particles/particular/engine/utils/distrubuteParticlesOnMesh.js +1 -1
  208. package/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.js +384 -0
  209. package/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +558 -0
  210. package/engine/graphics/particles/particular/group/Operation.js +18 -0
  211. package/engine/graphics/particles/particular/group/OperationType.js +9 -0
  212. package/engine/graphics/particles/particular/group/ParticleAttribute.js +2 -1
  213. package/engine/graphics/particles/particular/group/ParticleAttributeType.js +11 -0
  214. package/engine/graphics/particles/particular/group/ParticleDataType.js +10 -0
  215. package/engine/graphics/particles/particular/group/ParticleGroup.js +7 -245
  216. package/engine/graphics/particles/particular/group/ParticleGroup.spec.js +3 -1
  217. package/engine/graphics/particles/particular/group/ParticleSpecification.js +21 -14
  218. package/engine/graphics/particles/particular/group/itemSizeFromAttributeType.js +20 -0
  219. package/engine/graphics/particles/particular/group/optimizeCommandQueue.js +162 -0
  220. package/engine/graphics/particles/particular/group/typedArrayConstructorFromDataType.js +19 -0
  221. package/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +2 -2
  222. package/engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js +1 -1
  223. package/engine/graphics/render/buffer/slot/parameter/ProgramValueSlotParameter.js +2 -1
  224. package/engine/graphics/render/buffer/slot/parameter/ProgramValueSlotParameterSet.js +1 -1
  225. package/engine/graphics/render/forward_plus/LightManager.js +126 -95
  226. package/engine/graphics/render/forward_plus/PointLight.js +9 -0
  227. package/engine/graphics/render/forward_plus/PointLightData.js +1 -1
  228. package/engine/graphics/render/forward_plus/SpotLight.js +9 -0
  229. package/engine/graphics/render/forward_plus/cluster/compute_light_data_hash_0.js +2 -2
  230. package/engine/graphics/render/forward_plus/computeFrustumCorners.js +15 -33
  231. package/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.js +1 -1
  232. package/engine/graphics/render/forward_plus/plugin/MaterialTransformer.js +12 -2
  233. package/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +6 -6
  234. package/engine/graphics/render/forward_plus/prototypeLightManager.js +231 -136
  235. package/engine/graphics/render/forward_plus/query/analytical_triplanar_corner_mapping.js +8 -0
  236. package/engine/graphics/render/forward_plus/query/cube_mapping.js +38 -0
  237. package/engine/graphics/render/forward_plus/query/detailed_sphere_frustum_intersection_test.js +86 -0
  238. package/engine/graphics/render/forward_plus/query/point_light_inside_volume.js +73 -0
  239. package/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_objects.js +131 -0
  240. package/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_texture.js +129 -0
  241. package/engine/graphics/render/forward_plus/query/spot_light_inside_volume.js +33 -0
  242. package/engine/graphics/render/forward_plus/read_frustum_corner.js +14 -0
  243. package/engine/graphics/render/forward_plus/testClusterEquality.js +22 -0
  244. package/engine/graphics/render/layers/RenderLayerUtils.js +8 -5
  245. package/engine/graphics/render/visibility/IncrementalDeltaSet.js +11 -0
  246. package/engine/graphics/render/visibility/hiz/prototypeHiZ.js +2 -2
  247. package/engine/graphics/texture/atlas/AtlasPatch.js +7 -2
  248. package/engine/graphics/texture/atlas/TextureAtlas.js +18 -14
  249. package/engine/graphics/texture/sampler/HarmonicDiffusionGrid.spec.js +1 -1
  250. package/engine/graphics/texture/sampler/SampleTraverser.js +1 -1
  251. package/engine/graphics/texture/sampler/Sampler2D.js +8 -7
  252. package/engine/graphics/texture/sampler/distanceField.spec.js +1 -1
  253. package/engine/graphics/texture/sampler/scaleSampler2D.js +7 -10
  254. package/engine/graphics/trail/x/RibbonMaterialX.js +3 -3
  255. package/engine/graphics/trail/x/RibbonX.js +17 -2
  256. package/engine/graphics/trail/x/RibbonXPlugin.js +51 -1
  257. package/engine/graphics/util/projectSphere.js +1 -1
  258. package/engine/grid/components/GridObstacle.js +3 -10
  259. package/engine/intelligence/behavior/selector/WeightedElement.js +2 -1
  260. package/engine/intelligence/optimization/RandomOptimizer.js +1 -1
  261. package/engine/navigation/ecs/components/Path.js +3 -2
  262. package/engine/navigation/grid/FastBinaryHeap.spec.js +1 -1
  263. package/engine/reference/v2/Reference.js +6 -0
  264. package/engine/sound/ecs/emitter/SoundEmitter.js +2 -1
  265. package/engine/sound/ecs/emitter/SoundTrack.js +2 -1
  266. package/engine/sound/material/concrete/RandomSoundMaterial.js +1 -1
  267. package/engine/ui/notification/notificationGenerator.js +1 -1
  268. package/generation/filtering/numeric/complex/CellFilterAngleToNormal.js +3 -2
  269. package/generation/filtering/numeric/complex/CellFilterGaussianBlur.js +1 -1
  270. package/generation/grid/generation/GridTaskExecuteRuleTimes.js +2 -1
  271. package/generation/markers/GridCellActionPlaceMarker.js +13 -1
  272. package/generation/markers/MarkerNode.js +6 -0
  273. package/generation/markers/actions/MarkerNodeActionSelectRandom.js +1 -1
  274. package/generation/markers/transform/MarkerNodeTransformerRecordUniqueRandomEnum.js +1 -1
  275. package/generation/placement/action/random/CellActionSelectRandom.js +1 -1
  276. package/generation/theme/ThemeEngine.js +5 -2
  277. package/misc/makeMaterialIconCached.js +2 -2
  278. package/package.json +3 -3
  279. package/view/View.js +4 -2
  280. package/view/elements/image/HTMLElementCacheKey.js +2 -1
  281. package/view/elements/radial/RadialText.js +2 -1
  282. package/view/minimap/gl/MinimapMarkersGL.js +19 -101
  283. package/view/minimap/gl/buildMaterial.js +94 -0
  284. package/engine/graphics/micron/format/MicronGeometryBufferAttributeSpec.js +0 -71
  285. package/engine/graphics/render/forward_plus/queryBVH_Frustum.js +0 -345
@@ -6,8 +6,13 @@ import { min2 } from "../../math/min2.js";
6
6
  import { IndexedBinaryBVHVisitor } from "./IndexedBinaryBVHVisitor.js";
7
7
  import { NodeType } from "./NodeType.js";
8
8
  import { RayLeafIntersectionVisitor } from "./RayLeafIntersectionVisitor.js";
9
+ import { array_copy } from "../../collection/array/copyArray.js";
9
10
 
10
11
 
12
+ /**
13
+ *
14
+ * @type {Float32Array|number[]}
15
+ */
11
16
  const scratch_aabb_0 = new Float32Array(6);
12
17
 
13
18
 
@@ -30,16 +35,16 @@ export default class IndexedBinaryBVH {
30
35
  this.binaryNodeCount = 0;
31
36
 
32
37
  /**
33
- *
38
+ * Total number of boxes contained in the tree, some might be unused
34
39
  * @type {number}
35
40
  */
36
41
  this.boxCount = 0;
37
42
 
38
43
  /**
39
44
  *
40
- * @type {null|Float32Array}
45
+ * @type {Float32Array|number[]}
41
46
  */
42
- this.data = null;
47
+ this.data = new Float32Array(16);
43
48
  }
44
49
 
45
50
  /**
@@ -59,7 +64,14 @@ export default class IndexedBinaryBVH {
59
64
 
60
65
  this.boxCount = this.leafNodeCount + this.binaryNodeCount;
61
66
 
62
- this.data = new Float32Array(this.boxCount * 6);
67
+ // possibly resize the storage
68
+ const storage_size = this.boxCount * 6;
69
+
70
+ if (this.data.length < storage_size) {
71
+ this.data = new Float32Array(storage_size);
72
+ } else {
73
+ this.data.fill(0);
74
+ }
63
75
  }
64
76
 
65
77
  unsortedBuiltIntermediate() {
@@ -117,7 +129,7 @@ export default class IndexedBinaryBVH {
117
129
  }
118
130
 
119
131
  //set bounds of the bvh
120
- copy_box_array(0, data, scratch_aabb_0, 0);
132
+ array_copy(data, 0, scratch_aabb_0, 0, 6);
121
133
 
122
134
  this.x0 = scratch_aabb_0[0];
123
135
  this.y0 = scratch_aabb_0[1];
@@ -238,7 +250,7 @@ export default class IndexedBinaryBVH {
238
250
  }
239
251
 
240
252
  /**
241
- *
253
+ * @deprecated use a visitor object instead
242
254
  * @param {number} startX
243
255
  * @param {number} startY
244
256
  * @param {number} startZ
@@ -265,22 +277,6 @@ export default class IndexedBinaryBVH {
265
277
  }
266
278
  }
267
279
 
268
- /**
269
- *
270
- * @param {number} source_offset
271
- * @param {number[]|Float32Array} source
272
- * @param {number[]|Float32Array} destination
273
- * @param {number} destination_offset
274
- */
275
- function copy_box_array(source_offset, source, destination, destination_offset) {
276
- destination[destination_offset] = source[source_offset];
277
- destination[destination_offset + 1] = source[source_offset + 1];
278
- destination[destination_offset + 2] = source[source_offset + 2];
279
- destination[destination_offset + 3] = source[source_offset + 3];
280
- destination[destination_offset + 4] = source[source_offset + 4];
281
- destination[destination_offset + 5] = source[source_offset + 5];
282
- }
283
-
284
280
  /**
285
281
  *
286
282
  * @param {number[]|Float32Array} source
@@ -348,23 +344,23 @@ function writeBox(array, address, x0, y0, z0, x1, y1, z1) {
348
344
  * @param {Float32Array} array
349
345
  */
350
346
  function copyBox(from, to, array) {
351
- copy_box_array(from, array, array, to);
347
+ array_copy(data, from, scratch_aabb_0, to, 6);
352
348
  }
353
349
 
354
350
  /**
355
351
  *
356
352
  * @param {number} from
357
353
  * @param {number} to
358
- * @param {Float32Array} array
354
+ * @param {Float32Array|number[]} array
359
355
  */
360
356
  function copyBoxZeroSize(from, to, array) {
361
- copy_box_array(from, array, scratch_aabb_0, 0);
357
+ array_copy(array, from, scratch_aabb_0, 0, 3);
362
358
 
363
359
  scratch_aabb_0[3] = scratch_aabb_0[0];
364
360
  scratch_aabb_0[4] = scratch_aabb_0[1];
365
361
  scratch_aabb_0[5] = scratch_aabb_0[2];
366
362
 
367
- copy_box_array(0, scratch_aabb_0, array, to);
363
+ array_copy(scratch_aabb_0, 0, array, to, 6);
368
364
  }
369
365
 
370
366
  /**
@@ -4,9 +4,8 @@ import { computePointDistanceToPlane, plane3_computeLineSegmentIntersection } fr
4
4
  import { aabb3_corner_edge_mapping } from "../aabb3/aabb3_corner_edge_mapping.js";
5
5
  import { aabb3_edge_corner_mapping } from "../aabb3/aabb3_edge_corner_mapping.js";
6
6
  import { __process_point_if_within_planes } from "./__process_point_if_within_planes.js";
7
- import { plane_computeConvex3PlaneIntersection } from "../../geom/3d/plane_computeConvex3PlaneIntersection.js";
7
+ import { plane_computeConvex3PlaneIntersection } from "../../geom/3d/plane/plane_computeConvex3PlaneIntersection.js";
8
8
  import { EPSILON } from "../../math/MathUtils.js";
9
- import Vector3 from "../../geom/Vector3.js";
10
9
 
11
10
  /**
12
11
  *
@@ -26,7 +25,11 @@ const scratch_aabb_planes = new Float32Array(24);
26
25
  */
27
26
  const scratch_corner_out_bitfields = new Uint32Array(8);
28
27
 
29
- const scratch_v3 = new Vector3();
28
+ /**
29
+ *
30
+ * @type {number[]}
31
+ */
32
+ const scratch_v3_array = new Float32Array(3);
30
33
 
31
34
  /**
32
35
  *
@@ -183,7 +186,7 @@ export function __detailed_box_volume_intersection(
183
186
  const c = planes[plane_address + 3];
184
187
 
185
188
  const edge_intersects = plane3_computeLineSegmentIntersection(
186
- scratch_v3,
189
+ scratch_v3_array, 0,
187
190
  corner_0_x, corner_0_y, corner_0_z,
188
191
  corner_1_x, corner_1_y, corner_1_z,
189
192
  nx, ny, nz, c
@@ -192,7 +195,7 @@ export function __detailed_box_volume_intersection(
192
195
  if (edge_intersects) {
193
196
  // a possible candidate, let's see if this point is within rest of the planes
194
197
  __process_point_if_within_planes(
195
- scratch_v3.x, scratch_v3.y, scratch_v3.z,
198
+ scratch_v3_array[0], scratch_v3_array[1], scratch_v3_array[2],
196
199
  (plane_mask ^ plane_bit_mask),
197
200
  planes,
198
201
  plane_count,
@@ -230,7 +233,7 @@ export function __detailed_box_volume_intersection(
230
233
  const cp_1 = next_orthogonal_plane_index * 4;
231
234
 
232
235
  const intersection_exists = plane_computeConvex3PlaneIntersection(
233
- scratch_v3,
236
+ scratch_v3_array, 0,
234
237
  aabb_plane_nx, aabb_plane_ny, aabb_plane_nz, aabb_plane_constant,
235
238
  planes[cp_0], planes[cp_0 + 1], planes[cp_0 + 2], planes[cp_0 + 3],
236
239
  planes[cp_1], planes[cp_1 + 1], planes[cp_1 + 2], planes[cp_1 + 3]
@@ -238,14 +241,14 @@ export function __detailed_box_volume_intersection(
238
241
 
239
242
  if (intersection_exists) {
240
243
 
241
- const point_within_box = box.containsPointWithTolerance(scratch_v3.x, scratch_v3.y, scratch_v3.z, EPSILON);
244
+ const point_within_box = box.containsPointWithTolerance(scratch_v3_array[0], scratch_v3_array[1], scratch_v3_array[2], EPSILON);
242
245
 
243
246
  if (point_within_box) {
244
247
  // point is within the AABB bounds
245
248
 
246
249
  // ThreeClippingPlaneComputingBVHVisitor.DEBUG_POINTS_2.send3(scratch_v3.x, scratch_v3.y, scratch_v3.z);
247
250
 
248
- callback.call(thisArg, scratch_v3.x, scratch_v3.y, scratch_v3.z);
251
+ callback.call(thisArg, scratch_v3_array[0], scratch_v3_array[1], scratch_v3_array[2]);
249
252
  }
250
253
  }
251
254
  }
@@ -6,9 +6,9 @@
6
6
  */
7
7
  import { assert } from "../assert.js";
8
8
  import { returnZero } from "../function/Functions.js";
9
- import { randomIntegerBetween } from "../math/MathUtils.js";
10
9
  import { min2 } from "../math/min2.js";
11
10
  import { HashMap } from "./HashMap.js";
11
+ import { randomIntegerBetween } from "../math/random/randomIntegerBetween.js";
12
12
 
13
13
 
14
14
  /**
@@ -26,6 +26,18 @@ class MapEntry {
26
26
  }
27
27
  }
28
28
 
29
+ /**
30
+ * @readonly
31
+ * @type {number}
32
+ */
33
+ const DEFAULT_INITIAL_CAPACITY = 16;
34
+
35
+ /**
36
+ * @readonly
37
+ * @type {number}
38
+ */
39
+ const DEFAULT_LOAD_FACTOR = 0.75;
40
+
29
41
  /**
30
42
  * Implements part of {@link Map} interface
31
43
  * @template K,V
@@ -36,10 +48,14 @@ export class HashMap {
36
48
  * @template K, V
37
49
  * @param {function(K):number} [keyHashFunction]
38
50
  * @param {function(K,K):boolean} [keyEqualityFunction]
51
+ * @param {number} [capacity] initial number of buckets in the hash table
52
+ * @param {number} [loadFactor] a measure of how full the hash table is allowed to get before its capacity is automatically increased
39
53
  */
40
54
  constructor({
41
55
  keyHashFunction = invokeObjectHash,
42
- keyEqualityFunction = invokeObjectEquals
56
+ keyEqualityFunction = invokeObjectEquals,
57
+ capacity = DEFAULT_INITIAL_CAPACITY,
58
+ loadFactor = DEFAULT_LOAD_FACTOR
43
59
  } = {}) {
44
60
  assert.typeOf(keyHashFunction, 'function', 'keyHashFunction');
45
61
  assert.typeOf(keyEqualityFunction, 'function', 'keyEqualityFunction');
@@ -69,14 +85,21 @@ export class HashMap {
69
85
  * @type {number}
70
86
  * @private
71
87
  */
72
- this.__bucket_count = 16384;
88
+ this.__bucket_count = capacity;
89
+
90
+ /**
91
+ * How full the table can get before number of buckets is increased
92
+ * @type {number}
93
+ * @private
94
+ */
95
+ this.__load_factor = loadFactor;
73
96
  }
74
97
 
75
98
  /**
76
99
  * Proportion between actual number of records in the map and the bucket count (number of potential hashes)
77
100
  * @returns {number}
78
101
  */
79
- getLoadFactor() {
102
+ getCurrentLoad() {
80
103
  return this.size / this.__bucket_count;
81
104
  }
82
105
 
@@ -133,7 +156,7 @@ export class HashMap {
133
156
  this.__bucket_count = count;
134
157
  if (this.size > 0) {
135
158
  // re-hash
136
- this.updateHashes();
159
+ this.rebuild();
137
160
  }
138
161
  }
139
162
 
@@ -167,31 +190,49 @@ export class HashMap {
167
190
  let bucket = this.records[bucket_index];
168
191
 
169
192
  if (bucket === undefined) {
170
- bucket = [new MapEntry(key, value)];
193
+
194
+ // bucket for this value doesn't exist
195
+
196
+ bucket = [];
197
+
171
198
  this.records[bucket_index] = bucket;
172
199
 
173
- this.size++;
200
+ } else {
174
201
 
175
- return;
176
- }
202
+ // bucket exists
177
203
 
178
- const bucketSize = bucket.length;
204
+ const bucketSize = bucket.length;
179
205
 
180
- //check if key already exists
181
- for (let i = 0; i < bucketSize; i++) {
182
- const entry = bucket[i];
206
+ //check if key already exists
207
+ for (let i = 0; i < bucketSize; i++) {
208
+ const entry = bucket[i];
183
209
 
184
- const entryKey = entry.key;
185
- if (entryKey === key || this.keyEqualityFunction(entryKey, key)) {
210
+ const entryKey = entry.key;
186
211
 
187
- entry.value = value;
188
- return;
212
+ if (entryKey === key || this.keyEqualityFunction(entryKey, key)) {
213
+
214
+ entry.value = value;
215
+ return;
216
+
217
+ }
189
218
 
190
219
  }
220
+
191
221
  }
192
222
 
193
223
  bucket.push(new MapEntry(key, value));
194
- this.size++;
224
+
225
+ const old_size = this.size;
226
+ const new_size = old_size + 1;
227
+ this.size = new_size;
228
+
229
+ // compute actual current load
230
+ const load = new_size / this.__bucket_count;
231
+
232
+ if (load > this.__load_factor) {
233
+ // increase table size
234
+ this.setBucketCount(this.__bucket_count * 2);
235
+ }
195
236
  }
196
237
 
197
238
  /**
@@ -308,20 +349,22 @@ export class HashMap {
308
349
  }
309
350
 
310
351
  /**
311
- *
352
+ * Rebuild table, useful for when table is resized or hashes of stored keys change
312
353
  */
313
- updateHashes() {
354
+ rebuild() {
314
355
 
315
356
  let h, i, l;
316
357
 
317
358
  const records = this.records;
318
359
 
319
360
  for (h in records) {
361
+ const stored_bucket_index = parseInt(h);
362
+
320
363
  if (!records.hasOwnProperty(h)) {
321
364
  continue;
322
365
  }
323
366
 
324
- const bucket = records[h];
367
+ const bucket = records[stored_bucket_index];
325
368
 
326
369
  for (i = 0, l = bucket.length; i < l; i++) {
327
370
  /**
@@ -333,7 +376,6 @@ export class HashMap {
333
376
  const raw_hash = this.keyHashFunction(entry.key);
334
377
  const actual_bucket_index = this.__compute_bucket_index(raw_hash);
335
378
 
336
- const stored_bucket_index = parseInt(h);
337
379
 
338
380
  if (actual_bucket_index !== stored_bucket_index) {
339
381
  //remove entry from the bucket
@@ -345,15 +387,17 @@ export class HashMap {
345
387
 
346
388
  if (bucket.length === 0) {
347
389
  //delete empty bucket
348
- delete records[h];
390
+ delete records[stored_bucket_index];
349
391
  }
350
392
 
351
393
  const newBucket = records[actual_bucket_index];
394
+
352
395
  if (newBucket === undefined) {
353
396
  records[actual_bucket_index] = [entry];
354
397
  } else {
355
398
  newBucket.push(entry);
356
399
  }
400
+
357
401
  }
358
402
  }
359
403
  }
@@ -5,11 +5,14 @@ const stack = [];
5
5
  /**
6
6
  * @template T
7
7
  * @param {T[]} data
8
- * @param {function(T):number} keyExtractor
8
+ * @param {function(T):number} score_function
9
+ * @param {*} score_function_context
9
10
  * @param {number} start
10
11
  * @param {number} end
12
+ * @param {function(T[],number, number):*} [swap_operator]
13
+ * @param {*} [swap_context]
11
14
  */
12
- export function arrayQuickSort(data, keyExtractor, start, end) {
15
+ export function arrayQuickSort(data, score_function, score_function_context, start, end, swap_operator = arraySwapElements, swap_context = undefined) {
13
16
  if (start >= end) {
14
17
  // section of 0 size, nothing to sort
15
18
  return;
@@ -32,15 +35,15 @@ export function arrayQuickSort(data, keyExtractor, start, end) {
32
35
 
33
36
  const pivotIndex = (left + right) >> 1;
34
37
 
35
- const pivot = keyExtractor(data[pivotIndex]);
38
+ const pivot = score_function.call(score_function_context,data[pivotIndex]);
36
39
 
37
40
  /* partition */
38
41
  while (i <= j) {
39
- while (keyExtractor(data[i]) < pivot) {
42
+ while (score_function.call(score_function_context,data[i]) < pivot) {
40
43
  i++;
41
44
  }
42
45
 
43
- while (keyExtractor(data[j]) > pivot) {
46
+ while (score_function.call(score_function_context,data[j]) > pivot) {
44
47
  j--;
45
48
  }
46
49
 
@@ -48,7 +51,7 @@ export function arrayQuickSort(data, keyExtractor, start, end) {
48
51
 
49
52
  if (i !== j) {
50
53
  //do swap
51
- arraySwapElements(data, i, j);
54
+ swap_operator.call(swap_context, data, i, j);
52
55
  }
53
56
 
54
57
  i++;
@@ -0,0 +1,22 @@
1
+ /**
2
+ *
3
+ * @param {T[]|ArrayLike<T>|TypedArray|Uint8ClampedArray|Uint8Array} a
4
+ * @param {number} a_offset
5
+ * @param {T[]|ArrayLike<T>|TypedArray|Uint8ClampedArray|Uint8Array} b
6
+ * @param {number} b_offset
7
+ * @param {number} length How many elements should be moved
8
+ */
9
+ export function array_swap(a, a_offset, b, b_offset, length) {
10
+
11
+ let i, j, k;
12
+
13
+ for (k = 0; k < length; k++) {
14
+ i = a_offset + k;
15
+ j = b_offset + k;
16
+
17
+ const t = b[j];
18
+
19
+ b[j] = a[i];
20
+ a[i] = t;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @template T
3
+ * @param {T[]} array
4
+ * @param {function(T):number} elementHashFunction
5
+ */
6
+ export function computeHashArray(array, elementHashFunction) {
7
+
8
+ const numArguments = array.length;
9
+ let hash = numArguments;
10
+
11
+ for (let i = 0; i < numArguments; i++) {
12
+
13
+ const singleValue = array[i];
14
+
15
+ const elementHash = elementHashFunction(singleValue);
16
+
17
+ hash = ((hash << 5) - hash) + elementHash;
18
+ hash |= 0; // Convert to 32bit integer
19
+ }
20
+
21
+ return hash;
22
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Computes hash on integer values
3
+ * @param {...number} value
4
+ * @returns {number}
5
+ */
6
+ export function computeHashIntegerArray(value) {
7
+ let hash = 0;
8
+ const numArguments = arguments.length;
9
+ for (let i = 0; i < numArguments; i++) {
10
+ const singleValue = arguments[i];
11
+ hash = ((hash << 5) - hash) + singleValue;
12
+ hash |= 0; // Convert to 32bit integer
13
+ }
14
+ return hash;
15
+ }
@@ -16,4 +16,19 @@ export const DataType2TypedArrayConstructorMapping = {
16
16
  [DataType.Float16]: Uint16Array,
17
17
  [DataType.Float32]: Float32Array,
18
18
  [DataType.Float64]: Float64Array,
19
+ };
20
+
21
+ /**
22
+ *
23
+ * @param {DataType} dt
24
+ * @returns {constructor|function}
25
+ */
26
+ export function compute_typed_array_constructor_from_data_type(dt) {
27
+ const r = DataType2TypedArrayConstructorMapping[dt];
28
+
29
+ if (r === undefined) {
30
+ throw new Error(`Unsupported data type '${dt}'`);
31
+ }
32
+
33
+ return r;
19
34
  }
@@ -1,11 +1,12 @@
1
1
  import { assert } from "../assert.js";
2
2
  import Signal from "../events/signal/Signal.js";
3
- import { computeHashFloat, computeHashIntegerArray } from "../math/MathUtils.js";
4
3
  import { parseColor, rgb2hsv } from "./ColorUtils.js";
5
4
  import { clamp } from "../math/clamp.js";
6
5
  import { min2 } from "../math/min2.js";
7
6
  import { max2 } from "../math/max2.js";
8
7
  import { min3 } from "../math/min3.js";
8
+ import { computeHashIntegerArray } from "../collection/array/computeHashIntegerArray.js";
9
+ import { computeHashFloat } from "../math/hash/computeHashFloat.js";
9
10
 
10
11
  class Color {
11
12
  /**
@@ -1,11 +1,12 @@
1
1
  import { assert } from "../assert.js";
2
2
  import { Cache } from "../cache/Cache.js";
3
3
  import { isArrayEqualStrict } from "../collection/array/isArrayEqualStrict.js";
4
- import { computeHashArray, computeHashIntegerArray } from "../math/MathUtils.js";
5
4
  import { invokeObjectEquals } from "../model/object/invokeObjectEquals.js";
6
5
  import { invokeObjectHash } from "../model/object/invokeObjectHash.js";
7
6
  import { computeStringHash } from "../primitives/strings/computeStringHash.js";
8
7
  import { computeUTF8StringByteSize } from "../primitives/strings/StringUtils.js";
8
+ import { computeHashArray } from "../collection/array/computeHashArray.js";
9
+ import { computeHashIntegerArray } from "../collection/array/computeHashIntegerArray.js";
9
10
 
10
11
  /**
11
12
  * Hash is an integer value, so this is an invalid value for a computed hash
@@ -1,4 +1,4 @@
1
- import { v3_angleBetween } from "../Vector3.js";
1
+ import { v3_angle_between } from "../v3_angle_between.js";
2
2
 
3
3
  /**
4
4
  * NOTE: based on https://stackoverflow.com/questions/2592011/bounding-boxes-for-circle-and-arcs-in-3d
@@ -12,9 +12,9 @@ import { v3_angleBetween } from "../Vector3.js";
12
12
  * @param {number} radius
13
13
  */
14
14
  export function computeCircleBoundingBox(result, centerX, centerY, centerZ, normalX, normalY, normalZ, radius) {
15
- const ax = v3_angleBetween(normalX, normalY, normalZ, 1, 0, 0);
16
- const ay = v3_angleBetween(normalX, normalY, normalZ, 0, 1, 0);
17
- const az = v3_angleBetween(normalX, normalY, normalZ, 0, 0, 1);
15
+ const ax = v3_angle_between(normalX, normalY, normalZ, 1, 0, 0);
16
+ const ay = v3_angle_between(normalX, normalY, normalZ, 0, 1, 0);
17
+ const az = v3_angle_between(normalX, normalY, normalZ, 0, 0, 1);
18
18
 
19
19
  const rX = Math.sin(ax) * radius;
20
20
  const rY = Math.sin(ay) * radius;
@@ -1,5 +1,3 @@
1
- import { computePointDistanceToPlane } from "../../Plane.js";
2
-
3
1
  /**
4
2
  * @param {number} plane_normal_x
5
3
  * @param {number} plane_normal_y
@@ -14,38 +12,16 @@ import { computePointDistanceToPlane } from "../../Plane.js";
14
12
  * @returns {number}
15
13
  */
16
14
  export function aabb3_computeDistanceAbovePlane(
17
- plane_normal_x,
18
- plane_normal_y,
19
- plane_normal_z,
20
- plane_constant,
21
- _x0,
22
- _y0,
23
- _z0,
24
- _x1,
25
- _y1,
26
- _z1
15
+ plane_normal_x, plane_normal_y, plane_normal_z, plane_constant,
16
+ _x0, _y0, _z0,
17
+ _x1, _y1, _z1
27
18
  ) {
28
19
 
29
- let px, py, pz;
30
-
31
- // pick a corner point furthest along the normal
32
- if (plane_normal_x > 0) {
33
- px = _x1;
34
- } else {
35
- px = _x0;
36
- }
37
-
38
- if (plane_normal_y > 0) {
39
- py = _y1;
40
- } else {
41
- py = _y0;
42
- }
43
-
44
- if (plane_normal_z > 0) {
45
- pz = _z1;
46
- } else {
47
- pz = _z0;
48
- }
20
+ // pick a corner point furthest along the plane normal
21
+ const px = plane_normal_x > 0 ? _x1 : _x0;
22
+ const py = plane_normal_y > 0 ? _y1 : _y0;
23
+ const pz = plane_normal_z > 0 ? _z1 : _z0;
49
24
 
50
- return computePointDistanceToPlane(px, py, pz, plane_normal_x, plane_normal_y, plane_normal_z, plane_constant);
25
+ // dot(v4,v4) inlined for speed
26
+ return (plane_normal_x * px + plane_normal_y * py + plane_normal_z * pz) + plane_constant;
51
27
  }
@@ -1,6 +1,6 @@
1
1
  import { max2 } from "../../../math/max2.js";
2
2
  import { min2 } from "../../../math/min2.js";
3
- import { v3_angleBetween } from "../../Vector3.js";
3
+ import { v3_angle_between } from "../../v3_angle_between.js";
4
4
 
5
5
  /**
6
6
  * NOTE: used stackoverflow answer as a basis for circle part: https://stackoverflow.com/questions/2592011/bounding-boxes-for-circle-and-arcs-in-3d
@@ -15,9 +15,9 @@ import { v3_angleBetween } from "../../Vector3.js";
15
15
  * @param {number} length
16
16
  */
17
17
  export function computeConeBoundingBox(result, originX, originY, originZ, directionX, directionY, directionZ, angle, length) {
18
- const ax = v3_angleBetween(directionX, directionY, directionZ, 1, 0, 0);
19
- const ay = v3_angleBetween(directionX, directionY, directionZ, 0, 1, 0);
20
- const az = v3_angleBetween(directionX, directionY, directionZ, 0, 0, 1);
18
+ const ax = v3_angle_between(directionX, directionY, directionZ, 1, 0, 0);
19
+ const ay = v3_angle_between(directionX, directionY, directionZ, 0, 1, 0);
20
+ const az = v3_angle_between(directionX, directionY, directionZ, 0, 0, 1);
21
21
 
22
22
  //compute radius of the base of the cone
23
23
  const radius = length * Math.tan(angle);
@@ -1,9 +1,9 @@
1
1
  //
2
2
 
3
3
 
4
- import Vector3 from "../Vector3.js";
5
- import Quaternion, { quat3_createFromAxisAngle } from "../Quaternion.js";
6
- import { max2 } from "../../math/max2.js";
4
+ import Vector3 from "../../Vector3.js";
5
+ import Quaternion, { quat3_createFromAxisAngle } from "../../Quaternion.js";
6
+ import { max2 } from "../../../math/max2.js";
7
7
 
8
8
  const tangent = new Vector3();
9
9
 
@@ -1,5 +1,5 @@
1
1
  import { compute_bounding_cone_of_2_cones } from "./compute_bounding_cone_of_2_cones.js";
2
- import { ConicRay } from "../ConicRay.js";
2
+ import { ConicRay } from "../../ConicRay.js";
3
3
 
4
4
  /**
5
5
  *
@@ -1,4 +1,4 @@
1
- import { v3_length } from "../../Vector3.js";
1
+ import { v3_length } from "../../v3_length.js";
2
2
 
3
3
  /**
4
4
  *