@onerjs/core 8.41.6 → 8.41.7
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/Animations/animation.d.ts +6 -2
- package/Animations/animation.js +28 -4
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.d.ts +2 -1
- package/Animations/animationGroup.js +3 -2
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/animatorAvatar.d.ts +161 -0
- package/Animations/animatorAvatar.js +573 -0
- package/Animations/animatorAvatar.js.map +1 -0
- package/Animations/index.d.ts +1 -0
- package/Animations/index.js +1 -0
- package/Animations/index.js.map +1 -1
- package/AudioV2/webAudio/webAudioSoundSource.d.ts +2 -2
- package/AudioV2/webAudio/webAudioSoundSource.js +12 -2
- package/AudioV2/webAudio/webAudioSoundSource.js.map +1 -1
- package/Bones/index.d.ts +1 -0
- package/Bones/index.js +1 -0
- package/Bones/index.js.map +1 -1
- package/Bones/skeleton.d.ts +13 -0
- package/Bones/skeleton.functions.d.ts +26 -0
- package/Bones/skeleton.functions.js +91 -0
- package/Bones/skeleton.functions.js.map +1 -0
- package/Bones/skeleton.js +26 -0
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/geospatialCamera.js +21 -20
- package/Cameras/geospatialCamera.js.map +1 -1
- package/Cameras/geospatialCameraMovement.d.ts +8 -1
- package/Cameras/geospatialCameraMovement.js +29 -8
- package/Cameras/geospatialCameraMovement.js.map +1 -1
- package/Collisions/gpuPicker.d.ts +11 -0
- package/Collisions/gpuPicker.js +148 -19
- package/Collisions/gpuPicker.js.map +1 -1
- package/Debug/skeletonViewer.d.ts +4 -8
- package/Debug/skeletonViewer.js +13 -22
- package/Debug/skeletonViewer.js.map +1 -1
- package/Engines/Extensions/engine.multiview.d.ts +2 -0
- package/Engines/Extensions/engine.multiview.js +7 -3
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +4 -0
- package/Engines/constants.js +4 -0
- package/Engines/constants.js.map +1 -1
- package/Instrumentation/engineInstrumentation.js +2 -1
- package/Instrumentation/engineInstrumentation.js.map +1 -1
- package/Layers/effectLayer.js +1 -3
- package/Layers/effectLayer.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +2 -3
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +37 -2
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.d.ts +109 -0
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js +210 -0
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +71 -15
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.d.ts +86 -0
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js +161 -0
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js.map +1 -0
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +0 -6
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js +0 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js +0 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js.map +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.d.ts +14 -0
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +14 -0
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +20 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js +20 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/depthSourceBlock.d.ts +13 -0
- package/Materials/Node/Blocks/Dual/depthSourceBlock.js +13 -0
- package/Materials/Node/Blocks/Dual/depthSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.d.ts +21 -0
- package/Materials/Node/Blocks/Dual/fogBlock.js +21 -0
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.d.ts +21 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +21 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.d.ts +38 -0
- package/Materials/Node/Blocks/Dual/lightBlock.js +38 -0
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +29 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +29 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBlock.d.ts +5 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js +5 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.d.ts +16 -0
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +16 -0
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.d.ts +16 -0
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js +16 -0
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.d.ts +34 -0
- package/Materials/Node/Blocks/Dual/textureBlock.js +34 -0
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.d.ts +17 -0
- package/Materials/Node/Blocks/Fragment/TBNBlock.js +17 -2
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.d.ts +7 -0
- package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.js +7 -0
- package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +21 -0
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +21 -0
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.d.ts +10 -0
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +10 -0
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.d.ts +28 -0
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +28 -0
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +30 -0
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +30 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.d.ts +4 -0
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +4 -0
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSpaceBlock.d.ts +5 -0
- package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js +5 -0
- package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/twirlBlock.d.ts +3 -0
- package/Materials/Node/Blocks/Fragment/twirlBlock.js +3 -0
- package/Materials/Node/Blocks/Fragment/twirlBlock.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.d.ts +6 -0
- package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js +6 -0
- package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.d.ts +16 -0
- package/Materials/Node/Blocks/Input/inputBlock.js +16 -1
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.d.ts +5 -0
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js +5 -0
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +10 -0
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +10 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +23 -0
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +23 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.d.ts +17 -0
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js +17 -0
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.d.ts +41 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +41 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.d.ts +21 -0
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +21 -0
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.d.ts +29 -0
- package/Materials/Node/Blocks/PBR/refractionBlock.js +29 -0
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.d.ts +14 -0
- package/Materials/Node/Blocks/PBR/sheenBlock.js +14 -0
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.d.ts +7 -0
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +7 -0
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.d.ts +23 -0
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js +23 -0
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportInBlock.d.ts +6 -0
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js +6 -0
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.d.ts +17 -0
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js +17 -0
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/bonesBlock.d.ts +22 -0
- package/Materials/Node/Blocks/Vertex/bonesBlock.js +22 -0
- package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.d.ts +13 -0
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +13 -0
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.d.ts +20 -0
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +20 -0
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.d.ts +27 -0
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +27 -0
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/clampBlock.d.ts +10 -0
- package/Materials/Node/Blocks/clampBlock.js +10 -0
- package/Materials/Node/Blocks/clampBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.d.ts +10 -0
- package/Materials/Node/Blocks/cloudBlock.js +10 -0
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorMergerBlock.d.ts +10 -0
- package/Materials/Node/Blocks/colorMergerBlock.js +10 -0
- package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/conditionalBlock.d.ts +14 -0
- package/Materials/Node/Blocks/conditionalBlock.js +14 -0
- package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
- package/Materials/Node/Blocks/curveBlock.d.ts +10 -0
- package/Materials/Node/Blocks/curveBlock.js +10 -0
- package/Materials/Node/Blocks/curveBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.d.ts +10 -0
- package/Materials/Node/Blocks/customBlock.js +10 -0
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/debugBlock.d.ts +10 -0
- package/Materials/Node/Blocks/debugBlock.js +10 -0
- package/Materials/Node/Blocks/debugBlock.js.map +1 -1
- package/Materials/Node/Blocks/fresnelBlock.d.ts +4 -0
- package/Materials/Node/Blocks/fresnelBlock.js +4 -0
- package/Materials/Node/Blocks/fresnelBlock.js.map +1 -1
- package/Materials/Node/Blocks/gradientBlock.d.ts +10 -0
- package/Materials/Node/Blocks/gradientBlock.js +10 -0
- package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
- package/Materials/Node/Blocks/loopBlock.d.ts +10 -0
- package/Materials/Node/Blocks/loopBlock.js +10 -0
- package/Materials/Node/Blocks/loopBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.d.ts +1 -0
- package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -0
- package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.d.ts +10 -0
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js +10 -0
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
- package/Materials/Node/Blocks/pannerBlock.d.ts +5 -0
- package/Materials/Node/Blocks/pannerBlock.js +5 -0
- package/Materials/Node/Blocks/pannerBlock.js.map +1 -1
- package/Materials/Node/Blocks/remapBlock.d.ts +10 -0
- package/Materials/Node/Blocks/remapBlock.js +10 -0
- package/Materials/Node/Blocks/remapBlock.js.map +1 -1
- package/Materials/Node/Blocks/rotate2dBlock.d.ts +1 -0
- package/Materials/Node/Blocks/rotate2dBlock.js +1 -0
- package/Materials/Node/Blocks/rotate2dBlock.js.map +1 -1
- package/Materials/Node/Blocks/transformBlock.d.ts +10 -0
- package/Materials/Node/Blocks/transformBlock.js +10 -0
- package/Materials/Node/Blocks/transformBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.d.ts +22 -0
- package/Materials/Node/Blocks/triPlanarBlock.js +22 -0
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/trigonometryBlock.d.ts +10 -0
- package/Materials/Node/Blocks/trigonometryBlock.js +10 -0
- package/Materials/Node/Blocks/trigonometryBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorMergerBlock.d.ts +10 -0
- package/Materials/Node/Blocks/vectorMergerBlock.js +10 -0
- package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/viewDirectionBlock.d.ts +5 -0
- package/Materials/Node/Blocks/viewDirectionBlock.js +5 -0
- package/Materials/Node/Blocks/viewDirectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/waveBlock.d.ts +10 -0
- package/Materials/Node/Blocks/waveBlock.js +10 -0
- package/Materials/Node/Blocks/waveBlock.js.map +1 -1
- package/Materials/Node/Blocks/worleyNoise3DBlock.d.ts +1 -0
- package/Materials/Node/Blocks/worleyNoise3DBlock.js +1 -0
- package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +13 -0
- package/Materials/Node/nodeMaterial.js +14 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.d.ts +0 -3
- package/Materials/Node/nodeMaterialBlock.js +1 -6
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +1 -2
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +1 -1
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/index.d.ts +2 -0
- package/Materials/index.js +2 -0
- package/Materials/index.js.map +1 -1
- package/Maths/math.constants.d.ts +2 -1
- package/Maths/math.constants.js +3 -2
- package/Maths/math.constants.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +17 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/instancedMesh.js +1 -0
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +5 -0
- package/Meshes/mesh.js +39 -16
- package/Meshes/mesh.js.map +1 -1
- package/Misc/dataStorage.d.ts +13 -0
- package/Misc/dataStorage.js +25 -0
- package/Misc/dataStorage.js.map +1 -1
- package/Morph/morphTarget.d.ts +9 -5
- package/Morph/morphTarget.js +15 -7
- package/Morph/morphTarget.js.map +1 -1
- package/Morph/morphTargetManager.d.ts +3 -1
- package/Morph/morphTargetManager.js +5 -2
- package/Morph/morphTargetManager.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/coneShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/coneShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/customShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/customShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/emitters.functions.js +3 -3
- package/Particles/Node/Blocks/Emitters/emitters.functions.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js +2 -2
- package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js +7 -7
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleLocalVariableBlock.js +2 -2
- package/Particles/Node/Blocks/particleLocalVariableBlock.js.map +1 -1
- package/Particles/Node/nodeParticleBuildState.js +7 -7
- package/Particles/Node/nodeParticleBuildState.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.helper.js +9 -4
- package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
- package/Particles/particle.d.ts +73 -61
- package/Particles/particle.js +106 -91
- package/Particles/particle.js.map +1 -1
- package/Particles/particleSystem.js +5 -5
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.function.js +83 -83
- package/Particles/thinParticleSystem.function.js.map +1 -1
- package/Particles/thinParticleSystem.js +8 -8
- package/Particles/thinParticleSystem.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.d.ts +14 -1
- package/Physics/v2/Plugins/havokPlugin.js +154 -10
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Probes/reflectionProbe.js +9 -6
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +3 -1
- package/Rendering/objectRenderer.js +28 -8
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/reflectiveShadowMap.js +1 -1
- package/Rendering/reflectiveShadowMap.js.map +1 -1
- package/Rendering/thinDepthPeelingRenderer.js +8 -0
- package/Rendering/thinDepthPeelingRenderer.js.map +1 -1
- package/Shaders/gaussianSplatting.fragment.js +8 -2
- package/Shaders/gaussianSplatting.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +8 -2
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.fragment.js +7 -1
- package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +8 -2
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +22 -1
- package/scene.js +15 -15
- package/scene.js.map +1 -1
|
@@ -82,7 +82,6 @@ export declare class HavokPlugin implements IPhysicsEnginePluginV2 {
|
|
|
82
82
|
private _tmpVec3;
|
|
83
83
|
private _bodies;
|
|
84
84
|
private _shapes;
|
|
85
|
-
private _bodyBuffer;
|
|
86
85
|
private _bodyCollisionObservable;
|
|
87
86
|
private _constraintToBodyIdPair;
|
|
88
87
|
private _bodyCollisionEndedObservable;
|
|
@@ -112,6 +111,20 @@ export declare class HavokPlugin implements IPhysicsEnginePluginV2 {
|
|
|
112
111
|
* @returns The world region to use for this body
|
|
113
112
|
*/
|
|
114
113
|
private _getOrCreateWorldRegion;
|
|
114
|
+
/**
|
|
115
|
+
* Checks if a body's world position has left its current region and, if so,
|
|
116
|
+
* moves it to the correct region (existing or newly created).
|
|
117
|
+
* This preserves linear and angular velocity across the transition.
|
|
118
|
+
*
|
|
119
|
+
* @param pluginData - The plugin data for the body (or instance) to check
|
|
120
|
+
*/
|
|
121
|
+
private _reRegionBodyPluginData;
|
|
122
|
+
/**
|
|
123
|
+
* Searches existing world regions for one that contains the given position.
|
|
124
|
+
* @param worldPosition - The world position to find a region for
|
|
125
|
+
* @returns null if no existing region contains it (does NOT create a new one).
|
|
126
|
+
*/
|
|
127
|
+
private _findExistingRegion;
|
|
115
128
|
/**
|
|
116
129
|
* Observable for collision started and collision continued events
|
|
117
130
|
*/
|
|
@@ -250,6 +250,98 @@ export class HavokPlugin {
|
|
|
250
250
|
this._worldRegions.push(newRegion);
|
|
251
251
|
return newRegion;
|
|
252
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* Checks if a body's world position has left its current region and, if so,
|
|
255
|
+
* moves it to the correct region (existing or newly created).
|
|
256
|
+
* This preserves linear and angular velocity across the transition.
|
|
257
|
+
*
|
|
258
|
+
* @param pluginData - The plugin data for the body (or instance) to check
|
|
259
|
+
*/
|
|
260
|
+
_reRegionBodyPluginData(pluginData) {
|
|
261
|
+
const currentRegion = pluginData.worldRegion;
|
|
262
|
+
if (!currentRegion) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
// Read the body's current local transform from Havok
|
|
266
|
+
const bodyTransform = this._hknp.HP_Body_GetQTransform(pluginData.hpBodyId)[1];
|
|
267
|
+
const localPos = bodyTransform[0];
|
|
268
|
+
const orientation = bodyTransform[1];
|
|
269
|
+
// Compute world position = local position + floating origin
|
|
270
|
+
const worldPos = TmpVectors.Vector3[2];
|
|
271
|
+
worldPos.set(localPos[0] + currentRegion.floatingOrigin._x, localPos[1] + currentRegion.floatingOrigin._y, localPos[2] + currentRegion.floatingOrigin._z);
|
|
272
|
+
// Check if still within the current region.
|
|
273
|
+
// Use a 20% hysteresis margin so that bodies near the boundary
|
|
274
|
+
// don't oscillate between regions every frame.
|
|
275
|
+
const distToCurrent = Vector3.Distance(worldPos, currentRegion.floatingOrigin);
|
|
276
|
+
if (distToCurrent <= this._floatingOriginWorldRadius * 1.2) {
|
|
277
|
+
return; // still in region (with hysteresis), nothing to do
|
|
278
|
+
}
|
|
279
|
+
// Body has left its region. Use velocity to look ahead and find the best
|
|
280
|
+
// region to join. This prevents creating throwaway intermediate regions
|
|
281
|
+
// when a fast body is heading toward an existing region (e.g. a target).
|
|
282
|
+
const linVel = this._hknp.HP_Body_GetLinearVelocity(pluginData.hpBodyId)[1];
|
|
283
|
+
const angVel = this._hknp.HP_Body_GetAngularVelocity(pluginData.hpBodyId)[1];
|
|
284
|
+
// Project position forward by one second of travel to find a suitable existing region.
|
|
285
|
+
// This is purely for region selection — the body's actual position is not changed.
|
|
286
|
+
const lookAheadPos = TmpVectors.Vector3[3];
|
|
287
|
+
lookAheadPos.set(worldPos._x + linVel[0], worldPos._y + linVel[1], worldPos._z + linVel[2]);
|
|
288
|
+
// Try to find the best region: first check if look-ahead position falls in an existing region
|
|
289
|
+
let newRegion = this._findExistingRegion(lookAheadPos);
|
|
290
|
+
if (!newRegion || newRegion === currentRegion) {
|
|
291
|
+
// Fall back to current position
|
|
292
|
+
newRegion = this._findExistingRegion(worldPos);
|
|
293
|
+
}
|
|
294
|
+
if (!newRegion || newRegion === currentRegion) {
|
|
295
|
+
// No existing region works — create one at the current position
|
|
296
|
+
newRegion = this._getOrCreateWorldRegion(worldPos);
|
|
297
|
+
}
|
|
298
|
+
if (newRegion === currentRegion) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
// Remove from old world
|
|
302
|
+
this._hknp.HP_World_RemoveBody(currentRegion.world, pluginData.hpBodyId);
|
|
303
|
+
// Set transform relative to the new region's floating origin
|
|
304
|
+
const newOffset = newRegion.floatingOrigin;
|
|
305
|
+
const newLocalPos = [worldPos._x - newOffset._x, worldPos._y - newOffset._y, worldPos._z - newOffset._z];
|
|
306
|
+
this._hknp.HP_Body_SetQTransform(pluginData.hpBodyId, [newLocalPos, orientation]);
|
|
307
|
+
// Add to new world
|
|
308
|
+
this._hknp.HP_World_AddBody(newRegion.world, pluginData.hpBodyId, false);
|
|
309
|
+
// Restore velocity
|
|
310
|
+
this._hknp.HP_Body_SetLinearVelocity(pluginData.hpBodyId, linVel);
|
|
311
|
+
this._hknp.HP_Body_SetAngularVelocity(pluginData.hpBodyId, angVel);
|
|
312
|
+
// Update the region reference and world transform offset
|
|
313
|
+
pluginData.worldRegion = newRegion;
|
|
314
|
+
pluginData.worldTransformOffset = this._hknp.HP_Body_GetWorldTransformOffset(pluginData.hpBodyId)[1];
|
|
315
|
+
// Garbage-collect the old region if it has no bodies left and it's not the default world
|
|
316
|
+
if (currentRegion !== this._worldRegions[0]) {
|
|
317
|
+
const bodyCount = this._hknp.HP_World_GetNumBodies(currentRegion.world)[1];
|
|
318
|
+
if (bodyCount === 0) {
|
|
319
|
+
this._hknp.HP_World_Release(currentRegion.world);
|
|
320
|
+
const idx = this._worldRegions.indexOf(currentRegion);
|
|
321
|
+
if (idx > 0) {
|
|
322
|
+
this._worldRegions.splice(idx, 1);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Searches existing world regions for one that contains the given position.
|
|
329
|
+
* @param worldPosition - The world position to find a region for
|
|
330
|
+
* @returns null if no existing region contains it (does NOT create a new one).
|
|
331
|
+
*/
|
|
332
|
+
_findExistingRegion(worldPosition) {
|
|
333
|
+
const scene = FloatingOriginCurrentScene.getScene();
|
|
334
|
+
if (!scene?.floatingOriginMode) {
|
|
335
|
+
return this._worldRegions[0];
|
|
336
|
+
}
|
|
337
|
+
for (const region of this._worldRegions) {
|
|
338
|
+
const distance = Vector3.Distance(worldPosition, region.floatingOrigin);
|
|
339
|
+
if (distance <= this._floatingOriginWorldRadius) {
|
|
340
|
+
return region;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
253
345
|
constructor(_useDeltaForWorldStep = true, hpInjection = HK, parameters = {}) {
|
|
254
346
|
this._useDeltaForWorldStep = _useDeltaForWorldStep;
|
|
255
347
|
/**
|
|
@@ -419,6 +511,21 @@ export class HavokPlugin {
|
|
|
419
511
|
* to accurately simulate the physics bodies in the world.
|
|
420
512
|
*/
|
|
421
513
|
executeStep(delta, physicsBodies) {
|
|
514
|
+
// Re-region bodies that have moved outside their current world region
|
|
515
|
+
// BEFORE pre-step and stepping, so the body participates in the correct
|
|
516
|
+
// world's step and its body buffer transform is valid when sync reads it.
|
|
517
|
+
if (this._worldRegions.length > 1 || FloatingOriginCurrentScene.getScene()?.floatingOriginMode) {
|
|
518
|
+
for (const physicsBody of physicsBodies) {
|
|
519
|
+
if (physicsBody._pluginDataInstances.length > 0) {
|
|
520
|
+
for (const instance of physicsBody._pluginDataInstances) {
|
|
521
|
+
this._reRegionBodyPluginData(instance);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
else if (physicsBody._pluginData) {
|
|
525
|
+
this._reRegionBodyPluginData(physicsBody._pluginData);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
422
529
|
for (const physicsBody of physicsBodies) {
|
|
423
530
|
if (physicsBody.disablePreStep) {
|
|
424
531
|
continue;
|
|
@@ -431,8 +538,6 @@ export class HavokPlugin {
|
|
|
431
538
|
this._hknp.HP_World_SetIdealStepTime(region.world, deltaTime);
|
|
432
539
|
this._hknp.HP_World_Step(region.world, deltaTime);
|
|
433
540
|
}
|
|
434
|
-
// Get body buffer from the default world (first region)
|
|
435
|
-
this._bodyBuffer = this._hknp.HP_World_GetBodyBuffer(this.world)[1];
|
|
436
541
|
for (const physicsBody of physicsBodies) {
|
|
437
542
|
if (!physicsBody.disableSync) {
|
|
438
543
|
this.sync(physicsBody);
|
|
@@ -665,7 +770,8 @@ export class HavokPlugin {
|
|
|
665
770
|
const pluginData = body._pluginDataInstances[i];
|
|
666
771
|
// Use instance's world region offset
|
|
667
772
|
const instanceOffset = pluginData.worldRegion.floatingOrigin;
|
|
668
|
-
|
|
773
|
+
// Get body buffer from the instance's own world region (not always the default world)
|
|
774
|
+
const bodyBuffer = this._hknp.HP_World_GetBodyBuffer(pluginData.worldRegion.world)[1];
|
|
669
775
|
const bufOffset = pluginData.worldTransformOffset;
|
|
670
776
|
const transformBuffer = new Float32Array(this._hknp.HEAPU8.buffer, bodyBuffer + bufOffset, 16);
|
|
671
777
|
const index = i * 16;
|
|
@@ -1169,7 +1275,43 @@ export class HavokPlugin {
|
|
|
1169
1275
|
this._createOrUpdateBodyInstances(body, body.getMotionType(), matrixData, 0, instancesCount, true);
|
|
1170
1276
|
}
|
|
1171
1277
|
else {
|
|
1172
|
-
//
|
|
1278
|
+
// Check if the node's new world position requires a region change.
|
|
1279
|
+
// This ensures teleports (e.g. toggling disablePreStep after moving
|
|
1280
|
+
// the transform node) immediately land in the correct region with
|
|
1281
|
+
// correct local coordinates, avoiding a one-frame precision glitch.
|
|
1282
|
+
const pluginData = body._pluginData;
|
|
1283
|
+
if (pluginData.worldRegion && (this._worldRegions.length > 1 || FloatingOriginCurrentScene.getScene()?.floatingOriginMode)) {
|
|
1284
|
+
// Get world position of the node
|
|
1285
|
+
const worldPos = TmpVectors.Vector3[3];
|
|
1286
|
+
if (node.parent) {
|
|
1287
|
+
node.computeWorldMatrix(true);
|
|
1288
|
+
worldPos.copyFrom(node.absolutePosition);
|
|
1289
|
+
}
|
|
1290
|
+
else {
|
|
1291
|
+
worldPos.copyFrom(node.position);
|
|
1292
|
+
}
|
|
1293
|
+
const currentRegion = pluginData.worldRegion;
|
|
1294
|
+
const distToCurrent = Vector3.Distance(worldPos, currentRegion.floatingOrigin);
|
|
1295
|
+
if (distToCurrent > this._floatingOriginWorldRadius * 1.2) {
|
|
1296
|
+
// Teleporting outside current region - re-region before setting transform
|
|
1297
|
+
const newRegion = this._getOrCreateWorldRegion(worldPos);
|
|
1298
|
+
if (newRegion !== currentRegion) {
|
|
1299
|
+
// Save velocity before removing from old world
|
|
1300
|
+
const linVel = this._hknp.HP_Body_GetLinearVelocity(pluginData.hpBodyId)[1];
|
|
1301
|
+
const angVel = this._hknp.HP_Body_GetAngularVelocity(pluginData.hpBodyId)[1];
|
|
1302
|
+
// Remove from old world, add to new world
|
|
1303
|
+
this._hknp.HP_World_RemoveBody(currentRegion.world, pluginData.hpBodyId);
|
|
1304
|
+
this._hknp.HP_World_AddBody(newRegion.world, pluginData.hpBodyId, false);
|
|
1305
|
+
// Restore velocity
|
|
1306
|
+
this._hknp.HP_Body_SetLinearVelocity(pluginData.hpBodyId, linVel);
|
|
1307
|
+
this._hknp.HP_Body_SetAngularVelocity(pluginData.hpBodyId, angVel);
|
|
1308
|
+
// Update region reference and cached world transform offset
|
|
1309
|
+
pluginData.worldRegion = newRegion;
|
|
1310
|
+
pluginData.worldTransformOffset = this._hknp.HP_Body_GetWorldTransformOffset(pluginData.hpBodyId)[1];
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
// Set transform using the (possibly updated) region offset
|
|
1173
1315
|
const offset = body._pluginData.worldRegion.floatingOrigin;
|
|
1174
1316
|
this._hknp.HP_Body_SetQTransform(body._pluginData.hpBodyId, this._getTransformInfos(node, offset));
|
|
1175
1317
|
}
|
|
@@ -2289,16 +2431,18 @@ export class HavokPlugin {
|
|
|
2289
2431
|
let eventAddress = this._hknp.HP_World_GetCollisionEvents(targetWorld)[1];
|
|
2290
2432
|
const event = new CollisionEvent();
|
|
2291
2433
|
const worldAddr = Number(targetWorld);
|
|
2434
|
+
// Find the region for this world to get the correct floating origin offset.
|
|
2435
|
+
// All bodies in a collision share the same world, so use one offset for both.
|
|
2436
|
+
const region = this._worldRegions.find((r) => Number(r.world) === worldAddr) ?? this._worldRegions[0];
|
|
2437
|
+
const regionOffset = region.floatingOrigin;
|
|
2292
2438
|
while (eventAddress) {
|
|
2293
2439
|
CollisionEvent.readToRef(this._hknp.HEAPU8.buffer, eventAddress, event);
|
|
2294
2440
|
const bodyInfoA = this._bodies.get(event.contactOnA.bodyId);
|
|
2295
2441
|
const bodyInfoB = this._bodies.get(event.contactOnB.bodyId);
|
|
2296
|
-
// Add floating origin offset back to collision contact positions
|
|
2297
|
-
//
|
|
2298
|
-
|
|
2299
|
-
event.
|
|
2300
|
-
const offsetB = bodyInfoB?.body?._pluginData?.worldRegion?.floatingOrigin ?? this._worldRegions[0].floatingOrigin;
|
|
2301
|
-
event.contactOnB.position.addInPlace(offsetB);
|
|
2442
|
+
// Add floating origin offset back to collision contact positions.
|
|
2443
|
+
// Both contacts are in the same world, so use the region's floating origin.
|
|
2444
|
+
event.contactOnA.position.addInPlace(regionOffset);
|
|
2445
|
+
event.contactOnB.position.addInPlace(regionOffset);
|
|
2302
2446
|
// Bodies may have been disposed between events. Check both still exist.
|
|
2303
2447
|
if (bodyInfoA && bodyInfoB) {
|
|
2304
2448
|
const collisionInfo = {
|