@babylonjs/core 5.45.1 → 5.46.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/Actions/condition.js +23 -23
- package/Actions/condition.js.map +1 -1
- package/Animations/animatable.js +48 -48
- package/Animations/animatable.js.map +1 -1
- package/Animations/animation.js +53 -53
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.js +53 -53
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/runtimeAnimation.js +36 -36
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioEngine.js +14 -14
- package/Audio/audioEngine.js.map +1 -1
- package/Audio/audioSceneComponent.js +14 -14
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.js +47 -47
- package/Audio/sound.js.map +1 -1
- package/Behaviors/Meshes/baseSixDofDragBehavior.d.ts +1 -1
- package/Behaviors/Meshes/fadeInOutBehavior.js +11 -11
- package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.js +34 -34
- package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
- package/Bones/bone.js +15 -15
- package/Bones/bone.js.map +1 -1
- package/Bones/boneIKController.js +9 -9
- package/Bones/boneIKController.js.map +1 -1
- package/Bones/boneLookController.js +50 -50
- package/Bones/boneLookController.js.map +1 -1
- package/Bones/skeleton.js +35 -35
- package/Bones/skeleton.js.map +1 -1
- package/Buffers/buffer.js +14 -14
- package/Buffers/buffer.js.map +1 -1
- package/Buffers/dataBuffer.js +6 -6
- package/Buffers/dataBuffer.js.map +1 -1
- package/Cameras/Inputs/freeCameraDeviceOrientationInput.js +42 -42
- package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +18 -18
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.js +178 -178
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Cameras/arcRotateCamera.js +176 -176
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.js +90 -90
- package/Cameras/camera.js.map +1 -1
- package/Cameras/flyCamera.js +82 -82
- package/Cameras/flyCamera.js.map +1 -1
- package/Cameras/freeCamera.js +54 -54
- package/Cameras/freeCamera.js.map +1 -1
- package/Compute/computeShader.js +12 -12
- package/Compute/computeShader.js.map +1 -1
- package/Culling/ray.d.ts +1 -1
- package/Debug/axesViewer.js +12 -12
- package/Debug/axesViewer.js.map +1 -1
- package/Debug/debugLayer.js +21 -21
- package/Debug/debugLayer.js.map +1 -1
- package/Debug/directionalLightFrustumViewer.js +20 -20
- package/Debug/directionalLightFrustumViewer.js.map +1 -1
- package/Debug/rayHelper.js +10 -10
- package/Debug/rayHelper.js.map +1 -1
- package/Debug/skeletonViewer.js +81 -81
- package/Debug/skeletonViewer.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSource.d.ts +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.js +31 -31
- package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
- package/DeviceInput/InputDevices/deviceTypes.d.ts +1 -1
- package/DeviceInput/internalDeviceSourceManager.d.ts +2 -2
- package/Engines/Extensions/engine.computeShader.d.ts +3 -3
- package/Engines/Extensions/engine.multiRender.js +1 -1
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.query.d.ts +1 -1
- package/Engines/Extensions/engine.renderTarget.d.ts +1 -1
- package/Engines/Extensions/engine.renderTarget.js +1 -1
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Native/nativeDataStream.d.ts +1 -1
- package/Engines/Native/nativeHardwareTexture.js +3 -3
- package/Engines/Native/nativeHardwareTexture.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +5 -5
- package/Engines/Native/nativePipelineContext.js +7 -7
- package/Engines/Native/nativePipelineContext.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.js +6 -6
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Processors/shaderCodeInliner.js +4 -4
- package/Engines/Processors/shaderCodeInliner.js.map +1 -1
- package/Engines/Processors/shaderProcessingOptions.d.ts +1 -1
- package/Engines/WebGL/webGLHardwareTexture.js +3 -3
- package/Engines/WebGL/webGLHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +3 -3
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheBindGroups.js +6 -6
- package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js +5 -5
- package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +11 -11
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuComputeContext.js +7 -7
- package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
- package/Engines/WebGPU/webgpuComputePipelineContext.js +4 -4
- package/Engines/WebGPU/webgpuComputePipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuDrawContext.js +7 -7
- package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +9 -9
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuMaterialContext.js +5 -5
- package/Engines/WebGPU/webgpuMaterialContext.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +10 -10
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuPipelineContext.js +6 -6
- package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js +3 -3
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessingContext.js +3 -3
- package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +3 -3
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTimestampQuery.js +3 -3
- package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
- package/Engines/engine.js +134 -134
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.js +6 -6
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +25 -25
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +25 -25
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +243 -243
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +132 -132
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/keyboardEvents.js +10 -10
- package/Events/keyboardEvents.js.map +1 -1
- package/Events/pointerEvents.js +9 -9
- package/Events/pointerEvents.js.map +1 -1
- package/Gamepads/Controllers/poseEnabledController.js +9 -9
- package/Gamepads/Controllers/poseEnabledController.js.map +1 -1
- package/Gamepads/Controllers/webVRController.js +13 -13
- package/Gamepads/Controllers/webVRController.js.map +1 -1
- package/Gamepads/gamepad.js +20 -20
- package/Gamepads/gamepad.js.map +1 -1
- package/Gizmos/axisDragGizmo.js +45 -45
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.js +12 -12
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +74 -74
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/gizmo.js +34 -34
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/gizmoManager.js +40 -40
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/planeDragGizmo.js +23 -23
- package/Gizmos/planeDragGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js +12 -12
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Gizmos/positionGizmo.js +40 -40
- package/Gizmos/positionGizmo.js.map +1 -1
- package/Gizmos/rotationGizmo.js +47 -47
- package/Gizmos/rotationGizmo.js.map +1 -1
- package/Gizmos/scaleGizmo.js +41 -41
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Helpers/environmentHelper.js +18 -18
- package/Helpers/environmentHelper.js.map +1 -1
- package/Helpers/textureDome.js +96 -96
- package/Helpers/textureDome.js.map +1 -1
- package/IAccessibilityTag.d.ts +2 -2
- package/Inputs/scene.inputManager.js +12 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Instrumentation/engineInstrumentation.js +21 -21
- package/Instrumentation/engineInstrumentation.js.map +1 -1
- package/Instrumentation/sceneInstrumentation.js +90 -90
- package/Instrumentation/sceneInstrumentation.js.map +1 -1
- package/Layers/effectLayer.js +48 -48
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.js +32 -32
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.js +26 -26
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/layer.js +40 -40
- package/Layers/layer.js.map +1 -1
- package/LensFlares/lensFlare.js +15 -15
- package/LensFlares/lensFlare.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +4 -4
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +18 -18
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +115 -115
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/directionalLight.js +31 -31
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/light.js +72 -72
- package/Lights/light.js.map +1 -1
- package/Lights/pointLight.js +18 -18
- package/Lights/pointLight.js.map +1 -1
- package/Lights/spotLight.js +30 -30
- package/Lights/spotLight.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Materials/Background/backgroundMaterial.js +124 -124
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +8 -8
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +14 -14
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +9 -9
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +26 -26
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +34 -34
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +14 -14
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +16 -16
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.js +7 -7
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/gradientBlock.js +13 -13
- package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.js +30 -30
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +1 -1
- package/Materials/Node/nodeMaterial.js +60 -60
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.js +35 -35
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +50 -50
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.js +5 -5
- package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBRDFConfiguration.js +4 -4
- package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +52 -52
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseSimpleMaterial.js +17 -17
- package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.js +5 -5
- package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.js +5 -5
- package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
- package/Materials/PBR/pbrMaterial.js +209 -209
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrSheenConfiguration.js +5 -5
- package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js +6 -6
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.js +51 -51
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/baseTexture.js +99 -99
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +61 -61
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/externalTexture.js +16 -16
- package/Materials/Textures/externalTexture.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.js +44 -44
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.js +31 -31
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +73 -73
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.js +47 -47
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.js +6 -6
- package/Materials/Textures/rawTexture2DArray.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +142 -142
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +1 -1
- package/Materials/Textures/texture.js +26 -26
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +1 -1
- package/Materials/Textures/textureSampler.js +20 -20
- package/Materials/Textures/textureSampler.js.map +1 -1
- package/Materials/Textures/thinRenderTargetTexture.js +6 -6
- package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
- package/Materials/Textures/thinTexture.js +39 -39
- package/Materials/Textures/thinTexture.js.map +1 -1
- package/Materials/Textures/videoTexture.d.ts +1 -0
- package/Materials/Textures/videoTexture.js +59 -48
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/drawWrapper.js +6 -6
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.js +18 -18
- package/Materials/effect.js.map +1 -1
- package/Materials/effectRenderer.js +9 -9
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/fresnelParameters.d.ts +2 -2
- package/Materials/fresnelParameters.js +13 -13
- package/Materials/fresnelParameters.js.map +1 -1
- package/Materials/material.detailMapConfiguration.js +5 -5
- package/Materials/material.detailMapConfiguration.js.map +1 -1
- package/Materials/material.js +223 -223
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginBase.js +5 -5
- package/Materials/materialPluginBase.js.map +1 -1
- package/Materials/materialPluginEvent.d.ts +14 -14
- package/Materials/materialPluginManager.d.ts +1 -1
- package/Materials/multiMaterial.js +16 -16
- package/Materials/multiMaterial.js.map +1 -1
- package/Materials/shadowDepthWrapper.js +14 -14
- package/Materials/shadowDepthWrapper.js.map +1 -1
- package/Materials/standardMaterial.js +100 -100
- package/Materials/standardMaterial.js.map +1 -1
- package/Materials/uniformBufferEffectCommonAccessor.js +3 -3
- package/Materials/uniformBufferEffectCommonAccessor.js.map +1 -1
- package/Maths/math.functions.js +2 -0
- package/Maths/math.functions.js.map +1 -1
- package/Maths/math.path.js +11 -11
- package/Maths/math.path.js.map +1 -1
- package/Maths/math.vector.d.ts +6 -7
- package/Maths/math.vector.js +48 -48
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/goldbergBuilder.d.ts +2 -2
- package/Meshes/Compression/dracoCompression.js +23 -23
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/Compression/meshoptCompression.js +9 -9
- package/Meshes/Compression/meshoptCompression.js.map +1 -1
- package/Meshes/abstractMesh.js +179 -179
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.js +32 -32
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/goldbergMesh.d.ts +1 -1
- package/Meshes/linesMesh.js +3 -3
- package/Meshes/linesMesh.js.map +1 -1
- package/Meshes/mesh.js +165 -165
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/polygonMesh.js +5 -5
- package/Meshes/polygonMesh.js.map +1 -1
- package/Meshes/subMesh.js +59 -59
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/transformNode.js +52 -52
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.d.ts +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollector.js +12 -12
- package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
- package/Misc/arrayTools.d.ts +1 -1
- package/Misc/copyTextureToTexture.js +3 -3
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/coroutine.d.ts +5 -5
- package/Misc/deferred.js +9 -9
- package/Misc/deferred.js.map +1 -1
- package/Misc/depthReducer.js +7 -7
- package/Misc/depthReducer.js.map +1 -1
- package/Misc/environmentTextureTools.d.ts +1 -1
- package/Misc/error.d.ts +1 -1
- package/Misc/fileTools.d.ts +5 -5
- package/Misc/filesInput.js +6 -6
- package/Misc/filesInput.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +9 -9
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/observable.js +12 -12
- package/Misc/observable.js.map +1 -1
- package/Misc/perfCounter.js +16 -16
- package/Misc/perfCounter.js.map +1 -1
- package/Misc/sceneOptimizer.js +76 -76
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/stringDictionary.d.ts +1 -1
- package/Misc/trajectoryClassifier.js +67 -67
- package/Misc/trajectoryClassifier.js.map +1 -1
- package/Misc/videoRecorder.js +15 -15
- package/Misc/videoRecorder.js.map +1 -1
- package/Misc/virtualJoystick.js +12 -12
- package/Misc/virtualJoystick.js.map +1 -1
- package/Morph/morphTarget.js +28 -28
- package/Morph/morphTarget.js.map +1 -1
- package/Morph/morphTargetManager.js +18 -18
- package/Morph/morphTargetManager.js.map +1 -1
- package/Offline/database.js +12 -12
- package/Offline/database.js.map +1 -1
- package/Particles/EmitterTypes/coneParticleEmitter.js +25 -25
- package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
- package/Particles/EmitterTypes/meshParticleEmitter.js +20 -20
- package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
- package/Particles/baseParticleSystem.js +232 -232
- package/Particles/baseParticleSystem.js.map +1 -1
- package/Particles/cloudPoint.js +9 -9
- package/Particles/cloudPoint.js.map +1 -1
- package/Particles/gpuParticleSystem.js +123 -123
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.js +102 -102
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/pointsCloudSystem.js +18 -18
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/solidParticle.js +23 -23
- package/Particles/solidParticle.js.map +1 -1
- package/Physics/index.d.ts +1 -0
- package/Physics/index.js +1 -0
- package/Physics/index.js.map +1 -1
- package/Physics/physicsHelper.d.ts +452 -1
- package/Physics/physicsHelper.js +877 -2
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/v1/index.d.ts +0 -1
- package/Physics/v1/index.js +0 -1
- package/Physics/v1/index.js.map +1 -1
- package/Physics/v1/physicsEngine.js +14 -14
- package/Physics/v1/physicsEngine.js.map +1 -1
- package/Physics/v1/physicsImpostor.js +149 -149
- package/Physics/v1/physicsImpostor.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +2 -1
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/index.d.ts +1 -0
- package/Physics/v2/index.js +1 -0
- package/Physics/v2/index.js.map +1 -1
- package/Physics/v2/physicsAggregate.d.ts +18 -0
- package/Physics/v2/physicsAggregate.js +44 -2
- package/Physics/v2/physicsAggregate.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +22 -1
- package/Physics/v2/physicsBody.js +54 -1
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsEngine.d.ts +7 -2
- package/Physics/v2/physicsEngine.js +23 -16
- package/Physics/v2/physicsEngine.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +129 -129
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +68 -68
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +6 -6
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +226 -225
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +10 -10
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
- package/PostProcesses/anaglyphPostProcess.js +7 -7
- package/PostProcesses/anaglyphPostProcess.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.js +7 -7
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/bloomEffect.js +28 -28
- package/PostProcesses/bloomEffect.js.map +1 -1
- package/PostProcesses/bloomMergePostProcess.js +7 -7
- package/PostProcesses/bloomMergePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.js +32 -32
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.js +7 -7
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.js +7 -7
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/colorCorrectionPostProcess.js +7 -7
- package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/convolutionPostProcess.js +7 -7
- package/PostProcesses/convolutionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.js +7 -7
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.js +36 -36
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.js +7 -7
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/extractHighlightsPostProcess.js +7 -7
- package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
- package/PostProcesses/filterPostProcess.js +7 -7
- package/PostProcesses/filterPostProcess.js.map +1 -1
- package/PostProcesses/grainPostProcess.js +7 -7
- package/PostProcesses/grainPostProcess.js.map +1 -1
- package/PostProcesses/imageProcessingPostProcess.js +42 -42
- package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.js +41 -41
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/passPostProcess.js +15 -15
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +2 -2
- package/PostProcesses/postProcess.js +123 -123
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/refractionPostProcess.js +21 -21
- package/PostProcesses/refractionPostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.js +7 -7
- package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.js +19 -19
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.js +7 -7
- package/PostProcesses/sharpenPostProcess.js.map +1 -1
- package/PostProcesses/stereoscopicInterlacePostProcess.js +14 -14
- package/PostProcesses/stereoscopicInterlacePostProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.js +7 -7
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +11 -11
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/PostProcesses/vrDistortionCorrectionPostProcess.js +7 -7
- package/PostProcesses/vrDistortionCorrectionPostProcess.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js +36 -36
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/depthRenderer.js +8 -8
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.js +34 -34
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js +8 -8
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js +3 -3
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js +19 -19
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +12 -12
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +18 -18
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +68 -68
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTextures.js +29 -29
- package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +44 -44
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/prePassRenderer.js +51 -51
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/renderingGroup.js +25 -25
- package/Rendering/renderingGroup.js.map +1 -1
- package/Rendering/renderingManager.js +21 -21
- package/Rendering/renderingManager.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.js +18 -18
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Rendering/utilityLayerRenderer.js +76 -76
- package/Rendering/utilityLayerRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js +4 -1
- package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
- package/Sprites/sprite.js +16 -16
- package/Sprites/sprite.js.map +1 -1
- package/Sprites/spriteManager.js +81 -81
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteMap.js +32 -32
- package/Sprites/spriteMap.js.map +1 -1
- package/Sprites/spriteRenderer.js +6 -6
- package/Sprites/spriteRenderer.js.map +1 -1
- package/Sprites/thinSprite.js +22 -22
- package/Sprites/thinSprite.js.map +1 -1
- package/States/stencilStateComposer.js +10 -10
- package/States/stencilStateComposer.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.js +7 -7
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRControllerMovement.d.ts +3 -3
- package/XR/features/WebXRControllerMovement.js +97 -97
- package/XR/features/WebXRControllerMovement.js.map +1 -1
- package/XR/features/WebXRControllerPhysics.js +24 -24
- package/XR/features/WebXRControllerPhysics.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.js +26 -26
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/features/WebXRDOMOverlay.d.ts +1 -1
- package/XR/features/WebXRFeaturePointSystem.js +6 -6
- package/XR/features/WebXRFeaturePointSystem.js.map +1 -1
- package/XR/features/WebXRHandTracking.d.ts +1 -1
- package/XR/features/WebXRHandTracking.js +95 -95
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRWalkingLocomotion.js +21 -21
- package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.d.ts +3 -3
- package/XR/motionController/webXRMotionControllerManager.d.ts +1 -1
- package/XR/native/nativeXRFrame.js +3 -3
- package/XR/native/nativeXRFrame.js.map +1 -1
- package/XR/webXRFeaturesManager.d.ts +1 -1
- package/XR/webXRLayerWrapper.d.ts +2 -2
- package/XR/webXRLayerWrapper.js +17 -17
- package/XR/webXRLayerWrapper.js.map +1 -1
- package/abstractScene.d.ts +2 -2
- package/node.d.ts +1 -1
- package/node.js +71 -71
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +777 -777
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +12 -12
- package/types.d.ts +11 -11
- package/Physics/v1/physicsHelper.d.ts +0 -411
- package/Physics/v1/physicsHelper.js +0 -709
- package/Physics/v1/physicsHelper.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solidParticle.js","sourceRoot":"","sources":["../../../../lts/core/generated/Particles/solidParticle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD;;GAEG;AACH,MAAM,OAAO,aAAa;IA0ItB;;;;;;;;;;;;;OAaG;IACH,YACI,aAAqB,EACrB,UAAkB,EAClB,aAAqB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r\nimport type { Matrix } from \"../Maths/math.vector\";\r\nimport { Vector3, TmpVectors, Quaternion, Vector4, Vector2 } from \"../Maths/math.vector\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport { BoundingInfo } from \"../Culling/boundingInfo\";\r\nimport { BoundingSphere } from \"../Culling/boundingSphere\";\r\nimport type { SolidParticleSystem } from \"./solidParticleSystem\";\r\nimport { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Plane } from \"../Maths/math.plane\";\r\nimport type { Material } from \"../Materials/material\";\r\n/**\r\n * Represents one particle of a solid particle system.\r\n */\r\nexport class SolidParticle {\r\n /**\r\n * particle global index\r\n */\r\n public idx: number = 0;\r\n /**\r\n * particle identifier\r\n */\r\n public id: number = 0;\r\n /**\r\n * The color of the particle\r\n */\r\n public color: Nullable<Color4> = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * The world space position of the particle.\r\n */\r\n public position: Vector3 = Vector3.Zero();\r\n /**\r\n * The world space rotation of the particle. (Not use if rotationQuaternion is set)\r\n */\r\n public rotation: Vector3 = Vector3.Zero();\r\n /**\r\n * The world space rotation quaternion of the particle.\r\n */\r\n public rotationQuaternion: Nullable<Quaternion>;\r\n /**\r\n * The scaling of the particle.\r\n */\r\n public scaling: Vector3 = Vector3.One();\r\n /**\r\n * The uvs of the particle.\r\n */\r\n public uvs: Vector4 = new Vector4(0.0, 0.0, 1.0, 1.0);\r\n /**\r\n * The current speed of the particle.\r\n */\r\n public velocity: Vector3 = Vector3.Zero();\r\n /**\r\n * The pivot point in the particle local space.\r\n */\r\n public pivot: Vector3 = Vector3.Zero();\r\n /**\r\n * Must the particle be translated from its pivot point in its local space ?\r\n * In this case, the pivot point is set at the origin of the particle local space and the particle is translated.\r\n * Default : false\r\n */\r\n public translateFromPivot: boolean = false;\r\n /**\r\n * Is the particle active or not ?\r\n */\r\n public alive: boolean = true;\r\n /**\r\n * Is the particle visible or not ?\r\n */\r\n public isVisible: boolean = true;\r\n /**\r\n * Index of this particle in the global \"positions\" array (Internal use)\r\n * @internal\r\n */\r\n public _pos: number = 0;\r\n /**\r\n * @internal Index of this particle in the global \"indices\" array (Internal use)\r\n */\r\n public _ind: number = 0;\r\n /**\r\n * @internal ModelShape of this particle (Internal use)\r\n */\r\n public _model: ModelShape;\r\n /**\r\n * ModelShape id of this particle\r\n */\r\n public shapeId: number = 0;\r\n /**\r\n * Index of the particle in its shape id\r\n */\r\n public idxInShape: number = 0;\r\n /**\r\n * @internal Reference to the shape model BoundingInfo object (Internal use)\r\n */\r\n public _modelBoundingInfo: BoundingInfo;\r\n private _boundingInfo: BoundingInfo;\r\n /**\r\n * @internal Reference to the SPS what the particle belongs to (Internal use)\r\n */\r\n public _sps: SolidParticleSystem;\r\n /**\r\n * @internal Still set as invisible in order to skip useless computations (Internal use)\r\n */\r\n public _stillInvisible: boolean = false;\r\n /**\r\n * @internal Last computed particle rotation matrix\r\n */\r\n public _rotationMatrix: number[] = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0];\r\n /**\r\n * Parent particle Id, if any.\r\n * Default null.\r\n */\r\n public parentId: Nullable<number> = null;\r\n /**\r\n * The particle material identifier (integer) when MultiMaterials are enabled in the SPS.\r\n */\r\n public materialIndex: Nullable<number> = null;\r\n /**\r\n * Custom object or properties.\r\n */\r\n public props: Nullable<any> = null;\r\n /**\r\n * The culling strategy to use to check whether the solid particle must be culled or not when using isInFrustum().\r\n * The possible values are :\r\n * - AbstractMesh.CULLINGSTRATEGY_STANDARD\r\n * - AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY\r\n * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION\r\n * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY\r\n * The default value for solid particles is AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY\r\n * Please read each static variable documentation in the class AbstractMesh to get details about the culling process.\r\n * */\r\n public cullingStrategy = AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY;\r\n\r\n /**\r\n * @internal Internal global position in the SPS.\r\n */\r\n public _globalPosition: Vector3 = Vector3.Zero();\r\n\r\n /**\r\n * Particle BoundingInfo object\r\n * @returns a BoundingInfo\r\n */\r\n public getBoundingInfo(): BoundingInfo {\r\n return this._boundingInfo;\r\n }\r\n\r\n /**\r\n * Returns true if there is already a bounding info\r\n */\r\n public get hasBoundingInfo(): boolean {\r\n return this._boundingInfo !== null;\r\n }\r\n\r\n /**\r\n * Creates a Solid Particle object.\r\n * Don't create particles manually, use instead the Solid Particle System internal tools like _addParticle()\r\n * @param particleIndex (integer) is the particle index in the Solid Particle System pool.\r\n * @param particleId (integer) is the particle identifier. Unless some particles are removed from the SPS, it's the same value than the particle idx.\r\n * @param positionIndex (integer) is the starting index of the particle vertices in the SPS \"positions\" array.\r\n * @param indiceIndex (integer) is the starting index of the particle indices in the SPS \"indices\" array.\r\n * @param model (ModelShape) is a reference to the model shape on what the particle is designed.\r\n * @param shapeId (integer) is the model shape identifier in the SPS.\r\n * @param idxInShape (integer) is the index of the particle in the current model (ex: the 10th box of addShape(box, 30))\r\n * @param sps defines the sps it is associated to\r\n * @param modelBoundingInfo is the reference to the model BoundingInfo used for intersection computations.\r\n * @param materialIndex is the particle material identifier (integer) when the MultiMaterials are enabled in the SPS.\r\n */\r\n constructor(\r\n particleIndex: number,\r\n particleId: number,\r\n positionIndex: number,\r\n indiceIndex: number,\r\n model: Nullable<ModelShape>,\r\n shapeId: number,\r\n idxInShape: number,\r\n sps: SolidParticleSystem,\r\n modelBoundingInfo: Nullable<BoundingInfo> = null,\r\n materialIndex: Nullable<number> = null\r\n ) {\r\n this.idx = particleIndex;\r\n this.id = particleId;\r\n this._pos = positionIndex;\r\n this._ind = indiceIndex;\r\n this._model = <ModelShape>model;\r\n this.shapeId = shapeId;\r\n this.idxInShape = idxInShape;\r\n this._sps = sps;\r\n if (modelBoundingInfo) {\r\n this._modelBoundingInfo = modelBoundingInfo;\r\n this._boundingInfo = new BoundingInfo(modelBoundingInfo.minimum, modelBoundingInfo.maximum);\r\n }\r\n if (materialIndex !== null) {\r\n this.materialIndex = materialIndex;\r\n }\r\n }\r\n /**\r\n * Copies the particle property values into the existing target : position, rotation, scaling, uvs, colors, pivot, parent, visibility, alive\r\n * @param target the particle target\r\n * @returns the current particle\r\n */\r\n public copyToRef(target: SolidParticle): SolidParticle {\r\n target.position.copyFrom(this.position);\r\n target.rotation.copyFrom(this.rotation);\r\n if (this.rotationQuaternion) {\r\n if (target.rotationQuaternion) {\r\n target.rotationQuaternion!.copyFrom(this.rotationQuaternion!);\r\n } else {\r\n target.rotationQuaternion = this.rotationQuaternion.clone();\r\n }\r\n }\r\n target.scaling.copyFrom(this.scaling);\r\n if (this.color) {\r\n if (target.color) {\r\n target.color!.copyFrom(this.color!);\r\n } else {\r\n target.color = this.color.clone();\r\n }\r\n }\r\n target.uvs.copyFrom(this.uvs);\r\n target.velocity.copyFrom(this.velocity);\r\n target.pivot.copyFrom(this.pivot);\r\n target.translateFromPivot = this.translateFromPivot;\r\n target.alive = this.alive;\r\n target.isVisible = this.isVisible;\r\n target.parentId = this.parentId;\r\n target.cullingStrategy = this.cullingStrategy;\r\n if (this.materialIndex !== null) {\r\n target.materialIndex = this.materialIndex;\r\n }\r\n return this;\r\n }\r\n /**\r\n * Legacy support, changed scale to scaling\r\n */\r\n public get scale(): Vector3 {\r\n return this.scaling;\r\n }\r\n\r\n /**\r\n * Legacy support, changed scale to scaling\r\n */\r\n public set scale(scale: Vector3) {\r\n this.scaling = scale;\r\n }\r\n\r\n /**\r\n * Legacy support, changed quaternion to rotationQuaternion\r\n */\r\n public get quaternion(): Nullable<Quaternion> {\r\n return this.rotationQuaternion;\r\n }\r\n\r\n /**\r\n * Legacy support, changed quaternion to rotationQuaternion\r\n */\r\n public set quaternion(q: Nullable<Quaternion>) {\r\n this.rotationQuaternion = q;\r\n }\r\n\r\n /**\r\n * Returns a boolean. True if the particle intersects another particle or another mesh, else false.\r\n * The intersection is computed on the particle bounding sphere and Axis Aligned Bounding Box (AABB)\r\n * @param target is the object (solid particle or mesh) what the intersection is computed against.\r\n * @returns true if it intersects\r\n */\r\n public intersectsMesh(target: Mesh | SolidParticle): boolean {\r\n if (!this._boundingInfo || !target.hasBoundingInfo) {\r\n return false;\r\n }\r\n if (this._sps._bSphereOnly) {\r\n return BoundingSphere.Intersects(this._boundingInfo.boundingSphere, target.getBoundingInfo().boundingSphere);\r\n }\r\n return this._boundingInfo.intersects(target.getBoundingInfo(), false);\r\n }\r\n\r\n /**\r\n * Returns `true` if the solid particle is within the frustum defined by the passed array of planes.\r\n * A particle is in the frustum if its bounding box intersects the frustum\r\n * @param frustumPlanes defines the frustum to test\r\n * @returns true if the particle is in the frustum planes\r\n */\r\n public isInFrustum(frustumPlanes: Plane[]): boolean {\r\n return this._boundingInfo !== null && this._boundingInfo.isInFrustum(frustumPlanes, this.cullingStrategy);\r\n }\r\n\r\n /**\r\n * get the rotation matrix of the particle\r\n * @internal\r\n */\r\n public getRotationMatrix(m: Matrix) {\r\n let quaternion: Quaternion;\r\n if (this.rotationQuaternion) {\r\n quaternion = this.rotationQuaternion;\r\n } else {\r\n quaternion = TmpVectors.Quaternion[0];\r\n const rotation = this.rotation;\r\n Quaternion.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion);\r\n }\r\n\r\n quaternion.toRotationMatrix(m);\r\n }\r\n}\r\n\r\n/**\r\n * Represents the shape of the model used by one particle of a solid particle system.\r\n * SPS internal tool, don't use it manually.\r\n */\r\nexport class ModelShape {\r\n /**\r\n * Get or set the shapeId\r\n * @deprecated Please use shapeId instead\r\n */\r\n public get shapeID(): number {\r\n return this.shapeId;\r\n }\r\n public set shapeID(shapeID: number) {\r\n this.shapeId = shapeID;\r\n }\r\n /**\r\n * The shape id\r\n * @internal\r\n */\r\n public shapeId: number;\r\n /**\r\n * flat array of model positions (internal use)\r\n * @internal\r\n */\r\n public _shape: Vector3[];\r\n /**\r\n * flat array of model UVs (internal use)\r\n * @internal\r\n */\r\n public _shapeUV: number[];\r\n /**\r\n * color array of the model\r\n * @internal\r\n */\r\n public _shapeColors: number[];\r\n /**\r\n * indices array of the model\r\n * @internal\r\n */\r\n public _indices: number[];\r\n /**\r\n * normals array of the model\r\n * @internal\r\n */\r\n public _normals: number[];\r\n /**\r\n * length of the shape in the model indices array (internal use)\r\n * @internal\r\n */\r\n public _indicesLength: number = 0;\r\n /**\r\n * Custom position function (internal use)\r\n * @internal\r\n */\r\n public _positionFunction: Nullable<(particle: SolidParticle, i: number, s: number) => void>;\r\n /**\r\n * Custom vertex function (internal use)\r\n * @internal\r\n */\r\n public _vertexFunction: Nullable<(particle: SolidParticle, vertex: Vector3, i: number) => void>;\r\n /**\r\n * Model material (internal use)\r\n * @internal\r\n */\r\n public _material: Nullable<Material>;\r\n\r\n /**\r\n * Creates a ModelShape object. This is an internal simplified reference to a mesh used as for a model to replicate particles from by the SPS.\r\n * SPS internal tool, don't use it manually.\r\n * @internal\r\n */\r\n constructor(\r\n id: number,\r\n shape: Vector3[],\r\n indices: number[],\r\n normals: number[],\r\n colors: number[],\r\n shapeUV: number[],\r\n posFunction: Nullable<(particle: SolidParticle, i: number, s: number) => void>,\r\n vtxFunction: Nullable<(particle: SolidParticle, vertex: Vector3, i: number) => void>,\r\n material: Nullable<Material>\r\n ) {\r\n this.shapeId = id;\r\n this._shape = shape;\r\n this._indices = indices;\r\n this._indicesLength = indices.length;\r\n this._shapeUV = shapeUV;\r\n this._shapeColors = colors;\r\n this._normals = normals;\r\n this._positionFunction = posFunction;\r\n this._vertexFunction = vtxFunction;\r\n this._material = material;\r\n }\r\n}\r\n\r\n/**\r\n * Represents a Depth Sorted Particle in the solid particle system.\r\n * @internal\r\n */\r\nexport class DepthSortedParticle {\r\n /**\r\n * Particle index\r\n */\r\n public idx: number = 0;\r\n /**\r\n * Index of the particle in the \"indices\" array\r\n */\r\n public ind: number = 0;\r\n /**\r\n * Length of the particle shape in the \"indices\" array\r\n */\r\n public indicesLength: number = 0;\r\n /**\r\n * Squared distance from the particle to the camera\r\n */\r\n public sqDistance: number = 0.0;\r\n /**\r\n * Material index when used with MultiMaterials\r\n */\r\n public materialIndex: number = 0;\r\n\r\n /**\r\n * Creates a new sorted particle\r\n * @param idx\r\n * @param ind\r\n * @param indLength\r\n * @param materialIndex\r\n */\r\n constructor(idx: number, ind: number, indLength: number, materialIndex: number) {\r\n this.idx = idx;\r\n this.ind = ind;\r\n this.indicesLength = indLength;\r\n this.materialIndex = materialIndex;\r\n }\r\n}\r\n\r\n/**\r\n * Represents a solid particle vertex\r\n */\r\nexport class SolidParticleVertex {\r\n /**\r\n * Vertex position\r\n */\r\n public position: Vector3;\r\n /**\r\n * Vertex color\r\n */\r\n public color: Color4;\r\n /**\r\n * Vertex UV\r\n */\r\n public uv: Vector2;\r\n /**\r\n * Creates a new solid particle vertex\r\n */\r\n constructor() {\r\n this.position = Vector3.Zero();\r\n this.color = new Color4(1.0, 1.0, 1.0, 1.0);\r\n this.uv = Vector2.Zero();\r\n }\r\n // Getters and Setters for back-compatibility\r\n /** Vertex x coordinate */\r\n public get x(): number {\r\n return this.position.x;\r\n }\r\n public set x(val: number) {\r\n this.position.x = val;\r\n }\r\n /** Vertex y coordinate */\r\n public get y(): number {\r\n return this.position.y;\r\n }\r\n public set y(val: number) {\r\n this.position.y = val;\r\n }\r\n /** Vertex z coordinate */\r\n public get z(): number {\r\n return this.position.z;\r\n }\r\n public set z(val: number) {\r\n this.position.z = val;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"solidParticle.js","sourceRoot":"","sources":["../../../../lts/core/generated/Particles/solidParticle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,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I,CAAC,QAAQ,CAAC,CAAC,GAAG,GAAG,CAAC;IAC1B,CAAC;IACD,0BAA0B;IAC1B,IAAW,CAAC;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3B,CAAC;IACD,IAAW,CAAC,CAAC,GAAW;QACpB,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,GAAG,CAAC;IAC1B,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { Matrix } from \"../Maths/math.vector\";\r\nimport { Vector3, TmpVectors, Quaternion, Vector4, Vector2 } from \"../Maths/math.vector\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport { BoundingInfo } from \"../Culling/boundingInfo\";\r\nimport { BoundingSphere } from \"../Culling/boundingSphere\";\r\nimport type { SolidParticleSystem } from \"./solidParticleSystem\";\r\nimport { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Plane } from \"../Maths/math.plane\";\r\nimport type { Material } from \"../Materials/material\";\r\n/**\r\n * Represents one particle of a solid particle system.\r\n */\r\nexport class SolidParticle {\r\n /**\r\n * particle global index\r\n */\r\n public idx: number = 0;\r\n /**\r\n * particle identifier\r\n */\r\n public id: number = 0;\r\n /**\r\n * The color of the particle\r\n */\r\n public color: Nullable<Color4> = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * The world space position of the particle.\r\n */\r\n public position: Vector3 = Vector3.Zero();\r\n /**\r\n * The world space rotation of the particle. (Not use if rotationQuaternion is set)\r\n */\r\n public rotation: Vector3 = Vector3.Zero();\r\n /**\r\n * The world space rotation quaternion of the particle.\r\n */\r\n public rotationQuaternion: Nullable<Quaternion>;\r\n /**\r\n * The scaling of the particle.\r\n */\r\n public scaling: Vector3 = Vector3.One();\r\n /**\r\n * The uvs of the particle.\r\n */\r\n public uvs: Vector4 = new Vector4(0.0, 0.0, 1.0, 1.0);\r\n /**\r\n * The current speed of the particle.\r\n */\r\n public velocity: Vector3 = Vector3.Zero();\r\n /**\r\n * The pivot point in the particle local space.\r\n */\r\n public pivot: Vector3 = Vector3.Zero();\r\n /**\r\n * Must the particle be translated from its pivot point in its local space ?\r\n * In this case, the pivot point is set at the origin of the particle local space and the particle is translated.\r\n * Default : false\r\n */\r\n public translateFromPivot: boolean = false;\r\n /**\r\n * Is the particle active or not ?\r\n */\r\n public alive: boolean = true;\r\n /**\r\n * Is the particle visible or not ?\r\n */\r\n public isVisible: boolean = true;\r\n /**\r\n * Index of this particle in the global \"positions\" array (Internal use)\r\n * @internal\r\n */\r\n public _pos: number = 0;\r\n /**\r\n * @internal Index of this particle in the global \"indices\" array (Internal use)\r\n */\r\n public _ind: number = 0;\r\n /**\r\n * @internal ModelShape of this particle (Internal use)\r\n */\r\n public _model: ModelShape;\r\n /**\r\n * ModelShape id of this particle\r\n */\r\n public shapeId: number = 0;\r\n /**\r\n * Index of the particle in its shape id\r\n */\r\n public idxInShape: number = 0;\r\n /**\r\n * @internal Reference to the shape model BoundingInfo object (Internal use)\r\n */\r\n public _modelBoundingInfo: BoundingInfo;\r\n private _boundingInfo: BoundingInfo;\r\n /**\r\n * @internal Reference to the SPS what the particle belongs to (Internal use)\r\n */\r\n public _sps: SolidParticleSystem;\r\n /**\r\n * @internal Still set as invisible in order to skip useless computations (Internal use)\r\n */\r\n public _stillInvisible: boolean = false;\r\n /**\r\n * @internal Last computed particle rotation matrix\r\n */\r\n public _rotationMatrix: number[] = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0];\r\n /**\r\n * Parent particle Id, if any.\r\n * Default null.\r\n */\r\n public parentId: Nullable<number> = null;\r\n /**\r\n * The particle material identifier (integer) when MultiMaterials are enabled in the SPS.\r\n */\r\n public materialIndex: Nullable<number> = null;\r\n /**\r\n * Custom object or properties.\r\n */\r\n public props: Nullable<any> = null;\r\n /**\r\n * The culling strategy to use to check whether the solid particle must be culled or not when using isInFrustum().\r\n * The possible values are :\r\n * - AbstractMesh.CULLINGSTRATEGY_STANDARD\r\n * - AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY\r\n * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION\r\n * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY\r\n * The default value for solid particles is AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY\r\n * Please read each static variable documentation in the class AbstractMesh to get details about the culling process.\r\n * */\r\n public cullingStrategy = AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY;\r\n\r\n /**\r\n * @internal Internal global position in the SPS.\r\n */\r\n public _globalPosition: Vector3 = Vector3.Zero();\r\n\r\n /**\r\n * Particle BoundingInfo object\r\n * @returns a BoundingInfo\r\n */\r\n public getBoundingInfo(): BoundingInfo {\r\n return this._boundingInfo;\r\n }\r\n\r\n /**\r\n * Returns true if there is already a bounding info\r\n */\r\n public get hasBoundingInfo(): boolean {\r\n return this._boundingInfo !== null;\r\n }\r\n\r\n /**\r\n * Creates a Solid Particle object.\r\n * Don't create particles manually, use instead the Solid Particle System internal tools like _addParticle()\r\n * @param particleIndex (integer) is the particle index in the Solid Particle System pool.\r\n * @param particleId (integer) is the particle identifier. Unless some particles are removed from the SPS, it's the same value than the particle idx.\r\n * @param positionIndex (integer) is the starting index of the particle vertices in the SPS \"positions\" array.\r\n * @param indiceIndex (integer) is the starting index of the particle indices in the SPS \"indices\" array.\r\n * @param model (ModelShape) is a reference to the model shape on what the particle is designed.\r\n * @param shapeId (integer) is the model shape identifier in the SPS.\r\n * @param idxInShape (integer) is the index of the particle in the current model (ex: the 10th box of addShape(box, 30))\r\n * @param sps defines the sps it is associated to\r\n * @param modelBoundingInfo is the reference to the model BoundingInfo used for intersection computations.\r\n * @param materialIndex is the particle material identifier (integer) when the MultiMaterials are enabled in the SPS.\r\n */\r\n constructor(\r\n particleIndex: number,\r\n particleId: number,\r\n positionIndex: number,\r\n indiceIndex: number,\r\n model: Nullable<ModelShape>,\r\n shapeId: number,\r\n idxInShape: number,\r\n sps: SolidParticleSystem,\r\n modelBoundingInfo: Nullable<BoundingInfo> = null,\r\n materialIndex: Nullable<number> = null\r\n ) {\r\n this.idx = particleIndex;\r\n this.id = particleId;\r\n this._pos = positionIndex;\r\n this._ind = indiceIndex;\r\n this._model = <ModelShape>model;\r\n this.shapeId = shapeId;\r\n this.idxInShape = idxInShape;\r\n this._sps = sps;\r\n if (modelBoundingInfo) {\r\n this._modelBoundingInfo = modelBoundingInfo;\r\n this._boundingInfo = new BoundingInfo(modelBoundingInfo.minimum, modelBoundingInfo.maximum);\r\n }\r\n if (materialIndex !== null) {\r\n this.materialIndex = materialIndex;\r\n }\r\n }\r\n /**\r\n * Copies the particle property values into the existing target : position, rotation, scaling, uvs, colors, pivot, parent, visibility, alive\r\n * @param target the particle target\r\n * @returns the current particle\r\n */\r\n public copyToRef(target: SolidParticle): SolidParticle {\r\n target.position.copyFrom(this.position);\r\n target.rotation.copyFrom(this.rotation);\r\n if (this.rotationQuaternion) {\r\n if (target.rotationQuaternion) {\r\n target.rotationQuaternion!.copyFrom(this.rotationQuaternion!);\r\n } else {\r\n target.rotationQuaternion = this.rotationQuaternion.clone();\r\n }\r\n }\r\n target.scaling.copyFrom(this.scaling);\r\n if (this.color) {\r\n if (target.color) {\r\n target.color!.copyFrom(this.color!);\r\n } else {\r\n target.color = this.color.clone();\r\n }\r\n }\r\n target.uvs.copyFrom(this.uvs);\r\n target.velocity.copyFrom(this.velocity);\r\n target.pivot.copyFrom(this.pivot);\r\n target.translateFromPivot = this.translateFromPivot;\r\n target.alive = this.alive;\r\n target.isVisible = this.isVisible;\r\n target.parentId = this.parentId;\r\n target.cullingStrategy = this.cullingStrategy;\r\n if (this.materialIndex !== null) {\r\n target.materialIndex = this.materialIndex;\r\n }\r\n return this;\r\n }\r\n /**\r\n * Legacy support, changed scale to scaling\r\n */\r\n public get scale(): Vector3 {\r\n return this.scaling;\r\n }\r\n\r\n /**\r\n * Legacy support, changed scale to scaling\r\n */\r\n public set scale(scale: Vector3) {\r\n this.scaling = scale;\r\n }\r\n\r\n /**\r\n * Legacy support, changed quaternion to rotationQuaternion\r\n */\r\n public get quaternion(): Nullable<Quaternion> {\r\n return this.rotationQuaternion;\r\n }\r\n\r\n /**\r\n * Legacy support, changed quaternion to rotationQuaternion\r\n */\r\n public set quaternion(q: Nullable<Quaternion>) {\r\n this.rotationQuaternion = q;\r\n }\r\n\r\n /**\r\n * Returns a boolean. True if the particle intersects another particle or another mesh, else false.\r\n * The intersection is computed on the particle bounding sphere and Axis Aligned Bounding Box (AABB)\r\n * @param target is the object (solid particle or mesh) what the intersection is computed against.\r\n * @returns true if it intersects\r\n */\r\n public intersectsMesh(target: Mesh | SolidParticle): boolean {\r\n if (!this._boundingInfo || !target.hasBoundingInfo) {\r\n return false;\r\n }\r\n if (this._sps._bSphereOnly) {\r\n return BoundingSphere.Intersects(this._boundingInfo.boundingSphere, target.getBoundingInfo().boundingSphere);\r\n }\r\n return this._boundingInfo.intersects(target.getBoundingInfo(), false);\r\n }\r\n\r\n /**\r\n * Returns `true` if the solid particle is within the frustum defined by the passed array of planes.\r\n * A particle is in the frustum if its bounding box intersects the frustum\r\n * @param frustumPlanes defines the frustum to test\r\n * @returns true if the particle is in the frustum planes\r\n */\r\n public isInFrustum(frustumPlanes: Plane[]): boolean {\r\n return this._boundingInfo !== null && this._boundingInfo.isInFrustum(frustumPlanes, this.cullingStrategy);\r\n }\r\n\r\n /**\r\n * get the rotation matrix of the particle\r\n * @internal\r\n */\r\n public getRotationMatrix(m: Matrix) {\r\n let quaternion: Quaternion;\r\n if (this.rotationQuaternion) {\r\n quaternion = this.rotationQuaternion;\r\n } else {\r\n quaternion = TmpVectors.Quaternion[0];\r\n const rotation = this.rotation;\r\n Quaternion.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion);\r\n }\r\n\r\n quaternion.toRotationMatrix(m);\r\n }\r\n}\r\n\r\n/**\r\n * Represents the shape of the model used by one particle of a solid particle system.\r\n * SPS internal tool, don't use it manually.\r\n */\r\nexport class ModelShape {\r\n /**\r\n * Get or set the shapeId\r\n * @deprecated Please use shapeId instead\r\n */\r\n public get shapeID(): number {\r\n return this.shapeId;\r\n }\r\n public set shapeID(shapeID: number) {\r\n this.shapeId = shapeID;\r\n }\r\n /**\r\n * The shape id\r\n * @internal\r\n */\r\n public shapeId: number;\r\n /**\r\n * flat array of model positions (internal use)\r\n * @internal\r\n */\r\n public _shape: Vector3[];\r\n /**\r\n * flat array of model UVs (internal use)\r\n * @internal\r\n */\r\n public _shapeUV: number[];\r\n /**\r\n * color array of the model\r\n * @internal\r\n */\r\n public _shapeColors: number[];\r\n /**\r\n * indices array of the model\r\n * @internal\r\n */\r\n public _indices: number[];\r\n /**\r\n * normals array of the model\r\n * @internal\r\n */\r\n public _normals: number[];\r\n /**\r\n * length of the shape in the model indices array (internal use)\r\n * @internal\r\n */\r\n public _indicesLength: number = 0;\r\n /**\r\n * Custom position function (internal use)\r\n * @internal\r\n */\r\n public _positionFunction: Nullable<(particle: SolidParticle, i: number, s: number) => void>;\r\n /**\r\n * Custom vertex function (internal use)\r\n * @internal\r\n */\r\n public _vertexFunction: Nullable<(particle: SolidParticle, vertex: Vector3, i: number) => void>;\r\n /**\r\n * Model material (internal use)\r\n * @internal\r\n */\r\n public _material: Nullable<Material>;\r\n\r\n /**\r\n * Creates a ModelShape object. This is an internal simplified reference to a mesh used as for a model to replicate particles from by the SPS.\r\n * SPS internal tool, don't use it manually.\r\n * @internal\r\n */\r\n constructor(\r\n id: number,\r\n shape: Vector3[],\r\n indices: number[],\r\n normals: number[],\r\n colors: number[],\r\n shapeUV: number[],\r\n posFunction: Nullable<(particle: SolidParticle, i: number, s: number) => void>,\r\n vtxFunction: Nullable<(particle: SolidParticle, vertex: Vector3, i: number) => void>,\r\n material: Nullable<Material>\r\n ) {\r\n this.shapeId = id;\r\n this._shape = shape;\r\n this._indices = indices;\r\n this._indicesLength = indices.length;\r\n this._shapeUV = shapeUV;\r\n this._shapeColors = colors;\r\n this._normals = normals;\r\n this._positionFunction = posFunction;\r\n this._vertexFunction = vtxFunction;\r\n this._material = material;\r\n }\r\n}\r\n\r\n/**\r\n * Represents a Depth Sorted Particle in the solid particle system.\r\n * @internal\r\n */\r\nexport class DepthSortedParticle {\r\n /**\r\n * Particle index\r\n */\r\n public idx: number = 0;\r\n /**\r\n * Index of the particle in the \"indices\" array\r\n */\r\n public ind: number = 0;\r\n /**\r\n * Length of the particle shape in the \"indices\" array\r\n */\r\n public indicesLength: number = 0;\r\n /**\r\n * Squared distance from the particle to the camera\r\n */\r\n public sqDistance: number = 0.0;\r\n /**\r\n * Material index when used with MultiMaterials\r\n */\r\n public materialIndex: number = 0;\r\n\r\n /**\r\n * Creates a new sorted particle\r\n * @param idx\r\n * @param ind\r\n * @param indLength\r\n * @param materialIndex\r\n */\r\n constructor(idx: number, ind: number, indLength: number, materialIndex: number) {\r\n this.idx = idx;\r\n this.ind = ind;\r\n this.indicesLength = indLength;\r\n this.materialIndex = materialIndex;\r\n }\r\n}\r\n\r\n/**\r\n * Represents a solid particle vertex\r\n */\r\nexport class SolidParticleVertex {\r\n /**\r\n * Vertex position\r\n */\r\n public position: Vector3;\r\n /**\r\n * Vertex color\r\n */\r\n public color: Color4;\r\n /**\r\n * Vertex UV\r\n */\r\n public uv: Vector2;\r\n /**\r\n * Creates a new solid particle vertex\r\n */\r\n constructor() {\r\n this.position = Vector3.Zero();\r\n this.color = new Color4(1.0, 1.0, 1.0, 1.0);\r\n this.uv = Vector2.Zero();\r\n }\r\n // Getters and Setters for back-compatibility\r\n /** Vertex x coordinate */\r\n public get x(): number {\r\n return this.position.x;\r\n }\r\n public set x(val: number) {\r\n this.position.x = val;\r\n }\r\n /** Vertex y coordinate */\r\n public get y(): number {\r\n return this.position.y;\r\n }\r\n public set y(val: number) {\r\n this.position.y = val;\r\n }\r\n /** Vertex z coordinate */\r\n public get z(): number {\r\n return this.position.z;\r\n }\r\n public set z(val: number) {\r\n this.position.z = val;\r\n }\r\n}\r\n"]}
|
package/Physics/index.d.ts
CHANGED
package/Physics/index.js
CHANGED
package/Physics/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lts/core/generated/Physics/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./v1/index\";\r\nexport * from \"./v2/index\";\r\nexport * from \"./physicsEngineComponent\";\r\nexport * from \"./v1/physicsEngineComponent\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lts/core/generated/Physics/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./v1/index\";\r\nexport * from \"./v2/index\";\r\nexport * from \"./physicsEngineComponent\";\r\nexport * from \"./v1/physicsEngineComponent\";\r\nexport * from \"./physicsHelper\";\r\n"]}
|
|
@@ -1 +1,452 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Nullable } from "../types";
|
|
2
|
+
import { Vector3 } from "../Maths/math.vector";
|
|
3
|
+
import type { Mesh } from "../Meshes/mesh";
|
|
4
|
+
import type { Scene } from "../scene";
|
|
5
|
+
import type { PhysicsImpostor } from "./v1/physicsImpostor";
|
|
6
|
+
import type { PhysicsBody } from "./v2/physicsBody";
|
|
7
|
+
/**
|
|
8
|
+
* A helper for physics simulations
|
|
9
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
10
|
+
*/
|
|
11
|
+
export declare class PhysicsHelper {
|
|
12
|
+
private _scene;
|
|
13
|
+
private _physicsEngine;
|
|
14
|
+
private _hitData;
|
|
15
|
+
/**
|
|
16
|
+
* Initializes the Physics helper
|
|
17
|
+
* @param scene Babylon.js scene
|
|
18
|
+
*/
|
|
19
|
+
constructor(scene: Scene);
|
|
20
|
+
/**
|
|
21
|
+
* Applies a radial explosion impulse
|
|
22
|
+
* @param origin the origin of the explosion
|
|
23
|
+
* @param radiusOrEventOptions the radius or the options of radial explosion
|
|
24
|
+
* @param strength the explosion strength
|
|
25
|
+
* @param falloff possible options: Constant & Linear. Defaults to Constant
|
|
26
|
+
* @returns A physics radial explosion event, or null
|
|
27
|
+
*/
|
|
28
|
+
applyRadialExplosionImpulse(origin: Vector3, radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions, strength?: number, falloff?: PhysicsRadialImpulseFalloff): Nullable<PhysicsRadialExplosionEvent>;
|
|
29
|
+
/**
|
|
30
|
+
* Applies a radial explosion force
|
|
31
|
+
* @param origin the origin of the explosion
|
|
32
|
+
* @param radiusOrEventOptions the radius or the options of radial explosion
|
|
33
|
+
* @param strength the explosion strength
|
|
34
|
+
* @param falloff possible options: Constant & Linear. Defaults to Constant
|
|
35
|
+
* @returns A physics radial explosion event, or null
|
|
36
|
+
*/
|
|
37
|
+
applyRadialExplosionForce(origin: Vector3, radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions, strength?: number, falloff?: PhysicsRadialImpulseFalloff): Nullable<PhysicsRadialExplosionEvent>;
|
|
38
|
+
/**
|
|
39
|
+
* Creates a gravitational field
|
|
40
|
+
* @param origin the origin of the gravitational field
|
|
41
|
+
* @param radiusOrEventOptions the radius or the options of radial gravitational field
|
|
42
|
+
* @param strength the gravitational field strength
|
|
43
|
+
* @param falloff possible options: Constant & Linear. Defaults to Constant
|
|
44
|
+
* @returns A physics gravitational field event, or null
|
|
45
|
+
*/
|
|
46
|
+
gravitationalField(origin: Vector3, radiusOrEventOptions: number | PhysicsRadialExplosionEventOptions, strength?: number, falloff?: PhysicsRadialImpulseFalloff): Nullable<PhysicsGravitationalFieldEvent>;
|
|
47
|
+
/**
|
|
48
|
+
* Creates a physics updraft event
|
|
49
|
+
* @param origin the origin of the updraft
|
|
50
|
+
* @param radiusOrEventOptions the radius or the options of the updraft
|
|
51
|
+
* @param strength the strength of the updraft
|
|
52
|
+
* @param height the height of the updraft
|
|
53
|
+
* @param updraftMode possible options: Center & Perpendicular. Defaults to Center
|
|
54
|
+
* @returns A physics updraft event, or null
|
|
55
|
+
*/
|
|
56
|
+
updraft(origin: Vector3, radiusOrEventOptions: number | PhysicsUpdraftEventOptions, strength?: number, height?: number, updraftMode?: PhysicsUpdraftMode): Nullable<PhysicsUpdraftEvent>;
|
|
57
|
+
/**
|
|
58
|
+
* Creates a physics vortex event
|
|
59
|
+
* @param origin the of the vortex
|
|
60
|
+
* @param radiusOrEventOptions the radius or the options of the vortex
|
|
61
|
+
* @param strength the strength of the vortex
|
|
62
|
+
* @param height the height of the vortex
|
|
63
|
+
* @returns a Physics vortex event, or null
|
|
64
|
+
* A physics vortex event or null
|
|
65
|
+
*/
|
|
66
|
+
vortex(origin: Vector3, radiusOrEventOptions: number | PhysicsVortexEventOptions, strength?: number, height?: number): Nullable<PhysicsVortexEvent>;
|
|
67
|
+
private _copyPhysicsHitData;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Represents a physics radial explosion event
|
|
71
|
+
*/
|
|
72
|
+
declare class PhysicsRadialExplosionEvent {
|
|
73
|
+
private _scene;
|
|
74
|
+
private _options;
|
|
75
|
+
private _sphere;
|
|
76
|
+
private _dataFetched;
|
|
77
|
+
/**
|
|
78
|
+
* Initializes a radial explosion event
|
|
79
|
+
* @param _scene BabylonJS scene
|
|
80
|
+
* @param _options The options for the vortex event
|
|
81
|
+
*/
|
|
82
|
+
constructor(_scene: Scene, _options: PhysicsRadialExplosionEventOptions);
|
|
83
|
+
/**
|
|
84
|
+
* Returns the data related to the radial explosion event (sphere).
|
|
85
|
+
* @returns The radial explosion event data
|
|
86
|
+
*/
|
|
87
|
+
getData(): PhysicsRadialExplosionEventData;
|
|
88
|
+
private _getHitData;
|
|
89
|
+
/**
|
|
90
|
+
* Returns the force and contact point of the body or false, if the body is not affected by the force/impulse.
|
|
91
|
+
* @param body A physics body
|
|
92
|
+
* @param origin the origin of the explosion
|
|
93
|
+
* @returns A physics force and contact point, or null
|
|
94
|
+
*/
|
|
95
|
+
getBodyHitData(body: PhysicsBody, origin: Vector3, data: PhysicsHitData): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Returns the force and contact point of the impostor or false, if the impostor is not affected by the force/impulse.
|
|
98
|
+
* @param impostor A physics imposter
|
|
99
|
+
* @param origin the origin of the explosion
|
|
100
|
+
* @returns A physics force and contact point, or null
|
|
101
|
+
*/
|
|
102
|
+
getImpostorHitData(impostor: PhysicsImpostor, origin: Vector3, data: PhysicsHitData): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Triggers affected impostors callbacks
|
|
105
|
+
* @param affectedImpostorsWithData defines the list of affected impostors (including associated data)
|
|
106
|
+
*/
|
|
107
|
+
triggerAffectedImpostorsCallback(affectedImpostorsWithData: Array<PhysicsAffectedImpostorWithData>): void;
|
|
108
|
+
/**
|
|
109
|
+
* Triggers affected bodies callbacks
|
|
110
|
+
* @param affectedBodiesWithData defines the list of affected bodies (including associated data)
|
|
111
|
+
*/
|
|
112
|
+
triggerAffectedBodiesCallback(affectedBodiesWithData: Array<PhysicsAffectedBodyWithData>): void;
|
|
113
|
+
/**
|
|
114
|
+
* Disposes the sphere.
|
|
115
|
+
* @param force Specifies if the sphere should be disposed by force
|
|
116
|
+
*/
|
|
117
|
+
dispose(force?: boolean): void;
|
|
118
|
+
/*** Helpers ***/
|
|
119
|
+
private _prepareSphere;
|
|
120
|
+
private _intersectsWithSphere;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Represents a gravitational field event
|
|
124
|
+
*/
|
|
125
|
+
declare class PhysicsGravitationalFieldEvent {
|
|
126
|
+
private _physicsHelper;
|
|
127
|
+
private _scene;
|
|
128
|
+
private _origin;
|
|
129
|
+
private _options;
|
|
130
|
+
private _tickCallback;
|
|
131
|
+
private _sphere;
|
|
132
|
+
private _dataFetched;
|
|
133
|
+
/**
|
|
134
|
+
* Initializes the physics gravitational field event
|
|
135
|
+
* @param _physicsHelper A physics helper
|
|
136
|
+
* @param _scene BabylonJS scene
|
|
137
|
+
* @param _origin The origin position of the gravitational field event
|
|
138
|
+
* @param _options The options for the vortex event
|
|
139
|
+
*/
|
|
140
|
+
constructor(_physicsHelper: PhysicsHelper, _scene: Scene, _origin: Vector3, _options: PhysicsRadialExplosionEventOptions);
|
|
141
|
+
/**
|
|
142
|
+
* Returns the data related to the gravitational field event (sphere).
|
|
143
|
+
* @returns A gravitational field event
|
|
144
|
+
*/
|
|
145
|
+
getData(): PhysicsGravitationalFieldEventData;
|
|
146
|
+
/**
|
|
147
|
+
* Enables the gravitational field.
|
|
148
|
+
*/
|
|
149
|
+
enable(): void;
|
|
150
|
+
/**
|
|
151
|
+
* Disables the gravitational field.
|
|
152
|
+
*/
|
|
153
|
+
disable(): void;
|
|
154
|
+
/**
|
|
155
|
+
* Disposes the sphere.
|
|
156
|
+
* @param force The force to dispose from the gravitational field event
|
|
157
|
+
*/
|
|
158
|
+
dispose(force?: boolean): void;
|
|
159
|
+
private _tick;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Represents a physics updraft event
|
|
163
|
+
*/
|
|
164
|
+
declare class PhysicsUpdraftEvent {
|
|
165
|
+
private _scene;
|
|
166
|
+
private _origin;
|
|
167
|
+
private _options;
|
|
168
|
+
private _physicsEngine;
|
|
169
|
+
private _originTop;
|
|
170
|
+
private _originDirection;
|
|
171
|
+
private _tickCallback;
|
|
172
|
+
private _cylinder;
|
|
173
|
+
private _cylinderPosition;
|
|
174
|
+
private _dataFetched;
|
|
175
|
+
private static hitData;
|
|
176
|
+
/**
|
|
177
|
+
* Initializes the physics updraft event
|
|
178
|
+
* @param _scene BabylonJS scene
|
|
179
|
+
* @param _origin The origin position of the updraft
|
|
180
|
+
* @param _options The options for the updraft event
|
|
181
|
+
*/
|
|
182
|
+
constructor(_scene: Scene, _origin: Vector3, _options: PhysicsUpdraftEventOptions);
|
|
183
|
+
/**
|
|
184
|
+
* Returns the data related to the updraft event (cylinder).
|
|
185
|
+
* @returns A physics updraft event
|
|
186
|
+
*/
|
|
187
|
+
getData(): PhysicsUpdraftEventData;
|
|
188
|
+
/**
|
|
189
|
+
* Enables the updraft.
|
|
190
|
+
*/
|
|
191
|
+
enable(): void;
|
|
192
|
+
/**
|
|
193
|
+
* Disables the updraft.
|
|
194
|
+
*/
|
|
195
|
+
disable(): void;
|
|
196
|
+
/**
|
|
197
|
+
* Disposes the cylinder.
|
|
198
|
+
* @param force Specifies if the updraft should be disposed by force
|
|
199
|
+
*/
|
|
200
|
+
dispose(force?: boolean): void;
|
|
201
|
+
private _getHitData;
|
|
202
|
+
private _getBodyHitData;
|
|
203
|
+
private _getImpostorHitData;
|
|
204
|
+
private _tick;
|
|
205
|
+
/*** Helpers ***/
|
|
206
|
+
private _prepareCylinder;
|
|
207
|
+
private _intersectsWithCylinder;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Represents a physics vortex event
|
|
211
|
+
*/
|
|
212
|
+
declare class PhysicsVortexEvent {
|
|
213
|
+
private _scene;
|
|
214
|
+
private _origin;
|
|
215
|
+
private _options;
|
|
216
|
+
private _physicsEngine;
|
|
217
|
+
private _originTop;
|
|
218
|
+
private _tickCallback;
|
|
219
|
+
private _cylinder;
|
|
220
|
+
private _cylinderPosition;
|
|
221
|
+
private _dataFetched;
|
|
222
|
+
private static originOnPlane;
|
|
223
|
+
private static hitData;
|
|
224
|
+
/**
|
|
225
|
+
* Initializes the physics vortex event
|
|
226
|
+
* @param _scene The BabylonJS scene
|
|
227
|
+
* @param _origin The origin position of the vortex
|
|
228
|
+
* @param _options The options for the vortex event
|
|
229
|
+
*/
|
|
230
|
+
constructor(_scene: Scene, _origin: Vector3, _options: PhysicsVortexEventOptions);
|
|
231
|
+
/**
|
|
232
|
+
* Returns the data related to the vortex event (cylinder).
|
|
233
|
+
* @returns The physics vortex event data
|
|
234
|
+
*/
|
|
235
|
+
getData(): PhysicsVortexEventData;
|
|
236
|
+
/**
|
|
237
|
+
* Enables the vortex.
|
|
238
|
+
*/
|
|
239
|
+
enable(): void;
|
|
240
|
+
/**
|
|
241
|
+
* Disables the cortex.
|
|
242
|
+
*/
|
|
243
|
+
disable(): void;
|
|
244
|
+
/**
|
|
245
|
+
* Disposes the sphere.
|
|
246
|
+
* @param force
|
|
247
|
+
*/
|
|
248
|
+
dispose(force?: boolean): void;
|
|
249
|
+
private _getHitData;
|
|
250
|
+
private _getBodyHitData;
|
|
251
|
+
private _getImpostorHitData;
|
|
252
|
+
private _tick;
|
|
253
|
+
/*** Helpers ***/
|
|
254
|
+
private _prepareCylinder;
|
|
255
|
+
private _intersectsWithCylinder;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Options fot the radial explosion event
|
|
259
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
260
|
+
*/
|
|
261
|
+
export declare class PhysicsRadialExplosionEventOptions {
|
|
262
|
+
/**
|
|
263
|
+
* The radius of the sphere for the radial explosion.
|
|
264
|
+
*/
|
|
265
|
+
radius: number;
|
|
266
|
+
/**
|
|
267
|
+
* The strength of the explosion.
|
|
268
|
+
*/
|
|
269
|
+
strength: number;
|
|
270
|
+
/**
|
|
271
|
+
* The strength of the force in correspondence to the distance of the affected object
|
|
272
|
+
*/
|
|
273
|
+
falloff: PhysicsRadialImpulseFalloff;
|
|
274
|
+
/**
|
|
275
|
+
* Sphere options for the radial explosion.
|
|
276
|
+
*/
|
|
277
|
+
sphere: {
|
|
278
|
+
segments: number;
|
|
279
|
+
diameter: number;
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* Sphere options for the radial explosion.
|
|
283
|
+
*/
|
|
284
|
+
affectedImpostorsCallback: (affectedImpostorsWithData: Array<PhysicsAffectedImpostorWithData>) => void;
|
|
285
|
+
/**
|
|
286
|
+
* Sphere options for the radial explosion.
|
|
287
|
+
*/
|
|
288
|
+
affectedBodiesCallback: (affectedBodiesWithData: Array<PhysicsAffectedBodyWithData>) => void;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Options fot the updraft event
|
|
292
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
293
|
+
*/
|
|
294
|
+
export declare class PhysicsUpdraftEventOptions {
|
|
295
|
+
/**
|
|
296
|
+
* The radius of the cylinder for the vortex
|
|
297
|
+
*/
|
|
298
|
+
radius: number;
|
|
299
|
+
/**
|
|
300
|
+
* The strength of the updraft.
|
|
301
|
+
*/
|
|
302
|
+
strength: number;
|
|
303
|
+
/**
|
|
304
|
+
* The height of the cylinder for the updraft.
|
|
305
|
+
*/
|
|
306
|
+
height: number;
|
|
307
|
+
/**
|
|
308
|
+
* The mode for the the updraft.
|
|
309
|
+
*/
|
|
310
|
+
updraftMode: PhysicsUpdraftMode;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Options fot the vortex event
|
|
314
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
315
|
+
*/
|
|
316
|
+
export declare class PhysicsVortexEventOptions {
|
|
317
|
+
/**
|
|
318
|
+
* The radius of the cylinder for the vortex
|
|
319
|
+
*/
|
|
320
|
+
radius: number;
|
|
321
|
+
/**
|
|
322
|
+
* The strength of the vortex.
|
|
323
|
+
*/
|
|
324
|
+
strength: number;
|
|
325
|
+
/**
|
|
326
|
+
* The height of the cylinder for the vortex.
|
|
327
|
+
*/
|
|
328
|
+
height: number;
|
|
329
|
+
/**
|
|
330
|
+
* At which distance, relative to the radius the centripetal forces should kick in? Range: 0-1
|
|
331
|
+
*/
|
|
332
|
+
centripetalForceThreshold: number;
|
|
333
|
+
/**
|
|
334
|
+
* This multiplier determines with how much force the objects will be pushed sideways/around the vortex, when below the threshold.
|
|
335
|
+
*/
|
|
336
|
+
centripetalForceMultiplier: number;
|
|
337
|
+
/**
|
|
338
|
+
* This multiplier determines with how much force the objects will be pushed sideways/around the vortex, when above the threshold.
|
|
339
|
+
*/
|
|
340
|
+
centrifugalForceMultiplier: number;
|
|
341
|
+
/**
|
|
342
|
+
* This multiplier determines with how much force the objects will be pushed upwards, when in the vortex.
|
|
343
|
+
*/
|
|
344
|
+
updraftForceMultiplier: number;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* The strength of the force in correspondence to the distance of the affected object
|
|
348
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
349
|
+
*/
|
|
350
|
+
export declare enum PhysicsRadialImpulseFalloff {
|
|
351
|
+
/** Defines that impulse is constant in strength across it's whole radius */
|
|
352
|
+
Constant = 0,
|
|
353
|
+
/** Defines that impulse gets weaker if it's further from the origin */
|
|
354
|
+
Linear = 1
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* The strength of the force in correspondence to the distance of the affected object
|
|
358
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
359
|
+
*/
|
|
360
|
+
export declare enum PhysicsUpdraftMode {
|
|
361
|
+
/** Defines that the upstream forces will pull towards the top center of the cylinder */
|
|
362
|
+
Center = 0,
|
|
363
|
+
/** Defines that once a impostor is inside the cylinder, it will shoot out perpendicular from the ground of the cylinder */
|
|
364
|
+
Perpendicular = 1
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Interface for a physics hit data
|
|
368
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
369
|
+
*/
|
|
370
|
+
export interface PhysicsHitData {
|
|
371
|
+
/**
|
|
372
|
+
* The force applied at the contact point
|
|
373
|
+
*/
|
|
374
|
+
force: Vector3;
|
|
375
|
+
/**
|
|
376
|
+
* The contact point
|
|
377
|
+
*/
|
|
378
|
+
contactPoint: Vector3;
|
|
379
|
+
/**
|
|
380
|
+
* The distance from the origin to the contact point
|
|
381
|
+
*/
|
|
382
|
+
distanceFromOrigin: number;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Interface for radial explosion event data
|
|
386
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
387
|
+
*/
|
|
388
|
+
export interface PhysicsRadialExplosionEventData {
|
|
389
|
+
/**
|
|
390
|
+
* A sphere used for the radial explosion event
|
|
391
|
+
*/
|
|
392
|
+
sphere: Mesh;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Interface for gravitational field event data
|
|
396
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
397
|
+
*/
|
|
398
|
+
export interface PhysicsGravitationalFieldEventData {
|
|
399
|
+
/**
|
|
400
|
+
* A sphere mesh used for the gravitational field event
|
|
401
|
+
*/
|
|
402
|
+
sphere: Mesh;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Interface for updraft event data
|
|
406
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
407
|
+
*/
|
|
408
|
+
export interface PhysicsUpdraftEventData {
|
|
409
|
+
/**
|
|
410
|
+
* A cylinder used for the updraft event
|
|
411
|
+
*/
|
|
412
|
+
cylinder: Mesh;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Interface for vortex event data
|
|
416
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
417
|
+
*/
|
|
418
|
+
export interface PhysicsVortexEventData {
|
|
419
|
+
/**
|
|
420
|
+
* A cylinder used for the vortex event
|
|
421
|
+
*/
|
|
422
|
+
cylinder: Mesh;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Interface for an affected physics impostor
|
|
426
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine#further-functionality-of-the-impostor-class
|
|
427
|
+
*/
|
|
428
|
+
export interface PhysicsAffectedImpostorWithData {
|
|
429
|
+
/**
|
|
430
|
+
* The impostor affected by the effect
|
|
431
|
+
*/
|
|
432
|
+
impostor: PhysicsImpostor;
|
|
433
|
+
/**
|
|
434
|
+
* The data about the hit/force from the explosion
|
|
435
|
+
*/
|
|
436
|
+
hitData: PhysicsHitData;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Interface for an affected physics body
|
|
440
|
+
* @see
|
|
441
|
+
*/
|
|
442
|
+
export interface PhysicsAffectedBodyWithData {
|
|
443
|
+
/**
|
|
444
|
+
* The impostor affected by the effect
|
|
445
|
+
*/
|
|
446
|
+
body: PhysicsBody;
|
|
447
|
+
/**
|
|
448
|
+
* The data about the hit/force from the explosion
|
|
449
|
+
*/
|
|
450
|
+
hitData: PhysicsHitData;
|
|
451
|
+
}
|
|
452
|
+
export {};
|