@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.
- package/build/bundle-worker-terrain.js +1 -1
- package/editor/actions/concrete/TransformModifyAction.d.ts.map +1 -1
- package/editor/actions/concrete/TransformModifyAction.js +10 -2
- package/editor/ecs/component/FieldDescriptor.js +15 -0
- package/editor/ecs/component/createObjectEditor.js +41 -12
- package/editor/ecs/component/editors/ecs/Transform64Editor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ecs/Transform64Editor.js +77 -70
- package/editor/tools/TransformToolV2.d.ts.map +1 -1
- package/editor/tools/TransformToolV2.js +4 -0
- package/editor/tools/v2/TransformControls.d.ts.map +1 -1
- package/editor/tools/v2/TransformControls.js +7 -0
- package/editor/view/ecs/EntityEditor.d.ts.map +1 -1
- package/editor/view/ecs/EntityEditor.js +4 -2
- package/package.json +1 -1
- package/src/core/assert.d.ts.map +1 -1
- package/src/core/assert.js +5 -1
- package/src/core/binary/hash/XXH128Hash.d.ts +1 -37
- package/src/core/binary/hash/XXH128Hash.d.ts.map +1 -1
- package/src/core/binary/hash/XXH128Hash.js +4 -55
- package/src/core/binary/hash/XXH3_SECRET.d.ts +1 -12
- package/src/core/binary/hash/XXH3_SECRET.d.ts.map +1 -1
- package/src/core/binary/hash/XXH3_SECRET.js +4 -25
- package/src/core/binary/hash/crc32.d.ts +1 -15
- package/src/core/binary/hash/crc32.d.ts.map +1 -1
- package/src/core/binary/hash/crc32.js +4 -96
- package/src/core/binary/hash/xxh3_128.d.ts +1 -9
- package/src/core/binary/hash/xxh3_128.d.ts.map +1 -1
- package/src/core/binary/hash/xxh3_128.js +4 -341
- package/src/core/binary/hash/xxh3_64.d.ts +1 -8
- package/src/core/binary/hash/xxh3_64.d.ts.map +1 -1
- package/src/core/binary/hash/xxh3_64.js +4 -241
- package/src/core/binary/hash/xxh3_common.d.ts +1 -223
- package/src/core/binary/hash/xxh3_common.d.ts.map +1 -1
- package/src/core/binary/hash/xxh3_common.js +90 -476
- package/src/core/collection/array/array_insert_at.d.ts +16 -0
- package/src/core/collection/array/array_insert_at.d.ts.map +1 -0
- package/src/core/collection/array/array_insert_at.js +32 -0
- package/src/core/collection/array/array_remove_at.d.ts +15 -0
- package/src/core/collection/array/array_remove_at.d.ts.map +1 -0
- package/src/core/collection/array/array_remove_at.js +30 -0
- package/src/core/collection/array/combine_hash.d.ts +6 -0
- package/src/core/collection/array/combine_hash.d.ts.map +1 -1
- package/src/core/collection/array/combine_hash.js +6 -0
- package/src/core/function/FunctionCompiler.js +2 -2
- package/src/core/geom/3d/mat4/m4_multiply.d.ts +3 -0
- package/src/core/geom/3d/mat4/m4_multiply.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/m4_multiply.js +3 -0
- package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts +30 -0
- package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_multiply_f64.js +106 -0
- package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts +37 -0
- package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_look_rotation.js +172 -0
- package/src/core/geom/ConicRay.js +2 -2
- package/src/core/geom/Quaternion.d.ts +1 -0
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +12 -48
- package/src/core/geom/Vector4.d.ts.map +1 -1
- package/src/core/geom/Vector4.js +8 -5
- package/src/core/math/hash/XXH128Hash.d.ts +38 -0
- package/src/core/math/hash/XXH128Hash.d.ts.map +1 -0
- package/src/core/math/hash/XXH128Hash.js +55 -0
- package/src/core/math/hash/XXH3_SECRET.d.ts +13 -0
- package/src/core/math/hash/XXH3_SECRET.d.ts.map +1 -0
- package/src/core/math/hash/XXH3_SECRET.js +25 -0
- package/src/core/math/hash/crc32.d.ts +16 -0
- package/src/core/math/hash/crc32.d.ts.map +1 -0
- package/src/core/math/hash/crc32.js +96 -0
- package/src/core/math/hash/xxh3_128.d.ts +10 -0
- package/src/core/math/hash/xxh3_128.d.ts.map +1 -0
- package/src/core/math/hash/xxh3_128.js +341 -0
- package/src/core/math/hash/xxh3_64.d.ts +9 -0
- package/src/core/math/hash/xxh3_64.d.ts.map +1 -0
- package/src/core/math/hash/xxh3_64.js +241 -0
- package/src/core/math/hash/xxh3_common.d.ts +224 -0
- package/src/core/math/hash/xxh3_common.d.ts.map +1 -0
- package/src/core/math/hash/xxh3_common.js +476 -0
- package/src/core/math/lookup/ParameterLookupTable.js +2 -2
- package/src/core/model/node-graph/node/NodeInstancePortReference.js +2 -2
- package/src/core/model/reactive/model/ReactiveBinaryExpression.js +2 -2
- package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -2
- package/src/engine/Engine.d.ts.map +1 -1
- package/src/engine/Engine.js +9 -4
- package/src/engine/asset/AssetDescription.js +2 -2
- package/src/engine/ecs/animation/Animation.js +2 -2
- package/src/engine/ecs/animation/AnimationClip.d.ts.map +1 -1
- package/src/engine/ecs/animation/AnimationClip.js +7 -5
- package/src/engine/ecs/gui/GUIElement.d.ts.map +1 -1
- package/src/engine/ecs/gui/GUIElement.js +7 -5
- package/src/engine/ecs/gui/hud/HeadsUpDisplay.js +2 -2
- package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
- package/src/engine/ecs/gui/position/ViewportPosition.js +11 -7
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +10 -0
- package/src/engine/ecs/transform/Transform64.d.ts +1 -1
- package/src/engine/ecs/transform/Transform64.d.ts.map +1 -1
- package/src/engine/ecs/transform/Transform64.js +5 -4
- package/src/engine/ecs/transform/t64_look_rotation.d.ts +4 -4
- package/src/engine/ecs/transform/t64_look_rotation.d.ts.map +1 -1
- package/src/engine/ecs/transform/t64_look_rotation.js +7 -18
- package/src/engine/graphics/ecs/animation/animator/AnimationClip.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/AnimationClip.js +8 -5
- package/src/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/AnimationNotification.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.js +8 -5
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.js +30 -1
- package/src/engine/graphics/ecs/decal/v2/Decal.d.ts.map +1 -1
- package/src/engine/graphics/ecs/decal/v2/Decal.js +9 -8
- package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.js +9 -6
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +6 -0
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
- package/src/engine/graphics3/GPUParticleEmitterSystem.js +72 -29
- package/src/engine/graphics3/ParticipatingMedia.js +204 -204
- package/src/engine/graphics3/animation/AnimationClips.d.ts +5 -0
- package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -1
- package/src/engine/graphics3/animation/AnimationClips.js +5 -0
- package/src/engine/grid/obstacle/GridObstacle.js +2 -2
- package/src/engine/input/devices/KeyboardDevice.d.ts +1 -0
- package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
- package/src/engine/input/devices/KeyboardDevice.js +7 -6
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +2 -2
- package/src/engine/interpolation/Interpolated.js +2 -2
- package/src/engine/navigation/ecs/path_following/PathFollowingSystem.d.ts.map +1 -1
- package/src/engine/navigation/ecs/path_following/PathFollowingSystem.js +15 -2
- package/src/engine/network/CONGESTION_CONTROL.md +9 -9
- package/src/engine/network/MESSAGE_TRANSPORT.md +364 -0
- package/src/engine/network/NetworkSession.d.ts +31 -11
- package/src/engine/network/NetworkSession.d.ts.map +1 -1
- package/src/engine/network/NetworkSession.js +453 -286
- package/src/engine/network/README.md +77 -27
- package/src/engine/network/SMOOTHNESS_DESIGN.md +13 -5
- package/src/engine/network/diagnostics/BandwidthMeter.d.ts +1 -1
- package/src/engine/network/diagnostics/BandwidthMeter.js +1 -1
- package/src/engine/network/orchestrator/HostJoin.d.ts +111 -0
- package/src/engine/network/orchestrator/HostJoin.d.ts.map +1 -0
- package/src/engine/network/orchestrator/HostJoin.js +271 -0
- package/src/engine/network/orchestrator/NetworkPeer.d.ts +151 -112
- package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.js +450 -499
- package/src/engine/network/orchestrator/PendingSlices.d.ts +30 -0
- package/src/engine/network/orchestrator/PendingSlices.d.ts.map +1 -0
- package/src/engine/network/orchestrator/PendingSlices.js +83 -0
- package/src/engine/network/orchestrator/ReliableFrames.d.ts +34 -0
- package/src/engine/network/orchestrator/ReliableFrames.d.ts.map +1 -0
- package/src/engine/network/orchestrator/ReliableFrames.js +96 -0
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +77 -10
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +236 -61
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +20 -6
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +33 -8
- package/src/engine/network/replication/Replicator.d.ts.map +1 -1
- package/src/engine/network/replication/Replicator.js +7 -1
- package/src/engine/network/sim/ActionLog.d.ts +32 -5
- package/src/engine/network/sim/ActionLog.d.ts.map +1 -1
- package/src/engine/network/sim/ActionLog.js +47 -5
- package/src/engine/network/sim/SimActionExecutor.d.ts +42 -2
- package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
- package/src/engine/network/sim/SimActionExecutor.js +100 -4
- package/src/engine/network/sim/Snapshotter.d.ts +12 -0
- package/src/engine/network/sim/Snapshotter.d.ts.map +1 -1
- package/src/engine/network/sim/Snapshotter.js +43 -0
- package/src/engine/network/state/Baseline.d.ts +1 -1
- package/src/engine/network/state/Baseline.js +1 -1
- package/src/engine/network/state/FrameBufferRing.d.ts +25 -6
- package/src/engine/network/state/FrameBufferRing.d.ts.map +1 -1
- package/src/engine/network/state/FrameBufferRing.js +51 -6
- package/src/engine/network/state/InputRing.d.ts +4 -0
- package/src/engine/network/state/InputRing.d.ts.map +1 -1
- package/src/engine/network/state/InputRing.js +7 -0
- package/src/engine/network/transport/DeferredTransport.d.ts.map +1 -1
- package/src/engine/network/transport/DeferredTransport.js +1 -0
- package/src/engine/network/transport/LoopbackTransport.d.ts.map +1 -1
- package/src/engine/network/transport/LoopbackTransport.js +4 -2
- package/src/engine/network/transport/Transport.d.ts +7 -0
- package/src/engine/network/transport/Transport.d.ts.map +1 -1
- package/src/engine/network/transport/Transport.js +8 -0
- package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/NodeUDPTransport.js +20 -5
- package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.js +8 -0
- package/src/engine/network/transport/adapters/WebTransportTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/WebTransportTransport.js +6 -0
- package/src/engine/network/transport/connection/Connection.d.ts +191 -0
- package/src/engine/network/transport/connection/Connection.d.ts.map +1 -0
- package/src/engine/network/transport/connection/Connection.js +1262 -0
- package/src/engine/network/transport/connection/RangeSet.d.ts +94 -0
- package/src/engine/network/transport/connection/RangeSet.d.ts.map +1 -0
- package/src/engine/network/transport/connection/RangeSet.js +260 -0
- package/src/engine/network/transport/connection/RxStream.d.ts +48 -0
- package/src/engine/network/transport/connection/RxStream.d.ts.map +1 -0
- package/src/engine/network/transport/connection/RxStream.js +211 -0
- package/src/engine/network/transport/connection/TxStream.d.ts +90 -0
- package/src/engine/network/transport/connection/TxStream.d.ts.map +1 -0
- package/src/engine/network/transport/connection/TxStream.js +243 -0
- package/src/engine/network/transport/connection/bytes_copy.d.ts +17 -0
- package/src/engine/network/transport/connection/bytes_copy.d.ts.map +1 -0
- package/src/engine/network/transport/connection/bytes_copy.js +34 -0
- package/src/engine/network/transport/connection/varint.d.ts +46 -0
- package/src/engine/network/transport/connection/varint.d.ts.map +1 -0
- package/src/engine/network/transport/connection/varint.js +107 -0
- package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/Cloth.js +7 -5
- package/src/engine/physics/cloth/ecs/ClothCollider.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothCollider.js +7 -5
- package/src/engine/physics/cloth/ecs/ClothDynamics.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothDynamics.js +20 -11
- package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidField.js +7 -5
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -1
- package/src/engine/physics/fluid/ecs/FluidComponent.js +19 -11
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +2 -2
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +2 -2
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +11 -7
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +11 -7
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.js +16 -9
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts +38 -7
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitter.js +47 -14
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.js +5 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts +18 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.js +48 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +12 -2
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +173 -9
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts +9 -3
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/LiveEmitterSet.js +28 -8
- package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts +8 -0
- package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts.map +1 -1
- package/src/engine/sound/ecs/trigger/AudioEventTrigger.js +192 -191
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.js +5 -1
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts +18 -0
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.js +51 -0
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.js +15 -1
- package/src/engine/sound/simulation/core/AcousticMedium.js +2 -2
- package/src/engine/sound/simulation/definition/AcousticDirectivity.js +2 -2
- package/src/engine/sound/simulation/definition/AcousticMaterial.d.ts.map +1 -1
- package/src/engine/sound/simulation/definition/AcousticMaterial.js +11 -7
- package/src/engine/sound/sopra/README.md +768 -644
- package/src/engine/sound/sopra/SopraEngine.d.ts +104 -8
- package/src/engine/sound/sopra/SopraEngine.d.ts.map +1 -1
- package/src/engine/sound/sopra/SopraEngine.js +327 -12
- package/src/engine/sound/sopra/definition/BusDefinition.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/BusDefinition.js +5 -4
- package/src/engine/sound/sopra/definition/DuckingRule.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/DuckingRule.js +7 -5
- package/src/engine/sound/sopra/definition/EventDescription.d.ts +28 -2
- package/src/engine/sound/sopra/definition/EventDescription.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/EventDescription.js +77 -17
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts +10 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.js +77 -55
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts +31 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.js +75 -0
- package/src/engine/sound/sopra/definition/MixerSnapshot.js +2 -2
- package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/ParameterDefinition.js +7 -5
- package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.js +4 -3
- package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.js +3 -3
- package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/SampleAudioClip.js +16 -9
- package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts +1 -1
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts +38 -9
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.js +34 -5
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts +7 -2
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.js +137 -120
- package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts +3 -1
- package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/EqEffect.js +146 -128
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts +1 -0
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.js +8 -3
- package/src/engine/sound/sopra/legacy/SoundEmitter.d.ts.map +1 -1
- package/src/engine/sound/sopra/legacy/SoundEmitter.js +357 -352
- package/src/engine/sound/sopra/legacy/SoundTrack.d.ts.map +1 -1
- package/src/engine/sound/sopra/legacy/SoundTrack.js +281 -278
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts +44 -2
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/BusGraph.js +83 -43
- package/src/engine/sound/sopra/runtime/EffectChain.d.ts +96 -0
- package/src/engine/sound/sopra/runtime/EffectChain.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/EffectChain.js +286 -0
- package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts +123 -0
- package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/EffectParamOverrides.js +320 -0
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts +55 -5
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/EventInstance.js +201 -26
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts +2 -1
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts.map +1 -1
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.js +6 -1
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts +15 -0
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts.map +1 -1
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.js +32 -0
- package/src/engine/sound/sopra/util/MockAudioContext.d.ts.map +1 -1
- package/src/engine/sound/sopra/util/MockAudioContext.js +3 -0
- package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts +13 -3
- package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts.map +1 -1
- package/src/engine/sound/sopra/util/fadeOutAndStop.js +25 -13
- package/src/format/image/png/PNGReader.js +644 -644
- package/src/format/image/png/crc32.d.ts +1 -1
- package/src/format/image/png/crc32.js +7 -8
- package/src/shade/RENDERER_CONTRACT.md +6 -3
- package/src/shade/descriptor/binding/BindGroupLayoutDescriptor.js +2 -2
- package/src/shade/descriptor/binding/BindGroupLayoutEntry.d.ts.map +1 -1
- package/src/shade/descriptor/binding/BindGroupLayoutEntry.js +12 -8
- package/src/shade/descriptor/binding/StorageTextureBindingLayout.js +2 -2
- package/src/shade/descriptor/binding/TextureBindingLayout.js +2 -2
- package/src/shade/descriptor/blend/BlendComponent.js +2 -2
- package/src/shade/descriptor/pipeline/PipelineDescriptorBase.js +2 -2
- package/src/shade/descriptor/pipeline/PipelineLayoutDescriptor.js +2 -2
- package/src/shade/descriptor/pipeline/ProgrammableStage.js +2 -2
- package/src/shade/descriptor/pipeline/compute/ComputePipelineDescriptor.js +2 -2
- package/src/shade/descriptor/pipeline/render/ColorTargetState.js +2 -2
- package/src/shade/descriptor/pipeline/render/FragmentState.js +2 -2
- package/src/shade/descriptor/pipeline/render/PrimitiveState.js +2 -2
- package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.js +8 -5
- package/src/shade/descriptor/pipeline/render/VertexAttribute.js +2 -2
- package/src/shade/descriptor/texture/SamplerDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/texture/SamplerDescriptor.js +20 -12
- package/src/shade/descriptor/texture/TextureDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/texture/TextureDescriptor.js +11 -7
- package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts +24 -0
- package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts.map +1 -0
- package/src/shade/device/SHADE_DEVICE_FLOOR.js +34 -0
- package/src/shade/device/ShadeDeviceFailure.d.ts +12 -5
- package/src/shade/device/ShadeDeviceFailure.d.ts.map +1 -1
- package/src/shade/device/ShadeDeviceFailure.js +17 -8
- package/src/shade/device/ShadeDeviceFailureReason.d.ts +1 -1
- package/src/shade/device/ShadeDeviceFailureReason.js +2 -2
- package/src/shade/device/graph/BufferResourceDescriptor.d.ts.map +1 -1
- package/src/shade/device/graph/BufferResourceDescriptor.js +196 -193
- package/src/shade/device/graph/TextureResourceDescriptor.d.ts.map +1 -1
- package/src/shade/device/graph/TextureResourceDescriptor.js +178 -173
- package/src/shade/device/shade_device_floor_unmet.d.ts +13 -0
- package/src/shade/device/shade_device_floor_unmet.d.ts.map +1 -0
- package/src/shade/device/shade_device_floor_unmet.js +32 -0
- package/src/shade/device/timing/profile/sgpt_read_header.js +1 -1
- package/src/shade/device/timing/profile/sgpt_read_records.js +1 -1
- package/src/shade/device/timing/profile/sgpt_write_header.js +1 -1
- package/src/shade/device/timing/profile/sgpt_write_record.js +1 -1
- package/src/shade/renderer/Renderer.d.ts +2 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +29 -55
- package/src/shade/renderer/binding/BufferBinding.js +2 -2
- package/src/shade/renderer/buffer/GPUBufferAllocator.d.ts.map +1 -1
- package/src/shade/renderer/buffer/GPUBufferAllocator.js +9 -0
- package/src/shade/renderer/buffer/buffer_pool_ops.d.ts +21 -12
- package/src/shade/renderer/buffer/buffer_pool_ops.d.ts.map +1 -1
- package/src/shade/renderer/buffer/buffer_pool_ops.js +18 -19
- package/src/shade/renderer/camera/Camera.js +2 -2
- package/src/shade/renderer/geometry/Attribute.js +2 -2
- package/src/shade/renderer/geometry/Geometry.js +2 -2
- package/src/shade/renderer/geometry/geometry_deduplicate_vertices.js +2 -2
- package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +2 -2
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_asset_id.js +13 -13
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_directory_block_checksum.js +41 -41
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_frame_checksum.js +41 -41
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_header_checksum.js +25 -25
- package/src/shade/renderer/gpu_primitive/test/gpu_test.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/test/gpu_test.js +8 -11
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/material/StandardShadeMaterial.d.ts.map +1 -1
- package/src/shade/renderer/material/StandardShadeMaterial.js +13 -8
- package/src/shade/renderer/pool/TransientResourcePool.d.ts +24 -0
- package/src/shade/renderer/pool/TransientResourcePool.d.ts.map +1 -1
- package/src/shade/renderer/pool/TransientResourcePool.js +41 -10
- package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.d.ts.map +1 -1
- package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.js +14 -5
- package/src/shade/renderer/scene/optimization/sampler2d_from_image_bitmap.js +1 -1
- package/src/shade/renderer/shader/ComputeShader.d.ts.map +1 -1
- package/src/shade/renderer/shader/ComputeShader.js +18 -2
- package/src/shade/renderer/shader/ImageShader.d.ts.map +1 -1
- package/src/shade/renderer/shader/ImageShader.js +230 -218
- package/src/shade/renderer/shader/type/WGSLStructField.js +2 -2
- package/src/shade/renderer/shader/type/WebGPUArray.js +2 -2
- package/src/shade/renderer/shader/type/WebGPUStruct.d.ts.map +1 -1
- package/src/shade/renderer/shader/type/WebGPUStruct.js +9 -6
- package/src/shade/renderer/texture/ShadeTexture.d.ts.map +1 -1
- package/src/shade/renderer/texture/ShadeTexture.js +17 -10
- package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +2 -2
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +4 -4
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +6 -6
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +46 -55
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts +3 -3
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +14 -4
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +10 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +82 -40
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +4 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +8 -4
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +98 -86
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/shader_water_particles.js +440 -298
- package/src/view/common/HTMLElementCacheKey.d.ts.map +1 -1
- package/src/view/common/HTMLElementCacheKey.js +4 -3
- package/src/view/graphics/GraphicsContextFailureView.d.ts +1 -2
- package/src/view/graphics/GraphicsContextFailureView.d.ts.map +1 -1
- package/src/view/graphics/GraphicsContextFailureView.js +1 -2
- package/src/view/minimap/MinimapMarker.js +2 -2
- package/src/engine/network/transport/Channel.js +0 -336
- package/src/engine/network/transport/ReliableCommandPipeline.js +0 -335
- package/src/engine/network/transport/fragments/FragmentAssembler.js +0 -350
- package/src/engine/network/transport/fragments/FragmentRetention.js +0 -191
- package/src/engine/network/transport/fragments/fragment_send.js +0 -157
- 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
|
|
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 {
|
|
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 =
|
|
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
|
|
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 {
|
|
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
|
|
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":"
|
|
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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G;IACH,iBAJW,MAAM,EAAE,WACR,MAAM,GACJ,IAAI,CAYhB;IAED;;;;;OAKG;IACH,gBAJW,MAAM,EAAE,WACR,MAAM,GACJ,MAAM,EAAE,CAYpB;IAED;;;;;OAKG;IACH,cAJW,UAAU,GACR,OAAO,CASnB;IAED;;;OAGG;IACH,QAFa,MAAM,CAQlB;IAED;;;;;OAKG;IACH,qBAJW,UAAU,cACV,MAAM,GACL,OAAO,CAOlB;IAED;;;;;;;;OAQG;IACH,kBAPW,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,cACN,MAAM,GACL,OAAO,CASlB;IAED;;;OAGG;IACH,wBAFsB,MAAM,QAI3B;IAED;;;OAGG;IACH,sBAFsB,MAAM,QAuB3B;IAqEL;;OAEG;IACH,uBApMe,MAAM,EAAE,WACR,MAAM,KACJ,IAAI,CAkMa;IAElC;;OAEG;IACH,uBAvLe,MAAM,EAAE,WACR,MAAM,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;;;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
|
-
|
|
21
|
-
|
|
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
|
-
|
|
168
|
-
|
|
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":"
|
|
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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OAAO,CASlB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,SAFa,OAAO,CAQnB;IAED;;;OAGG;IACH,mBAFW,UAAU,QAyBpB;IAED;;;;OAIG;IACH,aAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,QAFY,MAAM,CAWjB;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,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"}
|
package/src/core/geom/Vector4.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { assert } from "../assert.js";
|
|
2
|
-
import {
|
|
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
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
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"}
|