@woosh/meep-engine 3.45.0 → 3.47.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 (435) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/editor/actions/concrete/TransformModifyAction.d.ts.map +1 -1
  3. package/editor/actions/concrete/TransformModifyAction.js +10 -2
  4. package/editor/ecs/component/FieldDescriptor.js +15 -0
  5. package/editor/ecs/component/createObjectEditor.js +41 -12
  6. package/editor/ecs/component/editors/ecs/Transform64Editor.d.ts.map +1 -1
  7. package/editor/ecs/component/editors/ecs/Transform64Editor.js +77 -70
  8. package/editor/tools/TransformToolV2.d.ts.map +1 -1
  9. package/editor/tools/TransformToolV2.js +4 -0
  10. package/editor/tools/v2/TransformControls.d.ts.map +1 -1
  11. package/editor/tools/v2/TransformControls.js +7 -0
  12. package/editor/view/ecs/EntityEditor.d.ts.map +1 -1
  13. package/editor/view/ecs/EntityEditor.js +4 -2
  14. package/package.json +1 -1
  15. package/src/core/assert.d.ts.map +1 -1
  16. package/src/core/assert.js +5 -1
  17. package/src/core/binary/hash/XXH128Hash.d.ts +1 -37
  18. package/src/core/binary/hash/XXH128Hash.d.ts.map +1 -1
  19. package/src/core/binary/hash/XXH128Hash.js +4 -55
  20. package/src/core/binary/hash/XXH3_SECRET.d.ts +1 -12
  21. package/src/core/binary/hash/XXH3_SECRET.d.ts.map +1 -1
  22. package/src/core/binary/hash/XXH3_SECRET.js +4 -25
  23. package/src/core/binary/hash/crc32.d.ts +1 -15
  24. package/src/core/binary/hash/crc32.d.ts.map +1 -1
  25. package/src/core/binary/hash/crc32.js +4 -96
  26. package/src/core/binary/hash/xxh3_128.d.ts +1 -9
  27. package/src/core/binary/hash/xxh3_128.d.ts.map +1 -1
  28. package/src/core/binary/hash/xxh3_128.js +4 -341
  29. package/src/core/binary/hash/xxh3_64.d.ts +1 -8
  30. package/src/core/binary/hash/xxh3_64.d.ts.map +1 -1
  31. package/src/core/binary/hash/xxh3_64.js +4 -241
  32. package/src/core/binary/hash/xxh3_common.d.ts +1 -223
  33. package/src/core/binary/hash/xxh3_common.d.ts.map +1 -1
  34. package/src/core/binary/hash/xxh3_common.js +90 -476
  35. package/src/core/collection/array/array_insert_at.d.ts +16 -0
  36. package/src/core/collection/array/array_insert_at.d.ts.map +1 -0
  37. package/src/core/collection/array/array_insert_at.js +32 -0
  38. package/src/core/collection/array/array_remove_at.d.ts +15 -0
  39. package/src/core/collection/array/array_remove_at.d.ts.map +1 -0
  40. package/src/core/collection/array/array_remove_at.js +30 -0
  41. package/src/core/collection/array/combine_hash.d.ts +6 -0
  42. package/src/core/collection/array/combine_hash.d.ts.map +1 -1
  43. package/src/core/collection/array/combine_hash.js +6 -0
  44. package/src/core/function/FunctionCompiler.js +2 -2
  45. package/src/core/geom/3d/mat4/m4_multiply.d.ts +3 -0
  46. package/src/core/geom/3d/mat4/m4_multiply.d.ts.map +1 -1
  47. package/src/core/geom/3d/mat4/m4_multiply.js +3 -0
  48. package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts +30 -0
  49. package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts.map +1 -0
  50. package/src/core/geom/3d/mat4/m4_multiply_f64.js +106 -0
  51. package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts +37 -0
  52. package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts.map +1 -0
  53. package/src/core/geom/3d/quaternion/quat3_look_rotation.js +172 -0
  54. package/src/core/geom/ConicRay.js +2 -2
  55. package/src/core/geom/Quaternion.d.ts +1 -0
  56. package/src/core/geom/Quaternion.d.ts.map +1 -1
  57. package/src/core/geom/Quaternion.js +12 -48
  58. package/src/core/geom/Vector4.d.ts.map +1 -1
  59. package/src/core/geom/Vector4.js +8 -5
  60. package/src/core/math/hash/XXH128Hash.d.ts +38 -0
  61. package/src/core/math/hash/XXH128Hash.d.ts.map +1 -0
  62. package/src/core/math/hash/XXH128Hash.js +55 -0
  63. package/src/core/math/hash/XXH3_SECRET.d.ts +13 -0
  64. package/src/core/math/hash/XXH3_SECRET.d.ts.map +1 -0
  65. package/src/core/math/hash/XXH3_SECRET.js +25 -0
  66. package/src/core/math/hash/crc32.d.ts +16 -0
  67. package/src/core/math/hash/crc32.d.ts.map +1 -0
  68. package/src/core/math/hash/crc32.js +96 -0
  69. package/src/core/math/hash/xxh3_128.d.ts +10 -0
  70. package/src/core/math/hash/xxh3_128.d.ts.map +1 -0
  71. package/src/core/math/hash/xxh3_128.js +341 -0
  72. package/src/core/math/hash/xxh3_64.d.ts +9 -0
  73. package/src/core/math/hash/xxh3_64.d.ts.map +1 -0
  74. package/src/core/math/hash/xxh3_64.js +241 -0
  75. package/src/core/math/hash/xxh3_common.d.ts +224 -0
  76. package/src/core/math/hash/xxh3_common.d.ts.map +1 -0
  77. package/src/core/math/hash/xxh3_common.js +476 -0
  78. package/src/core/math/lookup/ParameterLookupTable.js +2 -2
  79. package/src/core/model/node-graph/node/NodeInstancePortReference.js +2 -2
  80. package/src/core/model/reactive/model/ReactiveBinaryExpression.js +2 -2
  81. package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -2
  82. package/src/engine/Engine.d.ts.map +1 -1
  83. package/src/engine/Engine.js +9 -4
  84. package/src/engine/asset/AssetDescription.js +2 -2
  85. package/src/engine/ecs/animation/Animation.js +2 -2
  86. package/src/engine/ecs/animation/AnimationClip.d.ts.map +1 -1
  87. package/src/engine/ecs/animation/AnimationClip.js +7 -5
  88. package/src/engine/ecs/gui/GUIElement.d.ts.map +1 -1
  89. package/src/engine/ecs/gui/GUIElement.js +7 -5
  90. package/src/engine/ecs/gui/hud/HeadsUpDisplay.js +2 -2
  91. package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
  92. package/src/engine/ecs/gui/position/ViewportPosition.js +11 -7
  93. package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
  94. package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +10 -0
  95. package/src/engine/ecs/transform/Transform64.d.ts +1 -1
  96. package/src/engine/ecs/transform/Transform64.d.ts.map +1 -1
  97. package/src/engine/ecs/transform/Transform64.js +5 -4
  98. package/src/engine/ecs/transform/t64_look_rotation.d.ts +4 -4
  99. package/src/engine/ecs/transform/t64_look_rotation.d.ts.map +1 -1
  100. package/src/engine/ecs/transform/t64_look_rotation.js +7 -18
  101. package/src/engine/graphics/ecs/animation/animator/AnimationClip.d.ts.map +1 -1
  102. package/src/engine/graphics/ecs/animation/animator/AnimationClip.js +8 -5
  103. package/src/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +2 -2
  104. package/src/engine/graphics/ecs/animation/animator/AnimationNotification.js +2 -2
  105. package/src/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.js +2 -2
  106. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +2 -2
  107. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.js +2 -2
  108. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.d.ts.map +1 -1
  109. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.js +8 -5
  110. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.d.ts.map +1 -1
  111. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.js +30 -1
  112. package/src/engine/graphics/ecs/decal/v2/Decal.d.ts.map +1 -1
  113. package/src/engine/graphics/ecs/decal/v2/Decal.js +9 -8
  114. package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.d.ts.map +1 -1
  115. package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.js +9 -6
  116. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +6 -0
  117. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
  118. package/src/engine/graphics3/GPUParticleEmitterSystem.js +72 -29
  119. package/src/engine/graphics3/ParticipatingMedia.js +204 -204
  120. package/src/engine/graphics3/animation/AnimationClips.d.ts +5 -0
  121. package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -1
  122. package/src/engine/graphics3/animation/AnimationClips.js +5 -0
  123. package/src/engine/grid/obstacle/GridObstacle.js +2 -2
  124. package/src/engine/input/devices/KeyboardDevice.d.ts +1 -0
  125. package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
  126. package/src/engine/input/devices/KeyboardDevice.js +7 -6
  127. package/src/engine/intelligence/behavior/selector/WeightedElement.js +2 -2
  128. package/src/engine/interpolation/Interpolated.js +2 -2
  129. package/src/engine/navigation/ecs/path_following/PathFollowingSystem.d.ts.map +1 -1
  130. package/src/engine/navigation/ecs/path_following/PathFollowingSystem.js +15 -2
  131. package/src/engine/network/CONGESTION_CONTROL.md +9 -9
  132. package/src/engine/network/MESSAGE_TRANSPORT.md +364 -0
  133. package/src/engine/network/NetworkSession.d.ts +31 -11
  134. package/src/engine/network/NetworkSession.d.ts.map +1 -1
  135. package/src/engine/network/NetworkSession.js +453 -286
  136. package/src/engine/network/README.md +77 -27
  137. package/src/engine/network/SMOOTHNESS_DESIGN.md +13 -5
  138. package/src/engine/network/diagnostics/BandwidthMeter.d.ts +1 -1
  139. package/src/engine/network/diagnostics/BandwidthMeter.js +1 -1
  140. package/src/engine/network/orchestrator/HostJoin.d.ts +111 -0
  141. package/src/engine/network/orchestrator/HostJoin.d.ts.map +1 -0
  142. package/src/engine/network/orchestrator/HostJoin.js +271 -0
  143. package/src/engine/network/orchestrator/NetworkPeer.d.ts +151 -112
  144. package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
  145. package/src/engine/network/orchestrator/NetworkPeer.js +450 -499
  146. package/src/engine/network/orchestrator/PendingSlices.d.ts +30 -0
  147. package/src/engine/network/orchestrator/PendingSlices.d.ts.map +1 -0
  148. package/src/engine/network/orchestrator/PendingSlices.js +83 -0
  149. package/src/engine/network/orchestrator/ReliableFrames.d.ts +34 -0
  150. package/src/engine/network/orchestrator/ReliableFrames.d.ts.map +1 -0
  151. package/src/engine/network/orchestrator/ReliableFrames.js +96 -0
  152. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +77 -10
  153. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
  154. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +236 -61
  155. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +20 -6
  156. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
  157. package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +33 -8
  158. package/src/engine/network/replication/Replicator.d.ts.map +1 -1
  159. package/src/engine/network/replication/Replicator.js +7 -1
  160. package/src/engine/network/sim/ActionLog.d.ts +32 -5
  161. package/src/engine/network/sim/ActionLog.d.ts.map +1 -1
  162. package/src/engine/network/sim/ActionLog.js +47 -5
  163. package/src/engine/network/sim/SimActionExecutor.d.ts +42 -2
  164. package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
  165. package/src/engine/network/sim/SimActionExecutor.js +100 -4
  166. package/src/engine/network/sim/Snapshotter.d.ts +12 -0
  167. package/src/engine/network/sim/Snapshotter.d.ts.map +1 -1
  168. package/src/engine/network/sim/Snapshotter.js +43 -0
  169. package/src/engine/network/state/Baseline.d.ts +1 -1
  170. package/src/engine/network/state/Baseline.js +1 -1
  171. package/src/engine/network/state/FrameBufferRing.d.ts +25 -6
  172. package/src/engine/network/state/FrameBufferRing.d.ts.map +1 -1
  173. package/src/engine/network/state/FrameBufferRing.js +51 -6
  174. package/src/engine/network/state/InputRing.d.ts +4 -0
  175. package/src/engine/network/state/InputRing.d.ts.map +1 -1
  176. package/src/engine/network/state/InputRing.js +7 -0
  177. package/src/engine/network/transport/DeferredTransport.d.ts.map +1 -1
  178. package/src/engine/network/transport/DeferredTransport.js +1 -0
  179. package/src/engine/network/transport/LoopbackTransport.d.ts.map +1 -1
  180. package/src/engine/network/transport/LoopbackTransport.js +4 -2
  181. package/src/engine/network/transport/Transport.d.ts +7 -0
  182. package/src/engine/network/transport/Transport.d.ts.map +1 -1
  183. package/src/engine/network/transport/Transport.js +8 -0
  184. package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts.map +1 -1
  185. package/src/engine/network/transport/adapters/NodeUDPTransport.js +20 -5
  186. package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.d.ts.map +1 -1
  187. package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.js +8 -0
  188. package/src/engine/network/transport/adapters/WebTransportTransport.d.ts.map +1 -1
  189. package/src/engine/network/transport/adapters/WebTransportTransport.js +6 -0
  190. package/src/engine/network/transport/connection/Connection.d.ts +191 -0
  191. package/src/engine/network/transport/connection/Connection.d.ts.map +1 -0
  192. package/src/engine/network/transport/connection/Connection.js +1262 -0
  193. package/src/engine/network/transport/connection/RangeSet.d.ts +94 -0
  194. package/src/engine/network/transport/connection/RangeSet.d.ts.map +1 -0
  195. package/src/engine/network/transport/connection/RangeSet.js +260 -0
  196. package/src/engine/network/transport/connection/RxStream.d.ts +48 -0
  197. package/src/engine/network/transport/connection/RxStream.d.ts.map +1 -0
  198. package/src/engine/network/transport/connection/RxStream.js +211 -0
  199. package/src/engine/network/transport/connection/TxStream.d.ts +90 -0
  200. package/src/engine/network/transport/connection/TxStream.d.ts.map +1 -0
  201. package/src/engine/network/transport/connection/TxStream.js +243 -0
  202. package/src/engine/network/transport/connection/bytes_copy.d.ts +17 -0
  203. package/src/engine/network/transport/connection/bytes_copy.d.ts.map +1 -0
  204. package/src/engine/network/transport/connection/bytes_copy.js +34 -0
  205. package/src/engine/network/transport/connection/varint.d.ts +46 -0
  206. package/src/engine/network/transport/connection/varint.d.ts.map +1 -0
  207. package/src/engine/network/transport/connection/varint.js +107 -0
  208. package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
  209. package/src/engine/physics/cloth/ecs/Cloth.js +7 -5
  210. package/src/engine/physics/cloth/ecs/ClothCollider.d.ts.map +1 -1
  211. package/src/engine/physics/cloth/ecs/ClothCollider.js +7 -5
  212. package/src/engine/physics/cloth/ecs/ClothDynamics.d.ts.map +1 -1
  213. package/src/engine/physics/cloth/ecs/ClothDynamics.js +20 -11
  214. package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
  215. package/src/engine/physics/fluid/FluidField.js +7 -5
  216. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -1
  217. package/src/engine/physics/fluid/ecs/FluidComponent.js +19 -11
  218. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  219. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +2 -2
  220. package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +2 -2
  221. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
  222. package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +11 -7
  223. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -1
  224. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +11 -7
  225. package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
  226. package/src/engine/physics/fluid/effector/WakeFluidEffector.js +16 -9
  227. package/src/engine/sound/ecs/audio/AudioEmitter.d.ts +38 -7
  228. package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -1
  229. package/src/engine/sound/ecs/audio/AudioEmitter.js +47 -14
  230. package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.d.ts.map +1 -1
  231. package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.js +5 -1
  232. package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts +18 -0
  233. package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts.map +1 -0
  234. package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.js +48 -0
  235. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +12 -2
  236. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
  237. package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +173 -9
  238. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts +9 -3
  239. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
  240. package/src/engine/sound/ecs/audio/LiveEmitterSet.js +28 -8
  241. package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts +8 -0
  242. package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts.map +1 -1
  243. package/src/engine/sound/ecs/trigger/AudioEventTrigger.js +192 -191
  244. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.d.ts.map +1 -1
  245. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.js +5 -1
  246. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts +18 -0
  247. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts.map +1 -0
  248. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.js +51 -0
  249. package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.d.ts.map +1 -1
  250. package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.js +15 -1
  251. package/src/engine/sound/simulation/core/AcousticMedium.js +2 -2
  252. package/src/engine/sound/simulation/definition/AcousticDirectivity.js +2 -2
  253. package/src/engine/sound/simulation/definition/AcousticMaterial.d.ts.map +1 -1
  254. package/src/engine/sound/simulation/definition/AcousticMaterial.js +11 -7
  255. package/src/engine/sound/sopra/README.md +768 -644
  256. package/src/engine/sound/sopra/SopraEngine.d.ts +104 -8
  257. package/src/engine/sound/sopra/SopraEngine.d.ts.map +1 -1
  258. package/src/engine/sound/sopra/SopraEngine.js +327 -12
  259. package/src/engine/sound/sopra/definition/BusDefinition.d.ts.map +1 -1
  260. package/src/engine/sound/sopra/definition/BusDefinition.js +5 -4
  261. package/src/engine/sound/sopra/definition/DuckingRule.d.ts.map +1 -1
  262. package/src/engine/sound/sopra/definition/DuckingRule.js +7 -5
  263. package/src/engine/sound/sopra/definition/EventDescription.d.ts +28 -2
  264. package/src/engine/sound/sopra/definition/EventDescription.d.ts.map +1 -1
  265. package/src/engine/sound/sopra/definition/EventDescription.js +77 -17
  266. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts +10 -0
  267. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts.map +1 -1
  268. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.js +77 -55
  269. package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts +31 -0
  270. package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts.map +1 -0
  271. package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.js +75 -0
  272. package/src/engine/sound/sopra/definition/MixerSnapshot.js +2 -2
  273. package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts.map +1 -1
  274. package/src/engine/sound/sopra/definition/ParameterDefinition.js +7 -5
  275. package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.js +2 -2
  276. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts.map +1 -1
  277. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.js +4 -3
  278. package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.js +2 -2
  279. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.js +3 -3
  280. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts.map +1 -1
  281. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.js +16 -9
  282. package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.js +2 -2
  283. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts +1 -1
  284. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts.map +1 -1
  285. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.js +2 -2
  286. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts +38 -9
  287. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts.map +1 -1
  288. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.js +34 -5
  289. package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts +7 -2
  290. package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts.map +1 -1
  291. package/src/engine/sound/sopra/definition/effect/CompressorEffect.js +137 -120
  292. package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts +3 -1
  293. package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts.map +1 -1
  294. package/src/engine/sound/sopra/definition/effect/EqEffect.js +146 -128
  295. package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts +1 -0
  296. package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts.map +1 -1
  297. package/src/engine/sound/sopra/definition/effect/ReverbEffect.js +8 -3
  298. package/src/engine/sound/sopra/legacy/SoundEmitter.d.ts.map +1 -1
  299. package/src/engine/sound/sopra/legacy/SoundEmitter.js +357 -352
  300. package/src/engine/sound/sopra/legacy/SoundTrack.d.ts.map +1 -1
  301. package/src/engine/sound/sopra/legacy/SoundTrack.js +281 -278
  302. package/src/engine/sound/sopra/runtime/BusGraph.d.ts +44 -2
  303. package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
  304. package/src/engine/sound/sopra/runtime/BusGraph.js +83 -43
  305. package/src/engine/sound/sopra/runtime/EffectChain.d.ts +96 -0
  306. package/src/engine/sound/sopra/runtime/EffectChain.d.ts.map +1 -0
  307. package/src/engine/sound/sopra/runtime/EffectChain.js +286 -0
  308. package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts +123 -0
  309. package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts.map +1 -0
  310. package/src/engine/sound/sopra/runtime/EffectParamOverrides.js +320 -0
  311. package/src/engine/sound/sopra/runtime/EventInstance.d.ts +55 -5
  312. package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
  313. package/src/engine/sound/sopra/runtime/EventInstance.js +201 -26
  314. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts +2 -1
  315. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts.map +1 -1
  316. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.js +6 -1
  317. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts +15 -0
  318. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts.map +1 -1
  319. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.js +32 -0
  320. package/src/engine/sound/sopra/util/MockAudioContext.d.ts.map +1 -1
  321. package/src/engine/sound/sopra/util/MockAudioContext.js +3 -0
  322. package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts +13 -3
  323. package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts.map +1 -1
  324. package/src/engine/sound/sopra/util/fadeOutAndStop.js +25 -13
  325. package/src/format/image/png/PNGReader.js +644 -644
  326. package/src/format/image/png/crc32.d.ts +1 -1
  327. package/src/format/image/png/crc32.js +7 -8
  328. package/src/shade/RENDERER_CONTRACT.md +6 -3
  329. package/src/shade/descriptor/binding/BindGroupLayoutDescriptor.js +2 -2
  330. package/src/shade/descriptor/binding/BindGroupLayoutEntry.d.ts.map +1 -1
  331. package/src/shade/descriptor/binding/BindGroupLayoutEntry.js +12 -8
  332. package/src/shade/descriptor/binding/StorageTextureBindingLayout.js +2 -2
  333. package/src/shade/descriptor/binding/TextureBindingLayout.js +2 -2
  334. package/src/shade/descriptor/blend/BlendComponent.js +2 -2
  335. package/src/shade/descriptor/pipeline/PipelineDescriptorBase.js +2 -2
  336. package/src/shade/descriptor/pipeline/PipelineLayoutDescriptor.js +2 -2
  337. package/src/shade/descriptor/pipeline/ProgrammableStage.js +2 -2
  338. package/src/shade/descriptor/pipeline/compute/ComputePipelineDescriptor.js +2 -2
  339. package/src/shade/descriptor/pipeline/render/ColorTargetState.js +2 -2
  340. package/src/shade/descriptor/pipeline/render/FragmentState.js +2 -2
  341. package/src/shade/descriptor/pipeline/render/PrimitiveState.js +2 -2
  342. package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.d.ts.map +1 -1
  343. package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.js +8 -5
  344. package/src/shade/descriptor/pipeline/render/VertexAttribute.js +2 -2
  345. package/src/shade/descriptor/texture/SamplerDescriptor.d.ts.map +1 -1
  346. package/src/shade/descriptor/texture/SamplerDescriptor.js +20 -12
  347. package/src/shade/descriptor/texture/TextureDescriptor.d.ts.map +1 -1
  348. package/src/shade/descriptor/texture/TextureDescriptor.js +11 -7
  349. package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts +24 -0
  350. package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts.map +1 -0
  351. package/src/shade/device/SHADE_DEVICE_FLOOR.js +34 -0
  352. package/src/shade/device/ShadeDeviceFailure.d.ts +12 -5
  353. package/src/shade/device/ShadeDeviceFailure.d.ts.map +1 -1
  354. package/src/shade/device/ShadeDeviceFailure.js +17 -8
  355. package/src/shade/device/ShadeDeviceFailureReason.d.ts +1 -1
  356. package/src/shade/device/ShadeDeviceFailureReason.js +2 -2
  357. package/src/shade/device/graph/BufferResourceDescriptor.d.ts.map +1 -1
  358. package/src/shade/device/graph/BufferResourceDescriptor.js +196 -193
  359. package/src/shade/device/graph/TextureResourceDescriptor.d.ts.map +1 -1
  360. package/src/shade/device/graph/TextureResourceDescriptor.js +178 -173
  361. package/src/shade/device/shade_device_floor_unmet.d.ts +13 -0
  362. package/src/shade/device/shade_device_floor_unmet.d.ts.map +1 -0
  363. package/src/shade/device/shade_device_floor_unmet.js +32 -0
  364. package/src/shade/device/timing/profile/sgpt_read_header.js +1 -1
  365. package/src/shade/device/timing/profile/sgpt_read_records.js +1 -1
  366. package/src/shade/device/timing/profile/sgpt_write_header.js +1 -1
  367. package/src/shade/device/timing/profile/sgpt_write_record.js +1 -1
  368. package/src/shade/renderer/Renderer.d.ts +2 -0
  369. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  370. package/src/shade/renderer/Renderer.js +29 -55
  371. package/src/shade/renderer/binding/BufferBinding.js +2 -2
  372. package/src/shade/renderer/buffer/GPUBufferAllocator.d.ts.map +1 -1
  373. package/src/shade/renderer/buffer/GPUBufferAllocator.js +9 -0
  374. package/src/shade/renderer/buffer/buffer_pool_ops.d.ts +21 -12
  375. package/src/shade/renderer/buffer/buffer_pool_ops.d.ts.map +1 -1
  376. package/src/shade/renderer/buffer/buffer_pool_ops.js +18 -19
  377. package/src/shade/renderer/camera/Camera.js +2 -2
  378. package/src/shade/renderer/geometry/Attribute.js +2 -2
  379. package/src/shade/renderer/geometry/Geometry.js +2 -2
  380. package/src/shade/renderer/geometry/geometry_deduplicate_vertices.js +2 -2
  381. package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +2 -2
  382. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_asset_id.js +13 -13
  383. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_directory_block_checksum.js +41 -41
  384. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_frame_checksum.js +41 -41
  385. package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_header_checksum.js +25 -25
  386. package/src/shade/renderer/gpu_primitive/test/gpu_test.d.ts.map +1 -1
  387. package/src/shade/renderer/gpu_primitive/test/gpu_test.js +8 -11
  388. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  389. package/src/shade/renderer/material/StandardShadeMaterial.d.ts.map +1 -1
  390. package/src/shade/renderer/material/StandardShadeMaterial.js +13 -8
  391. package/src/shade/renderer/pool/TransientResourcePool.d.ts +24 -0
  392. package/src/shade/renderer/pool/TransientResourcePool.d.ts.map +1 -1
  393. package/src/shade/renderer/pool/TransientResourcePool.js +41 -10
  394. package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.d.ts.map +1 -1
  395. package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.js +14 -5
  396. package/src/shade/renderer/scene/optimization/sampler2d_from_image_bitmap.js +1 -1
  397. package/src/shade/renderer/shader/ComputeShader.d.ts.map +1 -1
  398. package/src/shade/renderer/shader/ComputeShader.js +18 -2
  399. package/src/shade/renderer/shader/ImageShader.d.ts.map +1 -1
  400. package/src/shade/renderer/shader/ImageShader.js +230 -218
  401. package/src/shade/renderer/shader/type/WGSLStructField.js +2 -2
  402. package/src/shade/renderer/shader/type/WebGPUArray.js +2 -2
  403. package/src/shade/renderer/shader/type/WebGPUStruct.d.ts.map +1 -1
  404. package/src/shade/renderer/shader/type/WebGPUStruct.js +9 -6
  405. package/src/shade/renderer/texture/ShadeTexture.d.ts.map +1 -1
  406. package/src/shade/renderer/texture/ShadeTexture.js +17 -10
  407. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +2 -2
  408. package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +4 -4
  409. package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +6 -6
  410. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  411. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +46 -55
  412. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts +3 -3
  413. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -1
  414. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +14 -4
  415. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +10 -1
  416. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
  417. package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +82 -40
  418. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +4 -1
  419. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
  420. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +8 -4
  421. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +98 -86
  422. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -1
  423. package/src/shade/renderer/water/surface/particles/shader_water_particles.js +440 -298
  424. package/src/view/common/HTMLElementCacheKey.d.ts.map +1 -1
  425. package/src/view/common/HTMLElementCacheKey.js +4 -3
  426. package/src/view/graphics/GraphicsContextFailureView.d.ts +1 -2
  427. package/src/view/graphics/GraphicsContextFailureView.d.ts.map +1 -1
  428. package/src/view/graphics/GraphicsContextFailureView.js +1 -2
  429. package/src/view/minimap/MinimapMarker.js +2 -2
  430. package/src/engine/network/transport/Channel.js +0 -336
  431. package/src/engine/network/transport/ReliableCommandPipeline.js +0 -335
  432. package/src/engine/network/transport/fragments/FragmentAssembler.js +0 -350
  433. package/src/engine/network/transport/fragments/FragmentRetention.js +0 -191
  434. package/src/engine/network/transport/fragments/fragment_send.js +0 -157
  435. package/src/engine/network/transport/fragments/packet_size.js +0 -107
@@ -1 +1 @@
1
- {"version":3,"file":"combine_hash.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/combine_hash.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,uCAHc,MAAM,KACP,MAAM,CAMlB"}
1
+ {"version":3,"file":"combine_hash.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/combine_hash.js"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,uCAHc,MAAM,KACP,MAAM,CAMlB"}
@@ -3,6 +3,12 @@ import { computeIntegerArrayHash } from "./computeIntegerArrayHash.js";
3
3
 
4
4
  /**
5
5
  * Computes hash on integer values, useful for building composite hashes
6
+ *
7
+ * @deprecated Varargs, so every call allocates a rest array. Use `hash_mix2` / `hash_mix3` from
8
+ * `core/math/hash/`, which fold the same `h * 31 + x` step without allocating. Their values differ
9
+ * from this function's: it seeds the fold with the argument count and returns uint32, while the
10
+ * mixers are unseeded and return int32. Kept, with its values unchanged, for code outside the engine.
11
+ *
6
12
  * @param {...number} value
7
13
  * @returns {number}
8
14
  */
@@ -1,6 +1,6 @@
1
1
  import { assert } from "../assert.js";
2
2
  import { Cache } from "../cache/Cache.js";
3
- import { combine_hash } from "../collection/array/combine_hash.js";
3
+ import { hash_mix3 } from "../math/hash/hash_mix3.js";
4
4
  import { computeHashArray } from "../collection/array/computeHashArray.js";
5
5
  import { isArrayEqualStrict } from "../collection/array/isArrayEqualStrict.js";
6
6
  import { invokeObjectEquals } from "../model/object/invokeObjectEquals.js";
@@ -50,7 +50,7 @@ class FunctionDefinition {
50
50
  }
51
51
 
52
52
  updateHash() {
53
- this.__hash = combine_hash(
53
+ this.__hash = hash_mix3(
54
54
  computeStringHash(this.name),
55
55
  computeStringHash(this.body),
56
56
  computeHashArray(this.args, computeStringHash)
@@ -2,6 +2,9 @@
2
2
  * Multiplies two 4x4 matrices.
3
3
  * `out = a * b`.
4
4
  *
5
+ * Hot code on `Float64Array` storage (`Transform64` included) calls {@link m4_multiply_f64} instead, an
6
+ * identical copy: this one is reached with every array kind, so V8 boxes each element it writes.
7
+ *
5
8
  * @param {number[]|ArrayLike<number>|Float32Array} out the receiving matrix
6
9
  * @param {number[]|ArrayLike<number>|Float32Array} a the first operand
7
10
  * @param {number[]|ArrayLike<number>|Float32Array} b the second operand
@@ -1 +1 @@
1
- {"version":3,"file":"m4_multiply.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/mat4/m4_multiply.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,iCALW,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,KACvC,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,KACvC,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,GACrC,MAAM,EAAE,CA0EpB"}
1
+ {"version":3,"file":"m4_multiply.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/mat4/m4_multiply.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,iCALW,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,KACvC,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,KACvC,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,GACrC,MAAM,EAAE,CA0EpB"}
@@ -4,6 +4,9 @@ import { assert } from "../../../assert.js";
4
4
  * Multiplies two 4x4 matrices.
5
5
  * `out = a * b`.
6
6
  *
7
+ * Hot code on `Float64Array` storage (`Transform64` included) calls {@link m4_multiply_f64} instead, an
8
+ * identical copy: this one is reached with every array kind, so V8 boxes each element it writes.
9
+ *
7
10
  * @param {number[]|ArrayLike<number>|Float32Array} out the receiving matrix
8
11
  * @param {number[]|ArrayLike<number>|Float32Array} a the first operand
9
12
  * @param {number[]|ArrayLike<number>|Float32Array} b the second operand
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Multiplies two 4x4 matrices held in `Float64Array`s.
3
+ * `out = a * b`.
4
+ *
5
+ * A deliberate duplicate of {@link m4_multiply}: the same arithmetic in the same order, so the two give
6
+ * the same result bit for bit, and they must stay identical. Change one, change the other.
7
+ *
8
+ * It exists because {@link m4_multiply} is shared. About twenty modules call it, with `Float32Array`,
9
+ * `Float64Array`, `Transform64` and plain `Array` operands, and V8 keeps one set of type feedback per
10
+ * function, so its element loads and stores go megamorphic. A megamorphic store boxes every number it
11
+ * writes into a fresh HeapNumber. Measured in the dance-stage example (2026-10-12), on `Transform64`
12
+ * operands: 193 B per call through the shared {@link m4_multiply}, ~10 B through an identical copy no
13
+ * other caller reached. `Transform64#multiplyTransforms` composes every attached entity, ~1,700 calls a
14
+ * frame there, and that boxing was a third of the main thread's allocation.
15
+ *
16
+ * So this copy must only ever see `Float64Array` storage; a `Transform64` is one. A single caller passing
17
+ * a `Float32Array` or an `Array` would pollute this copy's feedback too, and bring the boxing back for
18
+ * every caller. The assertions are what keep such a caller out: anything else goes through
19
+ * {@link m4_multiply}.
20
+ *
21
+ * All of `a` is read before the first write, and each column of `b` before the column of `out` it
22
+ * produces, so `out` may be `a` or `b`.
23
+ *
24
+ * @param {Float64Array} out the receiving matrix
25
+ * @param {Float64Array} a the first operand
26
+ * @param {Float64Array} b the second operand
27
+ * @returns {Float64Array} `out` parameter
28
+ */
29
+ export function m4_multiply_f64(out: Float64Array, a: Float64Array, b: Float64Array): Float64Array;
30
+ //# sourceMappingURL=m4_multiply_f64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"m4_multiply_f64.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/mat4/m4_multiply_f64.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qCALW,YAAY,KACZ,YAAY,KACZ,YAAY,GACV,YAAY,CA6ExB"}
@@ -0,0 +1,106 @@
1
+ import { assert } from "../../../assert.js";
2
+
3
+ /**
4
+ * Multiplies two 4x4 matrices held in `Float64Array`s.
5
+ * `out = a * b`.
6
+ *
7
+ * A deliberate duplicate of {@link m4_multiply}: the same arithmetic in the same order, so the two give
8
+ * the same result bit for bit, and they must stay identical. Change one, change the other.
9
+ *
10
+ * It exists because {@link m4_multiply} is shared. About twenty modules call it, with `Float32Array`,
11
+ * `Float64Array`, `Transform64` and plain `Array` operands, and V8 keeps one set of type feedback per
12
+ * function, so its element loads and stores go megamorphic. A megamorphic store boxes every number it
13
+ * writes into a fresh HeapNumber. Measured in the dance-stage example (2026-10-12), on `Transform64`
14
+ * operands: 193 B per call through the shared {@link m4_multiply}, ~10 B through an identical copy no
15
+ * other caller reached. `Transform64#multiplyTransforms` composes every attached entity, ~1,700 calls a
16
+ * frame there, and that boxing was a third of the main thread's allocation.
17
+ *
18
+ * So this copy must only ever see `Float64Array` storage; a `Transform64` is one. A single caller passing
19
+ * a `Float32Array` or an `Array` would pollute this copy's feedback too, and bring the boxing back for
20
+ * every caller. The assertions are what keep such a caller out: anything else goes through
21
+ * {@link m4_multiply}.
22
+ *
23
+ * All of `a` is read before the first write, and each column of `b` before the column of `out` it
24
+ * produces, so `out` may be `a` or `b`.
25
+ *
26
+ * @param {Float64Array} out the receiving matrix
27
+ * @param {Float64Array} a the first operand
28
+ * @param {Float64Array} b the second operand
29
+ * @returns {Float64Array} `out` parameter
30
+ */
31
+ export function m4_multiply_f64(out, a, b) {
32
+ // A bare instanceof, not assert.isInstanceOf: that one is shared by every call site in the engine,
33
+ // and once it had seen their mix of classes, this function took 21 ns a call through it against
34
+ // 15.5 ns this way (node 24, 2026-10-12, a build that keeps assertions). Each check throws before
35
+ // the first element access, so a rejected operand never reaches this copy's element feedback.
36
+ assert.ok(out instanceof Float64Array, 'out is not a Float64Array');
37
+ assert.greaterThanOrEqual(out.length, 16, 'out.length');
38
+
39
+ assert.ok(a instanceof Float64Array, 'a is not a Float64Array');
40
+ assert.greaterThanOrEqual(a.length, 16, 'a.length');
41
+
42
+ assert.ok(b instanceof Float64Array, 'b is not a Float64Array');
43
+ assert.greaterThanOrEqual(b.length, 16, 'b.length');
44
+
45
+ // Adapted from gl-matrix, by way of m4_multiply
46
+
47
+ const a00 = a[0],
48
+ a01 = a[1],
49
+ a02 = a[2],
50
+ a03 = a[3],
51
+ a10 = a[4],
52
+ a11 = a[5],
53
+ a12 = a[6],
54
+ a13 = a[7],
55
+ a20 = a[8],
56
+ a21 = a[9],
57
+ a22 = a[10],
58
+ a23 = a[11],
59
+ a30 = a[12],
60
+ a31 = a[13],
61
+ a32 = a[14],
62
+ a33 = a[15];
63
+
64
+ // Cache only the current line of the second matrix
65
+ let b0 = b[0],
66
+ b1 = b[1],
67
+ b2 = b[2],
68
+ b3 = b[3];
69
+
70
+ out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
71
+ out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
72
+ out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
73
+ out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
74
+
75
+ b0 = b[4];
76
+ b1 = b[5];
77
+ b2 = b[6];
78
+ b3 = b[7];
79
+
80
+ out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
81
+ out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
82
+ out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
83
+ out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
84
+
85
+ b0 = b[8];
86
+ b1 = b[9];
87
+ b2 = b[10];
88
+ b3 = b[11];
89
+
90
+ out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
91
+ out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
92
+ out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
93
+ out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
94
+
95
+ b0 = b[12];
96
+ b1 = b[13];
97
+ b2 = b[14];
98
+ b3 = b[15];
99
+
100
+ out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
101
+ out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
102
+ out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
103
+ out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
104
+
105
+ return out;
106
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The rotation that points local +Z along `forward`, with local +Y turned as close to `up` as it can be:
3
+ * the orientation of a camera, a turret or a walking body told where to face.
4
+ *
5
+ * Neither vector has to be unit length, within what their squares can hold: lanes from about 1e-154
6
+ * to 1e154. Below that a square is 0 and the vector reads as zero, above it Infinity. The frame is built
7
+ * from them the usual way — `right = up × forward` and `up' = forward × right`, each normalised — and the
8
+ * rotation is read off that matrix, so it maps +X to `right`, +Y to `up'` and +Z to `forward`.
9
+ *
10
+ * **When `up` is parallel to `forward` there is no frame to build**: their cross product is the zero
11
+ * vector, and any roll about `forward` would do. The forward direction is then nudged by 0.001 along X
12
+ * when `up` is ±Z, and along Z otherwise, and renormalised. For a unit `up` the answer is then a unit
13
+ * rotation within about a milliradian of `forward`, rolled however the nudge leaves it; do not rely on
14
+ * the roll there. The ±Z test reads `|uz| === 1`, so a longer `up` along Z is nudged along Z, stays
15
+ * parallel, and gets a rotation that is not unit length. Pass a unit `up` where it can be parallel.
16
+ *
17
+ * Sign convention: `(x, y, z, w)` — `w` last, matching {@link Quaternion} and the rest of the
18
+ * `core/geom/3d/quaternion/` family.
19
+ *
20
+ * Everything is worked in locals and only the result is written, so it allocates nothing, and a caller
21
+ * that hands its own parameters straight on boxes nothing either. {@link Quaternion#_lookRotation} and
22
+ * `t64_look_rotation` both answer through this.
23
+ *
24
+ * @param {number[]|Float32Array|Float64Array} out
25
+ * @param {number} out_offset offset into `out`; receives 4 floats (x, y, z, w)
26
+ * @param {number} fx forward, any length
27
+ * @param {number} fy
28
+ * @param {number} fz
29
+ * @param {number} ux up, any length
30
+ * @param {number} uy
31
+ * @param {number} uz
32
+ *
33
+ * @author Alex Goldring
34
+ * @copyright Company Named Limited (c) 2026
35
+ */
36
+ export function quat3_look_rotation(out: number[] | Float32Array | Float64Array, out_offset: number, fx: number, fy: number, fz: number, ux: number, uy: number, uz: number): void;
37
+ //# sourceMappingURL=quat3_look_rotation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quat3_look_rotation.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/quaternion/quat3_look_rotation.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,yCAZW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,cAClC,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAkIhB"}
@@ -0,0 +1,172 @@
1
+ import { assert } from "../../../assert.js";
2
+
3
+ /**
4
+ * @param {number} length
5
+ * @returns {number} what normalises a vector of that length: `1 / length`, or 1 for a zero vector, which
6
+ * leaves it as it is
7
+ */
8
+ function inverse_or_one(length) {
9
+ return length === 0 ? 1 : 1 / length;
10
+ }
11
+
12
+ /**
13
+ * The rotation that points local +Z along `forward`, with local +Y turned as close to `up` as it can be:
14
+ * the orientation of a camera, a turret or a walking body told where to face.
15
+ *
16
+ * Neither vector has to be unit length, within what their squares can hold: lanes from about 1e-154
17
+ * to 1e154. Below that a square is 0 and the vector reads as zero, above it Infinity. The frame is built
18
+ * from them the usual way — `right = up × forward` and `up' = forward × right`, each normalised — and the
19
+ * rotation is read off that matrix, so it maps +X to `right`, +Y to `up'` and +Z to `forward`.
20
+ *
21
+ * **When `up` is parallel to `forward` there is no frame to build**: their cross product is the zero
22
+ * vector, and any roll about `forward` would do. The forward direction is then nudged by 0.001 along X
23
+ * when `up` is ±Z, and along Z otherwise, and renormalised. For a unit `up` the answer is then a unit
24
+ * rotation within about a milliradian of `forward`, rolled however the nudge leaves it; do not rely on
25
+ * the roll there. The ±Z test reads `|uz| === 1`, so a longer `up` along Z is nudged along Z, stays
26
+ * parallel, and gets a rotation that is not unit length. Pass a unit `up` where it can be parallel.
27
+ *
28
+ * Sign convention: `(x, y, z, w)` — `w` last, matching {@link Quaternion} and the rest of the
29
+ * `core/geom/3d/quaternion/` family.
30
+ *
31
+ * Everything is worked in locals and only the result is written, so it allocates nothing, and a caller
32
+ * that hands its own parameters straight on boxes nothing either. {@link Quaternion#_lookRotation} and
33
+ * `t64_look_rotation` both answer through this.
34
+ *
35
+ * @param {number[]|Float32Array|Float64Array} out
36
+ * @param {number} out_offset offset into `out`; receives 4 floats (x, y, z, w)
37
+ * @param {number} fx forward, any length
38
+ * @param {number} fy
39
+ * @param {number} fz
40
+ * @param {number} ux up, any length
41
+ * @param {number} uy
42
+ * @param {number} uz
43
+ *
44
+ * @author Alex Goldring
45
+ * @copyright Company Named Limited (c) 2026
46
+ */
47
+ export function quat3_look_rotation(out, out_offset, fx, fy, fz, ux, uy, uz) {
48
+ assert.isFinite(fx, 'fx');
49
+ assert.isFinite(fy, 'fy');
50
+ assert.isFinite(fz, 'fz');
51
+ assert.isFinite(ux, 'ux');
52
+ assert.isFinite(uy, 'uy');
53
+ assert.isFinite(uz, 'uz');
54
+
55
+ /*
56
+ Forward, normalised; a zero vector is left as it is.
57
+
58
+ Every normalisation here scales unconditionally, by 1 for a zero vector, which leaves each lane as it
59
+ was bit for bit. Written as `if (length !== 0) { ax *= 1 / length; }` it merged a computed number
60
+ with the incoming argument, and V8 then held `ax` as a boxed number: 32 B a call.
61
+ */
62
+ let scale = inverse_or_one(Math.sqrt(fx * fx + fy * fy + fz * fz));
63
+
64
+ let ax = fx * scale;
65
+ let ay = fy * scale;
66
+ let az = fz * scale;
67
+
68
+ // right = up × forward
69
+ let cx = uy * az - uz * ay;
70
+ let cy = uz * ax - ux * az;
71
+ let cz = ux * ay - uy * ax;
72
+
73
+ if (cx * cx + cy * cy + cz * cz === 0) {
74
+ // up and forward are parallel; adjust forward slightly, as three.js does
75
+ // https://github.com/mrdoob/three.js/blob/88e8954b69377dad4ad1ceaf1a383f3536e88e5a/src/math/Matrix4.js#L304
76
+
77
+ if (Math.abs(uz) === 1) {
78
+ ax += 0.001;
79
+ } else {
80
+ az += 0.001;
81
+ }
82
+
83
+ scale = inverse_or_one(Math.sqrt(ax * ax + ay * ay + az * az));
84
+
85
+ ax *= scale;
86
+ ay *= scale;
87
+ az *= scale;
88
+
89
+ cx = uy * az - uz * ay;
90
+ cy = uz * ax - ux * az;
91
+ cz = ux * ay - uy * ax;
92
+ }
93
+
94
+ scale = inverse_or_one(Math.sqrt(cx * cx + cy * cy + cz * cz));
95
+
96
+ cx *= scale;
97
+ cy *= scale;
98
+ cz *= scale;
99
+
100
+ // up' = forward × right
101
+ const bx = ay * cz - az * cy;
102
+ const by = az * cx - ax * cz;
103
+ const bz = ax * cy - ay * cx;
104
+
105
+ // the rotation of the matrix whose columns are right, up' and forward
106
+ const m11 = cx, m12 = bx, m13 = ax;
107
+ const m21 = cy, m22 = by, m23 = ay;
108
+ const m31 = cz, m32 = bz, m33 = az;
109
+
110
+ const trace = m11 + m22 + m33;
111
+
112
+ let x, y, z, w, s;
113
+
114
+ if (trace > 0) {
115
+
116
+ s = Math.sqrt(trace + 1.0);
117
+
118
+ w = 0.5 * s;
119
+
120
+ s = 0.5 / s;
121
+
122
+ x = (m32 - m23) * s;
123
+ y = (m13 - m31) * s;
124
+ z = (m21 - m12) * s;
125
+
126
+ } else if (m11 > m22 && m11 > m33) {
127
+
128
+ s = Math.sqrt(1.0 + m11 - m22 - m33);
129
+
130
+ x = 0.5 * s;
131
+
132
+ s = 0.5 / s;
133
+
134
+ w = (m32 - m23) * s;
135
+ y = (m12 + m21) * s;
136
+ z = (m13 + m31) * s;
137
+
138
+ } else if (m22 > m33) {
139
+
140
+ s = Math.sqrt(1.0 + m22 - m11 - m33);
141
+
142
+ y = 0.5 * s;
143
+
144
+ s = 0.5 / s;
145
+
146
+ w = (m13 - m31) * s;
147
+ x = (m12 + m21) * s;
148
+ z = (m23 + m32) * s;
149
+
150
+ } else {
151
+
152
+ s = Math.sqrt(1.0 + m33 - m11 - m22);
153
+
154
+ z = 0.5 * s;
155
+
156
+ s = 0.5 / s;
157
+
158
+ w = (m21 - m12) * s;
159
+ x = (m13 + m31) * s;
160
+ y = (m23 + m32) * s;
161
+
162
+ }
163
+
164
+ // Finite inputs can still come out NaN, when a square or a cross product overflows. One check of one
165
+ // boolean, so a build keeping assertions boxes nothing for it.
166
+ assert.ok(x === x && y === y && z === z && w === w, 'look rotation is NaN: forward or up is too large for its square');
167
+
168
+ out[out_offset] = x;
169
+ out[out_offset + 1] = y;
170
+ out[out_offset + 2] = z;
171
+ out[out_offset + 3] = w;
172
+ }
@@ -1,5 +1,5 @@
1
1
  import { assert } from "../assert.js";
2
- import { combine_hash } from "../collection/array/combine_hash.js";
2
+ import { hash_mix2 } from "../math/hash/hash_mix2.js";
3
3
  import { EPSILON } from "../math/EPSILON.js";
4
4
  import { epsilonEquals } from "../math/epsilonEquals.js";
5
5
  import { PI2 } from "../math/PI2.js";
@@ -90,7 +90,7 @@ export class ConicRay {
90
90
  * @return {number}
91
91
  */
92
92
  hash() {
93
- return combine_hash(
93
+ return hash_mix2(
94
94
  computeHashFloat(this.angle),
95
95
  this.direction.hash()
96
96
  );
@@ -125,6 +125,7 @@ export class Quaternion extends Float64Array implements Iterable<number> {
125
125
  * @param {number} uy up vector
126
126
  * @param {number} uz up vector
127
127
  * @returns {this}
128
+ * @see quat3_look_rotation the arithmetic, which this hands its arguments to unchanged
128
129
  */
129
130
  _lookRotation(fx: number, fy: number, fz: number, ux: number, uy: number, uz: number): this;
130
131
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Quaternion.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Quaternion.js"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;GAcG;AACH,iEALwB,MAAM;IA2R1B;;;;;OAKG;IACH,2BAJW,OAAO,SACP,MAAM,GACJ,UAAU,CAQtB;IAgsCD;;;;OAIG;IACH,kCAFa,UAAU,CAQtB;IAED;;;;;;;OAOG;IACH,0BALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,UAAU,CAQtB;IAED;;;;;;OAMG;IACH,6BALW,UAAU,QACV,UAAU,MACV,UAAU,aACV,MAAM,QA0BhB;IA9/CD;;;;OAIG;IACH,uDAEC;IAtCD;;;;;;;OAOG;IACH,gBANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,EAwBhB;IAbG,UAAW;IACX,UAAW;IACX,UAAW;IACX,UAAW;IAEX;;;;;;OAMG;IACH,wBAA6B;IAoBjC;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gB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AM,KACJ,MAAM,EAAE,CAqLQ;IAEjC;;OAEG;IACH,kBA5Le,MAAM,EAAE,WACR,MAAM,KACJ,MAAM,EAAE,CA0LG;IAC5B,qBA3zBe,MAAM,KACN,MAAM,KACN,MAAM,KACJ,IAAI,CAwzBe;IAQpC;;;;OAIG;IACH,uBAFU,OAAO,CAEgB;CA7BhC;;kBAoBS,UAAU;kBAaV,MAAM;;;2BAzlDH,OAAO,2BAA2B,EAAE,YAAY;oBAHzC,cAAc"}
1
+ {"version":3,"file":"Quaternion.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Quaternion.js"],"names":[],"mappings":"AA+BA;;;;;;;;;;;;;;GAcG;AACH,iEALwB,MAAM;IAiP1B;;;;;OAKG;IACH,2BAJW,OAAO,SACP,MAAM,GACJ,UAAU,CAQtB;IAgsCD;;;;OAIG;IACH,kCAFa,UAAU,CAQtB;IAED;;;;;;;OAOG;IACH,0BALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,UAAU,CAQtB;IAED;;;;;;OAMG;IACH,6BALW,UAAU,QACV,UAAU,MACV,UAAU,aACV,MAAM,QA0BhB;IAp9CD;;;;OAIG;IACH,uDAEC;IAtCD;;;;;;;OAOG;IACH,gBANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,EAwBhB;IAbG,UAAW;IACX,UAAW;IACX,UAAW;IACX,UAAW;IAEX;;;;;;OAMG;IACH,wBAA6B;IAoBjC;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gBAEC;IAWD;;;;;;;;;;;;;;;OAeG;IACH,kBATW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,IAAI,CAWhB;IAED;;;;;OAKG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,KACN,MAAM,KACJ,IAAI,CAwzBe;IAQpC;;;;OAIG;IACH,uBAFU,OAAO,CAEgB;CA7BhC;;kBAoBS,UAAU;kBAaV,MAAM;;;2BApjDH,OAAO,2BAA2B,EAAE,YAAY;oBAHzC,cAAc"}
@@ -8,6 +8,7 @@ import { epsilonEquals } from "../math/epsilonEquals.js";
8
8
  import { lerp } from "../math/lerp.js";
9
9
  import { PI2 } from "../math/PI2.js";
10
10
  import { computeHashFloat } from "../primitives/numbers/computeHashFloat.js";
11
+ import { quat3_look_rotation } from "./3d/quaternion/quat3_look_rotation.js";
11
12
  import { v3_dot } from "./vec3/v3_dot.js";
12
13
  import { v4_length } from "./vec4/v4_length.js";
13
14
  import Vector3 from "./Vector3.js";
@@ -17,8 +18,13 @@ import Vector3 from "./Vector3.js";
17
18
  */
18
19
 
19
20
  const scratch_v3_a = new Vector3();
20
- const scratch_v3_b = new Vector3();
21
- const scratch_v3_c = new Vector3();
21
+
22
+ /**
23
+ * Where {@link Quaternion#_lookRotation} has its answer worked out before setting it.
24
+ *
25
+ * @type {Float64Array}
26
+ */
27
+ const scratch_rotation = new Float64Array(4);
22
28
 
23
29
  const sin = Math.sin;
24
30
  const cos = Math.cos;
@@ -158,58 +164,16 @@ export class Quaternion extends Float64Array {
158
164
  * @param {number} uy up vector
159
165
  * @param {number} uz up vector
160
166
  * @returns {this}
167
+ * @see quat3_look_rotation the arithmetic, which this hands its arguments to unchanged
161
168
  */
162
169
  _lookRotation(
163
170
  fx, fy, fz,
164
171
  ux, uy, uz
165
172
  ) {
173
+ quat3_look_rotation(scratch_rotation, 0, fx, fy, fz, ux, uy, uz);
166
174
 
167
- scratch_v3_a.set(fx, fy, fz);
168
- scratch_v3_a.normalize();
169
-
170
- scratch_v3_c._crossVectors(ux, uy, uz, scratch_v3_a.x, scratch_v3_a.y, scratch_v3_a.z);
171
-
172
- if (scratch_v3_c.lengthSq() === 0) {
173
- // up and forward are parallel
174
-
175
- /*
176
- adjust forward direction slightly
177
- code take from : https://github.com/mrdoob/three.js/blob/88e8954b69377dad4ad1ceaf1a383f3536e88e5a/src/math/Matrix4.js#L304
178
- */
179
-
180
- if (Math.abs(uz) === 1) {
181
- scratch_v3_a.x += 0.001;
182
- } else {
183
- scratch_v3_a.z += 0.001;
184
- }
185
-
186
- scratch_v3_a.normalize();
187
- scratch_v3_c._crossVectors(ux, uy, uz, scratch_v3_a.x, scratch_v3_a.y, scratch_v3_a.z);
188
-
189
- }
190
-
191
- scratch_v3_c.normalize();
192
-
193
- scratch_v3_b.crossVectors(scratch_v3_a, scratch_v3_c);
194
-
195
- // construct partial transform matrix
196
- const m00 = scratch_v3_c.x;
197
- const m10 = scratch_v3_c.y;
198
- const m20 = scratch_v3_c.z;
199
-
200
- const m01 = scratch_v3_b.x;
201
- const m11 = scratch_v3_b.y;
202
- const m21 = scratch_v3_b.z;
203
-
204
- const m02 = scratch_v3_a.x;
205
- const m12 = scratch_v3_a.y;
206
- const m22 = scratch_v3_a.z;
207
-
208
- return this.__setFromRotationMatrix(
209
- m00, m01, m02,
210
- m10, m11, m12,
211
- m20, m21, m22
212
- );
175
+ // through set(), so the change is announced as any other write is
176
+ return this.set(scratch_rotation[0], scratch_rotation[1], scratch_rotation[2], scratch_rotation[3]);
213
177
  }
214
178
 
215
179
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Vector4.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector4.js"],"names":[],"mappings":"AAMA;;;GAGG;AAGH;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,8DAFwB,MAAM;IAuc1B;;;;;;OAMG;IACH,gBALW,OAAO,MACP,OAAO,qBAEP,OAAO,QASjB;IApbD;;;;OAIG;IACH,uDAEC;IArCD;;;;;;;;OAQG;IACH,gBAPW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,EAuBhB;IAXG,UAAW;IACX,UAAW;IACX,UAAW;IACX,UAAW;IAEX;;;;OAIG;IACH,wBAA6B;IAoBjC;;;OAGG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;OAIG;IACH,aAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,QAFY,MAAM,CASjB;IAED;;;;OAIG;IACH,gBAJW,OAAO,MACP,OAAO,mBAKjB;IAGD;;OAEG;IACH,WAFa,MAAM,EAAE,CAQpB;IAED;;;;OAIG;IACH,mBAHW,MAAM,EAAE,UACR,MAAM,QAIhB;IAED;;;;;MAOC;IAED,0BAEC;IAED;;;OAGG;IACH,uBAFW,YAAY,QAOtB;IAED;;;OAGG;IACH,yBAFW,YAAY,QAStB;IAmBL;;;OAGG;IACH,oBAFU,OAAO,CAEU;IAE3B,mBAlXe,MAAM,EAAE,WACR,MAAM,UAiXM;IAC3B,iBArWe,MAAM,EAAE,WACR,MAAM,UAoWI;CATxB;;kBAaS,MAAM;;;yBAvfH,OAAO,iBAAiB,EAAE,UAAU;sBACpC,OAAO,cAAc,EAAE,OAAO;2BAK9B,OAAO,2BAA2B,EAAE,YAAY"}
1
+ {"version":3,"file":"Vector4.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector4.js"],"names":[],"mappings":"AAOA;;;GAGG;AAGH;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,8DAFwB,MAAM;IAyc1B;;;;;;OAMG;IACH,gBALW,OAAO,MACP,OAAO,qBAEP,OAAO,QASjB;IAtbD;;;;OAIG;IACH,uDAEC;IArCD;;;;;;;;OAQG;IACH,gBAPW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,EAuBhB;IAXG,UAAW;IACX,UAAW;IACX,UAAW;IACX,UAAW;IAEX;;;;OAIG;IACH,wBAA6B;IAoBjC;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,iBAEC;IAdD;;;OAGG;IACH,gBAEC;IAUD;;;;OAIG;IACH,qBA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hB;IAED;;;;;MAOC;IAED,0BAEC;IAED;;;OAGG;IACH,uBAFW,YAAY,QAOtB;IAED;;;OAGG;IACH,yBAFW,YAAY,QAStB;IAmBL;;;OAGG;IACH,oBAFU,OAAO,CAEU;IAE3B,mBApXe,MAAM,EAAE,WACR,MAAM,UAmXM;IAC3B,iBAvWe,MAAM,EAAE,WACR,MAAM,UAsWI;CATxB;;kBAaS,MAAM;;;yBAzfH,OAAO,iBAAiB,EAAE,UAAU;sBACpC,OAAO,cAAc,EAAE,OAAO;2BAK9B,OAAO,2BAA2B,EAAE,YAAY"}
@@ -1,5 +1,6 @@
1
1
  import { assert } from "../assert.js";
2
- import { combine_hash } from "../collection/array/combine_hash.js";
2
+ import { hash_mix2 } from "../math/hash/hash_mix2.js";
3
+ import { hash_mix3 } from "../math/hash/hash_mix3.js";
3
4
  import { Signal } from "../events/signal/Signal.js";
4
5
  import { lerp } from "../math/lerp.js";
5
6
  import { computeHashFloat } from "../primitives/numbers/computeHashFloat.js";
@@ -405,10 +406,12 @@ export class Vector4 extends Float64Array {
405
406
  * @return {number}
406
407
  */
407
408
  hash() {
408
- return combine_hash(
409
- computeHashFloat(this[0]),
410
- computeHashFloat(this[1]),
411
- computeHashFloat(this[2]),
409
+ return hash_mix2(
410
+ hash_mix3(
411
+ computeHashFloat(this[0]),
412
+ computeHashFloat(this[1]),
413
+ computeHashFloat(this[2])
414
+ ),
412
415
  computeHashFloat(this[3])
413
416
  );
414
417
  }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * A 128-bit xxHash3 result, kept as its two 64-bit halves because that is how the reference
3
+ * implementation names them and how every serialized form writes them.
4
+ *
5
+ * @author Alex Goldring
6
+ * @copyright Company Named Limited (c) 2026
7
+ */
8
+ export class XXH128Hash {
9
+ /**
10
+ * @param {bigint} low64
11
+ * @param {bigint} high64
12
+ */
13
+ constructor(low64: bigint, high64: bigint);
14
+ /**
15
+ * @type {bigint}
16
+ */
17
+ low64: bigint;
18
+ /**
19
+ * @type {bigint}
20
+ */
21
+ high64: bigint;
22
+ /**
23
+ * @param {XXH128Hash} other
24
+ * @returns {boolean}
25
+ */
26
+ equals(other: XXH128Hash): boolean;
27
+ /**
28
+ * @returns {string} 32 lowercase hex digits, high half first
29
+ */
30
+ toString(): string;
31
+ /**
32
+ * Useful for type checking
33
+ * @readonly
34
+ * @type {boolean}
35
+ */
36
+ readonly isXXH128Hash: boolean;
37
+ }
38
+ //# sourceMappingURL=XXH128Hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XXH128Hash.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/hash/XXH128Hash.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH;IAWI;;;OAGG;IACH,mBAHW,MAAM,UACN,MAAM,EAQhB;IApBD;;OAEG;IACH,OAFU,MAAM,CAEL;IAEX;;OAEG;IACH,QAFU,MAAM,CAEJ;IAcZ;;;OAGG;IACH,cAHW,UAAU,GACR,OAAO,CAInB;IAED;;OAEG;IACH,YAFa,MAAM,CAIlB;IAGL;;;;OAIG;IACH,uBAFU,OAAO,CAEgB;CAPhC"}