@babylonjs/core 7.12.0 → 7.13.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/Animations/animation.js +1 -2
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroupMask.d.ts +1 -1
- package/Animations/animationGroupMask.js +2 -2
- package/Animations/animationGroupMask.js.map +1 -1
- package/Animations/animationKey.d.ts +1 -1
- package/Animations/animationKey.js.map +1 -1
- package/Behaviors/Meshes/handConstraintBehavior.d.ts +3 -3
- package/Behaviors/Meshes/handConstraintBehavior.js +16 -17
- package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
- package/Behaviors/Meshes/sixDofDragBehavior.js +2 -3
- package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
- package/Bones/bone.js +31 -32
- package/Bones/bone.js.map +1 -1
- package/Bones/boneIKController.js +5 -6
- package/Bones/boneIKController.js.map +1 -1
- package/Bones/boneLookController.js +13 -13
- package/Bones/boneLookController.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseWheelInput.js +5 -6
- package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js +5 -5
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.js +8 -10
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Compute/computeEffect.js +2 -3
- package/Compute/computeEffect.js.map +1 -1
- package/Compute/computeShader.js +19 -20
- package/Compute/computeShader.js.map +1 -1
- package/Culling/Helper/IBoundingInfoHelperPlatform.d.ts +4 -0
- package/Culling/Helper/IBoundingInfoHelperPlatform.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.d.ts +26 -4
- package/Culling/Helper/boundingInfoHelper.js +41 -10
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Culling/Helper/computeShaderBoundingHelper.d.ts +12 -3
- package/Culling/Helper/computeShaderBoundingHelper.js +164 -76
- package/Culling/Helper/computeShaderBoundingHelper.js.map +1 -1
- package/Culling/Helper/transformFeedbackBoundingHelper.d.ts +11 -0
- package/Culling/Helper/transformFeedbackBoundingHelper.js +46 -14
- package/Culling/Helper/transformFeedbackBoundingHelper.js.map +1 -1
- package/Debug/debugLayer.d.ts +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Decorators/nodeDecorator.d.ts +1 -1
- package/Decorators/nodeDecorator.js +1 -1
- package/Decorators/nodeDecorator.js.map +1 -1
- package/DeviceInput/InputDevices/deviceEnums.d.ts +5 -5
- package/DeviceInput/InputDevices/deviceEnums.js.map +1 -1
- package/DeviceInput/eventFactory.js +3 -3
- package/DeviceInput/eventFactory.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +2 -2
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.computeShader.d.ts +1 -1
- package/Engines/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.js +2 -2
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.dynamicTexture.js +2 -2
- package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +3 -3
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.multiview.js +2 -2
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.js +3 -3
- package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.js +4 -4
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +3 -3
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.renderTargetCube.js +2 -2
- package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/Native/nativeShaderProcessors.js +1 -2
- package/Engines/Native/nativeShaderProcessors.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +2 -3
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGL2ShaderProcessors.js +1 -2
- package/Engines/WebGL/webGL2ShaderProcessors.js.map +1 -1
- package/Engines/WebGL/webGLShaderProcessors.js +1 -2
- package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +1 -2
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js +2 -2
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +2 -2
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +2 -2
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +5 -5
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -3
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js +2 -2
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +81 -82
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +60 -64
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +1 -2
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuComputeContext.js +13 -15
- package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +39 -39
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +6 -8
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -2
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js +3 -3
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js +15 -19
- package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +8 -10
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +26 -28
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +413 -416
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +50 -51
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/WebGPU/webgpuTimestampQuery.js +1 -2
- package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
- package/Engines/abstractEngine.js +4 -4
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.js +2 -2
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.js +9 -9
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +5 -5
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +1 -2
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/shaderStore.js +6 -7
- package/Engines/shaderStore.js.map +1 -1
- package/Engines/thinEngine.js +4 -5
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +11 -0
- package/Engines/webgpuEngine.js +91 -72
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/deviceInputEvents.d.ts +1 -1
- package/Events/deviceInputEvents.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +1 -1
- package/FlowGraph/flowGraph.js +5 -5
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphBlock.js +2 -3
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +1 -1
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.js +3 -3
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.js +2 -3
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphSignalConnection.js +3 -3
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/Gamepads/dualShockGamepad.d.ts +2 -2
- package/Gamepads/dualShockGamepad.js +14 -14
- package/Gamepads/dualShockGamepad.js.map +1 -1
- package/Gamepads/xboxGamepad.d.ts +2 -2
- package/Gamepads/xboxGamepad.js +14 -14
- package/Gamepads/xboxGamepad.js.map +1 -1
- package/Gizmos/gizmo.d.ts +2 -2
- package/Gizmos/gizmo.js +4 -4
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/gizmoManager.js +2 -2
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/scaleGizmo.js +3 -3
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js +6 -6
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.d.ts +3 -3
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +10 -11
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js +8 -9
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js +3 -4
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js +2 -3
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +1 -2
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +5 -6
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +4 -5
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +7 -8
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +4 -6
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.js +2 -4
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/derivativeBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/derivativeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragDepthBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/fragDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +5 -6
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +5 -6
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +3 -4
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +7 -9
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +19 -21
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js +3 -4
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +2 -3
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +4 -5
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +28 -29
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +4 -5
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js +5 -6
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js +4 -5
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +2 -3
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/arcTan2Block.js +1 -2
- package/Materials/Node/Blocks/arcTan2Block.js.map +1 -1
- package/Materials/Node/Blocks/biPlanarBlock.js +3 -4
- package/Materials/Node/Blocks/biPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/clampBlock.js +4 -5
- package/Materials/Node/Blocks/clampBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js +3 -4
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/curveBlock.js +1 -2
- package/Materials/Node/Blocks/curveBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.js +1 -2
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -2
- package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.d.ts +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js +35 -35
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
- package/Materials/Node/Blocks/modBlock.js +1 -2
- package/Materials/Node/Blocks/modBlock.js.map +1 -1
- package/Materials/Node/Blocks/remapBlock.js +3 -3
- package/Materials/Node/Blocks/remapBlock.js.map +1 -1
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js +1 -2
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
- package/Materials/Node/Blocks/transformBlock.js +1 -2
- package/Materials/Node/Blocks/transformBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.js +10 -12
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/voronoiNoiseBlock.js +3 -4
- package/Materials/Node/Blocks/voronoiNoiseBlock.js.map +1 -1
- package/Materials/Node/Blocks/waveBlock.d.ts +1 -1
- package/Materials/Node/Blocks/waveBlock.js +4 -4
- package/Materials/Node/Blocks/waveBlock.js.map +1 -1
- package/Materials/Node/Blocks/worleyNoise3DBlock.js +3 -4
- package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
- package/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.d.ts +1 -1
- package/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +3 -4
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.js +5 -6
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +2 -2
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +10 -10
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +18 -19
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/Node/nodeMaterialConnectionPointCustomObject.js +3 -3
- package/Materials/Node/nodeMaterialConnectionPointCustomObject.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +3 -4
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +1 -1
- package/Materials/Textures/internalTexture.js +13 -13
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/ktx2decoderTypes.d.ts +1 -1
- package/Materials/Textures/ktx2decoderTypes.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.js +1 -2
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/effect.functions.js +2 -3
- package/Materials/effect.functions.js.map +1 -1
- package/Materials/effect.js +3 -4
- package/Materials/effect.js.map +1 -1
- package/Materials/effect.webgl.functions.js +1 -2
- package/Materials/effect.webgl.functions.js.map +1 -1
- package/Materials/material.js +7 -9
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginEvent.d.ts +1 -1
- package/Materials/materialPluginEvent.js.map +1 -1
- package/Materials/materialPluginManager.js +9 -11
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/meshDebugPluginMaterial.d.ts +1 -1
- package/Materials/meshDebugPluginMaterial.js +2 -2
- package/Materials/meshDebugPluginMaterial.js.map +1 -1
- package/Materials/shaderLanguage.d.ts +1 -1
- package/Materials/shaderLanguage.js.map +1 -1
- package/Materials/shadowDepthWrapper.js +1 -2
- package/Materials/shadowDepthWrapper.js.map +1 -1
- package/Materials/standardMaterial.js +2 -3
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.axis.d.ts +2 -2
- package/Maths/math.axis.js.map +1 -1
- package/Maths/math.path.d.ts +1 -1
- package/Maths/math.path.js +3 -3
- package/Maths/math.path.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +2 -2
- package/Meshes/Builders/greasedLineBuilder.js +21 -23
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +3 -3
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +14 -14
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +2 -2
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +2 -2
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +3 -3
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +3 -3
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setColorsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setNormalsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setTangentsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setUVsBlock.js +3 -3
- package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/boxBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/capsuleBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/cylinderBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/discBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/gridBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/meshBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/planeBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/sphereBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/torusBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +2 -2
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +2 -2
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.js +3 -3
- package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/conditionBlock.js +2 -2
- package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryClampBlock.js +3 -3
- package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCollectionBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCurveBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js +3 -3
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTransformBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mappingBlock.js +2 -2
- package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mathBlock.js +2 -2
- package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mergeGeometryBlock.js +2 -2
- package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/randomBlock.js +2 -2
- package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.js +3 -3
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.d.ts +2 -2
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +7 -7
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
- package/Meshes/abstractMesh.js +2 -3
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.js +1 -2
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/meshSimplification.d.ts +1 -1
- package/Meshes/meshSimplification.js +1 -1
- package/Meshes/meshSimplification.js.map +1 -1
- package/Meshes/meshSimplificationSceneComponent.js +2 -2
- package/Meshes/meshSimplificationSceneComponent.js.map +1 -1
- package/Meshes/transformNode.js +7 -8
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/assetsManager.d.ts +1 -1
- package/Misc/assetsManager.js +9 -9
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/basis.js +2 -2
- package/Misc/basis.js.map +1 -1
- package/Misc/copyTextureToTexture.d.ts +1 -1
- package/Misc/copyTextureToTexture.js +1 -1
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/environmentTextureTools.js +3 -3
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/iInspectable.d.ts +1 -1
- package/Misc/iInspectable.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +2 -2
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/timer.d.ts +1 -1
- package/Misc/timer.js +5 -5
- package/Misc/timer.js.map +1 -1
- package/Misc/virtualJoystick.d.ts +1 -1
- package/Misc/virtualJoystick.js +16 -16
- package/Misc/virtualJoystick.js.map +1 -1
- package/Particles/particleSystem.js +3 -3
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/particleSystemComponent.js +1 -2
- package/Particles/particleSystemComponent.js.map +1 -1
- package/Particles/pointsCloudSystem.d.ts +1 -1
- package/Particles/pointsCloudSystem.js +14 -14
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/subEmitter.d.ts +1 -1
- package/Particles/subEmitter.js +1 -1
- package/Particles/subEmitter.js.map +1 -1
- package/Physics/physicsHelper.d.ts +2 -2
- package/Physics/physicsHelper.js +6 -7
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/v1/physicsImpostor.js +4 -5
- package/Physics/v1/physicsImpostor.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +16 -8
- package/Physics/v2/IPhysicsEnginePlugin.js +9 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +96 -79
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/physicsAggregate.js +8 -9
- package/Physics/v2/physicsAggregate.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +14 -2
- package/Physics/v2/physicsBody.js +30 -11
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsConstraint.js +8 -9
- package/Physics/v2/physicsConstraint.js.map +1 -1
- package/Physics/v2/physicsMaterial.d.ts +1 -1
- package/Physics/v2/physicsMaterial.js.map +1 -1
- package/Physics/v2/physicsShape.js +9 -10
- package/Physics/v2/physicsShape.js.map +1 -1
- package/Physics/v2/ragdoll.js +11 -12
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +2 -2
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.d.ts +1 -1
- package/PostProcesses/depthOfFieldEffect.js +3 -3
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/postProcess.js +2 -3
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.d.ts +1 -1
- package/PostProcesses/tonemapPostProcess.js +4 -4
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +10 -10
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Shaders/spriteMap.fragment.js +3 -2
- package/Shaders/spriteMap.fragment.js.map +1 -1
- package/ShadersWGSL/boundingInfo.compute.js +8 -8
- package/ShadersWGSL/boundingInfo.compute.js.map +1 -1
- package/XR/features/WebXRDepthSensing.js +2 -2
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXRHandTracking.d.ts +2 -2
- package/XR/features/WebXRHandTracking.js +76 -76
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRLightEstimation.js +2 -2
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRNearInteraction.d.ts +1 -1
- package/XR/features/WebXRNearInteraction.js +5 -5
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.js +2 -2
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/XR/motionController/webXRProfiledMotionController.js +2 -2
- package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
- package/XR/webXRCamera.js +3 -4
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXREnterExitUI.js +3 -4
- package/XR/webXREnterExitUI.js.map +1 -1
- package/XR/webXRExperienceHelper.js +12 -13
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRManagedOutputCanvas.d.ts +1 -1
- package/XR/webXRManagedOutputCanvas.js +15 -6
- package/XR/webXRManagedOutputCanvas.js.map +1 -1
- package/XR/webXRRenderTargetTextureProvider.js +2 -2
- package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
- package/XR/webXRTypes.d.ts +2 -2
- package/XR/webXRTypes.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +1 -1
- package/scene.js +4 -4
- package/scene.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"physicsImpostor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v1/physicsImpostor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAOzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AA6K9C,IAAI,CAAC,sBAAsB,GAAG,UAAU,KAAY,EAAE,YAAmC,EAAE,UAAe;IACtG,OAAO,IAAI,eAAe,CACtB,YAAY,EACZ,UAAU,CAAC,eAAe,EAC1B;QACI,IAAI,EAAE,UAAU,CAAC,WAAW;QAC5B,QAAQ,EAAE,UAAU,CAAC,eAAe;QACpC,WAAW,EAAE,UAAU,CAAC,kBAAkB;KAC7C,EACD,KAAK,CACR,CAAC;AACN,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,eAAe;IA0CxB;;OAEG;IACH,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,gBAAgB,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,IAAI,CAAC,KAAa;QAClB,I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AJ,CAAK;AACnC;;GAEG;AACW,gCAAgB,GAAG,CAAC,AAAJ,CAAK;AACnC;;GAEG;AACW,iCAAiB,GAAG,CAAC,AAAJ,CAAK;AACpC;;GAEG;AACW,kCAAkB,GAAG,EAAE,AAAL,CAAM;AACtC;;GAEG;AACW,8BAAc,GAAG,GAAG,AAAN,CAAO;AACnC;;GAEG;AACW,4BAAY,GAAG,GAAG,AAAN,CAAO;AACjC;;GAEG;AACW,6BAAa,GAAG,GAAG,AAAN,CAAO;AAClC;;GAEG;AACW,gCAAgB,GAAG,GAAG,AAAN,CAAO","sourcesContent":["import type { Nullable, IndicesArray } from \"../../types\";\r\nimport { Logger } from \"../../Misc/logger\";\r\nimport { ArrayTools } from \"../../Misc/arrayTools\";\r\nimport type { Matrix } from \"../../Maths/math.vector\";\r\nimport { Vector3, Quaternion } from \"../../Maths/math.vector\";\r\nimport type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { Mesh } from \"../../Meshes/mesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { Bone } from \"../../Bones/bone\";\r\nimport type { BoundingInfo } from \"../../Culling/boundingInfo\";\r\nimport type { PhysicsEngine as PhysicsEngineV1 } from \"./physicsEngine\";\r\n\r\nimport type { PhysicsJointData } from \"./physicsJoint\";\r\nimport { PhysicsJoint } from \"./physicsJoint\";\r\nimport { Space } from \"../../Maths/math.axis\";\r\n\r\n/**\r\n * The interface for the physics imposter parameters\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface PhysicsImpostorParameters {\r\n /**\r\n * The mass of the physics imposter\r\n */\r\n mass: number;\r\n /**\r\n * The friction of the physics imposter\r\n */\r\n friction?: number;\r\n /**\r\n * The coefficient of restitution of the physics imposter\r\n */\r\n restitution?: number;\r\n /**\r\n * The native options of the physics imposter\r\n */\r\n nativeOptions?: any;\r\n /**\r\n * Specifies if the parent should be ignored\r\n */\r\n ignoreParent?: boolean;\r\n /**\r\n * Specifies if bi-directional transformations should be disabled\r\n */\r\n disableBidirectionalTransformation?: boolean;\r\n /**\r\n * The pressure inside the physics imposter, soft object only\r\n */\r\n pressure?: number;\r\n /**\r\n * The stiffness the physics imposter, soft object only\r\n */\r\n stiffness?: number;\r\n /**\r\n * The number of iterations used in maintaining consistent vertex velocities, soft object only\r\n */\r\n velocityIterations?: number;\r\n /**\r\n * The number of iterations used in maintaining consistent vertex positions, soft object only\r\n */\r\n positionIterations?: number;\r\n /**\r\n * The number used to fix points on a cloth (0, 1, 2, 4, 8) or rope (0, 1, 2) only\r\n * 0 None, 1, back left or top, 2, back right or bottom, 4, front left, 8, front right\r\n * Add to fix multiple points\r\n */\r\n fixedPoints?: number;\r\n /**\r\n * The collision margin around a soft object\r\n */\r\n margin?: number;\r\n /**\r\n * The collision margin around a soft object\r\n */\r\n damping?: number;\r\n /**\r\n * The path for a rope based on an extrusion\r\n */\r\n path?: any;\r\n /**\r\n * The shape of an extrusion used for a rope based on an extrusion\r\n */\r\n shape?: any;\r\n}\r\n\r\n/**\r\n * Interface for a physics-enabled object\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface IPhysicsEnabledObject {\r\n /**\r\n * The position of the physics-enabled object\r\n */\r\n position: Vector3;\r\n /**\r\n * The rotation of the physics-enabled object\r\n */\r\n rotationQuaternion: Nullable<Quaternion>;\r\n /**\r\n * The scale of the physics-enabled object\r\n */\r\n scaling: Vector3;\r\n /**\r\n * The rotation of the physics-enabled object\r\n */\r\n rotation?: Vector3;\r\n /**\r\n * The parent of the physics-enabled object\r\n */\r\n parent?: any;\r\n /**\r\n * The bounding info of the physics-enabled object\r\n * @returns The bounding info of the physics-enabled object\r\n */\r\n getBoundingInfo(): BoundingInfo;\r\n /**\r\n * Computes the world matrix\r\n * @param force Specifies if the world matrix should be computed by force\r\n * @returns A world matrix\r\n */\r\n computeWorldMatrix(force: boolean): Matrix;\r\n /**\r\n * Gets the world matrix\r\n * @returns A world matrix\r\n */\r\n getWorldMatrix?(): Matrix;\r\n /**\r\n * Gets the child meshes\r\n * @param directDescendantsOnly Specifies if only direct-descendants should be obtained\r\n * @returns An array of abstract meshes\r\n */\r\n getChildMeshes?(directDescendantsOnly?: boolean): Array<AbstractMesh>;\r\n /**\r\n * Gets the vertex data\r\n * @param kind The type of vertex data\r\n * @returns A nullable array of numbers, or a float32 array\r\n */\r\n getVerticesData(kind: string): Nullable<Array<number> | Float32Array>;\r\n /**\r\n * Gets the indices from the mesh\r\n * @returns A nullable array of index arrays\r\n */\r\n getIndices?(): Nullable<IndicesArray>;\r\n /**\r\n * Gets the scene from the mesh\r\n * @returns the indices array or null\r\n */\r\n getScene?(): Scene;\r\n /**\r\n * Gets the absolute position from the mesh\r\n * @returns the absolute position\r\n */\r\n getAbsolutePosition(): Vector3;\r\n /**\r\n * Gets the absolute pivot point from the mesh\r\n * @returns the absolute pivot point\r\n */\r\n getAbsolutePivotPoint(): Vector3;\r\n /**\r\n * Rotates the mesh\r\n * @param axis The axis of rotation\r\n * @param amount The amount of rotation\r\n * @param space The space of the rotation\r\n * @returns The rotation transform node\r\n */\r\n rotate(axis: Vector3, amount: number, space?: Space): TransformNode;\r\n /**\r\n * Translates the mesh\r\n * @param axis The axis of translation\r\n * @param distance The distance of translation\r\n * @param space The space of the translation\r\n * @returns The transform node\r\n */\r\n translate(axis: Vector3, distance: number, space?: Space): TransformNode;\r\n /**\r\n * Sets the absolute position of the mesh\r\n * @param absolutePosition The absolute position of the mesh\r\n * @returns The transform node\r\n */\r\n setAbsolutePosition(absolutePosition: Vector3): TransformNode;\r\n /**\r\n * Gets the class name of the mesh\r\n * @returns The class name\r\n */\r\n getClassName(): string;\r\n}\r\n\r\nMesh._PhysicsImpostorParser = function (scene: Scene, physicObject: IPhysicsEnabledObject, jsonObject: any): PhysicsImpostor {\r\n return new PhysicsImpostor(\r\n physicObject,\r\n jsonObject.physicsImpostor,\r\n {\r\n mass: jsonObject.physicsMass,\r\n friction: jsonObject.physicsFriction,\r\n restitution: jsonObject.physicsRestitution,\r\n },\r\n scene\r\n );\r\n};\r\n\r\n/**\r\n * Represents a physics imposter\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport class PhysicsImpostor {\r\n /**\r\n * The default object size of the imposter\r\n */\r\n public static DEFAULT_OBJECT_SIZE: Vector3 = new Vector3(1, 1, 1);\r\n\r\n /**\r\n * The identity quaternion of the imposter\r\n */\r\n public static IDENTITY_QUATERNION = Quaternion.Identity();\r\n\r\n /** @internal */\r\n public _pluginData: any = {};\r\n\r\n private _physicsEngine: Nullable<PhysicsEngineV1>;\r\n //The native cannon/oimo/energy physics body object.\r\n private _physicsBody: any;\r\n private _bodyUpdateRequired: boolean = false;\r\n\r\n private _onBeforePhysicsStepCallbacks = new Array<(impostor: PhysicsImpostor) => void>();\r\n private _onAfterPhysicsStepCallbacks = new Array<(impostor: PhysicsImpostor) => void>();\r\n /** @internal */\r\n public _onPhysicsCollideCallbacks: Array<{\r\n callback: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor, point: Nullable<Vector3>, distance: number, impulse: number, normal: Nullable<Vector3>) => void;\r\n otherImpostors: Array<PhysicsImpostor>;\r\n }> = [];\r\n\r\n private _deltaPosition: Vector3 = Vector3.Zero();\r\n private _deltaRotation: Quaternion;\r\n private _deltaRotationConjugated: Quaternion;\r\n\r\n /** @internal */\r\n public _isFromLine: boolean;\r\n\r\n //If set, this is this impostor's parent\r\n private _parent: Nullable<PhysicsImpostor>;\r\n\r\n private _isDisposed = false;\r\n\r\n private static _TmpVecs: Vector3[] = ArrayTools.BuildArray(3, Vector3.Zero);\r\n private static _TmpQuat: Quaternion = Quaternion.Identity();\r\n\r\n /**\r\n * Specifies if the physics imposter is disposed\r\n */\r\n get isDisposed(): boolean {\r\n return this._isDisposed;\r\n }\r\n\r\n /**\r\n * Gets the mass of the physics imposter\r\n */\r\n get mass(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyMass(this) : 0;\r\n }\r\n\r\n set mass(value: number) {\r\n this.setMass(value);\r\n }\r\n\r\n /**\r\n * Gets the coefficient of friction\r\n */\r\n get friction(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyFriction(this) : 0;\r\n }\r\n\r\n /**\r\n * Sets the coefficient of friction\r\n */\r\n set friction(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n this._physicsEngine.getPhysicsPlugin().setBodyFriction(this, value);\r\n }\r\n\r\n /**\r\n * Gets the coefficient of restitution\r\n */\r\n get restitution(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this) : 0;\r\n }\r\n\r\n /**\r\n * Sets the coefficient of restitution\r\n */\r\n set restitution(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this, value);\r\n }\r\n\r\n /**\r\n * Gets the pressure of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get pressure(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPressure) {\r\n return 0;\r\n }\r\n return plugin.getBodyPressure!(this);\r\n }\r\n\r\n /**\r\n * Sets the pressure of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set pressure(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPressure) {\r\n return;\r\n }\r\n plugin.setBodyPressure!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the stiffness of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get stiffness(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyStiffness) {\r\n return 0;\r\n }\r\n return plugin.getBodyStiffness!(this);\r\n }\r\n\r\n /**\r\n * Sets the stiffness of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set stiffness(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyStiffness) {\r\n return;\r\n }\r\n plugin.setBodyStiffness!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the velocityIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get velocityIterations(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyVelocityIterations) {\r\n return 0;\r\n }\r\n return plugin.getBodyVelocityIterations!(this);\r\n }\r\n\r\n /**\r\n * Sets the velocityIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set velocityIterations(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyVelocityIterations) {\r\n return;\r\n }\r\n plugin.setBodyVelocityIterations!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the positionIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get positionIterations(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyPositionIterations) {\r\n return 0;\r\n }\r\n return plugin.getBodyPositionIterations!(this);\r\n }\r\n\r\n /**\r\n * Sets the positionIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set positionIterations(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPositionIterations) {\r\n return;\r\n }\r\n plugin.setBodyPositionIterations!(this, value);\r\n }\r\n\r\n /**\r\n * The unique id of the physics imposter\r\n * set by the physics engine when adding this impostor to the array\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * @internal\r\n */\r\n public soft: boolean = false;\r\n\r\n /**\r\n * @internal\r\n */\r\n public segments: number = 0;\r\n\r\n private _joints: Array<{\r\n joint: PhysicsJoint;\r\n otherImpostor: PhysicsImpostor;\r\n }>;\r\n\r\n /**\r\n * Initializes the physics imposter\r\n * @param object The physics-enabled object used as the physics imposter\r\n * @param type The type of the physics imposter. Types are available as static members of this class.\r\n * @param _options The options for the physics imposter\r\n * @param _scene The Babylon scene\r\n */\r\n constructor(\r\n /**\r\n * The physics-enabled object used as the physics imposter\r\n */\r\n public object: IPhysicsEnabledObject,\r\n /**\r\n * The type of the physics imposter\r\n */\r\n public type: number,\r\n private _options: PhysicsImpostorParameters = { mass: 0 },\r\n private _scene?: Scene\r\n ) {\r\n //sanity check!\r\n if (!this.object) {\r\n Logger.Error(\"No object was provided. A physics object is obligatory\");\r\n return;\r\n }\r\n if (this.object.parent && _options.mass !== 0) {\r\n Logger.Warn(\"A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur.\");\r\n }\r\n\r\n // Legacy support for old syntax.\r\n if (!this._scene && object.getScene) {\r\n this._scene = object.getScene();\r\n }\r\n\r\n if (!this._scene) {\r\n return;\r\n }\r\n\r\n if (this.type > 100) {\r\n this.soft = true;\r\n }\r\n\r\n this._physicsEngine = this._scene.getPhysicsEngine() as any;\r\n if (!this._physicsEngine) {\r\n Logger.Error(\"Physics not enabled. Please use scene.enablePhysics(...) before creating impostors.\");\r\n } else {\r\n //set the object's quaternion, if not set\r\n if (!this.object.rotationQuaternion) {\r\n if (this.object.rotation) {\r\n this.object.rotationQuaternion = Quaternion.RotationYawPitchRoll(this.object.rotation.y, this.object.rotation.x, this.object.rotation.z);\r\n } else {\r\n this.object.rotationQuaternion = new Quaternion();\r\n }\r\n }\r\n //default options params\r\n this._options.mass = _options.mass === void 0 ? 0 : _options.mass;\r\n this._options.friction = _options.friction === void 0 ? 0.2 : _options.friction;\r\n this._options.restitution = _options.restitution === void 0 ? 0.2 : _options.restitution;\r\n if (this.soft) {\r\n //softbody mass must be above 0;\r\n this._options.mass = this._options.mass > 0 ? this._options.mass : 1;\r\n this._options.pressure = _options.pressure === void 0 ? 200 : _options.pressure;\r\n this._options.stiffness = _options.stiffness === void 0 ? 1 : _options.stiffness;\r\n this._options.velocityIterations = _options.velocityIterations === void 0 ? 20 : _options.velocityIterations;\r\n this._options.positionIterations = _options.positionIterations === void 0 ? 20 : _options.positionIterations;\r\n this._options.fixedPoints = _options.fixedPoints === void 0 ? 0 : _options.fixedPoints;\r\n this._options.margin = _options.margin === void 0 ? 0 : _options.margin;\r\n this._options.damping = _options.damping === void 0 ? 0 : _options.damping;\r\n this._options.path = _options.path === void 0 ? null : _options.path;\r\n this._options.shape = _options.shape === void 0 ? null : _options.shape;\r\n }\r\n this._joints = [];\r\n //If the mesh has a parent, don't initialize the physicsBody. Instead wait for the parent to do that.\r\n if (!this.object.parent || this._options.ignoreParent) {\r\n this._init();\r\n } else if (this.object.parent.physicsImpostor) {\r\n Logger.Warn(\"You must affect impostors to children before affecting impostor to parent.\");\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * This function will completely initialize this impostor.\r\n * It will create a new body - but only if this mesh has no parent.\r\n * If it has, this impostor will not be used other than to define the impostor\r\n * of the child mesh.\r\n * @internal\r\n */\r\n public _init() {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._physicsEngine.removeImpostor(this);\r\n this.physicsBody = null;\r\n this._parent = this._parent || this._getPhysicsParent();\r\n if (!this._isDisposed && (!this.parent || this._options.ignoreParent)) {\r\n this._physicsEngine.addImpostor(this);\r\n }\r\n }\r\n\r\n private _getPhysicsParent(): Nullable<PhysicsImpostor> {\r\n if (this.object.parent instanceof AbstractMesh) {\r\n const parentMesh: AbstractMesh = <AbstractMesh>this.object.parent;\r\n return parentMesh.physicsImpostor;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Should a new body be generated.\r\n * @returns boolean specifying if body initialization is required\r\n */\r\n public isBodyInitRequired(): boolean {\r\n return this._bodyUpdateRequired || (!this._physicsBody && (!this._parent || !!this._options.ignoreParent));\r\n }\r\n\r\n /**\r\n * Sets the updated scaling\r\n */\r\n public setScalingUpdated() {\r\n this.forceUpdate();\r\n }\r\n\r\n /**\r\n * Force a regeneration of this or the parent's impostor's body.\r\n * Use with caution - This will remove all previously-instantiated joints.\r\n */\r\n public forceUpdate() {\r\n this._init();\r\n if (this.parent && !this._options.ignoreParent) {\r\n this.parent.forceUpdate();\r\n }\r\n }\r\n\r\n /*public get mesh(): AbstractMesh {\r\n return this._mesh;\r\n }*/\r\n\r\n /**\r\n * Gets the body that holds this impostor. Either its own, or its parent.\r\n */\r\n public get physicsBody(): any {\r\n return this._parent && !this._options.ignoreParent ? this._parent.physicsBody : this._physicsBody;\r\n }\r\n\r\n /**\r\n * Get the parent of the physics imposter\r\n * @returns Physics imposter or null\r\n */\r\n public get parent(): Nullable<PhysicsImpostor> {\r\n return !this._options.ignoreParent && this._parent ? this._parent : null;\r\n }\r\n\r\n /**\r\n * Sets the parent of the physics imposter\r\n */\r\n public set parent(value: Nullable<PhysicsImpostor>) {\r\n this._parent = value;\r\n }\r\n\r\n /**\r\n * Set the physics body. Used mainly by the physics engine/plugin\r\n */\r\n public set physicsBody(physicsBody: any) {\r\n if (this._physicsBody && this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this);\r\n }\r\n this._physicsBody = physicsBody;\r\n this.resetUpdateFlags();\r\n }\r\n\r\n /**\r\n * Resets the update flags\r\n */\r\n public resetUpdateFlags() {\r\n this._bodyUpdateRequired = false;\r\n }\r\n\r\n /**\r\n * Gets the object extents\r\n * @returns the object extents\r\n */\r\n public getObjectExtents(): Vector3 {\r\n if (this.object.getBoundingInfo) {\r\n const q = this.object.rotationQuaternion;\r\n const scaling = this.object.scaling.clone();\r\n //reset rotation\r\n this.object.rotationQuaternion = PhysicsImpostor.IDENTITY_QUATERNION;\r\n //calculate the world matrix with no rotation\r\n const worldMatrix = this.object.computeWorldMatrix && this.object.computeWorldMatrix(true);\r\n if (worldMatrix) {\r\n worldMatrix.decompose(scaling, undefined, undefined);\r\n }\r\n const boundingInfo = this.object.getBoundingInfo();\r\n // get the global scaling of the object\r\n const size = boundingInfo.boundingBox.extendSize.scale(2).multiplyInPlace(scaling);\r\n size.x = Math.abs(size.x);\r\n size.y = Math.abs(size.y);\r\n size.z = Math.abs(size.z);\r\n //bring back the rotation\r\n this.object.rotationQuaternion = q;\r\n //calculate the world matrix with the new rotation\r\n this.object.computeWorldMatrix && this.object.computeWorldMatrix(true);\r\n return size;\r\n } else {\r\n return PhysicsImpostor.DEFAULT_OBJECT_SIZE;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the object center\r\n * @returns The object center\r\n */\r\n public getObjectCenter(): Vector3 {\r\n if (this.object.getBoundingInfo) {\r\n const boundingInfo = this.object.getBoundingInfo();\r\n return boundingInfo.boundingBox.centerWorld;\r\n } else {\r\n return this.object.position;\r\n }\r\n }\r\n\r\n /**\r\n * Get a specific parameter from the options parameters\r\n * @param paramName The object parameter name\r\n * @returns The object parameter\r\n */\r\n public getParam(paramName: string): any {\r\n return (<any>this._options)[paramName];\r\n }\r\n\r\n /**\r\n * Sets a specific parameter in the options given to the physics plugin\r\n * @param paramName The parameter name\r\n * @param value The value of the parameter\r\n */\r\n public setParam(paramName: string, value: number) {\r\n (<any>this._options)[paramName] = value;\r\n this._bodyUpdateRequired = true;\r\n }\r\n\r\n /**\r\n * Specifically change the body's mass. Won't recreate the physics body object\r\n * @param mass The mass of the physics imposter\r\n */\r\n public setMass(mass: number) {\r\n if (this.getParam(\"mass\") !== mass) {\r\n this.setParam(\"mass\", mass);\r\n }\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setBodyMass(this, mass);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the linear velocity\r\n * @returns linear velocity or null\r\n */\r\n public getLinearVelocity(): Nullable<Vector3> {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this) : Vector3.Zero();\r\n }\r\n\r\n /**\r\n * Sets the linear velocity\r\n * @param velocity linear velocity or null\r\n */\r\n public setLinearVelocity(velocity: Nullable<Vector3>) {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this, velocity);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the angular velocity\r\n * @returns angular velocity or null\r\n */\r\n public getAngularVelocity(): Nullable<Vector3> {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this) : Vector3.Zero();\r\n }\r\n\r\n /**\r\n * Sets the angular velocity\r\n * @param velocity The velocity or null\r\n */\r\n public setAngularVelocity(velocity: Nullable<Vector3>) {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this, velocity);\r\n }\r\n }\r\n\r\n /**\r\n * Execute a function with the physics plugin native code\r\n * Provide a function the will have two variables - the world object and the physics body object\r\n * @param func The function to execute with the physics plugin native code\r\n */\r\n public executeNativeFunction(func: (world: any, physicsBody: any) => void) {\r\n if (this._physicsEngine) {\r\n func(this._physicsEngine.getPhysicsPlugin().world, this.physicsBody);\r\n }\r\n }\r\n\r\n /**\r\n * Register a function that will be executed before the physics world is stepping forward\r\n * @param func The function to execute before the physics world is stepped forward\r\n */\r\n public registerBeforePhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n this._onBeforePhysicsStepCallbacks.push(func);\r\n }\r\n\r\n /**\r\n * Unregister a function that will be executed before the physics world is stepping forward\r\n * @param func The function to execute before the physics world is stepped forward\r\n */\r\n public unregisterBeforePhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n const index = this._onBeforePhysicsStepCallbacks.indexOf(func);\r\n\r\n if (index > -1) {\r\n this._onBeforePhysicsStepCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n /**\r\n * Register a function that will be executed after the physics step\r\n * @param func The function to execute after physics step\r\n */\r\n public registerAfterPhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n this._onAfterPhysicsStepCallbacks.push(func);\r\n }\r\n\r\n /**\r\n * Unregisters a function that will be executed after the physics step\r\n * @param func The function to execute after physics step\r\n */\r\n public unregisterAfterPhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n const index = this._onAfterPhysicsStepCallbacks.indexOf(func);\r\n\r\n if (index > -1) {\r\n this._onAfterPhysicsStepCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n /**\r\n * register a function that will be executed when this impostor collides against a different body\r\n * @param collideAgainst Physics imposter, or array of physics imposters to collide against\r\n * @param func Callback that is executed on collision\r\n */\r\n public registerOnPhysicsCollide(\r\n collideAgainst: PhysicsImpostor | Array<PhysicsImpostor>,\r\n func: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor, point: Nullable<Vector3>) => void\r\n ): void {\r\n const collidedAgainstList: Array<PhysicsImpostor> = collideAgainst instanceof Array ? <Array<PhysicsImpostor>>collideAgainst : [<PhysicsImpostor>collideAgainst];\r\n this._onPhysicsCollideCallbacks.push({ callback: func, otherImpostors: collidedAgainstList });\r\n }\r\n\r\n /**\r\n * Unregisters the physics imposter's collision callback\r\n * @param collideAgainst The physics object to collide against\r\n * @param func Callback to execute on collision\r\n */\r\n public unregisterOnPhysicsCollide(\r\n collideAgainst: PhysicsImpostor | Array<PhysicsImpostor>,\r\n func: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor | Array<PhysicsImpostor>, point: Nullable<Vector3>) => void\r\n ): void {\r\n const collidedAgainstList: Array<PhysicsImpostor> = collideAgainst instanceof Array ? <Array<PhysicsImpostor>>collideAgainst : [<PhysicsImpostor>collideAgainst];\r\n let index = -1;\r\n const found = this._onPhysicsCollideCallbacks.some((cbDef, idx) => {\r\n if (cbDef.callback === func && cbDef.otherImpostors.length === collidedAgainstList.length) {\r\n // chcek the arrays match\r\n const sameList = cbDef.otherImpostors.every((impostor) => {\r\n return collidedAgainstList.indexOf(impostor) > -1;\r\n });\r\n if (sameList) {\r\n index = idx;\r\n }\r\n return sameList;\r\n }\r\n return false;\r\n });\r\n\r\n if (found) {\r\n this._onPhysicsCollideCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n //temp variables for parent rotation calculations\r\n //private _mats: Array<Matrix> = [new Matrix(), new Matrix()];\r\n private _tmpQuat: Quaternion = new Quaternion();\r\n private _tmpQuat2: Quaternion = new Quaternion();\r\n\r\n /**\r\n * Get the parent rotation\r\n * @returns The parent rotation\r\n */\r\n public getParentsRotation(): Quaternion {\r\n let parent = this.object.parent;\r\n this._tmpQuat.copyFromFloats(0, 0, 0, 1);\r\n while (parent) {\r\n if (parent.rotationQuaternion) {\r\n this._tmpQuat2.copyFrom(parent.rotationQuaternion);\r\n } else {\r\n Quaternion.RotationYawPitchRollToRef(parent.rotation.y, parent.rotation.x, parent.rotation.z, this._tmpQuat2);\r\n }\r\n this._tmpQuat.multiplyToRef(this._tmpQuat2, this._tmpQuat);\r\n parent = parent.parent;\r\n }\r\n return this._tmpQuat;\r\n }\r\n\r\n /**\r\n * this function is executed by the physics engine.\r\n */\r\n public beforeStep = () => {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this.object.translate(this._deltaPosition, -1);\r\n this._deltaRotationConjugated &&\r\n this.object.rotationQuaternion &&\r\n this.object.rotationQuaternion.multiplyToRef(this._deltaRotationConjugated, this.object.rotationQuaternion);\r\n this.object.computeWorldMatrix(false);\r\n if (this.object.parent && this.object.rotationQuaternion) {\r\n this.getParentsRotation();\r\n this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this._tmpQuat);\r\n } else {\r\n this._tmpQuat.copyFrom(this.object.rotationQuaternion || new Quaternion());\r\n }\r\n if (!this._options.disableBidirectionalTransformation) {\r\n this.object.rotationQuaternion &&\r\n this._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(this, /*bInfo.boundingBox.centerWorld*/ this.object.getAbsolutePosition(), this._tmpQuat);\r\n }\r\n\r\n this._onBeforePhysicsStepCallbacks.forEach((func) => {\r\n func(this);\r\n });\r\n };\r\n\r\n /**\r\n * this function is executed by the physics engine\r\n */\r\n public afterStep = () => {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._onAfterPhysicsStepCallbacks.forEach((func) => {\r\n func(this);\r\n });\r\n\r\n this._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(this);\r\n // object has now its world rotation. needs to be converted to local.\r\n if (this.object.parent && this.object.rotationQuaternion) {\r\n this.getParentsRotation();\r\n this._tmpQuat.conjugateInPlace();\r\n this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this.object.rotationQuaternion);\r\n }\r\n // take the position set and make it the absolute position of this object.\r\n this.object.setAbsolutePosition(this.object.position);\r\n if (this._deltaRotation) {\r\n this.object.rotationQuaternion && this.object.rotationQuaternion.multiplyToRef(this._deltaRotation, this.object.rotationQuaternion);\r\n this._deltaPosition.applyRotationQuaternionToRef(this._deltaRotation, PhysicsImpostor._TmpVecs[0]);\r\n this.object.translate(PhysicsImpostor._TmpVecs[0], 1);\r\n } else {\r\n this.object.translate(this._deltaPosition, 1);\r\n }\r\n this.object.computeWorldMatrix(true);\r\n };\r\n\r\n /**\r\n * Legacy collision detection event support\r\n */\r\n public onCollideEvent: Nullable<(collider: PhysicsImpostor, collidedWith: PhysicsImpostor) => void> = null;\r\n\r\n /**\r\n * define an onCollide function to call when this impostor collides against a different body\r\n * @param e collide event data\r\n */\r\n public onCollide = (e: { body: any; point: Nullable<Vector3>; distance: number; impulse: number; normal: Nullable<Vector3> }) => {\r\n if (!this._onPhysicsCollideCallbacks.length && !this.onCollideEvent) {\r\n return;\r\n }\r\n\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const otherImpostor = this._physicsEngine.getImpostorWithPhysicsBody(e.body);\r\n if (otherImpostor) {\r\n // Legacy collision detection event support\r\n if (this.onCollideEvent) {\r\n this.onCollideEvent(this, otherImpostor);\r\n }\r\n this._onPhysicsCollideCallbacks\r\n .filter((obj) => {\r\n return obj.otherImpostors.indexOf(<PhysicsImpostor>otherImpostor) !== -1;\r\n })\r\n .forEach((obj) => {\r\n obj.callback(this, <PhysicsImpostor>otherImpostor, e.point, e.distance, e.impulse, e.normal);\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Apply a force\r\n * @param force The force to apply\r\n * @param contactPoint The contact point for the force\r\n * @returns The physics imposter\r\n */\r\n public applyForce(force: Vector3, contactPoint: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().applyForce(this, force, contactPoint);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Apply an impulse\r\n * @param force The impulse force\r\n * @param contactPoint The contact point for the impulse force\r\n * @returns The physics imposter\r\n */\r\n public applyImpulse(force: Vector3, contactPoint: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().applyImpulse(this, force, contactPoint);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * A help function to create a joint\r\n * @param otherImpostor A physics imposter used to create a joint\r\n * @param jointType The type of joint\r\n * @param jointData The data for the joint\r\n * @returns The physics imposter\r\n */\r\n public createJoint(otherImpostor: PhysicsImpostor, jointType: number, jointData: PhysicsJointData): PhysicsImpostor {\r\n const joint = new PhysicsJoint(jointType, jointData);\r\n this.addJoint(otherImpostor, joint);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Add a joint to this impostor with a different impostor\r\n * @param otherImpostor A physics imposter used to add a joint\r\n * @param joint The joint to add\r\n * @returns The physics imposter\r\n */\r\n public addJoint(otherImpostor: PhysicsImpostor, joint: PhysicsJoint): PhysicsImpostor {\r\n this._joints.push({\r\n otherImpostor: otherImpostor,\r\n joint: joint,\r\n });\r\n\r\n if (this._physicsEngine) {\r\n this._physicsEngine.addJoint(this, otherImpostor, joint);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Add an anchor to a cloth impostor\r\n * @param otherImpostor rigid impostor to anchor to\r\n * @param width ratio across width from 0 to 1\r\n * @param height ratio up height from 0 to 1\r\n * @param influence the elasticity between cloth impostor and anchor from 0, very stretchy to 1, little stretch\r\n * @param noCollisionBetweenLinkedBodies when true collisions between cloth impostor and anchor are ignored; default false\r\n * @returns impostor the soft imposter\r\n */\r\n public addAnchor(otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor {\r\n if (!this._physicsEngine) {\r\n return this;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.appendAnchor) {\r\n return this;\r\n }\r\n if (this._physicsEngine) {\r\n plugin.appendAnchor!(this, otherImpostor, width, height, influence, noCollisionBetweenLinkedBodies);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Add a hook to a rope impostor\r\n * @param otherImpostor rigid impostor to anchor to\r\n * @param length ratio across rope from 0 to 1\r\n * @param influence the elasticity between rope impostor and anchor from 0, very stretchy to 1, little stretch\r\n * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false\r\n * @returns impostor the rope imposter\r\n */\r\n public addHook(otherImpostor: PhysicsImpostor, length: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor {\r\n if (!this._physicsEngine) {\r\n return this;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.appendAnchor) {\r\n return this;\r\n }\r\n if (this._physicsEngine) {\r\n plugin.appendHook!(this, otherImpostor, length, influence, noCollisionBetweenLinkedBodies);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Will keep this body still, in a sleep mode.\r\n * @returns the physics imposter\r\n */\r\n public sleep(): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().sleepBody(this);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Wake the body up.\r\n * @returns The physics imposter\r\n */\r\n public wakeUp(): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().wakeUpBody(this);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Clones the physics imposter\r\n * @param newObject The physics imposter clones to this physics-enabled object\r\n * @returns A nullable physics imposter\r\n */\r\n public clone(newObject: IPhysicsEnabledObject): Nullable<PhysicsImpostor> {\r\n if (!newObject) {\r\n return null;\r\n }\r\n return new PhysicsImpostor(newObject, this.type, this._options, this._scene);\r\n }\r\n\r\n /**\r\n * Disposes the physics imposter\r\n */\r\n public dispose(/*disposeChildren: boolean = true*/) {\r\n //no dispose if no physics engine is available.\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._joints.forEach((j) => {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.removeJoint(this, j.otherImpostor, j.joint);\r\n }\r\n });\r\n //dispose the physics body\r\n this._physicsEngine.removeImpostor(this);\r\n if (this.parent) {\r\n this.parent.forceUpdate();\r\n } else {\r\n /*this._object.getChildMeshes().forEach(function(mesh) {\r\n if (mesh.physicsImpostor) {\r\n if (disposeChildren) {\r\n mesh.physicsImpostor.dispose();\r\n mesh.physicsImpostor = null;\r\n }\r\n }\r\n })*/\r\n }\r\n\r\n this._isDisposed = true;\r\n }\r\n\r\n /**\r\n * Sets the delta position\r\n * @param position The delta position amount\r\n */\r\n public setDeltaPosition(position: Vector3) {\r\n this._deltaPosition.copyFrom(position);\r\n }\r\n\r\n /**\r\n * Sets the delta rotation\r\n * @param rotation The delta rotation amount\r\n */\r\n public setDeltaRotation(rotation: Quaternion) {\r\n if (!this._deltaRotation) {\r\n this._deltaRotation = new Quaternion();\r\n }\r\n this._deltaRotation.copyFrom(rotation);\r\n this._deltaRotationConjugated = this._deltaRotation.conjugate();\r\n }\r\n\r\n /**\r\n * Gets the box size of the physics imposter and stores the result in the input parameter\r\n * @param result Stores the box size\r\n * @returns The physics imposter\r\n */\r\n public getBoxSizeToRef(result: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this, result);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the radius of the physics imposter\r\n * @returns Radius of the physics imposter\r\n */\r\n public getRadius(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getRadius(this) : 0;\r\n }\r\n\r\n /**\r\n * Sync a bone with this impostor\r\n * @param bone The bone to sync to the impostor.\r\n * @param boneMesh The mesh that the bone is influencing.\r\n * @param jointPivot The pivot of the joint / bone in local space.\r\n * @param distToJoint Optional distance from the impostor to the joint.\r\n * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.\r\n */\r\n public syncBoneWithImpostor(bone: Bone, boneMesh: AbstractMesh, jointPivot: Vector3, distToJoint?: number, adjustRotation?: Quaternion) {\r\n const tempVec = PhysicsImpostor._TmpVecs[0];\r\n const mesh = <AbstractMesh>this.object;\r\n\r\n if (mesh.rotationQuaternion) {\r\n if (adjustRotation) {\r\n const tempQuat = PhysicsImpostor._TmpQuat;\r\n mesh.rotationQuaternion.multiplyToRef(adjustRotation, tempQuat);\r\n bone.setRotationQuaternion(tempQuat, Space.WORLD, boneMesh);\r\n } else {\r\n bone.setRotationQuaternion(mesh.rotationQuaternion, Space.WORLD, boneMesh);\r\n }\r\n }\r\n\r\n tempVec.x = 0;\r\n tempVec.y = 0;\r\n tempVec.z = 0;\r\n\r\n if (jointPivot) {\r\n tempVec.x = jointPivot.x;\r\n tempVec.y = jointPivot.y;\r\n tempVec.z = jointPivot.z;\r\n\r\n bone.getDirectionToRef(tempVec, boneMesh, tempVec);\r\n\r\n if (distToJoint === undefined || distToJoint === null) {\r\n distToJoint = jointPivot.length();\r\n }\r\n\r\n tempVec.x *= distToJoint;\r\n tempVec.y *= distToJoint;\r\n tempVec.z *= distToJoint;\r\n }\r\n\r\n if (bone.getParent()) {\r\n tempVec.addInPlace(mesh.getAbsolutePosition());\r\n bone.setAbsolutePosition(tempVec, boneMesh);\r\n } else {\r\n boneMesh.setAbsolutePosition(mesh.getAbsolutePosition());\r\n boneMesh.position.x -= tempVec.x;\r\n boneMesh.position.y -= tempVec.y;\r\n boneMesh.position.z -= tempVec.z;\r\n }\r\n }\r\n\r\n /**\r\n * Sync impostor to a bone\r\n * @param bone The bone that the impostor will be synced to.\r\n * @param boneMesh The mesh that the bone is influencing.\r\n * @param jointPivot The pivot of the joint / bone in local space.\r\n * @param distToJoint Optional distance from the impostor to the joint.\r\n * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.\r\n * @param boneAxis Optional vector3 axis the bone is aligned with\r\n */\r\n public syncImpostorWithBone(bone: Bone, boneMesh: AbstractMesh, jointPivot: Vector3, distToJoint?: number, adjustRotation?: Quaternion, boneAxis?: Vector3) {\r\n const mesh = <AbstractMesh>this.object;\r\n\r\n if (mesh.rotationQuaternion) {\r\n if (adjustRotation) {\r\n const tempQuat = PhysicsImpostor._TmpQuat;\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, tempQuat);\r\n tempQuat.multiplyToRef(adjustRotation, mesh.rotationQuaternion);\r\n } else {\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, mesh.rotationQuaternion);\r\n }\r\n }\r\n\r\n const pos = PhysicsImpostor._TmpVecs[0];\r\n const boneDir = PhysicsImpostor._TmpVecs[1];\r\n\r\n if (!boneAxis) {\r\n boneAxis = PhysicsImpostor._TmpVecs[2];\r\n boneAxis.x = 0;\r\n boneAxis.y = 1;\r\n boneAxis.z = 0;\r\n }\r\n\r\n bone.getDirectionToRef(boneAxis, boneMesh, boneDir);\r\n bone.getAbsolutePositionToRef(boneMesh, pos);\r\n\r\n if ((distToJoint === undefined || distToJoint === null) && jointPivot) {\r\n distToJoint = jointPivot.length();\r\n }\r\n\r\n if (distToJoint !== undefined && distToJoint !== null) {\r\n pos.x += boneDir.x * distToJoint;\r\n pos.y += boneDir.y * distToJoint;\r\n pos.z += boneDir.z * distToJoint;\r\n }\r\n\r\n mesh.setAbsolutePosition(pos);\r\n }\r\n\r\n //Impostor types\r\n /**\r\n * No-Imposter type\r\n */\r\n public static NoImpostor = 0;\r\n /**\r\n * Sphere-Imposter type\r\n */\r\n public static SphereImpostor = 1;\r\n /**\r\n * Box-Imposter type\r\n */\r\n public static BoxImpostor = 2;\r\n /**\r\n * Plane-Imposter type\r\n */\r\n public static PlaneImpostor = 3;\r\n /**\r\n * Mesh-imposter type (Only available to objects with vertices data)\r\n */\r\n public static MeshImpostor = 4;\r\n /**\r\n * Capsule-Impostor type (Ammo.js plugin only)\r\n */\r\n public static CapsuleImpostor = 6;\r\n /**\r\n * Cylinder-Imposter type\r\n */\r\n public static CylinderImpostor = 7;\r\n /**\r\n * Particle-Imposter type\r\n */\r\n public static ParticleImpostor = 8;\r\n /**\r\n * Heightmap-Imposter type\r\n */\r\n public static HeightmapImpostor = 9;\r\n /**\r\n * ConvexHull-Impostor type (Ammo.js plugin only)\r\n */\r\n public static ConvexHullImpostor = 10;\r\n /**\r\n * Custom-Imposter type (Ammo.js plugin only)\r\n */\r\n public static CustomImpostor = 100;\r\n /**\r\n * Rope-Imposter type\r\n */\r\n public static RopeImpostor = 101;\r\n /**\r\n * Cloth-Imposter type\r\n */\r\n public static ClothImpostor = 102;\r\n /**\r\n * Softbody-Imposter type\r\n */\r\n public static SoftbodyImpostor = 103;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"physicsImpostor.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v1/physicsImpostor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM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C,CAAC;IAClC,CAAC;;AAthCD;;GAEG;AACW,mCAAmB,GAAY,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,AAAhC,CAAiC;AAElE;;GAEG;AACW,mCAAmB,GAAG,UAAU,CAAC,QAAQ,EAAE,AAAxB,CAAyB;AA8B3C,wBAAQ,GAAc,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,AAApD,CAAqD;AAC7D,wBAAQ,GAAe,UAAU,CAAC,QAAQ,EAAE,AAApC,CAAqC;AAi/B5D,gBAAgB;AAChB;;GAEG;AACW,0BAAU,GAAG,CAAC,AAAJ,CAAK;AAC7B;;GAEG;AACW,8BAAc,GAAG,CAAC,AAAJ,CAAK;AACjC;;GAEG;AACW,2BAAW,GAAG,CAAC,AAAJ,CAAK;AAC9B;;GAEG;AACW,6BAAa,GAAG,CAAC,AAAJ,CAAK;AAChC;;GAEG;AACW,4BAAY,GAAG,CAAC,AAAJ,CAAK;AAC/B;;GAEG;AACW,+BAAe,GAAG,CAAC,AAAJ,CAAK;AAClC;;GAEG;AACW,gCAAgB,GAAG,CAAC,AAAJ,CAAK;AACnC;;GAEG;AACW,gCAAgB,GAAG,CAAC,AAAJ,CAAK;AACnC;;GAEG;AACW,iCAAiB,GAAG,CAAC,AAAJ,CAAK;AACpC;;GAEG;AACW,kCAAkB,GAAG,EAAE,AAAL,CAAM;AACtC;;GAEG;AACW,8BAAc,GAAG,GAAG,AAAN,CAAO;AACnC;;GAEG;AACW,4BAAY,GAAG,GAAG,AAAN,CAAO;AACjC;;GAEG;AACW,6BAAa,GAAG,GAAG,AAAN,CAAO;AAClC;;GAEG;AACW,gCAAgB,GAAG,GAAG,AAAN,CAAO","sourcesContent":["import type { Nullable, IndicesArray } from \"../../types\";\r\nimport { Logger } from \"../../Misc/logger\";\r\nimport { ArrayTools } from \"../../Misc/arrayTools\";\r\nimport type { Matrix } from \"../../Maths/math.vector\";\r\nimport { Vector3, Quaternion } from \"../../Maths/math.vector\";\r\nimport type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\nimport { Mesh } from \"../../Meshes/mesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { Bone } from \"../../Bones/bone\";\r\nimport type { BoundingInfo } from \"../../Culling/boundingInfo\";\r\nimport type { PhysicsEngine as PhysicsEngineV1 } from \"./physicsEngine\";\r\n\r\nimport type { PhysicsJointData } from \"./physicsJoint\";\r\nimport { PhysicsJoint } from \"./physicsJoint\";\r\nimport { Space } from \"../../Maths/math.axis\";\r\n\r\n/**\r\n * The interface for the physics imposter parameters\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface PhysicsImpostorParameters {\r\n /**\r\n * The mass of the physics imposter\r\n */\r\n mass: number;\r\n /**\r\n * The friction of the physics imposter\r\n */\r\n friction?: number;\r\n /**\r\n * The coefficient of restitution of the physics imposter\r\n */\r\n restitution?: number;\r\n /**\r\n * The native options of the physics imposter\r\n */\r\n nativeOptions?: any;\r\n /**\r\n * Specifies if the parent should be ignored\r\n */\r\n ignoreParent?: boolean;\r\n /**\r\n * Specifies if bi-directional transformations should be disabled\r\n */\r\n disableBidirectionalTransformation?: boolean;\r\n /**\r\n * The pressure inside the physics imposter, soft object only\r\n */\r\n pressure?: number;\r\n /**\r\n * The stiffness the physics imposter, soft object only\r\n */\r\n stiffness?: number;\r\n /**\r\n * The number of iterations used in maintaining consistent vertex velocities, soft object only\r\n */\r\n velocityIterations?: number;\r\n /**\r\n * The number of iterations used in maintaining consistent vertex positions, soft object only\r\n */\r\n positionIterations?: number;\r\n /**\r\n * The number used to fix points on a cloth (0, 1, 2, 4, 8) or rope (0, 1, 2) only\r\n * 0 None, 1, back left or top, 2, back right or bottom, 4, front left, 8, front right\r\n * Add to fix multiple points\r\n */\r\n fixedPoints?: number;\r\n /**\r\n * The collision margin around a soft object\r\n */\r\n margin?: number;\r\n /**\r\n * The collision margin around a soft object\r\n */\r\n damping?: number;\r\n /**\r\n * The path for a rope based on an extrusion\r\n */\r\n path?: any;\r\n /**\r\n * The shape of an extrusion used for a rope based on an extrusion\r\n */\r\n shape?: any;\r\n}\r\n\r\n/**\r\n * Interface for a physics-enabled object\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport interface IPhysicsEnabledObject {\r\n /**\r\n * The position of the physics-enabled object\r\n */\r\n position: Vector3;\r\n /**\r\n * The rotation of the physics-enabled object\r\n */\r\n rotationQuaternion: Nullable<Quaternion>;\r\n /**\r\n * The scale of the physics-enabled object\r\n */\r\n scaling: Vector3;\r\n /**\r\n * The rotation of the physics-enabled object\r\n */\r\n rotation?: Vector3;\r\n /**\r\n * The parent of the physics-enabled object\r\n */\r\n parent?: any;\r\n /**\r\n * The bounding info of the physics-enabled object\r\n * @returns The bounding info of the physics-enabled object\r\n */\r\n getBoundingInfo(): BoundingInfo;\r\n /**\r\n * Computes the world matrix\r\n * @param force Specifies if the world matrix should be computed by force\r\n * @returns A world matrix\r\n */\r\n computeWorldMatrix(force: boolean): Matrix;\r\n /**\r\n * Gets the world matrix\r\n * @returns A world matrix\r\n */\r\n getWorldMatrix?(): Matrix;\r\n /**\r\n * Gets the child meshes\r\n * @param directDescendantsOnly Specifies if only direct-descendants should be obtained\r\n * @returns An array of abstract meshes\r\n */\r\n getChildMeshes?(directDescendantsOnly?: boolean): Array<AbstractMesh>;\r\n /**\r\n * Gets the vertex data\r\n * @param kind The type of vertex data\r\n * @returns A nullable array of numbers, or a float32 array\r\n */\r\n getVerticesData(kind: string): Nullable<Array<number> | Float32Array>;\r\n /**\r\n * Gets the indices from the mesh\r\n * @returns A nullable array of index arrays\r\n */\r\n getIndices?(): Nullable<IndicesArray>;\r\n /**\r\n * Gets the scene from the mesh\r\n * @returns the indices array or null\r\n */\r\n getScene?(): Scene;\r\n /**\r\n * Gets the absolute position from the mesh\r\n * @returns the absolute position\r\n */\r\n getAbsolutePosition(): Vector3;\r\n /**\r\n * Gets the absolute pivot point from the mesh\r\n * @returns the absolute pivot point\r\n */\r\n getAbsolutePivotPoint(): Vector3;\r\n /**\r\n * Rotates the mesh\r\n * @param axis The axis of rotation\r\n * @param amount The amount of rotation\r\n * @param space The space of the rotation\r\n * @returns The rotation transform node\r\n */\r\n rotate(axis: Vector3, amount: number, space?: Space): TransformNode;\r\n /**\r\n * Translates the mesh\r\n * @param axis The axis of translation\r\n * @param distance The distance of translation\r\n * @param space The space of the translation\r\n * @returns The transform node\r\n */\r\n translate(axis: Vector3, distance: number, space?: Space): TransformNode;\r\n /**\r\n * Sets the absolute position of the mesh\r\n * @param absolutePosition The absolute position of the mesh\r\n * @returns The transform node\r\n */\r\n setAbsolutePosition(absolutePosition: Vector3): TransformNode;\r\n /**\r\n * Gets the class name of the mesh\r\n * @returns The class name\r\n */\r\n getClassName(): string;\r\n}\r\n\r\nMesh._PhysicsImpostorParser = function (scene: Scene, physicObject: IPhysicsEnabledObject, jsonObject: any): PhysicsImpostor {\r\n return new PhysicsImpostor(\r\n physicObject,\r\n jsonObject.physicsImpostor,\r\n {\r\n mass: jsonObject.physicsMass,\r\n friction: jsonObject.physicsFriction,\r\n restitution: jsonObject.physicsRestitution,\r\n },\r\n scene\r\n );\r\n};\r\n\r\n/**\r\n * Represents a physics imposter\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine\r\n */\r\nexport class PhysicsImpostor {\r\n /**\r\n * The default object size of the imposter\r\n */\r\n public static DEFAULT_OBJECT_SIZE: Vector3 = new Vector3(1, 1, 1);\r\n\r\n /**\r\n * The identity quaternion of the imposter\r\n */\r\n public static IDENTITY_QUATERNION = Quaternion.Identity();\r\n\r\n /** @internal */\r\n public _pluginData: any = {};\r\n\r\n private _physicsEngine: Nullable<PhysicsEngineV1>;\r\n //The native cannon/oimo/energy physics body object.\r\n private _physicsBody: any;\r\n private _bodyUpdateRequired: boolean = false;\r\n\r\n private _onBeforePhysicsStepCallbacks = new Array<(impostor: PhysicsImpostor) => void>();\r\n private _onAfterPhysicsStepCallbacks = new Array<(impostor: PhysicsImpostor) => void>();\r\n /** @internal */\r\n public _onPhysicsCollideCallbacks: Array<{\r\n callback: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor, point: Nullable<Vector3>, distance: number, impulse: number, normal: Nullable<Vector3>) => void;\r\n otherImpostors: Array<PhysicsImpostor>;\r\n }> = [];\r\n\r\n private _deltaPosition: Vector3 = Vector3.Zero();\r\n private _deltaRotation: Quaternion;\r\n private _deltaRotationConjugated: Quaternion;\r\n\r\n /** @internal */\r\n public _isFromLine: boolean;\r\n\r\n //If set, this is this impostor's parent\r\n private _parent: Nullable<PhysicsImpostor>;\r\n\r\n private _isDisposed = false;\r\n\r\n private static _TmpVecs: Vector3[] = ArrayTools.BuildArray(3, Vector3.Zero);\r\n private static _TmpQuat: Quaternion = Quaternion.Identity();\r\n\r\n /**\r\n * Specifies if the physics imposter is disposed\r\n */\r\n get isDisposed(): boolean {\r\n return this._isDisposed;\r\n }\r\n\r\n /**\r\n * Gets the mass of the physics imposter\r\n */\r\n get mass(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyMass(this) : 0;\r\n }\r\n\r\n set mass(value: number) {\r\n this.setMass(value);\r\n }\r\n\r\n /**\r\n * Gets the coefficient of friction\r\n */\r\n get friction(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyFriction(this) : 0;\r\n }\r\n\r\n /**\r\n * Sets the coefficient of friction\r\n */\r\n set friction(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n this._physicsEngine.getPhysicsPlugin().setBodyFriction(this, value);\r\n }\r\n\r\n /**\r\n * Gets the coefficient of restitution\r\n */\r\n get restitution(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this) : 0;\r\n }\r\n\r\n /**\r\n * Sets the coefficient of restitution\r\n */\r\n set restitution(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this, value);\r\n }\r\n\r\n /**\r\n * Gets the pressure of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get pressure(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPressure) {\r\n return 0;\r\n }\r\n return plugin.getBodyPressure!(this);\r\n }\r\n\r\n /**\r\n * Sets the pressure of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set pressure(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPressure) {\r\n return;\r\n }\r\n plugin.setBodyPressure!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the stiffness of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get stiffness(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyStiffness) {\r\n return 0;\r\n }\r\n return plugin.getBodyStiffness!(this);\r\n }\r\n\r\n /**\r\n * Sets the stiffness of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set stiffness(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyStiffness) {\r\n return;\r\n }\r\n plugin.setBodyStiffness!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the velocityIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get velocityIterations(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyVelocityIterations) {\r\n return 0;\r\n }\r\n return plugin.getBodyVelocityIterations!(this);\r\n }\r\n\r\n /**\r\n * Sets the velocityIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set velocityIterations(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyVelocityIterations) {\r\n return;\r\n }\r\n plugin.setBodyVelocityIterations!(this, value);\r\n }\r\n\r\n /**\r\n * Gets the positionIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n get positionIterations(): number {\r\n if (!this._physicsEngine) {\r\n return 0;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.getBodyPositionIterations) {\r\n return 0;\r\n }\r\n return plugin.getBodyPositionIterations!(this);\r\n }\r\n\r\n /**\r\n * Sets the positionIterations of a soft body; only supported by the AmmoJSPlugin\r\n */\r\n set positionIterations(value: number) {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.setBodyPositionIterations) {\r\n return;\r\n }\r\n plugin.setBodyPositionIterations!(this, value);\r\n }\r\n\r\n /**\r\n * The unique id of the physics imposter\r\n * set by the physics engine when adding this impostor to the array\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * @internal\r\n */\r\n public soft: boolean = false;\r\n\r\n /**\r\n * @internal\r\n */\r\n public segments: number = 0;\r\n\r\n private _joints: Array<{\r\n joint: PhysicsJoint;\r\n otherImpostor: PhysicsImpostor;\r\n }>;\r\n\r\n /**\r\n * Initializes the physics imposter\r\n * @param object The physics-enabled object used as the physics imposter\r\n * @param type The type of the physics imposter. Types are available as static members of this class.\r\n * @param _options The options for the physics imposter\r\n * @param _scene The Babylon scene\r\n */\r\n constructor(\r\n /**\r\n * The physics-enabled object used as the physics imposter\r\n */\r\n public object: IPhysicsEnabledObject,\r\n /**\r\n * The type of the physics imposter\r\n */\r\n public type: number,\r\n private _options: PhysicsImpostorParameters = { mass: 0 },\r\n private _scene?: Scene\r\n ) {\r\n //sanity check!\r\n if (!this.object) {\r\n Logger.Error(\"No object was provided. A physics object is obligatory\");\r\n return;\r\n }\r\n if (this.object.parent && _options.mass !== 0) {\r\n Logger.Warn(\"A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur.\");\r\n }\r\n\r\n // Legacy support for old syntax.\r\n if (!this._scene && object.getScene) {\r\n this._scene = object.getScene();\r\n }\r\n\r\n if (!this._scene) {\r\n return;\r\n }\r\n\r\n if (this.type > 100) {\r\n this.soft = true;\r\n }\r\n\r\n this._physicsEngine = this._scene.getPhysicsEngine() as any;\r\n if (!this._physicsEngine) {\r\n Logger.Error(\"Physics not enabled. Please use scene.enablePhysics(...) before creating impostors.\");\r\n } else {\r\n //set the object's quaternion, if not set\r\n if (!this.object.rotationQuaternion) {\r\n if (this.object.rotation) {\r\n this.object.rotationQuaternion = Quaternion.RotationYawPitchRoll(this.object.rotation.y, this.object.rotation.x, this.object.rotation.z);\r\n } else {\r\n this.object.rotationQuaternion = new Quaternion();\r\n }\r\n }\r\n //default options params\r\n this._options.mass = _options.mass === void 0 ? 0 : _options.mass;\r\n this._options.friction = _options.friction === void 0 ? 0.2 : _options.friction;\r\n this._options.restitution = _options.restitution === void 0 ? 0.2 : _options.restitution;\r\n if (this.soft) {\r\n //softbody mass must be above 0;\r\n this._options.mass = this._options.mass > 0 ? this._options.mass : 1;\r\n this._options.pressure = _options.pressure === void 0 ? 200 : _options.pressure;\r\n this._options.stiffness = _options.stiffness === void 0 ? 1 : _options.stiffness;\r\n this._options.velocityIterations = _options.velocityIterations === void 0 ? 20 : _options.velocityIterations;\r\n this._options.positionIterations = _options.positionIterations === void 0 ? 20 : _options.positionIterations;\r\n this._options.fixedPoints = _options.fixedPoints === void 0 ? 0 : _options.fixedPoints;\r\n this._options.margin = _options.margin === void 0 ? 0 : _options.margin;\r\n this._options.damping = _options.damping === void 0 ? 0 : _options.damping;\r\n this._options.path = _options.path === void 0 ? null : _options.path;\r\n this._options.shape = _options.shape === void 0 ? null : _options.shape;\r\n }\r\n this._joints = [];\r\n //If the mesh has a parent, don't initialize the physicsBody. Instead wait for the parent to do that.\r\n if (!this.object.parent || this._options.ignoreParent) {\r\n this._init();\r\n } else if (this.object.parent.physicsImpostor) {\r\n Logger.Warn(\"You must affect impostors to children before affecting impostor to parent.\");\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * This function will completely initialize this impostor.\r\n * It will create a new body - but only if this mesh has no parent.\r\n * If it has, this impostor will not be used other than to define the impostor\r\n * of the child mesh.\r\n * @internal\r\n */\r\n public _init() {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._physicsEngine.removeImpostor(this);\r\n this.physicsBody = null;\r\n this._parent = this._parent || this._getPhysicsParent();\r\n if (!this._isDisposed && (!this.parent || this._options.ignoreParent)) {\r\n this._physicsEngine.addImpostor(this);\r\n }\r\n }\r\n\r\n private _getPhysicsParent(): Nullable<PhysicsImpostor> {\r\n if (this.object.parent instanceof AbstractMesh) {\r\n const parentMesh: AbstractMesh = <AbstractMesh>this.object.parent;\r\n return parentMesh.physicsImpostor;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Should a new body be generated.\r\n * @returns boolean specifying if body initialization is required\r\n */\r\n public isBodyInitRequired(): boolean {\r\n return this._bodyUpdateRequired || (!this._physicsBody && (!this._parent || !!this._options.ignoreParent));\r\n }\r\n\r\n /**\r\n * Sets the updated scaling\r\n */\r\n public setScalingUpdated() {\r\n this.forceUpdate();\r\n }\r\n\r\n /**\r\n * Force a regeneration of this or the parent's impostor's body.\r\n * Use with caution - This will remove all previously-instantiated joints.\r\n */\r\n public forceUpdate() {\r\n this._init();\r\n if (this.parent && !this._options.ignoreParent) {\r\n this.parent.forceUpdate();\r\n }\r\n }\r\n\r\n /*public get mesh(): AbstractMesh {\r\n return this._mesh;\r\n }*/\r\n\r\n /**\r\n * Gets the body that holds this impostor. Either its own, or its parent.\r\n */\r\n public get physicsBody(): any {\r\n return this._parent && !this._options.ignoreParent ? this._parent.physicsBody : this._physicsBody;\r\n }\r\n\r\n /**\r\n * Get the parent of the physics imposter\r\n * @returns Physics imposter or null\r\n */\r\n public get parent(): Nullable<PhysicsImpostor> {\r\n return !this._options.ignoreParent && this._parent ? this._parent : null;\r\n }\r\n\r\n /**\r\n * Sets the parent of the physics imposter\r\n */\r\n public set parent(value: Nullable<PhysicsImpostor>) {\r\n this._parent = value;\r\n }\r\n\r\n /**\r\n * Set the physics body. Used mainly by the physics engine/plugin\r\n */\r\n public set physicsBody(physicsBody: any) {\r\n if (this._physicsBody && this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this);\r\n }\r\n this._physicsBody = physicsBody;\r\n this.resetUpdateFlags();\r\n }\r\n\r\n /**\r\n * Resets the update flags\r\n */\r\n public resetUpdateFlags() {\r\n this._bodyUpdateRequired = false;\r\n }\r\n\r\n /**\r\n * Gets the object extents\r\n * @returns the object extents\r\n */\r\n public getObjectExtents(): Vector3 {\r\n if (this.object.getBoundingInfo) {\r\n const q = this.object.rotationQuaternion;\r\n const scaling = this.object.scaling.clone();\r\n //reset rotation\r\n this.object.rotationQuaternion = PhysicsImpostor.IDENTITY_QUATERNION;\r\n //calculate the world matrix with no rotation\r\n const worldMatrix = this.object.computeWorldMatrix && this.object.computeWorldMatrix(true);\r\n if (worldMatrix) {\r\n worldMatrix.decompose(scaling, undefined, undefined);\r\n }\r\n const boundingInfo = this.object.getBoundingInfo();\r\n // get the global scaling of the object\r\n const size = boundingInfo.boundingBox.extendSize.scale(2).multiplyInPlace(scaling);\r\n size.x = Math.abs(size.x);\r\n size.y = Math.abs(size.y);\r\n size.z = Math.abs(size.z);\r\n //bring back the rotation\r\n this.object.rotationQuaternion = q;\r\n //calculate the world matrix with the new rotation\r\n this.object.computeWorldMatrix && this.object.computeWorldMatrix(true);\r\n return size;\r\n } else {\r\n return PhysicsImpostor.DEFAULT_OBJECT_SIZE;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the object center\r\n * @returns The object center\r\n */\r\n public getObjectCenter(): Vector3 {\r\n if (this.object.getBoundingInfo) {\r\n const boundingInfo = this.object.getBoundingInfo();\r\n return boundingInfo.boundingBox.centerWorld;\r\n } else {\r\n return this.object.position;\r\n }\r\n }\r\n\r\n /**\r\n * Get a specific parameter from the options parameters\r\n * @param paramName The object parameter name\r\n * @returns The object parameter\r\n */\r\n public getParam(paramName: string): any {\r\n return (<any>this._options)[paramName];\r\n }\r\n\r\n /**\r\n * Sets a specific parameter in the options given to the physics plugin\r\n * @param paramName The parameter name\r\n * @param value The value of the parameter\r\n */\r\n public setParam(paramName: string, value: number) {\r\n (<any>this._options)[paramName] = value;\r\n this._bodyUpdateRequired = true;\r\n }\r\n\r\n /**\r\n * Specifically change the body's mass. Won't recreate the physics body object\r\n * @param mass The mass of the physics imposter\r\n */\r\n public setMass(mass: number) {\r\n if (this.getParam(\"mass\") !== mass) {\r\n this.setParam(\"mass\", mass);\r\n }\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setBodyMass(this, mass);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the linear velocity\r\n * @returns linear velocity or null\r\n */\r\n public getLinearVelocity(): Nullable<Vector3> {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this) : Vector3.Zero();\r\n }\r\n\r\n /**\r\n * Sets the linear velocity\r\n * @param velocity linear velocity or null\r\n */\r\n public setLinearVelocity(velocity: Nullable<Vector3>) {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this, velocity);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the angular velocity\r\n * @returns angular velocity or null\r\n */\r\n public getAngularVelocity(): Nullable<Vector3> {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this) : Vector3.Zero();\r\n }\r\n\r\n /**\r\n * Sets the angular velocity\r\n * @param velocity The velocity or null\r\n */\r\n public setAngularVelocity(velocity: Nullable<Vector3>) {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this, velocity);\r\n }\r\n }\r\n\r\n /**\r\n * Execute a function with the physics plugin native code\r\n * Provide a function the will have two variables - the world object and the physics body object\r\n * @param func The function to execute with the physics plugin native code\r\n */\r\n public executeNativeFunction(func: (world: any, physicsBody: any) => void) {\r\n if (this._physicsEngine) {\r\n func(this._physicsEngine.getPhysicsPlugin().world, this.physicsBody);\r\n }\r\n }\r\n\r\n /**\r\n * Register a function that will be executed before the physics world is stepping forward\r\n * @param func The function to execute before the physics world is stepped forward\r\n */\r\n public registerBeforePhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n this._onBeforePhysicsStepCallbacks.push(func);\r\n }\r\n\r\n /**\r\n * Unregister a function that will be executed before the physics world is stepping forward\r\n * @param func The function to execute before the physics world is stepped forward\r\n */\r\n public unregisterBeforePhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n const index = this._onBeforePhysicsStepCallbacks.indexOf(func);\r\n\r\n if (index > -1) {\r\n this._onBeforePhysicsStepCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n /**\r\n * Register a function that will be executed after the physics step\r\n * @param func The function to execute after physics step\r\n */\r\n public registerAfterPhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n this._onAfterPhysicsStepCallbacks.push(func);\r\n }\r\n\r\n /**\r\n * Unregisters a function that will be executed after the physics step\r\n * @param func The function to execute after physics step\r\n */\r\n public unregisterAfterPhysicsStep(func: (impostor: PhysicsImpostor) => void): void {\r\n const index = this._onAfterPhysicsStepCallbacks.indexOf(func);\r\n\r\n if (index > -1) {\r\n this._onAfterPhysicsStepCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n /**\r\n * register a function that will be executed when this impostor collides against a different body\r\n * @param collideAgainst Physics imposter, or array of physics imposters to collide against\r\n * @param func Callback that is executed on collision\r\n */\r\n public registerOnPhysicsCollide(\r\n collideAgainst: PhysicsImpostor | Array<PhysicsImpostor>,\r\n func: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor, point: Nullable<Vector3>) => void\r\n ): void {\r\n const collidedAgainstList: Array<PhysicsImpostor> = collideAgainst instanceof Array ? <Array<PhysicsImpostor>>collideAgainst : [<PhysicsImpostor>collideAgainst];\r\n this._onPhysicsCollideCallbacks.push({ callback: func, otherImpostors: collidedAgainstList });\r\n }\r\n\r\n /**\r\n * Unregisters the physics imposter's collision callback\r\n * @param collideAgainst The physics object to collide against\r\n * @param func Callback to execute on collision\r\n */\r\n public unregisterOnPhysicsCollide(\r\n collideAgainst: PhysicsImpostor | Array<PhysicsImpostor>,\r\n func: (collider: PhysicsImpostor, collidedAgainst: PhysicsImpostor | Array<PhysicsImpostor>, point: Nullable<Vector3>) => void\r\n ): void {\r\n const collidedAgainstList: Array<PhysicsImpostor> = collideAgainst instanceof Array ? <Array<PhysicsImpostor>>collideAgainst : [<PhysicsImpostor>collideAgainst];\r\n let index = -1;\r\n const found = this._onPhysicsCollideCallbacks.some((cbDef, idx) => {\r\n if (cbDef.callback === func && cbDef.otherImpostors.length === collidedAgainstList.length) {\r\n // chcek the arrays match\r\n const sameList = cbDef.otherImpostors.every((impostor) => {\r\n return collidedAgainstList.indexOf(impostor) > -1;\r\n });\r\n if (sameList) {\r\n index = idx;\r\n }\r\n return sameList;\r\n }\r\n return false;\r\n });\r\n\r\n if (found) {\r\n this._onPhysicsCollideCallbacks.splice(index, 1);\r\n } else {\r\n Logger.Warn(\"Function to remove was not found\");\r\n }\r\n }\r\n\r\n //temp variables for parent rotation calculations\r\n //private _mats: Array<Matrix> = [new Matrix(), new Matrix()];\r\n private _tmpQuat: Quaternion = new Quaternion();\r\n private _tmpQuat2: Quaternion = new Quaternion();\r\n\r\n /**\r\n * Get the parent rotation\r\n * @returns The parent rotation\r\n */\r\n public getParentsRotation(): Quaternion {\r\n let parent = this.object.parent;\r\n this._tmpQuat.copyFromFloats(0, 0, 0, 1);\r\n while (parent) {\r\n if (parent.rotationQuaternion) {\r\n this._tmpQuat2.copyFrom(parent.rotationQuaternion);\r\n } else {\r\n Quaternion.RotationYawPitchRollToRef(parent.rotation.y, parent.rotation.x, parent.rotation.z, this._tmpQuat2);\r\n }\r\n this._tmpQuat.multiplyToRef(this._tmpQuat2, this._tmpQuat);\r\n parent = parent.parent;\r\n }\r\n return this._tmpQuat;\r\n }\r\n\r\n /**\r\n * this function is executed by the physics engine.\r\n */\r\n public beforeStep = () => {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this.object.translate(this._deltaPosition, -1);\r\n this._deltaRotationConjugated &&\r\n this.object.rotationQuaternion &&\r\n this.object.rotationQuaternion.multiplyToRef(this._deltaRotationConjugated, this.object.rotationQuaternion);\r\n this.object.computeWorldMatrix(false);\r\n if (this.object.parent && this.object.rotationQuaternion) {\r\n this.getParentsRotation();\r\n this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this._tmpQuat);\r\n } else {\r\n this._tmpQuat.copyFrom(this.object.rotationQuaternion || new Quaternion());\r\n }\r\n if (!this._options.disableBidirectionalTransformation) {\r\n this.object.rotationQuaternion &&\r\n this._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(this, /*bInfo.boundingBox.centerWorld*/ this.object.getAbsolutePosition(), this._tmpQuat);\r\n }\r\n\r\n this._onBeforePhysicsStepCallbacks.forEach((func) => {\r\n func(this);\r\n });\r\n };\r\n\r\n /**\r\n * this function is executed by the physics engine\r\n */\r\n public afterStep = () => {\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._onAfterPhysicsStepCallbacks.forEach((func) => {\r\n func(this);\r\n });\r\n\r\n this._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(this);\r\n // object has now its world rotation. needs to be converted to local.\r\n if (this.object.parent && this.object.rotationQuaternion) {\r\n this.getParentsRotation();\r\n this._tmpQuat.conjugateInPlace();\r\n this._tmpQuat.multiplyToRef(this.object.rotationQuaternion, this.object.rotationQuaternion);\r\n }\r\n // take the position set and make it the absolute position of this object.\r\n this.object.setAbsolutePosition(this.object.position);\r\n if (this._deltaRotation) {\r\n this.object.rotationQuaternion && this.object.rotationQuaternion.multiplyToRef(this._deltaRotation, this.object.rotationQuaternion);\r\n this._deltaPosition.applyRotationQuaternionToRef(this._deltaRotation, PhysicsImpostor._TmpVecs[0]);\r\n this.object.translate(PhysicsImpostor._TmpVecs[0], 1);\r\n } else {\r\n this.object.translate(this._deltaPosition, 1);\r\n }\r\n this.object.computeWorldMatrix(true);\r\n };\r\n\r\n /**\r\n * Legacy collision detection event support\r\n */\r\n public onCollideEvent: Nullable<(collider: PhysicsImpostor, collidedWith: PhysicsImpostor) => void> = null;\r\n\r\n /**\r\n * define an onCollide function to call when this impostor collides against a different body\r\n * @param e collide event data\r\n */\r\n public onCollide = (e: { body: any; point: Nullable<Vector3>; distance: number; impulse: number; normal: Nullable<Vector3> }) => {\r\n if (!this._onPhysicsCollideCallbacks.length && !this.onCollideEvent) {\r\n return;\r\n }\r\n\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n const otherImpostor = this._physicsEngine.getImpostorWithPhysicsBody(e.body);\r\n if (otherImpostor) {\r\n // Legacy collision detection event support\r\n if (this.onCollideEvent) {\r\n this.onCollideEvent(this, otherImpostor);\r\n }\r\n this._onPhysicsCollideCallbacks\r\n .filter((obj) => {\r\n return obj.otherImpostors.indexOf(<PhysicsImpostor>otherImpostor) !== -1;\r\n })\r\n .forEach((obj) => {\r\n obj.callback(this, <PhysicsImpostor>otherImpostor, e.point, e.distance, e.impulse, e.normal);\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Apply a force\r\n * @param force The force to apply\r\n * @param contactPoint The contact point for the force\r\n * @returns The physics imposter\r\n */\r\n public applyForce(force: Vector3, contactPoint: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().applyForce(this, force, contactPoint);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Apply an impulse\r\n * @param force The impulse force\r\n * @param contactPoint The contact point for the impulse force\r\n * @returns The physics imposter\r\n */\r\n public applyImpulse(force: Vector3, contactPoint: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().applyImpulse(this, force, contactPoint);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * A help function to create a joint\r\n * @param otherImpostor A physics imposter used to create a joint\r\n * @param jointType The type of joint\r\n * @param jointData The data for the joint\r\n * @returns The physics imposter\r\n */\r\n public createJoint(otherImpostor: PhysicsImpostor, jointType: number, jointData: PhysicsJointData): PhysicsImpostor {\r\n const joint = new PhysicsJoint(jointType, jointData);\r\n this.addJoint(otherImpostor, joint);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Add a joint to this impostor with a different impostor\r\n * @param otherImpostor A physics imposter used to add a joint\r\n * @param joint The joint to add\r\n * @returns The physics imposter\r\n */\r\n public addJoint(otherImpostor: PhysicsImpostor, joint: PhysicsJoint): PhysicsImpostor {\r\n this._joints.push({\r\n otherImpostor: otherImpostor,\r\n joint: joint,\r\n });\r\n\r\n if (this._physicsEngine) {\r\n this._physicsEngine.addJoint(this, otherImpostor, joint);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Add an anchor to a cloth impostor\r\n * @param otherImpostor rigid impostor to anchor to\r\n * @param width ratio across width from 0 to 1\r\n * @param height ratio up height from 0 to 1\r\n * @param influence the elasticity between cloth impostor and anchor from 0, very stretchy to 1, little stretch\r\n * @param noCollisionBetweenLinkedBodies when true collisions between cloth impostor and anchor are ignored; default false\r\n * @returns impostor the soft imposter\r\n */\r\n public addAnchor(otherImpostor: PhysicsImpostor, width: number, height: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor {\r\n if (!this._physicsEngine) {\r\n return this;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.appendAnchor) {\r\n return this;\r\n }\r\n if (this._physicsEngine) {\r\n plugin.appendAnchor!(this, otherImpostor, width, height, influence, noCollisionBetweenLinkedBodies);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Add a hook to a rope impostor\r\n * @param otherImpostor rigid impostor to anchor to\r\n * @param length ratio across rope from 0 to 1\r\n * @param influence the elasticity between rope impostor and anchor from 0, very stretchy to 1, little stretch\r\n * @param noCollisionBetweenLinkedBodies when true collisions between soft impostor and anchor are ignored; default false\r\n * @returns impostor the rope imposter\r\n */\r\n public addHook(otherImpostor: PhysicsImpostor, length: number, influence: number, noCollisionBetweenLinkedBodies: boolean): PhysicsImpostor {\r\n if (!this._physicsEngine) {\r\n return this;\r\n }\r\n const plugin = this._physicsEngine.getPhysicsPlugin();\r\n if (!plugin.appendAnchor) {\r\n return this;\r\n }\r\n if (this._physicsEngine) {\r\n plugin.appendHook!(this, otherImpostor, length, influence, noCollisionBetweenLinkedBodies);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Will keep this body still, in a sleep mode.\r\n * @returns the physics imposter\r\n */\r\n public sleep(): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().sleepBody(this);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Wake the body up.\r\n * @returns The physics imposter\r\n */\r\n public wakeUp(): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().wakeUpBody(this);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Clones the physics imposter\r\n * @param newObject The physics imposter clones to this physics-enabled object\r\n * @returns A nullable physics imposter\r\n */\r\n public clone(newObject: IPhysicsEnabledObject): Nullable<PhysicsImpostor> {\r\n if (!newObject) {\r\n return null;\r\n }\r\n return new PhysicsImpostor(newObject, this.type, this._options, this._scene);\r\n }\r\n\r\n /**\r\n * Disposes the physics imposter\r\n */\r\n public dispose(/*disposeChildren: boolean = true*/) {\r\n //no dispose if no physics engine is available.\r\n if (!this._physicsEngine) {\r\n return;\r\n }\r\n\r\n this._joints.forEach((j) => {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.removeJoint(this, j.otherImpostor, j.joint);\r\n }\r\n });\r\n //dispose the physics body\r\n this._physicsEngine.removeImpostor(this);\r\n if (this.parent) {\r\n this.parent.forceUpdate();\r\n } else {\r\n /*this._object.getChildMeshes().forEach(function(mesh) {\r\n if (mesh.physicsImpostor) {\r\n if (disposeChildren) {\r\n mesh.physicsImpostor.dispose();\r\n mesh.physicsImpostor = null;\r\n }\r\n }\r\n })*/\r\n }\r\n\r\n this._isDisposed = true;\r\n }\r\n\r\n /**\r\n * Sets the delta position\r\n * @param position The delta position amount\r\n */\r\n public setDeltaPosition(position: Vector3) {\r\n this._deltaPosition.copyFrom(position);\r\n }\r\n\r\n /**\r\n * Sets the delta rotation\r\n * @param rotation The delta rotation amount\r\n */\r\n public setDeltaRotation(rotation: Quaternion) {\r\n if (!this._deltaRotation) {\r\n this._deltaRotation = new Quaternion();\r\n }\r\n this._deltaRotation.copyFrom(rotation);\r\n this._deltaRotationConjugated = this._deltaRotation.conjugate();\r\n }\r\n\r\n /**\r\n * Gets the box size of the physics imposter and stores the result in the input parameter\r\n * @param result Stores the box size\r\n * @returns The physics imposter\r\n */\r\n public getBoxSizeToRef(result: Vector3): PhysicsImpostor {\r\n if (this._physicsEngine) {\r\n this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this, result);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the radius of the physics imposter\r\n * @returns Radius of the physics imposter\r\n */\r\n public getRadius(): number {\r\n return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getRadius(this) : 0;\r\n }\r\n\r\n /**\r\n * Sync a bone with this impostor\r\n * @param bone The bone to sync to the impostor.\r\n * @param boneMesh The mesh that the bone is influencing.\r\n * @param jointPivot The pivot of the joint / bone in local space.\r\n * @param distToJoint Optional distance from the impostor to the joint.\r\n * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.\r\n */\r\n public syncBoneWithImpostor(bone: Bone, boneMesh: AbstractMesh, jointPivot: Vector3, distToJoint?: number, adjustRotation?: Quaternion) {\r\n const tempVec = PhysicsImpostor._TmpVecs[0];\r\n const mesh = <AbstractMesh>this.object;\r\n\r\n if (mesh.rotationQuaternion) {\r\n if (adjustRotation) {\r\n const tempQuat = PhysicsImpostor._TmpQuat;\r\n mesh.rotationQuaternion.multiplyToRef(adjustRotation, tempQuat);\r\n bone.setRotationQuaternion(tempQuat, Space.WORLD, boneMesh);\r\n } else {\r\n bone.setRotationQuaternion(mesh.rotationQuaternion, Space.WORLD, boneMesh);\r\n }\r\n }\r\n\r\n tempVec.x = 0;\r\n tempVec.y = 0;\r\n tempVec.z = 0;\r\n\r\n if (jointPivot) {\r\n tempVec.x = jointPivot.x;\r\n tempVec.y = jointPivot.y;\r\n tempVec.z = jointPivot.z;\r\n\r\n bone.getDirectionToRef(tempVec, boneMesh, tempVec);\r\n\r\n if (distToJoint === undefined || distToJoint === null) {\r\n distToJoint = jointPivot.length();\r\n }\r\n\r\n tempVec.x *= distToJoint;\r\n tempVec.y *= distToJoint;\r\n tempVec.z *= distToJoint;\r\n }\r\n\r\n if (bone.getParent()) {\r\n tempVec.addInPlace(mesh.getAbsolutePosition());\r\n bone.setAbsolutePosition(tempVec, boneMesh);\r\n } else {\r\n boneMesh.setAbsolutePosition(mesh.getAbsolutePosition());\r\n boneMesh.position.x -= tempVec.x;\r\n boneMesh.position.y -= tempVec.y;\r\n boneMesh.position.z -= tempVec.z;\r\n }\r\n }\r\n\r\n /**\r\n * Sync impostor to a bone\r\n * @param bone The bone that the impostor will be synced to.\r\n * @param boneMesh The mesh that the bone is influencing.\r\n * @param jointPivot The pivot of the joint / bone in local space.\r\n * @param distToJoint Optional distance from the impostor to the joint.\r\n * @param adjustRotation Optional quaternion for adjusting the local rotation of the bone.\r\n * @param boneAxis Optional vector3 axis the bone is aligned with\r\n */\r\n public syncImpostorWithBone(bone: Bone, boneMesh: AbstractMesh, jointPivot: Vector3, distToJoint?: number, adjustRotation?: Quaternion, boneAxis?: Vector3) {\r\n const mesh = <AbstractMesh>this.object;\r\n\r\n if (mesh.rotationQuaternion) {\r\n if (adjustRotation) {\r\n const tempQuat = PhysicsImpostor._TmpQuat;\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, tempQuat);\r\n tempQuat.multiplyToRef(adjustRotation, mesh.rotationQuaternion);\r\n } else {\r\n bone.getRotationQuaternionToRef(Space.WORLD, boneMesh, mesh.rotationQuaternion);\r\n }\r\n }\r\n\r\n const pos = PhysicsImpostor._TmpVecs[0];\r\n const boneDir = PhysicsImpostor._TmpVecs[1];\r\n\r\n if (!boneAxis) {\r\n boneAxis = PhysicsImpostor._TmpVecs[2];\r\n boneAxis.x = 0;\r\n boneAxis.y = 1;\r\n boneAxis.z = 0;\r\n }\r\n\r\n bone.getDirectionToRef(boneAxis, boneMesh, boneDir);\r\n bone.getAbsolutePositionToRef(boneMesh, pos);\r\n\r\n if ((distToJoint === undefined || distToJoint === null) && jointPivot) {\r\n distToJoint = jointPivot.length();\r\n }\r\n\r\n if (distToJoint !== undefined && distToJoint !== null) {\r\n pos.x += boneDir.x * distToJoint;\r\n pos.y += boneDir.y * distToJoint;\r\n pos.z += boneDir.z * distToJoint;\r\n }\r\n\r\n mesh.setAbsolutePosition(pos);\r\n }\r\n\r\n //Impostor types\r\n /**\r\n * No-Imposter type\r\n */\r\n public static NoImpostor = 0;\r\n /**\r\n * Sphere-Imposter type\r\n */\r\n public static SphereImpostor = 1;\r\n /**\r\n * Box-Imposter type\r\n */\r\n public static BoxImpostor = 2;\r\n /**\r\n * Plane-Imposter type\r\n */\r\n public static PlaneImpostor = 3;\r\n /**\r\n * Mesh-imposter type (Only available to objects with vertices data)\r\n */\r\n public static MeshImpostor = 4;\r\n /**\r\n * Capsule-Impostor type (Ammo.js plugin only)\r\n */\r\n public static CapsuleImpostor = 6;\r\n /**\r\n * Cylinder-Imposter type\r\n */\r\n public static CylinderImpostor = 7;\r\n /**\r\n * Particle-Imposter type\r\n */\r\n public static ParticleImpostor = 8;\r\n /**\r\n * Heightmap-Imposter type\r\n */\r\n public static HeightmapImpostor = 9;\r\n /**\r\n * ConvexHull-Impostor type (Ammo.js plugin only)\r\n */\r\n public static ConvexHullImpostor = 10;\r\n /**\r\n * Custom-Imposter type (Ammo.js plugin only)\r\n */\r\n public static CustomImpostor = 100;\r\n /**\r\n * Rope-Imposter type\r\n */\r\n public static RopeImpostor = 101;\r\n /**\r\n * Cloth-Imposter type\r\n */\r\n public static ClothImpostor = 102;\r\n /**\r\n * Softbody-Imposter type\r\n */\r\n public static SoftbodyImpostor = 103;\r\n}\r\n"]}
|
|
@@ -11,13 +11,13 @@ import type { Nullable } from "../../types";
|
|
|
11
11
|
import type { Observable } from "../../Misc/observable";
|
|
12
12
|
import type { GroundMesh } from "../../Meshes/groundMesh";
|
|
13
13
|
/** How a specific axis can be constrained */
|
|
14
|
-
export declare enum PhysicsConstraintAxisLimitMode {
|
|
14
|
+
export declare const enum PhysicsConstraintAxisLimitMode {
|
|
15
15
|
FREE = 0,
|
|
16
16
|
LIMITED = 1,
|
|
17
17
|
LOCKED = 2
|
|
18
18
|
}
|
|
19
19
|
/** The constraint specific axis to use when setting Friction, `ConstraintAxisLimitMode`, max force, ... */
|
|
20
|
-
export declare enum PhysicsConstraintAxis {
|
|
20
|
+
export declare const enum PhysicsConstraintAxis {
|
|
21
21
|
LINEAR_X = 0,
|
|
22
22
|
LINEAR_Y = 1,
|
|
23
23
|
LINEAR_Z = 2,
|
|
@@ -27,7 +27,7 @@ export declare enum PhysicsConstraintAxis {
|
|
|
27
27
|
LINEAR_DISTANCE = 6
|
|
28
28
|
}
|
|
29
29
|
/** Type of Constraint */
|
|
30
|
-
export declare enum PhysicsConstraintType {
|
|
30
|
+
export declare const enum PhysicsConstraintType {
|
|
31
31
|
/**
|
|
32
32
|
* A ball and socket constraint will attempt to line up the pivot
|
|
33
33
|
* positions in each body, and have no restrictions on rotation
|
|
@@ -58,7 +58,7 @@ export declare enum PhysicsConstraintType {
|
|
|
58
58
|
SIX_DOF = 7
|
|
59
59
|
}
|
|
60
60
|
/** Type of Shape */
|
|
61
|
-
export declare enum PhysicsShapeType {
|
|
61
|
+
export declare const enum PhysicsShapeType {
|
|
62
62
|
SPHERE = 0,
|
|
63
63
|
CAPSULE = 1,
|
|
64
64
|
CYLINDER = 2,
|
|
@@ -69,12 +69,12 @@ export declare enum PhysicsShapeType {
|
|
|
69
69
|
HEIGHTFIELD = 7
|
|
70
70
|
}
|
|
71
71
|
/** Optional motor which attempts to move a body at a specific velocity, or at a specific position */
|
|
72
|
-
export declare enum PhysicsConstraintMotorType {
|
|
72
|
+
export declare const enum PhysicsConstraintMotorType {
|
|
73
73
|
NONE = 0,
|
|
74
74
|
VELOCITY = 1,
|
|
75
75
|
POSITION = 2
|
|
76
76
|
}
|
|
77
|
-
export declare enum PhysicsEventType {
|
|
77
|
+
export declare const enum PhysicsEventType {
|
|
78
78
|
COLLISION_STARTED = "COLLISION_STARTED",
|
|
79
79
|
COLLISION_CONTINUED = "COLLISION_CONTINUED",
|
|
80
80
|
COLLISION_FINISHED = "COLLISION_FINISHED",
|
|
@@ -282,15 +282,23 @@ export interface PhysicsMassProperties {
|
|
|
282
282
|
/**
|
|
283
283
|
* Indicates how the body will behave.
|
|
284
284
|
*/
|
|
285
|
-
export declare enum PhysicsMotionType {
|
|
285
|
+
export declare const enum PhysicsMotionType {
|
|
286
286
|
STATIC = 0,
|
|
287
287
|
ANIMATED = 1,
|
|
288
288
|
DYNAMIC = 2
|
|
289
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* Indicates how to handle position/rotation change of transform node attached to a physics body
|
|
292
|
+
*/
|
|
293
|
+
export declare enum PhysicsPrestepType {
|
|
294
|
+
DISABLED = 0,
|
|
295
|
+
TELEPORT = 1,
|
|
296
|
+
ACTION = 2
|
|
297
|
+
}
|
|
290
298
|
/**
|
|
291
299
|
* Controls the body sleep mode.
|
|
292
300
|
*/
|
|
293
|
-
export declare enum PhysicsActivationControl {
|
|
301
|
+
export declare const enum PhysicsActivationControl {
|
|
294
302
|
SIMULATION_CONTROLLED = 0,
|
|
295
303
|
ALWAYS_ACTIVE = 1,
|
|
296
304
|
ALWAYS_INACTIVE = 2
|
|
@@ -131,6 +131,15 @@ export var PhysicsMotionType;
|
|
|
131
131
|
PhysicsMotionType[PhysicsMotionType["ANIMATED"] = 1] = "ANIMATED";
|
|
132
132
|
PhysicsMotionType[PhysicsMotionType["DYNAMIC"] = 2] = "DYNAMIC";
|
|
133
133
|
})(PhysicsMotionType || (PhysicsMotionType = {}));
|
|
134
|
+
/**
|
|
135
|
+
* Indicates how to handle position/rotation change of transform node attached to a physics body
|
|
136
|
+
*/
|
|
137
|
+
export var PhysicsPrestepType;
|
|
138
|
+
(function (PhysicsPrestepType) {
|
|
139
|
+
PhysicsPrestepType[PhysicsPrestepType["DISABLED"] = 0] = "DISABLED";
|
|
140
|
+
PhysicsPrestepType[PhysicsPrestepType["TELEPORT"] = 1] = "TELEPORT";
|
|
141
|
+
PhysicsPrestepType[PhysicsPrestepType["ACTION"] = 2] = "ACTION";
|
|
142
|
+
})(PhysicsPrestepType || (PhysicsPrestepType = {}));
|
|
134
143
|
/**
|
|
135
144
|
* Controls the body sleep mode.
|
|
136
145
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPhysicsEnginePlugin.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v2/IPhysicsEnginePlugin.ts"],"names":[],"mappings":"AAaA,6CAA6C;AAC7C,MAAM,CAAN,IAAY,8BAaX;AAbD,WAAY,8BAA8B;IACtC;;OAEG;IACH,mFAAI,CAAA;IACJ;;OAEG;IACH,yFAAO,CAAA;IACP;;OAEG;IACH,uFAAM,CAAA;AACV,CAAC,EAbW,8BAA8B,KAA9B,8BAA8B,QAazC;AAED,2GAA2G;AAC3G,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C,qDAAiC,CAAA;AACrC,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B;AAiND;;GAEG;AACH,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IACzB,6DAAM,CAAA;IACN,iEAAQ,CAAA;IACR,+DAAO,CAAA;AACX,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAChC,yGAAqB,CAAA;IACrB,yFAAa,CAAA;IACb,6FAAe,CAAA;AACnB,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC","sourcesContent":["import type { Vector3, Quaternion } from \"../../Maths/math.vector\";\r\nimport type { IRaycastQuery, PhysicsRaycastResult } from \"../physicsRaycastResult\";\r\nimport type { PhysicsBody } from \"./physicsBody\";\r\nimport type { PhysicsShape } from \"./physicsShape\";\r\nimport type { PhysicsConstraint } from \"./physicsConstraint\";\r\nimport type { BoundingBox } from \"../../Culling/boundingBox\";\r\nimport type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport type { PhysicsMaterial } from \"./physicsMaterial\";\r\nimport type { Mesh } from \"../../Meshes/mesh\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Observable } from \"../../Misc/observable\";\r\nimport type { GroundMesh } from \"../../Meshes/groundMesh\";\r\n\r\n/** How a specific axis can be constrained */\r\nexport enum PhysicsConstraintAxisLimitMode {\r\n /*\r\n * The axis is not restricted at all\r\n */\r\n FREE,\r\n /*\r\n * The axis has a minimum/maximum limit\r\n */\r\n LIMITED,\r\n /*\r\n * The axis allows no relative movement of the pivots\r\n */\r\n LOCKED,\r\n}\r\n\r\n/** The constraint specific axis to use when setting Friction, `ConstraintAxisLimitMode`, max force, ... */\r\nexport enum PhysicsConstraintAxis {\r\n /*\r\n * Translation along the primary axis of the constraint (i.e. the\r\n * direction specified by PhysicsConstraintParameters.axisA/axisB)\r\n */\r\n LINEAR_X,\r\n /*\r\n * Translation along the second axis of the constraint (i.e. the\r\n * direction specified by PhysicsConstraintParameters.perpAxisA/perpAxisB)\r\n */\r\n LINEAR_Y,\r\n /*\r\n * Translation along the third axis of the constraint. This axis is\r\n * computed from the cross product of axisA/axisB and perpAxisA/perpAxisB)\r\n */\r\n LINEAR_Z,\r\n /*\r\n * Rotation around the primary axis of the constraint (i.e. the\r\n * axis specified by PhysicsConstraintParameters.axisA/axisB)\r\n */\r\n ANGULAR_X,\r\n /*\r\n * Rotation around the second axis of the constraint (i.e. the\r\n * axis specified by PhysicsConstraintParameters.perpAxisA/perpAxisB)\r\n */\r\n ANGULAR_Y,\r\n /*\r\n * Rotation around the third axis of the constraint. This axis is\r\n * computed from the cross product of axisA/axisB and perpAxisA/perpAxisB)\r\n */\r\n ANGULAR_Z,\r\n /*\r\n * A 3D distance limit; similar to specifying the LINEAR_X/Y/Z axes\r\n * individually, but the distance calculation uses all three axes\r\n * simultaneously, instead of individually.\r\n */\r\n LINEAR_DISTANCE,\r\n}\r\n\r\n/** Type of Constraint */\r\nexport enum PhysicsConstraintType {\r\n /**\r\n * A ball and socket constraint will attempt to line up the pivot\r\n * positions in each body, and have no restrictions on rotation\r\n */\r\n BALL_AND_SOCKET = 1,\r\n /**\r\n * A distance constraint will attempt to keep the pivot locations\r\n * within a specified distance.\r\n */\r\n DISTANCE = 2,\r\n /**\r\n * A hinge constraint will keep the pivot positions aligned as well\r\n * as two angular axes. The remaining angular axis will be free to rotate.\r\n */\r\n HINGE = 3,\r\n /**\r\n * A slider constraint allows bodies to translate along one axis and\r\n * rotate about the same axis. The remaining two axes are locked in\r\n * place\r\n */\r\n SLIDER = 4,\r\n /**\r\n * A lock constraint will attempt to keep the pivots completely lined\r\n * up between both bodies, allowing no relative movement.\r\n */\r\n LOCK = 5,\r\n /*\r\n * A prismatic will lock the rotations of the bodies, and allow translation\r\n * only along one axis\r\n */\r\n PRISMATIC = 6,\r\n /*\r\n * A generic constraint; this starts with no limits on how the bodies can\r\n * move relative to each other, but limits can be added via the PhysicsConstraint\r\n * interfaces. This can be used to specify a large variety of constraints\r\n */\r\n SIX_DOF = 7,\r\n}\r\n\r\n/** Type of Shape */\r\nexport enum PhysicsShapeType {\r\n SPHERE,\r\n CAPSULE,\r\n CYLINDER,\r\n BOX,\r\n CONVEX_HULL,\r\n CONTAINER,\r\n MESH,\r\n HEIGHTFIELD,\r\n}\r\n\r\n/** Optional motor which attempts to move a body at a specific velocity, or at a specific position */\r\nexport enum PhysicsConstraintMotorType {\r\n NONE,\r\n VELOCITY,\r\n POSITION,\r\n}\r\n\r\nexport enum PhysicsEventType {\r\n COLLISION_STARTED = \"COLLISION_STARTED\",\r\n COLLISION_CONTINUED = \"COLLISION_CONTINUED\",\r\n COLLISION_FINISHED = \"COLLISION_FINISHED\",\r\n TRIGGER_ENTERED = \"TRIGGER_ENTERED\",\r\n TRIGGER_EXITED = \"TRIGGER_EXITED\",\r\n}\r\n\r\n/**\r\n * Base collision object\r\n */\r\nexport interface IBasePhysicsCollisionEvent {\r\n /**\r\n * 1st physics body that collided\r\n */\r\n collider: PhysicsBody;\r\n /**\r\n * 2nd physics body that collided\r\n */\r\n collidedAgainst: PhysicsBody;\r\n /**\r\n * index in instances array for the collider\r\n */\r\n colliderIndex: number;\r\n /**\r\n * index in instances array for the collidedAgainst\r\n */\r\n collidedAgainstIndex: number;\r\n /**\r\n * Event type\r\n */\r\n type: PhysicsEventType;\r\n}\r\n\r\n/**\r\n * Collision object that is the parameter when notification for collision fires.\r\n */\r\nexport interface IPhysicsCollisionEvent extends IBasePhysicsCollisionEvent {\r\n /**\r\n * World position where the collision occured\r\n */\r\n point: Nullable<Vector3>;\r\n /**\r\n * Penetration distance\r\n */\r\n distance: number;\r\n /**\r\n * Impulse value computed by the solver response\r\n */\r\n impulse: number;\r\n /**\r\n * Collision world normal direction\r\n */\r\n normal: Nullable<Vector3>;\r\n}\r\n\r\n/**\r\n * Parameters used to describe the Shape\r\n */\r\nexport interface PhysicsShapeParameters {\r\n /**\r\n * Shape center position\r\n */\r\n center?: Vector3;\r\n /**\r\n * Radius for cylinder, shape and capsule\r\n */\r\n radius?: number;\r\n /**\r\n * First point position that defines the cylinder or capsule\r\n */\r\n pointA?: Vector3;\r\n /**\r\n * Second point position that defines the cylinder or capsule\r\n */\r\n pointB?: Vector3;\r\n /**\r\n * Shape orientation\r\n */\r\n rotation?: Quaternion;\r\n /**\r\n * Dimesion extention for the box\r\n */\r\n extents?: Vector3;\r\n /**\r\n * Mesh used for Mesh shape or convex hull. It can be different than the mesh the body is attached to.\r\n */\r\n mesh?: Mesh;\r\n /**\r\n * Use children hierarchy\r\n */\r\n includeChildMeshes?: boolean;\r\n /**\r\n * The size of the heightfield in the X axis\r\n */\r\n heightFieldSizeX?: number;\r\n /**\r\n * The size of the heightfield in the Z axis\r\n */\r\n heightFieldSizeZ?: number;\r\n /**\r\n * The number of samples along the X axis\r\n */\r\n numHeightFieldSamplesX?: number;\r\n /**\r\n * The number of samples along the Z axis\r\n */\r\n numHeightFieldSamplesZ?: number;\r\n /**\r\n * The data for the heightfield\r\n */\r\n heightFieldData?: Float32Array;\r\n /**\r\n * Ground mesh used for display\r\n */\r\n groundMesh?: GroundMesh;\r\n}\r\n\r\n/**\r\n * Parameters used to describe a Constraint\r\n */\r\nexport interface PhysicsConstraintParameters {\r\n /**\r\n * Location of the constraint pivot in the space of first body\r\n */\r\n pivotA?: Vector3;\r\n /**\r\n * Location of the constraint pivot in the space of the second body\r\n */\r\n pivotB?: Vector3;\r\n /**\r\n * An axis in the space of the first body which determines how\r\n * distances/angles are measured for LINEAR_X/ANGULAR_X limits.\r\n */\r\n axisA?: Vector3;\r\n /**\r\n * An axis in the space of the second body which determines how\r\n * distances/angles are measured for LINEAR_X/ANGULAR_X limits.\r\n */\r\n axisB?: Vector3;\r\n\r\n /**\r\n * An axis in the space of the first body which determines how\r\n * distances/angles are measured for LINEAR_Y/ANGULAR_Y limits.\r\n */\r\n perpAxisA?: Vector3;\r\n\r\n /**\r\n * An axis in the space of the second body which determines how\r\n * distances/angles are measured for LINEAR_Y/ANGULAR_Y limits.\r\n */\r\n perpAxisB?: Vector3;\r\n\r\n /**\r\n * The maximum distance that can seperate the two pivots.\r\n * Only used for DISTANCE constraints\r\n */\r\n maxDistance?: number;\r\n\r\n /**\r\n * Determines if the connected bodies should collide. Generally,\r\n * it is preferable to set this to false, especially if the constraint\r\n * positions the bodies so that they overlap. Otherwise, the constraint\r\n * will \"fight\" the collision detection and may cause jitter.\r\n */\r\n collision?: boolean;\r\n}\r\n\r\n/**\r\n * Parameters used to describe mass and inertia of the Physics Body\r\n */\r\nexport interface PhysicsMassProperties {\r\n /**\r\n * The center of mass, in local space. This is The\r\n * point the body will rotate around when applying\r\n * an angular velocity.\r\n *\r\n * If not provided, the physics engine will compute\r\n * an appropriate value.\r\n */\r\n centerOfMass?: Vector3;\r\n /**\r\n * The total mass of this object, in kilograms. This\r\n * affects how easy it is to move the body. A value\r\n * of zero will be used as an infinite mass.\r\n *\r\n * If not provided, the physics engine will compute\r\n * an appropriate value.\r\n */\r\n mass?: number;\r\n /**\r\n * The principal moments of inertia of this object\r\n * for a unit mass. This determines how easy it is\r\n * for the body to rotate. A value of zero on any\r\n * axis will be used as infinite interia about that\r\n * axis.\r\n *\r\n * If not provided, the physics engine will compute\r\n * an appropriate value.\r\n */\r\n inertia?: Vector3;\r\n /**\r\n * The rotation rotating from inertia major axis space\r\n * to parent space (i.e., the rotation which, when\r\n * applied to the 3x3 inertia tensor causes the inertia\r\n * tensor to become a diagonal matrix). This determines\r\n * how the values of inertia are aligned with the parent\r\n * object.\r\n *\r\n * If not provided, the physics engine will compute\r\n * an appropriate value.\r\n */\r\n inertiaOrientation?: Quaternion;\r\n}\r\n\r\n/**\r\n * Indicates how the body will behave.\r\n */\r\nexport enum PhysicsMotionType {\r\n STATIC,\r\n ANIMATED,\r\n DYNAMIC,\r\n}\r\n\r\n/**\r\n * Controls the body sleep mode.\r\n */\r\nexport enum PhysicsActivationControl {\r\n SIMULATION_CONTROLLED,\r\n ALWAYS_ACTIVE,\r\n ALWAYS_INACTIVE,\r\n}\r\n\r\n/**\r\n * Represents a pair of bodies connected by a constraint.\r\n */\r\nexport type ConstrainedBodyPair = { parentBody: PhysicsBody; parentBodyIndex: number; childBody: PhysicsBody; childBodyIndex: number };\r\n\r\n/** @internal */\r\nexport interface IPhysicsEnginePluginV2 {\r\n /**\r\n * Physics plugin world instance\r\n */\r\n world: any;\r\n /**\r\n * Physics plugin name\r\n */\r\n name: string;\r\n\r\n /**\r\n * Collision observable\r\n */\r\n onCollisionObservable: Observable<IPhysicsCollisionEvent>;\r\n /**\r\n * Collision ended observable\r\n */\r\n onCollisionEndedObservable: Observable<IBasePhysicsCollisionEvent>;\r\n /**\r\n * Trigger observable\r\n */\r\n onTriggerCollisionObservable: Observable<IBasePhysicsCollisionEvent>;\r\n\r\n setGravity(gravity: Vector3): void;\r\n setTimeStep(timeStep: number): void;\r\n getTimeStep(): number;\r\n executeStep(delta: number, bodies: Array<PhysicsBody>): void; //not forgetting pre and post events\r\n getPluginVersion(): number;\r\n setVelocityLimits(maxLinearVelocity: number, maxAngularVelocity: number): void;\r\n getMaxLinearVelocity(): number;\r\n getMaxAngularVelocity(): number;\r\n\r\n // body\r\n initBody(body: PhysicsBody, motionType: PhysicsMotionType, position: Vector3, orientation: Quaternion): void;\r\n initBodyInstances(body: PhysicsBody, motionType: PhysicsMotionType, mesh: Mesh): void;\r\n updateBodyInstances(body: PhysicsBody, mesh: Mesh): void;\r\n removeBody(body: PhysicsBody): void;\r\n sync(body: PhysicsBody): void;\r\n syncTransform(body: PhysicsBody, transformNode: TransformNode): void;\r\n setShape(body: PhysicsBody, shape: Nullable<PhysicsShape>): void;\r\n getShape(body: PhysicsBody): Nullable<PhysicsShape>;\r\n getShapeType(shape: PhysicsShape): PhysicsShapeType;\r\n setEventMask(body: PhysicsBody, eventMask: number, instanceIndex?: number): void;\r\n getEventMask(body: PhysicsBody, instanceIndex?: number): number;\r\n setMotionType(body: PhysicsBody, motionType: PhysicsMotionType, instanceIndex?: number): void;\r\n getMotionType(body: PhysicsBody, instanceIndex?: number): PhysicsMotionType;\r\n computeMassProperties(body: PhysicsBody, instanceIndex?: number): PhysicsMassProperties;\r\n setMassProperties(body: PhysicsBody, massProps: PhysicsMassProperties, instanceIndex?: number): void;\r\n getMassProperties(body: PhysicsBody, instanceIndex?: number): PhysicsMassProperties;\r\n setLinearDamping(body: PhysicsBody, damping: number, instanceIndex?: number): void;\r\n getLinearDamping(body: PhysicsBody, instanceIndex?: number): number;\r\n setAngularDamping(body: PhysicsBody, damping: number, instanceIndex?: number): void;\r\n getAngularDamping(body: PhysicsBody, instanceIndex?: number): number;\r\n setLinearVelocity(body: PhysicsBody, linVel: Vector3, instanceIndex?: number): void;\r\n getLinearVelocityToRef(body: PhysicsBody, linVel: Vector3, instanceIndex?: number): void;\r\n applyImpulse(body: PhysicsBody, impulse: Vector3, location: Vector3, instanceIndex?: number): void;\r\n applyAngularImpulse(body: PhysicsBody, angularImpulse: Vector3, instanceIndex?: number): void;\r\n applyForce(body: PhysicsBody, force: Vector3, location: Vector3, instanceIndex?: number): void;\r\n setAngularVelocity(body: PhysicsBody, angVel: Vector3, instanceIndex?: number): void;\r\n getAngularVelocityToRef(body: PhysicsBody, angVel: Vector3, instanceIndex?: number): void;\r\n getBodyGeometry(body: PhysicsBody): {};\r\n disposeBody(body: PhysicsBody): void;\r\n setCollisionCallbackEnabled(body: PhysicsBody, enabled: boolean, instanceIndex?: number): void;\r\n setCollisionEndedCallbackEnabled(body: PhysicsBody, enabled: boolean, instanceIndex?: number): void;\r\n addConstraint(body: PhysicsBody, childBody: PhysicsBody, constraint: PhysicsConstraint, instanceIndex?: number, childInstanceIndex?: number): void;\r\n getCollisionObservable(body: PhysicsBody, instanceIndex?: number): Observable<IPhysicsCollisionEvent>;\r\n getCollisionEndedObservable(body: PhysicsBody, instanceIndex?: number): Observable<IBasePhysicsCollisionEvent>;\r\n setGravityFactor(body: PhysicsBody, factor: number, instanceIndex?: number): void;\r\n getGravityFactor(body: PhysicsBody, instanceIndex?: number): number;\r\n setTargetTransform(body: PhysicsBody, position: Vector3, rotation: Quaternion, instanceIndex?: number): void;\r\n\r\n // shape\r\n initShape(shape: PhysicsShape, type: PhysicsShapeType, options: PhysicsShapeParameters): void;\r\n setShapeFilterMembershipMask(shape: PhysicsShape, membershipMask: number): void;\r\n getShapeFilterMembershipMask(shape: PhysicsShape): number;\r\n setShapeFilterCollideMask(shape: PhysicsShape, collideMask: number): void;\r\n getShapeFilterCollideMask(shape: PhysicsShape): number;\r\n setMaterial(shape: PhysicsShape, material: PhysicsMaterial): void;\r\n getMaterial(shape: PhysicsShape): PhysicsMaterial;\r\n setDensity(shape: PhysicsShape, density: number): void;\r\n getDensity(shape: PhysicsShape): number;\r\n addChild(shape: PhysicsShape, newChild: PhysicsShape, translation?: Vector3, rotation?: Quaternion, scale?: Vector3): void;\r\n removeChild(shape: PhysicsShape, childIndex: number): void;\r\n getNumChildren(shape: PhysicsShape): number;\r\n getBoundingBox(shape: PhysicsShape): BoundingBox;\r\n getBodyBoundingBox(body: PhysicsBody): BoundingBox;\r\n disposeShape(shape: PhysicsShape): void;\r\n setTrigger(shape: PhysicsShape, isTrigger: boolean): void;\r\n\r\n // constraint\r\n initConstraint(constraint: PhysicsConstraint, body: PhysicsBody, childBody: PhysicsBody): void;\r\n setEnabled(constraint: PhysicsConstraint, isEnabled: boolean): void;\r\n getEnabled(constraint: PhysicsConstraint): boolean;\r\n setCollisionsEnabled(constraint: PhysicsConstraint, isEnabled: boolean): void;\r\n getCollisionsEnabled(constraint: PhysicsConstraint): boolean;\r\n setAxisFriction(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, friction: number): void;\r\n getAxisFriction(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<number>;\r\n setAxisMode(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, limitMode: PhysicsConstraintAxisLimitMode): void;\r\n getAxisMode(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<PhysicsConstraintAxisLimitMode>;\r\n setAxisMinLimit(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, minLimit: number): void;\r\n getAxisMinLimit(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<number>;\r\n setAxisMaxLimit(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, limit: number): void;\r\n getAxisMaxLimit(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<number>;\r\n setAxisMotorType(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, motorType: PhysicsConstraintMotorType): void;\r\n getAxisMotorType(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<PhysicsConstraintMotorType>;\r\n setAxisMotorTarget(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, target: number): void;\r\n getAxisMotorTarget(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<number>;\r\n setAxisMotorMaxForce(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, maxForce: number): void;\r\n getAxisMotorMaxForce(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<number>;\r\n disposeConstraint(constraint: PhysicsConstraint): void;\r\n getBodiesUsingConstraint(constraint: PhysicsConstraint): ConstrainedBodyPair[];\r\n\r\n // raycast\r\n raycast(from: Vector3, to: Vector3, result: PhysicsRaycastResult, query?: IRaycastQuery): void;\r\n\r\n dispose(): void;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"IPhysicsEnginePlugin.js","sourceRoot":"","sources":["../../../../../dev/core/src/Physics/v2/IPhysicsEnginePlugin.ts"],"names":[],"mappings":"AAaA,6CAA6C;AAC7C,MAAM,CAAN,IAAkB,8BAajB;AAbD,WAAkB,8BAA8B;IAC5C;;OAEG;IACH,mFAAI,CAAA;IACJ;;OAEG;IACH,yFAAO,CAAA;IACP;;OAEG;IACH,uFAAM,CAAA;AACV,CAAC,EAbiB,8BAA8B,KA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ACvC,+DAA2C,CAAA;IAC3C,6DAAyC,CAAA;IACzC,uDAAmC,CAAA;IACnC,qDAAiC,CAAA;AACrC,CAAC,EANiB,gBAAgB,KAAhB,gBAAgB,QAMjC;AAiND;;GAEG;AACH,MAAM,CAAN,IAAkB,iBAIjB;AAJD,WAAkB,iBAAiB;IAC/B,6DAAM,CAAA;IACN,iEAAQ,CAAA;IACR,+DAAO,CAAA;AACX,CAAC,EAJiB,iBAAiB,KAAjB,iBAAiB,QAIlC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,mEAAQ,CAAA;IACR,mEAAQ,CAAA;IACR,+DAAM,CAAA;AACV,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B;AAED;;GAEG;AACH,MAAM,CAAN,IAAkB,wBAIjB;AAJD,WAAkB,wBAAwB;IACtC,yGAAqB,CAAA;IACrB,yFAAa,CAAA;IACb,6FAAe,CAAA;AACnB,CAAC,EAJiB,wBAAwB,KAAxB,wBAAwB,QAIzC","sourcesContent":["import type { Vector3, Quaternion } from \"../../Maths/math.vector\";\r\nimport type { IRaycastQuery, PhysicsRaycastResult } from \"../physicsRaycastResult\";\r\nimport type { PhysicsBody } from \"./physicsBody\";\r\nimport type { PhysicsShape } from \"./physicsShape\";\r\nimport type { PhysicsConstraint } from \"./physicsConstraint\";\r\nimport type { BoundingBox } from \"../../Culling/boundingBox\";\r\nimport type { TransformNode } from \"../../Meshes/transformNode\";\r\nimport type { PhysicsMaterial } from \"./physicsMaterial\";\r\nimport type { Mesh } from \"../../Meshes/mesh\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Observable } from \"../../Misc/observable\";\r\nimport type { GroundMesh } from \"../../Meshes/groundMesh\";\r\n\r\n/** How a specific axis can be constrained */\r\nexport const enum PhysicsConstraintAxisLimitMode {\r\n /*\r\n * The axis is not restricted at all\r\n */\r\n FREE,\r\n /*\r\n * The axis has a minimum/maximum limit\r\n */\r\n LIMITED,\r\n /*\r\n * The axis allows no relative movement of the pivots\r\n */\r\n LOCKED,\r\n}\r\n\r\n/** The constraint specific axis to use when setting Friction, `ConstraintAxisLimitMode`, max force, ... */\r\nexport const enum PhysicsConstraintAxis {\r\n /*\r\n * Translation along the primary axis of the constraint (i.e. the\r\n * direction specified by PhysicsConstraintParameters.axisA/axisB)\r\n */\r\n LINEAR_X,\r\n /*\r\n * Translation along the second axis of the constraint (i.e. the\r\n * direction specified by PhysicsConstraintParameters.perpAxisA/perpAxisB)\r\n */\r\n LINEAR_Y,\r\n /*\r\n * Translation along the third axis of the constraint. This axis is\r\n * computed from the cross product of axisA/axisB and perpAxisA/perpAxisB)\r\n */\r\n LINEAR_Z,\r\n /*\r\n * Rotation around the primary axis of the constraint (i.e. the\r\n * axis specified by PhysicsConstraintParameters.axisA/axisB)\r\n */\r\n ANGULAR_X,\r\n /*\r\n * Rotation around the second axis of the constraint (i.e. the\r\n * axis specified by PhysicsConstraintParameters.perpAxisA/perpAxisB)\r\n */\r\n ANGULAR_Y,\r\n /*\r\n * Rotation around the third axis of the constraint. This axis is\r\n * computed from the cross product of axisA/axisB and perpAxisA/perpAxisB)\r\n */\r\n ANGULAR_Z,\r\n /*\r\n * A 3D distance limit; similar to specifying the LINEAR_X/Y/Z axes\r\n * individually, but the distance calculation uses all three axes\r\n * simultaneously, instead of individually.\r\n */\r\n LINEAR_DISTANCE,\r\n}\r\n\r\n/** Type of Constraint */\r\nexport const enum PhysicsConstraintType {\r\n /**\r\n * A ball and socket constraint will attempt to line up the pivot\r\n * positions in each body, and have no restrictions on rotation\r\n */\r\n BALL_AND_SOCKET = 1,\r\n /**\r\n * A distance constraint will attempt to keep the pivot locations\r\n * within a specified distance.\r\n */\r\n DISTANCE = 2,\r\n /**\r\n * A hinge constraint will keep the pivot positions aligned as well\r\n * as two angular axes. The remaining angular axis will be free to rotate.\r\n */\r\n HINGE = 3,\r\n /**\r\n * A slider constraint allows bodies to translate along one axis and\r\n * rotate about the same axis. The remaining two axes are locked in\r\n * place\r\n */\r\n SLIDER = 4,\r\n /**\r\n * A lock constraint will attempt to keep the pivots completely lined\r\n * up between both bodies, allowing no relative movement.\r\n */\r\n LOCK = 5,\r\n /*\r\n * A prismatic will lock the rotations of the bodies, and allow translation\r\n * only along one axis\r\n */\r\n PRISMATIC = 6,\r\n /*\r\n * A generic constraint; this starts with no limits on how the bodies can\r\n * move relative to each other, but limits can be added via the PhysicsConstraint\r\n * interfaces. This can be used to specify a large variety of constraints\r\n */\r\n SIX_DOF = 7,\r\n}\r\n\r\n/** Type of Shape */\r\nexport const enum PhysicsShapeType {\r\n SPHERE,\r\n CAPSULE,\r\n CYLINDER,\r\n BOX,\r\n CONVEX_HULL,\r\n CONTAINER,\r\n MESH,\r\n HEIGHTFIELD,\r\n}\r\n\r\n/** Optional motor which attempts to move a body at a specific velocity, or at a specific position */\r\nexport const enum PhysicsConstraintMotorType {\r\n NONE,\r\n VELOCITY,\r\n POSITION,\r\n}\r\n\r\nexport const enum PhysicsEventType {\r\n COLLISION_STARTED = \"COLLISION_STARTED\",\r\n COLLISION_CONTINUED = \"COLLISION_CONTINUED\",\r\n COLLISION_FINISHED = \"COLLISION_FINISHED\",\r\n TRIGGER_ENTERED = \"TRIGGER_ENTERED\",\r\n TRIGGER_EXITED = \"TRIGGER_EXITED\",\r\n}\r\n\r\n/**\r\n * Base collision object\r\n */\r\nexport interface IBasePhysicsCollisionEvent {\r\n /**\r\n * 1st physics body that collided\r\n */\r\n collider: PhysicsBody;\r\n /**\r\n * 2nd physics body that collided\r\n */\r\n collidedAgainst: PhysicsBody;\r\n /**\r\n * index in instances array for the collider\r\n */\r\n colliderIndex: number;\r\n /**\r\n * index in instances array for the collidedAgainst\r\n */\r\n collidedAgainstIndex: number;\r\n /**\r\n * Event type\r\n */\r\n type: PhysicsEventType;\r\n}\r\n\r\n/**\r\n * Collision object that is the parameter when notification for collision fires.\r\n */\r\nexport interface IPhysicsCollisionEvent extends IBasePhysicsCollisionEvent {\r\n /**\r\n * World position where the collision occured\r\n */\r\n point: Nullable<Vector3>;\r\n /**\r\n * Penetration distance\r\n */\r\n distance: number;\r\n /**\r\n * Impulse value computed by the solver response\r\n */\r\n impulse: number;\r\n /**\r\n * Collision world normal direction\r\n */\r\n normal: Nullable<Vector3>;\r\n}\r\n\r\n/**\r\n * Parameters used to describe the Shape\r\n */\r\nexport interface PhysicsShapeParameters {\r\n /**\r\n * Shape center position\r\n */\r\n center?: Vector3;\r\n /**\r\n * Radius for cylinder, shape and capsule\r\n */\r\n radius?: number;\r\n /**\r\n * First point position that defines the cylinder or capsule\r\n */\r\n pointA?: Vector3;\r\n /**\r\n * Second point position that defines the cylinder or capsule\r\n */\r\n pointB?: Vector3;\r\n /**\r\n * Shape orientation\r\n */\r\n rotation?: Quaternion;\r\n /**\r\n * Dimesion extention for the box\r\n */\r\n extents?: Vector3;\r\n /**\r\n * Mesh used for Mesh shape or convex hull. It can be different than the mesh the body is attached to.\r\n */\r\n mesh?: Mesh;\r\n /**\r\n * Use children hierarchy\r\n */\r\n includeChildMeshes?: boolean;\r\n /**\r\n * The size of the heightfield in the X axis\r\n */\r\n heightFieldSizeX?: number;\r\n /**\r\n * The size of the heightfield in the Z axis\r\n */\r\n heightFieldSizeZ?: number;\r\n /**\r\n * The number of samples along the X axis\r\n */\r\n numHeightFieldSamplesX?: number;\r\n /**\r\n * The number of samples along the Z axis\r\n */\r\n numHeightFieldSamplesZ?: number;\r\n /**\r\n * The data for the heightfield\r\n */\r\n heightFieldData?: Float32Array;\r\n /**\r\n * Ground mesh used for display\r\n */\r\n groundMesh?: GroundMesh;\r\n}\r\n\r\n/**\r\n * Parameters used to describe a Constraint\r\n */\r\nexport interface PhysicsConstraintParameters {\r\n /**\r\n * Location of the constraint pivot in the space of first body\r\n */\r\n pivotA?: Vector3;\r\n /**\r\n * Location of the constraint pivot in the space of the second body\r\n */\r\n pivotB?: Vector3;\r\n /**\r\n * An axis in the space of the first body which determines how\r\n * distances/angles are measured for LINEAR_X/ANGULAR_X limits.\r\n */\r\n axisA?: Vector3;\r\n /**\r\n * An axis in the space of the second body which determines how\r\n * distances/angles are measured for LINEAR_X/ANGULAR_X limits.\r\n */\r\n axisB?: Vector3;\r\n\r\n /**\r\n * An axis in the space of the first body which determines how\r\n * distances/angles are measured for LINEAR_Y/ANGULAR_Y limits.\r\n */\r\n perpAxisA?: Vector3;\r\n\r\n /**\r\n * An axis in the space of the second body which determines how\r\n * distances/angles are measured for LINEAR_Y/ANGULAR_Y limits.\r\n */\r\n perpAxisB?: Vector3;\r\n\r\n /**\r\n * The maximum distance that can seperate the two pivots.\r\n * Only used for DISTANCE constraints\r\n */\r\n maxDistance?: number;\r\n\r\n /**\r\n * Determines if the connected bodies should collide. Generally,\r\n * it is preferable to set this to false, especially if the constraint\r\n * positions the bodies so that they overlap. Otherwise, the constraint\r\n * will \"fight\" the collision detection and may cause jitter.\r\n */\r\n collision?: boolean;\r\n}\r\n\r\n/**\r\n * Parameters used to describe mass and inertia of the Physics Body\r\n */\r\nexport interface PhysicsMassProperties {\r\n /**\r\n * The center of mass, in local space. This is The\r\n * point the body will rotate around when applying\r\n * an angular velocity.\r\n *\r\n * If not provided, the physics engine will compute\r\n * an appropriate value.\r\n */\r\n centerOfMass?: Vector3;\r\n /**\r\n * The total mass of this object, in kilograms. This\r\n * affects how easy it is to move the body. A value\r\n * of zero will be used as an infinite mass.\r\n *\r\n * If not provided, the physics engine will compute\r\n * an appropriate value.\r\n */\r\n mass?: number;\r\n /**\r\n * The principal moments of inertia of this object\r\n * for a unit mass. This determines how easy it is\r\n * for the body to rotate. A value of zero on any\r\n * axis will be used as infinite interia about that\r\n * axis.\r\n *\r\n * If not provided, the physics engine will compute\r\n * an appropriate value.\r\n */\r\n inertia?: Vector3;\r\n /**\r\n * The rotation rotating from inertia major axis space\r\n * to parent space (i.e., the rotation which, when\r\n * applied to the 3x3 inertia tensor causes the inertia\r\n * tensor to become a diagonal matrix). This determines\r\n * how the values of inertia are aligned with the parent\r\n * object.\r\n *\r\n * If not provided, the physics engine will compute\r\n * an appropriate value.\r\n */\r\n inertiaOrientation?: Quaternion;\r\n}\r\n\r\n/**\r\n * Indicates how the body will behave.\r\n */\r\nexport const enum PhysicsMotionType {\r\n STATIC,\r\n ANIMATED,\r\n DYNAMIC,\r\n}\r\n\r\n/**\r\n * Indicates how to handle position/rotation change of transform node attached to a physics body\r\n */\r\nexport enum PhysicsPrestepType {\r\n DISABLED,\r\n TELEPORT,\r\n ACTION,\r\n}\r\n\r\n/**\r\n * Controls the body sleep mode.\r\n */\r\nexport const enum PhysicsActivationControl {\r\n SIMULATION_CONTROLLED,\r\n ALWAYS_ACTIVE,\r\n ALWAYS_INACTIVE,\r\n}\r\n\r\n/**\r\n * Represents a pair of bodies connected by a constraint.\r\n */\r\nexport type ConstrainedBodyPair = { parentBody: PhysicsBody; parentBodyIndex: number; childBody: PhysicsBody; childBodyIndex: number };\r\n\r\n/** @internal */\r\nexport interface IPhysicsEnginePluginV2 {\r\n /**\r\n * Physics plugin world instance\r\n */\r\n world: any;\r\n /**\r\n * Physics plugin name\r\n */\r\n name: string;\r\n\r\n /**\r\n * Collision observable\r\n */\r\n onCollisionObservable: Observable<IPhysicsCollisionEvent>;\r\n /**\r\n * Collision ended observable\r\n */\r\n onCollisionEndedObservable: Observable<IBasePhysicsCollisionEvent>;\r\n /**\r\n * Trigger observable\r\n */\r\n onTriggerCollisionObservable: Observable<IBasePhysicsCollisionEvent>;\r\n\r\n setGravity(gravity: Vector3): void;\r\n setTimeStep(timeStep: number): void;\r\n getTimeStep(): number;\r\n executeStep(delta: number, bodies: Array<PhysicsBody>): void; //not forgetting pre and post events\r\n getPluginVersion(): number;\r\n setVelocityLimits(maxLinearVelocity: number, maxAngularVelocity: number): void;\r\n getMaxLinearVelocity(): number;\r\n getMaxAngularVelocity(): number;\r\n\r\n // body\r\n initBody(body: PhysicsBody, motionType: PhysicsMotionType, position: Vector3, orientation: Quaternion): void;\r\n initBodyInstances(body: PhysicsBody, motionType: PhysicsMotionType, mesh: Mesh): void;\r\n updateBodyInstances(body: PhysicsBody, mesh: Mesh): void;\r\n removeBody(body: PhysicsBody): void;\r\n sync(body: PhysicsBody): void;\r\n syncTransform(body: PhysicsBody, transformNode: TransformNode): void;\r\n setShape(body: PhysicsBody, shape: Nullable<PhysicsShape>): void;\r\n getShape(body: PhysicsBody): Nullable<PhysicsShape>;\r\n getShapeType(shape: PhysicsShape): PhysicsShapeType;\r\n setEventMask(body: PhysicsBody, eventMask: number, instanceIndex?: number): void;\r\n getEventMask(body: PhysicsBody, instanceIndex?: number): number;\r\n setMotionType(body: PhysicsBody, motionType: PhysicsMotionType, instanceIndex?: number): void;\r\n getMotionType(body: PhysicsBody, instanceIndex?: number): PhysicsMotionType;\r\n computeMassProperties(body: PhysicsBody, instanceIndex?: number): PhysicsMassProperties;\r\n setMassProperties(body: PhysicsBody, massProps: PhysicsMassProperties, instanceIndex?: number): void;\r\n getMassProperties(body: PhysicsBody, instanceIndex?: number): PhysicsMassProperties;\r\n setLinearDamping(body: PhysicsBody, damping: number, instanceIndex?: number): void;\r\n getLinearDamping(body: PhysicsBody, instanceIndex?: number): number;\r\n setAngularDamping(body: PhysicsBody, damping: number, instanceIndex?: number): void;\r\n getAngularDamping(body: PhysicsBody, instanceIndex?: number): number;\r\n setLinearVelocity(body: PhysicsBody, linVel: Vector3, instanceIndex?: number): void;\r\n getLinearVelocityToRef(body: PhysicsBody, linVel: Vector3, instanceIndex?: number): void;\r\n applyImpulse(body: PhysicsBody, impulse: Vector3, location: Vector3, instanceIndex?: number): void;\r\n applyAngularImpulse(body: PhysicsBody, angularImpulse: Vector3, instanceIndex?: number): void;\r\n applyForce(body: PhysicsBody, force: Vector3, location: Vector3, instanceIndex?: number): void;\r\n setAngularVelocity(body: PhysicsBody, angVel: Vector3, instanceIndex?: number): void;\r\n getAngularVelocityToRef(body: PhysicsBody, angVel: Vector3, instanceIndex?: number): void;\r\n getBodyGeometry(body: PhysicsBody): {};\r\n disposeBody(body: PhysicsBody): void;\r\n setCollisionCallbackEnabled(body: PhysicsBody, enabled: boolean, instanceIndex?: number): void;\r\n setCollisionEndedCallbackEnabled(body: PhysicsBody, enabled: boolean, instanceIndex?: number): void;\r\n addConstraint(body: PhysicsBody, childBody: PhysicsBody, constraint: PhysicsConstraint, instanceIndex?: number, childInstanceIndex?: number): void;\r\n getCollisionObservable(body: PhysicsBody, instanceIndex?: number): Observable<IPhysicsCollisionEvent>;\r\n getCollisionEndedObservable(body: PhysicsBody, instanceIndex?: number): Observable<IBasePhysicsCollisionEvent>;\r\n setGravityFactor(body: PhysicsBody, factor: number, instanceIndex?: number): void;\r\n getGravityFactor(body: PhysicsBody, instanceIndex?: number): number;\r\n setTargetTransform(body: PhysicsBody, position: Vector3, rotation: Quaternion, instanceIndex?: number): void;\r\n\r\n // shape\r\n initShape(shape: PhysicsShape, type: PhysicsShapeType, options: PhysicsShapeParameters): void;\r\n setShapeFilterMembershipMask(shape: PhysicsShape, membershipMask: number): void;\r\n getShapeFilterMembershipMask(shape: PhysicsShape): number;\r\n setShapeFilterCollideMask(shape: PhysicsShape, collideMask: number): void;\r\n getShapeFilterCollideMask(shape: PhysicsShape): number;\r\n setMaterial(shape: PhysicsShape, material: PhysicsMaterial): void;\r\n getMaterial(shape: PhysicsShape): PhysicsMaterial;\r\n setDensity(shape: PhysicsShape, density: number): void;\r\n getDensity(shape: PhysicsShape): number;\r\n addChild(shape: PhysicsShape, newChild: PhysicsShape, translation?: Vector3, rotation?: Quaternion, scale?: Vector3): void;\r\n removeChild(shape: PhysicsShape, childIndex: number): void;\r\n getNumChildren(shape: PhysicsShape): number;\r\n getBoundingBox(shape: PhysicsShape): BoundingBox;\r\n getBodyBoundingBox(body: PhysicsBody): BoundingBox;\r\n disposeShape(shape: PhysicsShape): void;\r\n setTrigger(shape: PhysicsShape, isTrigger: boolean): void;\r\n\r\n // constraint\r\n initConstraint(constraint: PhysicsConstraint, body: PhysicsBody, childBody: PhysicsBody): void;\r\n setEnabled(constraint: PhysicsConstraint, isEnabled: boolean): void;\r\n getEnabled(constraint: PhysicsConstraint): boolean;\r\n setCollisionsEnabled(constraint: PhysicsConstraint, isEnabled: boolean): void;\r\n getCollisionsEnabled(constraint: PhysicsConstraint): boolean;\r\n setAxisFriction(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, friction: number): void;\r\n getAxisFriction(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<number>;\r\n setAxisMode(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, limitMode: PhysicsConstraintAxisLimitMode): void;\r\n getAxisMode(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<PhysicsConstraintAxisLimitMode>;\r\n setAxisMinLimit(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, minLimit: number): void;\r\n getAxisMinLimit(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<number>;\r\n setAxisMaxLimit(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, limit: number): void;\r\n getAxisMaxLimit(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<number>;\r\n setAxisMotorType(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, motorType: PhysicsConstraintMotorType): void;\r\n getAxisMotorType(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<PhysicsConstraintMotorType>;\r\n setAxisMotorTarget(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, target: number): void;\r\n getAxisMotorTarget(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<number>;\r\n setAxisMotorMaxForce(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis, maxForce: number): void;\r\n getAxisMotorMaxForce(constraint: PhysicsConstraint, axis: PhysicsConstraintAxis): Nullable<number>;\r\n disposeConstraint(constraint: PhysicsConstraint): void;\r\n getBodiesUsingConstraint(constraint: PhysicsConstraint): ConstrainedBodyPair[];\r\n\r\n // raycast\r\n raycast(from: Vector3, to: Vector3, result: PhysicsRaycastResult, query?: IRaycastQuery): void;\r\n\r\n dispose(): void;\r\n}\r\n"]}
|