@babylonjs/core 5.45.2 → 5.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Actions/actionManager.js +6 -1
- package/Actions/actionManager.js.map +1 -1
- package/Actions/condition.js +23 -23
- package/Actions/condition.js.map +1 -1
- package/Animations/animatable.js +48 -48
- package/Animations/animatable.js.map +1 -1
- package/Animations/animation.js +53 -53
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.js +53 -53
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/runtimeAnimation.js +36 -36
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioEngine.js +14 -14
- package/Audio/audioEngine.js.map +1 -1
- package/Audio/audioSceneComponent.js +14 -14
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.js +47 -47
- package/Audio/sound.js.map +1 -1
- package/Behaviors/Meshes/baseSixDofDragBehavior.d.ts +1 -1
- package/Behaviors/Meshes/fadeInOutBehavior.js +11 -11
- package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.js +34 -34
- package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
- package/Bones/bone.js +15 -15
- package/Bones/bone.js.map +1 -1
- package/Bones/boneIKController.js +9 -9
- package/Bones/boneIKController.js.map +1 -1
- package/Bones/boneLookController.js +50 -50
- package/Bones/boneLookController.js.map +1 -1
- package/Bones/skeleton.js +35 -35
- package/Bones/skeleton.js.map +1 -1
- package/Buffers/buffer.js +14 -14
- package/Buffers/buffer.js.map +1 -1
- package/Buffers/dataBuffer.js +6 -6
- package/Buffers/dataBuffer.js.map +1 -1
- package/Cameras/Inputs/freeCameraDeviceOrientationInput.js +42 -42
- package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +18 -18
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.js +178 -178
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Cameras/arcRotateCamera.js +176 -176
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.js +90 -90
- package/Cameras/camera.js.map +1 -1
- package/Cameras/flyCamera.js +82 -82
- package/Cameras/flyCamera.js.map +1 -1
- package/Cameras/freeCamera.js +54 -54
- package/Cameras/freeCamera.js.map +1 -1
- package/Compute/computeShader.js +12 -12
- package/Compute/computeShader.js.map +1 -1
- package/Culling/ray.d.ts +1 -1
- package/Debug/axesViewer.js +12 -12
- package/Debug/axesViewer.js.map +1 -1
- package/Debug/debugLayer.js +21 -21
- package/Debug/debugLayer.js.map +1 -1
- package/Debug/directionalLightFrustumViewer.js +20 -20
- package/Debug/directionalLightFrustumViewer.js.map +1 -1
- package/Debug/physicsViewer.js +3 -3
- package/Debug/physicsViewer.js.map +1 -1
- package/Debug/rayHelper.js +10 -10
- package/Debug/rayHelper.js.map +1 -1
- package/Debug/skeletonViewer.js +81 -81
- package/Debug/skeletonViewer.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSource.d.ts +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.js +31 -31
- package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
- package/DeviceInput/InputDevices/deviceTypes.d.ts +1 -1
- package/DeviceInput/eventFactory.d.ts +1 -1
- package/DeviceInput/eventFactory.js +4 -4
- package/DeviceInput/eventFactory.js.map +1 -1
- package/DeviceInput/internalDeviceSourceManager.d.ts +2 -2
- package/DeviceInput/webDeviceInputSystem.js +2 -2
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.computeShader.d.ts +3 -3
- package/Engines/Extensions/engine.multiRender.js +1 -1
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.query.d.ts +1 -1
- package/Engines/Extensions/engine.renderTarget.d.ts +1 -1
- package/Engines/Extensions/engine.renderTarget.js +1 -1
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Native/nativeDataStream.d.ts +1 -1
- package/Engines/Native/nativeHardwareTexture.js +3 -3
- package/Engines/Native/nativeHardwareTexture.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +5 -5
- package/Engines/Native/nativePipelineContext.js +7 -7
- package/Engines/Native/nativePipelineContext.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.js +6 -6
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Processors/shaderCodeInliner.js +4 -4
- package/Engines/Processors/shaderCodeInliner.js.map +1 -1
- package/Engines/Processors/shaderProcessingOptions.d.ts +1 -1
- package/Engines/WebGL/webGLHardwareTexture.js +3 -3
- package/Engines/WebGL/webGLHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +3 -3
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheBindGroups.js +6 -6
- package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js +5 -5
- package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +11 -11
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuComputeContext.js +7 -7
- package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
- package/Engines/WebGPU/webgpuComputePipelineContext.js +4 -4
- package/Engines/WebGPU/webgpuComputePipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuDrawContext.js +7 -7
- package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +9 -9
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuMaterialContext.js +5 -5
- package/Engines/WebGPU/webgpuMaterialContext.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +10 -10
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuPipelineContext.js +6 -6
- package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js +3 -3
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessingContext.js +3 -3
- package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +3 -3
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTimestampQuery.js +3 -3
- package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
- package/Engines/engine.js +134 -134
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.js +6 -6
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +25 -25
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +25 -25
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +243 -243
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +132 -132
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/keyboardEvents.js +10 -10
- package/Events/keyboardEvents.js.map +1 -1
- package/Events/pointerEvents.js +10 -10
- package/Events/pointerEvents.js.map +1 -1
- package/Gamepads/Controllers/poseEnabledController.js +9 -9
- package/Gamepads/Controllers/poseEnabledController.js.map +1 -1
- package/Gamepads/Controllers/webVRController.js +13 -13
- package/Gamepads/Controllers/webVRController.js.map +1 -1
- package/Gamepads/gamepad.js +20 -20
- package/Gamepads/gamepad.js.map +1 -1
- package/Gizmos/axisDragGizmo.js +45 -45
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.js +12 -12
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +74 -74
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/gizmo.js +34 -34
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/gizmoManager.js +40 -40
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/planeDragGizmo.js +23 -23
- package/Gizmos/planeDragGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js +12 -12
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Gizmos/positionGizmo.js +40 -40
- package/Gizmos/positionGizmo.js.map +1 -1
- package/Gizmos/rotationGizmo.js +47 -47
- package/Gizmos/rotationGizmo.js.map +1 -1
- package/Gizmos/scaleGizmo.js +41 -41
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Helpers/environmentHelper.js +18 -18
- package/Helpers/environmentHelper.js.map +1 -1
- package/Helpers/textureDome.js +96 -96
- package/Helpers/textureDome.js.map +1 -1
- package/IAccessibilityTag.d.ts +2 -2
- package/Inputs/scene.inputManager.d.ts +4 -3
- package/Inputs/scene.inputManager.js +12 -11
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Instrumentation/engineInstrumentation.js +21 -21
- package/Instrumentation/engineInstrumentation.js.map +1 -1
- package/Instrumentation/sceneInstrumentation.js +90 -90
- package/Instrumentation/sceneInstrumentation.js.map +1 -1
- package/Layers/effectLayer.js +48 -48
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.js +32 -32
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.js +26 -26
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/layer.js +40 -40
- package/Layers/layer.js.map +1 -1
- package/LensFlares/lensFlare.js +15 -15
- package/LensFlares/lensFlare.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +4 -4
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +18 -18
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +115 -115
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/directionalLight.js +31 -31
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/light.js +72 -72
- package/Lights/light.js.map +1 -1
- package/Lights/pointLight.js +18 -18
- package/Lights/pointLight.js.map +1 -1
- package/Lights/spotLight.js +30 -30
- package/Lights/spotLight.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Materials/Background/backgroundMaterial.js +124 -124
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +8 -8
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +14 -14
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +9 -9
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +26 -26
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +34 -34
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +14 -14
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +16 -16
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.js +7 -7
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/gradientBlock.js +13 -13
- package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.js +30 -30
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +1 -1
- package/Materials/Node/nodeMaterial.js +60 -60
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.js +35 -35
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +50 -50
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.js +5 -5
- package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBRDFConfiguration.js +4 -4
- package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +53 -55
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseSimpleMaterial.js +17 -17
- package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.js +5 -5
- package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.js +5 -5
- package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
- package/Materials/PBR/pbrMaterial.js +209 -209
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrSheenConfiguration.js +5 -5
- package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js +6 -6
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.js +51 -51
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/baseTexture.js +99 -99
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +61 -61
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/externalTexture.js +16 -16
- package/Materials/Textures/externalTexture.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.js +44 -44
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.js +31 -31
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +73 -73
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.js +47 -47
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.js +6 -6
- package/Materials/Textures/rawTexture2DArray.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +142 -142
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +1 -1
- package/Materials/Textures/texture.js +26 -26
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +1 -1
- package/Materials/Textures/textureSampler.js +20 -20
- package/Materials/Textures/textureSampler.js.map +1 -1
- package/Materials/Textures/thinRenderTargetTexture.js +6 -6
- package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
- package/Materials/Textures/thinTexture.js +39 -39
- package/Materials/Textures/thinTexture.js.map +1 -1
- package/Materials/Textures/videoTexture.js +41 -41
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/drawWrapper.js +6 -6
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.js +18 -18
- package/Materials/effect.js.map +1 -1
- package/Materials/effectRenderer.js +9 -9
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/fresnelParameters.d.ts +2 -2
- package/Materials/fresnelParameters.js +13 -13
- package/Materials/fresnelParameters.js.map +1 -1
- package/Materials/material.detailMapConfiguration.js +5 -5
- package/Materials/material.detailMapConfiguration.js.map +1 -1
- package/Materials/material.js +223 -223
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginBase.js +5 -5
- package/Materials/materialPluginBase.js.map +1 -1
- package/Materials/materialPluginEvent.d.ts +14 -14
- package/Materials/materialPluginManager.d.ts +1 -1
- package/Materials/multiMaterial.js +16 -16
- package/Materials/multiMaterial.js.map +1 -1
- package/Materials/shadowDepthWrapper.js +14 -14
- package/Materials/shadowDepthWrapper.js.map +1 -1
- package/Materials/standardMaterial.js +100 -100
- package/Materials/standardMaterial.js.map +1 -1
- package/Materials/uniformBufferEffectCommonAccessor.js +3 -3
- package/Materials/uniformBufferEffectCommonAccessor.js.map +1 -1
- package/Maths/math.functions.js +2 -0
- package/Maths/math.functions.js.map +1 -1
- package/Maths/math.path.js +11 -11
- package/Maths/math.path.js.map +1 -1
- package/Maths/math.vector.d.ts +27 -7
- package/Maths/math.vector.js +75 -48
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/goldbergBuilder.d.ts +2 -2
- package/Meshes/Compression/dracoCompression.js +23 -23
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/Compression/meshoptCompression.js +9 -9
- package/Meshes/Compression/meshoptCompression.js.map +1 -1
- package/Meshes/abstractMesh.js +179 -179
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.js +32 -32
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/goldbergMesh.d.ts +1 -1
- package/Meshes/linesMesh.js +3 -3
- package/Meshes/linesMesh.js.map +1 -1
- package/Meshes/mesh.js +166 -166
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/polygonMesh.js +5 -5
- package/Meshes/polygonMesh.js.map +1 -1
- package/Meshes/subMesh.js +59 -59
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/transformNode.js +52 -52
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.d.ts +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollector.js +12 -12
- package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
- package/Misc/arrayTools.d.ts +1 -1
- package/Misc/copyTextureToTexture.js +3 -3
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/coroutine.d.ts +5 -5
- package/Misc/deferred.js +9 -9
- package/Misc/deferred.js.map +1 -1
- package/Misc/depthReducer.js +7 -7
- package/Misc/depthReducer.js.map +1 -1
- package/Misc/environmentTextureTools.d.ts +1 -1
- package/Misc/error.d.ts +1 -1
- package/Misc/fileTools.d.ts +5 -5
- package/Misc/filesInput.js +6 -6
- package/Misc/filesInput.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +9 -9
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/observable.js +12 -12
- package/Misc/observable.js.map +1 -1
- package/Misc/perfCounter.js +16 -16
- package/Misc/perfCounter.js.map +1 -1
- package/Misc/sceneOptimizer.js +76 -76
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/stringDictionary.d.ts +1 -1
- package/Misc/trajectoryClassifier.js +67 -67
- package/Misc/trajectoryClassifier.js.map +1 -1
- package/Misc/videoRecorder.js +15 -15
- package/Misc/videoRecorder.js.map +1 -1
- package/Misc/virtualJoystick.js +12 -12
- package/Misc/virtualJoystick.js.map +1 -1
- package/Morph/morphTarget.js +28 -28
- package/Morph/morphTarget.js.map +1 -1
- package/Morph/morphTargetManager.js +18 -18
- package/Morph/morphTargetManager.js.map +1 -1
- package/Offline/database.js +12 -12
- package/Offline/database.js.map +1 -1
- package/Particles/EmitterTypes/coneParticleEmitter.js +25 -25
- package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
- package/Particles/EmitterTypes/meshParticleEmitter.js +20 -20
- package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
- package/Particles/baseParticleSystem.js +232 -232
- package/Particles/baseParticleSystem.js.map +1 -1
- package/Particles/cloudPoint.js +9 -9
- package/Particles/cloudPoint.js.map +1 -1
- package/Particles/gpuParticleSystem.js +123 -123
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.js +102 -102
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/particleSystemComponent.js +5 -0
- package/Particles/particleSystemComponent.js.map +1 -1
- package/Particles/pointsCloudSystem.js +18 -18
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/solidParticle.js +23 -23
- package/Particles/solidParticle.js.map +1 -1
- package/Physics/index.d.ts +1 -0
- package/Physics/index.js +1 -0
- package/Physics/index.js.map +1 -1
- package/Physics/v1/physicsEngine.js +14 -14
- package/Physics/v1/physicsEngine.js.map +1 -1
- package/Physics/v1/physicsImpostor.js +149 -149
- package/Physics/v1/physicsImpostor.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +6 -8
- package/Physics/v2/IPhysicsEnginePlugin.js +1 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +10 -1
- package/Physics/v2/physicsBody.js +13 -1
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsConstraint.d.ts +139 -66
- package/Physics/v2/physicsConstraint.js +145 -78
- package/Physics/v2/physicsConstraint.js.map +1 -1
- package/Physics/v2/physicsEngine.js +14 -14
- package/Physics/v2/physicsEngine.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +137 -129
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +68 -68
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +6 -6
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +226 -225
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +10 -10
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
- package/PostProcesses/anaglyphPostProcess.js +7 -7
- package/PostProcesses/anaglyphPostProcess.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.js +7 -7
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/bloomEffect.js +28 -28
- package/PostProcesses/bloomEffect.js.map +1 -1
- package/PostProcesses/bloomMergePostProcess.js +7 -7
- package/PostProcesses/bloomMergePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.js +32 -32
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.js +7 -7
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.js +7 -7
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/colorCorrectionPostProcess.js +7 -7
- package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/convolutionPostProcess.js +7 -7
- package/PostProcesses/convolutionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.js +7 -7
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.js +36 -36
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.js +7 -7
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/extractHighlightsPostProcess.js +7 -7
- package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
- package/PostProcesses/filterPostProcess.js +7 -7
- package/PostProcesses/filterPostProcess.js.map +1 -1
- package/PostProcesses/grainPostProcess.js +7 -7
- package/PostProcesses/grainPostProcess.js.map +1 -1
- package/PostProcesses/imageProcessingPostProcess.js +42 -42
- package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.js +41 -41
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/passPostProcess.js +15 -15
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +2 -2
- package/PostProcesses/postProcess.js +123 -123
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/refractionPostProcess.js +21 -21
- package/PostProcesses/refractionPostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.js +7 -7
- package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.js +19 -19
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.js +7 -7
- package/PostProcesses/sharpenPostProcess.js.map +1 -1
- package/PostProcesses/stereoscopicInterlacePostProcess.js +14 -14
- package/PostProcesses/stereoscopicInterlacePostProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.js +7 -7
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +11 -11
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/PostProcesses/vrDistortionCorrectionPostProcess.js +7 -7
- package/PostProcesses/vrDistortionCorrectionPostProcess.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js +36 -36
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/depthRenderer.js +8 -8
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.js +34 -34
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js +8 -8
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js +3 -3
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js +22 -19
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +12 -12
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +18 -18
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +71 -68
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTextures.js +29 -29
- package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +173 -168
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/prePassRenderer.js +51 -51
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/renderingGroup.js +25 -25
- package/Rendering/renderingGroup.js.map +1 -1
- package/Rendering/renderingManager.js +21 -21
- package/Rendering/renderingManager.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.js +18 -18
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Rendering/utilityLayerRenderer.js +76 -76
- package/Rendering/utilityLayerRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/Shaders/fluidRenderingParticleDepth.fragment.js +5 -1
- package/Shaders/fluidRenderingParticleDepth.fragment.js.map +1 -1
- package/Shaders/fluidRenderingRender.fragment.js +7 -2
- package/Shaders/fluidRenderingRender.fragment.js.map +1 -1
- package/Shaders/geometry.fragment.d.ts +2 -0
- package/Shaders/geometry.fragment.js +5 -1
- package/Shaders/geometry.fragment.js.map +1 -1
- package/Shaders/geometry.vertex.d.ts +2 -0
- package/Shaders/geometry.vertex.js +8 -4
- package/Shaders/geometry.vertex.js.map +1 -1
- package/Sprites/sprite.js +16 -16
- package/Sprites/sprite.js.map +1 -1
- package/Sprites/spriteManager.js +81 -81
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteMap.js +32 -32
- package/Sprites/spriteMap.js.map +1 -1
- package/Sprites/spriteRenderer.js +6 -6
- package/Sprites/spriteRenderer.js.map +1 -1
- package/Sprites/thinSprite.js +22 -22
- package/Sprites/thinSprite.js.map +1 -1
- package/States/stencilStateComposer.js +10 -10
- package/States/stencilStateComposer.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.js +7 -7
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRControllerMovement.d.ts +3 -3
- package/XR/features/WebXRControllerMovement.js +97 -97
- package/XR/features/WebXRControllerMovement.js.map +1 -1
- package/XR/features/WebXRControllerPhysics.js +24 -24
- package/XR/features/WebXRControllerPhysics.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.js +26 -26
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/features/WebXRDOMOverlay.d.ts +1 -1
- package/XR/features/WebXRFeaturePointSystem.js +6 -6
- package/XR/features/WebXRFeaturePointSystem.js.map +1 -1
- package/XR/features/WebXRHandTracking.d.ts +1 -1
- package/XR/features/WebXRHandTracking.js +95 -95
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRWalkingLocomotion.js +21 -21
- package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.d.ts +3 -3
- package/XR/motionController/webXRMotionControllerManager.d.ts +1 -1
- package/XR/native/nativeXRFrame.js +3 -3
- package/XR/native/nativeXRFrame.js.map +1 -1
- package/XR/webXRFeaturesManager.d.ts +1 -1
- package/XR/webXRLayerWrapper.d.ts +2 -2
- package/XR/webXRLayerWrapper.js +17 -17
- package/XR/webXRLayerWrapper.js.map +1 -1
- package/abstractScene.d.ts +2 -2
- package/node.d.ts +1 -1
- package/node.js +71 -71
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +777 -777
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +12 -12
- package/types.d.ts +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"physicsBody.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/v2/physicsBody.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM9D;;;;GAIG;AAC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AAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC1B,yBAAyB;YACzB,IAAI,CAAC,aAAa,CAAC,kBAAkB,GAAG,CAAC,CAAC;YAC1C,kDAAkD;YAClD,IAAI,CAAC,aAAa,CAAC,kBAAkB,IAAI,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACrF,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,WAAW,CAAC,oBAAoB,CAAC;SAC3C;IACL,CAAC;IAED;;OAEG;IACI,eAAe;QAClB,OAAO;QACP,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACI,OAAO;QACV,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;;AA1Vc,gCAAoB,GAAY,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACrD,gCAAoB,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC","sourcesContent":["import type { IPhysicsEnginePluginV2, MassProperties } from \"./IPhysicsEnginePlugin\";\r\nimport type { PhysicsShape } from \"./physicsShape\";\r\nimport { Vector3, Quaternion } from \"../../Maths/math.vector\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { PhysicsEngine } from \"./physicsEngine\";\r\nimport type { Mesh, TransformNode, AbstractMesh } from \"../../Meshes\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\n/**\r\n * PhysicsBody is useful for creating a physics body that can be used in a physics engine. It allows\r\n * the user to set the mass and velocity of the body, which can then be used to calculate the\r\n * motion of the body in the physics engine.\r\n */\r\nexport class PhysicsBody {\r\n /**\r\n * V2 Physics plugin private data for single Transform\r\n */\r\n public _pluginData: any = undefined;\r\n /**\r\n * V2 Physics plugin private data for instances\r\n */\r\n public _pluginDataInstances: Array<any> = [];\r\n /**\r\n * The V2 plugin used to create and manage this Physics Body\r\n */\r\n private _physicsPlugin: IPhysicsEnginePluginV2;\r\n /**\r\n * The engine used to create and manage this Physics Body\r\n */\r\n private _physicsEngine: PhysicsEngine;\r\n /**\r\n * The transform node associated with this Physics Body\r\n */\r\n transformNode: TransformNode;\r\n /**\r\n * Disable pre-step that consists in updating Physics Body from Transform Node Translation/Orientation.\r\n * True by default for maximum performance.\r\n */\r\n disablePreStep: boolean = true;\r\n\r\n private static _DEFAULT_OBJECT_SIZE: Vector3 = new Vector3(1, 1, 1);\r\n private static _IDENTITY_QUATERNION = Quaternion.Identity();\r\n\r\n /**\r\n * Constructs a new physics body for the given node.\r\n * @param transformNode - The Transform Node to construct the physics body for.\r\n * @param scene - The scene containing the physics engine.\r\n *\r\n * This code is useful for creating a physics body for a given Transform Node in a scene.\r\n * It checks the version of the physics engine and the physics plugin, and initializes the body accordingly.\r\n * It also sets the node's rotation quaternion if it is not already set. Finally, it adds the body to the physics engine.\r\n */\r\n constructor(transformNode: TransformNode, scene: Scene) {\r\n if (!scene) {\r\n return;\r\n }\r\n const physicsEngine = scene.getPhysicsEngine() as PhysicsEngine;\r\n if (!physicsEngine) {\r\n throw new Error(\"No Physics Engine available.\");\r\n }\r\n this._physicsEngine = physicsEngine;\r\n if (physicsEngine.getPluginVersion() != 2) {\r\n throw new Error(\"Plugin version is incorrect. Expected version 2.\");\r\n }\r\n const physicsPlugin = physicsEngine.getPhysicsPlugin();\r\n if (!physicsPlugin) {\r\n throw new Error(\"No Physics Plugin available.\");\r\n }\r\n\r\n this._physicsPlugin = physicsPlugin as IPhysicsEnginePluginV2;\r\n if (!transformNode.rotationQuaternion) {\r\n transformNode.rotationQuaternion = Quaternion.FromEulerAngles(transformNode.rotation.x, transformNode.rotation.y, transformNode.rotation.z);\r\n }\r\n // instances?\r\n const m = transformNode as Mesh;\r\n if (m.hasThinInstances) {\r\n this._physicsPlugin.initBodyInstances(this, m);\r\n } else {\r\n // single instance\r\n this._physicsPlugin.initBody(this, transformNode.position, transformNode.rotationQuaternion);\r\n }\r\n this.transformNode = transformNode;\r\n transformNode.physicsBody = this;\r\n physicsEngine.addBody(this);\r\n }\r\n\r\n /**\r\n * Sets the shape of the physics body.\r\n * @param shape - The shape of the physics body.\r\n *\r\n * This method is useful for setting the shape of the physics body, which is necessary for the physics engine to accurately simulate the body's behavior.\r\n * The shape is used to calculate the body's mass, inertia, and other properties.\r\n */\r\n public setShape(shape: PhysicsShape): void {\r\n this._physicsPlugin.setShape(this, shape);\r\n }\r\n\r\n /**\r\n * Retrieves the physics shape associated with this object.\r\n *\r\n * @returns The physics shape associated with this object, or `undefined` if no\r\n * shape is associated.\r\n *\r\n * This method is useful for retrieving the physics shape associated with this object,\r\n * which can be used to apply physical forces to the object or to detect collisions.\r\n */\r\n public getShape(): PhysicsShape | undefined {\r\n return this._physicsPlugin.getShape(this);\r\n }\r\n\r\n /**\r\n * Sets the filter group of the physics body.\r\n * @param group - The filter group of the physics body.\r\n *\r\n * This method is useful for setting the filter group of the physics body.\r\n * The filter group is used to determine which bodies should collide with each other.\r\n * This allows for more control over the physics engine and can be used to create more realistic simulations.\r\n */\r\n public setFilterGroup(group: number): void {\r\n this._physicsPlugin.setFilterGroup(this, group);\r\n }\r\n\r\n /**\r\n * Gets the filter group of the physics engine.\r\n *\r\n * @returns The filter group of the physics engine.\r\n *\r\n * This method is useful for getting the filter group of the physics engine,\r\n * which is used to determine which objects will interact with each other.\r\n * This is important for creating realistic physics simulations.\r\n */\r\n public getFilterGroup(): number {\r\n return this._physicsPlugin.getFilterGroup(this);\r\n }\r\n\r\n /**\r\n * Sets the event mask for the physics engine.\r\n *\r\n * @param eventMask - A bitmask that determines which events will be sent to the physics engine.\r\n *\r\n * This method is useful for setting the event mask for the physics engine, which determines which events\r\n * will be sent to the physics engine. This allows the user to control which events the physics engine will respond to.\r\n */\r\n public setEventMask(eventMask: number): void {\r\n this._physicsPlugin.setEventMask(this, eventMask);\r\n }\r\n\r\n /**\r\n * Gets the event mask of the physics engine.\r\n *\r\n * @returns The event mask of the physics engine.\r\n *\r\n * This method is useful for getting the event mask of the physics engine,\r\n * which is used to determine which events the engine will respond to.\r\n * This is important for ensuring that the engine is responding to the correct events and not\r\n * wasting resources on unnecessary events.\r\n */\r\n public getEventMask(): number {\r\n return this._physicsPlugin.getEventMask(this);\r\n }\r\n\r\n /**\r\n * Sets the mass properties of the physics object.\r\n *\r\n * @param massProps - The mass properties to set.\r\n *\r\n * This method is useful for setting the mass properties of a physics object, such as its mass,\r\n * inertia, and center of mass. This is important for accurately simulating the physics of the object in the physics engine.\r\n */\r\n public setMassProperties(massProps: MassProperties): void {\r\n this._physicsPlugin.setMassProperties(this, massProps);\r\n }\r\n\r\n /**\r\n * Retrieves the mass properties of the object.\r\n *\r\n * @returns The mass properties of the object, or `undefined` if the physics\r\n * plugin does not support mass properties.\r\n *\r\n * This method is useful for physics simulations, as it allows the user to\r\n * retrieve the mass properties of the object, such as its mass, center of mass,\r\n * and moment of inertia. This information is necessary for accurate physics\r\n * simulations.\r\n */\r\n public getMassProperties(): MassProperties | undefined {\r\n return this._physicsPlugin.getMassProperties(this);\r\n }\r\n\r\n /**\r\n * Sets the linear damping of the physics body.\r\n *\r\n * @param damping - The linear damping value.\r\n *\r\n * This method is useful for controlling the linear damping of the physics body,\r\n * which is the rate at which the body's velocity decreases over time. This is useful for simulating\r\n * the effects of air resistance or other forms of friction.\r\n */\r\n public setLinearDamping(damping: number): void {\r\n this._physicsPlugin.setLinearDamping(this, damping);\r\n }\r\n\r\n /**\r\n * Gets the linear damping of the physics body.\r\n * @returns The linear damping of the physics body.\r\n *\r\n * This method is useful for retrieving the linear damping of the physics body, which is the amount of\r\n * resistance the body has to linear motion. This is useful for simulating realistic physics behavior\r\n * in a game.\r\n */\r\n public getLinearDamping(): number {\r\n return this._physicsPlugin.getLinearDamping(this);\r\n }\r\n\r\n /**\r\n * Sets the angular damping of the physics body.\r\n * @param damping The angular damping of the body.\r\n *\r\n * This method is useful for controlling the angular velocity of a physics body.\r\n * By setting the damping, the body's angular velocity will be reduced over time, simulating the effect of friction.\r\n * This can be used to create realistic physical behavior in a physics engine.\r\n */\r\n public setAngularDamping(damping: number): void {\r\n this._physicsPlugin.setAngularDamping(this, damping);\r\n }\r\n\r\n /**\r\n * Gets the angular damping of the physics body.\r\n *\r\n * @returns The angular damping of the physics body.\r\n *\r\n * This method is useful for getting the angular damping of the physics body,\r\n * which is the rate of reduction of the angular velocity over time.\r\n * This is important for simulating realistic physics behavior in a game.\r\n */\r\n public getAngularDamping(): number {\r\n return this._physicsPlugin.getAngularDamping(this);\r\n }\r\n\r\n /**\r\n * Sets the linear velocity of the physics object.\r\n * @param linVel - The linear velocity to set.\r\n *\r\n * This method is useful for setting the linear velocity of a physics object,\r\n * which is necessary for simulating realistic physics in a game engine.\r\n * By setting the linear velocity, the physics object will move in the direction and speed specified by the vector.\r\n * This allows for realistic physics simulations, such as simulating the motion of a ball rolling down a hill.\r\n */\r\n public setLinearVelocity(linVel: Vector3): void {\r\n this._physicsPlugin.setLinearVelocity(this, linVel);\r\n }\r\n\r\n /**\r\n * Gets the linear velocity of the physics body and stores it in the given vector3.\r\n * @param linVel - The vector3 to store the linear velocity in.\r\n *\r\n * This method is useful for getting the linear velocity of a physics body in a physics engine.\r\n * This can be used to determine the speed and direction of the body, which can be used to calculate the motion of the body.*/\r\n public getLinearVelocityToRef(linVel: Vector3): void {\r\n return this._physicsPlugin.getLinearVelocityToRef(this, linVel);\r\n }\r\n\r\n /**\r\n * Sets the angular velocity of the physics object.\r\n * @param angVel - The angular velocity to set.\r\n *\r\n * This method is useful for setting the angular velocity of a physics object, which is necessary for\r\n * simulating realistic physics behavior. The angular velocity is used to determine the rate of rotation of the object,\r\n * which is important for simulating realistic motion.\r\n */\r\n public setAngularVelocity(angVel: Vector3): void {\r\n this._physicsPlugin.setAngularVelocity(this, angVel);\r\n }\r\n\r\n /**\r\n * Gets the angular velocity of the physics body and stores it in the given vector3.\r\n * @param angVel - The vector3 to store the angular velocity in.\r\n *\r\n * This method is useful for getting the angular velocity of a physics body, which can be used to determine the body's\r\n * rotational speed. This information can be used to create realistic physics simulations.\r\n */\r\n public getAngularVelocityToRef(angVel: Vector3): void {\r\n return this._physicsPlugin.getAngularVelocityToRef(this, angVel);\r\n }\r\n\r\n /**\r\n * Applies an impulse to the physics object.\r\n *\r\n * @param location The location of the impulse.\r\n * @param impulse The impulse vector.\r\n *\r\n * This method is useful for applying an impulse to a physics object, which can be used to simulate physical forces such as gravity,\r\n * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.\r\n */\r\n public applyImpulse(location: Vector3, impulse: Vector3): void {\r\n this._physicsPlugin.applyImpulse(this, location, impulse);\r\n }\r\n\r\n /**\r\n * Applies a force to the physics object.\r\n *\r\n * @param location The location of the force.\r\n * @param force The force vector.\r\n *\r\n * This method is useful for applying a force to a physics object, which can be used to simulate physical forces such as gravity,\r\n * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.\r\n */\r\n public applyForce(location: Vector3, force: Vector3): void {\r\n this._physicsPlugin.applyForce(this, location, force);\r\n }\r\n\r\n /**\r\n * Retrieves the geometry of the body from the physics plugin.\r\n *\r\n * @returns The geometry of the body.\r\n *\r\n * This method is useful for retrieving the geometry of the body from the physics plugin, which can be used for various physics calculations.\r\n */\r\n public getGeometry(): {} {\r\n return this._physicsPlugin.getBodyGeometry(this);\r\n }\r\n\r\n /**\r\n * Register a collision callback that is called when the body collides\r\n * Filtering by body is inefficient. It's more preferable to register a collision callback for the entire world\r\n * and do the filtering on the user side.\r\n */\r\n public registerOnCollide(func: (collider: PhysicsBody, collidedAgainst: PhysicsBody, point: Nullable<Vector3>) => void): void {\r\n return this._physicsPlugin.registerOnBodyCollide(this, func);\r\n }\r\n\r\n /**\r\n * Unregister a collision callback that is called when the body collides\r\n */\r\n public unregisterOnCollide(func: (collider: PhysicsBody, collidedAgainst: PhysicsBody, point: Nullable<Vector3>) => void): void {\r\n return this._physicsPlugin.unregisterOnBodyCollide(this, func);\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 const tmAbstractMesh = this.transformNode as AbstractMesh;\r\n if (tmAbstractMesh.getBoundingInfo) {\r\n const q = this.transformNode.rotationQuaternion;\r\n const scaling = this.transformNode.scaling.clone();\r\n //reset rotation\r\n this.transformNode.rotationQuaternion = PhysicsBody._IDENTITY_QUATERNION;\r\n //calculate the world matrix with no rotation\r\n const worldMatrix = this.transformNode.computeWorldMatrix && this.transformNode.computeWorldMatrix(true);\r\n if (worldMatrix) {\r\n worldMatrix.decompose(scaling, undefined, undefined);\r\n }\r\n const boundingInfo = tmAbstractMesh.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.transformNode.rotationQuaternion = q;\r\n //calculate the world matrix with the new rotation\r\n this.transformNode.computeWorldMatrix && this.transformNode.computeWorldMatrix(true);\r\n return size;\r\n } else {\r\n return PhysicsBody._DEFAULT_OBJECT_SIZE;\r\n }\r\n }\r\n\r\n /**\r\n * return geometric center of the associated mesh\r\n */\r\n public getObjectCenter(): Vector3 {\r\n // TODO\r\n return new Vector3(0, 0, 0);\r\n }\r\n\r\n /**\r\n * Disposes the body from the physics engine.\r\n *\r\n * This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.\r\n */\r\n public dispose() {\r\n this._physicsEngine.removeBody(this);\r\n this._physicsPlugin.removeBody(this);\r\n this._physicsPlugin.disposeBody(this);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"physicsBody.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Physics/v2/physicsBody.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM9D;;;;GAIG;AACH,MAAM,OAAO,WAAW;IA8BpB;;;;;;;;OAQG;IACH,YAAY,aAA4B,EAAE,KAAY;QAtCtD;;WAEG;QACI,gBAAW,GAAQ,SAAS,CAAC;QACpC;;WAEG;QACI,yBAAoB,GAAe,EAAE,CAAC;QAa7C;;;WAGG;QACH,mBAAc,GAAY,IAAI,CAAC;QAe3B,IAAI,CAAC,KAAK,EAAE;YACR,OAAO;SACV;QACD,MAAM,aAAa,GAAG,KAAK,CAAC,gBAAgB,EAAmB,CAAC;QAChE,IAAI,CAAC,aAAa,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACnD;QACD,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,EAAE;YACvC,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;SACvE;QACD,MAAM,aAAa,GAAG,aAAa,CAAC,gBAAgB,EAAE,CAAC;QACvD,IAAI,CAAC,aAAa,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACnD;QAED,IAAI,CAAC,cAAc,GAAG,aAAuC,CAAC;QAC9D,IAAI,CAAC,aAAa,CAAC,kBAAkB,EAAE;YACnC,aAAa,CAAC,kBAAkB,GAAG,UAAU,CAAC,eAAe,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;SAC/I;QACD,aAAa;QACb,MAAM,CAA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AM,GAAG,CAAC,CAAC;IACzC,CAAC;;AAvWc,gCAAoB,GAAY,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACrD,gCAAoB,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC","sourcesContent":["import type { IPhysicsEnginePluginV2, MassProperties } from \"./IPhysicsEnginePlugin\";\r\nimport type { PhysicsShape } from \"./physicsShape\";\r\nimport { Vector3, Quaternion } from \"../../Maths/math.vector\";\r\nimport type { Scene } from \"../../scene\";\r\nimport type { PhysicsEngine } from \"./physicsEngine\";\r\nimport type { Mesh, TransformNode, AbstractMesh } from \"../../Meshes\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { PhysicsConstraint } from \"./physicsConstraint\";\r\n/**\r\n * PhysicsBody is useful for creating a physics body that can be used in a physics engine. It allows\r\n * the user to set the mass and velocity of the body, which can then be used to calculate the\r\n * motion of the body in the physics engine.\r\n */\r\nexport class PhysicsBody {\r\n /**\r\n * V2 Physics plugin private data for single Transform\r\n */\r\n public _pluginData: any = undefined;\r\n /**\r\n * V2 Physics plugin private data for instances\r\n */\r\n public _pluginDataInstances: Array<any> = [];\r\n /**\r\n * The V2 plugin used to create and manage this Physics Body\r\n */\r\n private _physicsPlugin: IPhysicsEnginePluginV2;\r\n /**\r\n * The engine used to create and manage this Physics Body\r\n */\r\n private _physicsEngine: PhysicsEngine;\r\n /**\r\n * The transform node associated with this Physics Body\r\n */\r\n transformNode: TransformNode;\r\n /**\r\n * Disable pre-step that consists in updating Physics Body from Transform Node Translation/Orientation.\r\n * True by default for maximum performance.\r\n */\r\n disablePreStep: boolean = true;\r\n\r\n private static _DEFAULT_OBJECT_SIZE: Vector3 = new Vector3(1, 1, 1);\r\n private static _IDENTITY_QUATERNION = Quaternion.Identity();\r\n\r\n /**\r\n * Constructs a new physics body for the given node.\r\n * @param transformNode - The Transform Node to construct the physics body for.\r\n * @param scene - The scene containing the physics engine.\r\n *\r\n * This code is useful for creating a physics body for a given Transform Node in a scene.\r\n * It checks the version of the physics engine and the physics plugin, and initializes the body accordingly.\r\n * It also sets the node's rotation quaternion if it is not already set. Finally, it adds the body to the physics engine.\r\n */\r\n constructor(transformNode: TransformNode, scene: Scene) {\r\n if (!scene) {\r\n return;\r\n }\r\n const physicsEngine = scene.getPhysicsEngine() as PhysicsEngine;\r\n if (!physicsEngine) {\r\n throw new Error(\"No Physics Engine available.\");\r\n }\r\n this._physicsEngine = physicsEngine;\r\n if (physicsEngine.getPluginVersion() != 2) {\r\n throw new Error(\"Plugin version is incorrect. Expected version 2.\");\r\n }\r\n const physicsPlugin = physicsEngine.getPhysicsPlugin();\r\n if (!physicsPlugin) {\r\n throw new Error(\"No Physics Plugin available.\");\r\n }\r\n\r\n this._physicsPlugin = physicsPlugin as IPhysicsEnginePluginV2;\r\n if (!transformNode.rotationQuaternion) {\r\n transformNode.rotationQuaternion = Quaternion.FromEulerAngles(transformNode.rotation.x, transformNode.rotation.y, transformNode.rotation.z);\r\n }\r\n // instances?\r\n const m = transformNode as Mesh;\r\n if (m.hasThinInstances) {\r\n this._physicsPlugin.initBodyInstances(this, m);\r\n } else {\r\n // single instance\r\n this._physicsPlugin.initBody(this, transformNode.position, transformNode.rotationQuaternion);\r\n }\r\n this.transformNode = transformNode;\r\n transformNode.physicsBody = this;\r\n physicsEngine.addBody(this);\r\n }\r\n\r\n /**\r\n * Sets the shape of the physics body.\r\n * @param shape - The shape of the physics body.\r\n *\r\n * This method is useful for setting the shape of the physics body, which is necessary for the physics engine to accurately simulate the body's behavior.\r\n * The shape is used to calculate the body's mass, inertia, and other properties.\r\n */\r\n public setShape(shape: PhysicsShape): void {\r\n this._physicsPlugin.setShape(this, shape);\r\n }\r\n\r\n /**\r\n * Retrieves the physics shape associated with this object.\r\n *\r\n * @returns The physics shape associated with this object, or `undefined` if no\r\n * shape is associated.\r\n *\r\n * This method is useful for retrieving the physics shape associated with this object,\r\n * which can be used to apply physical forces to the object or to detect collisions.\r\n */\r\n public getShape(): PhysicsShape | undefined {\r\n return this._physicsPlugin.getShape(this);\r\n }\r\n\r\n /**\r\n * Sets the filter group of the physics body.\r\n * @param group - The filter group of the physics body.\r\n *\r\n * This method is useful for setting the filter group of the physics body.\r\n * The filter group is used to determine which bodies should collide with each other.\r\n * This allows for more control over the physics engine and can be used to create more realistic simulations.\r\n */\r\n public setFilterGroup(group: number): void {\r\n this._physicsPlugin.setFilterGroup(this, group);\r\n }\r\n\r\n /**\r\n * Gets the filter group of the physics engine.\r\n *\r\n * @returns The filter group of the physics engine.\r\n *\r\n * This method is useful for getting the filter group of the physics engine,\r\n * which is used to determine which objects will interact with each other.\r\n * This is important for creating realistic physics simulations.\r\n */\r\n public getFilterGroup(): number {\r\n return this._physicsPlugin.getFilterGroup(this);\r\n }\r\n\r\n /**\r\n * Sets the event mask for the physics engine.\r\n *\r\n * @param eventMask - A bitmask that determines which events will be sent to the physics engine.\r\n *\r\n * This method is useful for setting the event mask for the physics engine, which determines which events\r\n * will be sent to the physics engine. This allows the user to control which events the physics engine will respond to.\r\n */\r\n public setEventMask(eventMask: number): void {\r\n this._physicsPlugin.setEventMask(this, eventMask);\r\n }\r\n\r\n /**\r\n * Gets the event mask of the physics engine.\r\n *\r\n * @returns The event mask of the physics engine.\r\n *\r\n * This method is useful for getting the event mask of the physics engine,\r\n * which is used to determine which events the engine will respond to.\r\n * This is important for ensuring that the engine is responding to the correct events and not\r\n * wasting resources on unnecessary events.\r\n */\r\n public getEventMask(): number {\r\n return this._physicsPlugin.getEventMask(this);\r\n }\r\n\r\n /**\r\n * Sets the mass properties of the physics object.\r\n *\r\n * @param massProps - The mass properties to set.\r\n *\r\n * This method is useful for setting the mass properties of a physics object, such as its mass,\r\n * inertia, and center of mass. This is important for accurately simulating the physics of the object in the physics engine.\r\n */\r\n public setMassProperties(massProps: MassProperties): void {\r\n this._physicsPlugin.setMassProperties(this, massProps);\r\n }\r\n\r\n /**\r\n * Retrieves the mass properties of the object.\r\n *\r\n * @returns The mass properties of the object, or `undefined` if the physics\r\n * plugin does not support mass properties.\r\n *\r\n * This method is useful for physics simulations, as it allows the user to\r\n * retrieve the mass properties of the object, such as its mass, center of mass,\r\n * and moment of inertia. This information is necessary for accurate physics\r\n * simulations.\r\n */\r\n public getMassProperties(): MassProperties | undefined {\r\n return this._physicsPlugin.getMassProperties(this);\r\n }\r\n\r\n /**\r\n * Sets the linear damping of the physics body.\r\n *\r\n * @param damping - The linear damping value.\r\n *\r\n * This method is useful for controlling the linear damping of the physics body,\r\n * which is the rate at which the body's velocity decreases over time. This is useful for simulating\r\n * the effects of air resistance or other forms of friction.\r\n */\r\n public setLinearDamping(damping: number): void {\r\n this._physicsPlugin.setLinearDamping(this, damping);\r\n }\r\n\r\n /**\r\n * Gets the linear damping of the physics body.\r\n * @returns The linear damping of the physics body.\r\n *\r\n * This method is useful for retrieving the linear damping of the physics body, which is the amount of\r\n * resistance the body has to linear motion. This is useful for simulating realistic physics behavior\r\n * in a game.\r\n */\r\n public getLinearDamping(): number {\r\n return this._physicsPlugin.getLinearDamping(this);\r\n }\r\n\r\n /**\r\n * Sets the angular damping of the physics body.\r\n * @param damping The angular damping of the body.\r\n *\r\n * This method is useful for controlling the angular velocity of a physics body.\r\n * By setting the damping, the body's angular velocity will be reduced over time, simulating the effect of friction.\r\n * This can be used to create realistic physical behavior in a physics engine.\r\n */\r\n public setAngularDamping(damping: number): void {\r\n this._physicsPlugin.setAngularDamping(this, damping);\r\n }\r\n\r\n /**\r\n * Gets the angular damping of the physics body.\r\n *\r\n * @returns The angular damping of the physics body.\r\n *\r\n * This method is useful for getting the angular damping of the physics body,\r\n * which is the rate of reduction of the angular velocity over time.\r\n * This is important for simulating realistic physics behavior in a game.\r\n */\r\n public getAngularDamping(): number {\r\n return this._physicsPlugin.getAngularDamping(this);\r\n }\r\n\r\n /**\r\n * Sets the linear velocity of the physics object.\r\n * @param linVel - The linear velocity to set.\r\n *\r\n * This method is useful for setting the linear velocity of a physics object,\r\n * which is necessary for simulating realistic physics in a game engine.\r\n * By setting the linear velocity, the physics object will move in the direction and speed specified by the vector.\r\n * This allows for realistic physics simulations, such as simulating the motion of a ball rolling down a hill.\r\n */\r\n public setLinearVelocity(linVel: Vector3): void {\r\n this._physicsPlugin.setLinearVelocity(this, linVel);\r\n }\r\n\r\n /**\r\n * Gets the linear velocity of the physics body and stores it in the given vector3.\r\n * @param linVel - The vector3 to store the linear velocity in.\r\n *\r\n * This method is useful for getting the linear velocity of a physics body in a physics engine.\r\n * This can be used to determine the speed and direction of the body, which can be used to calculate the motion of the body.*/\r\n public getLinearVelocityToRef(linVel: Vector3): void {\r\n return this._physicsPlugin.getLinearVelocityToRef(this, linVel);\r\n }\r\n\r\n /**\r\n * Sets the angular velocity of the physics object.\r\n * @param angVel - The angular velocity to set.\r\n *\r\n * This method is useful for setting the angular velocity of a physics object, which is necessary for\r\n * simulating realistic physics behavior. The angular velocity is used to determine the rate of rotation of the object,\r\n * which is important for simulating realistic motion.\r\n */\r\n public setAngularVelocity(angVel: Vector3): void {\r\n this._physicsPlugin.setAngularVelocity(this, angVel);\r\n }\r\n\r\n /**\r\n * Gets the angular velocity of the physics body and stores it in the given vector3.\r\n * @param angVel - The vector3 to store the angular velocity in.\r\n *\r\n * This method is useful for getting the angular velocity of a physics body, which can be used to determine the body's\r\n * rotational speed. This information can be used to create realistic physics simulations.\r\n */\r\n public getAngularVelocityToRef(angVel: Vector3): void {\r\n return this._physicsPlugin.getAngularVelocityToRef(this, angVel);\r\n }\r\n\r\n /**\r\n * Applies an impulse to the physics object.\r\n *\r\n * @param location The location of the impulse.\r\n * @param impulse The impulse vector.\r\n *\r\n * This method is useful for applying an impulse to a physics object, which can be used to simulate physical forces such as gravity,\r\n * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.\r\n */\r\n public applyImpulse(location: Vector3, impulse: Vector3): void {\r\n this._physicsPlugin.applyImpulse(this, location, impulse);\r\n }\r\n\r\n /**\r\n * Applies a force to the physics object.\r\n *\r\n * @param location The location of the force.\r\n * @param force The force vector.\r\n *\r\n * This method is useful for applying a force to a physics object, which can be used to simulate physical forces such as gravity,\r\n * collisions, and explosions. This can be used to create realistic physics simulations in a game or other application.\r\n */\r\n public applyForce(location: Vector3, force: Vector3): void {\r\n this._physicsPlugin.applyForce(this, location, force);\r\n }\r\n\r\n /**\r\n * Retrieves the geometry of the body from the physics plugin.\r\n *\r\n * @returns The geometry of the body.\r\n *\r\n * This method is useful for retrieving the geometry of the body from the physics plugin, which can be used for various physics calculations.\r\n */\r\n public getGeometry(): {} {\r\n return this._physicsPlugin.getBodyGeometry(this);\r\n }\r\n\r\n /**\r\n * Register a collision callback that is called when the body collides\r\n * Filtering by body is inefficient. It's more preferable to register a collision callback for the entire world\r\n * and do the filtering on the user side.\r\n */\r\n public registerOnCollide(func: (collider: PhysicsBody, collidedAgainst: PhysicsBody, point: Nullable<Vector3>) => void): void {\r\n return this._physicsPlugin.registerOnBodyCollide(this, func);\r\n }\r\n\r\n /**\r\n * Unregister a collision callback that is called when the body collides\r\n */\r\n public unregisterOnCollide(func: (collider: PhysicsBody, collidedAgainst: PhysicsBody, point: Nullable<Vector3>) => void): void {\r\n return this._physicsPlugin.unregisterOnBodyCollide(this, func);\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 const tmAbstractMesh = this.transformNode as AbstractMesh;\r\n if (tmAbstractMesh.getBoundingInfo) {\r\n const q = this.transformNode.rotationQuaternion;\r\n const scaling = this.transformNode.scaling.clone();\r\n //reset rotation\r\n this.transformNode.rotationQuaternion = PhysicsBody._IDENTITY_QUATERNION;\r\n //calculate the world matrix with no rotation\r\n const worldMatrix = this.transformNode.computeWorldMatrix && this.transformNode.computeWorldMatrix(true);\r\n if (worldMatrix) {\r\n worldMatrix.decompose(scaling, undefined, undefined);\r\n }\r\n const boundingInfo = tmAbstractMesh.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.transformNode.rotationQuaternion = q;\r\n //calculate the world matrix with the new rotation\r\n this.transformNode.computeWorldMatrix && this.transformNode.computeWorldMatrix(true);\r\n return size;\r\n } else {\r\n return PhysicsBody._DEFAULT_OBJECT_SIZE;\r\n }\r\n }\r\n\r\n /**\r\n * @returns geometric center of the associated mesh\r\n */\r\n public getObjectCenter(): Vector3 {\r\n // TODO\r\n return new Vector3(0, 0, 0);\r\n }\r\n\r\n /**\r\n * Adds a constraint to the physics engine.\r\n *\r\n * @param childBody - The body to which the constraint will be applied.\r\n * @param constraint - The constraint to be applied.\r\n *\r\n */\r\n public addConstraint(childBody: PhysicsBody, constraint: PhysicsConstraint): void {\r\n this._physicsPlugin.addConstraint(this, childBody, constraint);\r\n }\r\n\r\n /**\r\n * Disposes the body from the physics engine.\r\n *\r\n * This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.\r\n */\r\n public dispose() {\r\n this._physicsEngine.removeBody(this);\r\n this._physicsPlugin.removeBody(this);\r\n this._physicsPlugin.disposeBody(this);\r\n this._pluginData = null;\r\n this._pluginDataInstances.length = 0;\r\n }\r\n}\r\n"]}
|
|
@@ -2,7 +2,6 @@ import type { Scene } from "../../scene";
|
|
|
2
2
|
import type { Vector3 } from "../../Maths/math.vector";
|
|
3
3
|
import type { IPhysicsEnginePluginV2, ConstraintAxis, PhysicsConstraintParameters, ConstraintAxisLimitMode, ConstraintMotorType } from "./IPhysicsEnginePlugin";
|
|
4
4
|
import { ConstraintType } from "./IPhysicsEnginePlugin";
|
|
5
|
-
import type { PhysicsBody } from "./physicsBody";
|
|
6
5
|
/**
|
|
7
6
|
* This is a holder class for the physics constraint created by the physics plugin
|
|
8
7
|
* It holds a set of functions to control the underlying constraint
|
|
@@ -17,6 +16,8 @@ export declare class PhysicsConstraint {
|
|
|
17
16
|
* The V2 plugin used to create and manage this Physics Body
|
|
18
17
|
*/
|
|
19
18
|
protected _physicsPlugin: IPhysicsEnginePluginV2;
|
|
19
|
+
protected _options: PhysicsConstraintParameters;
|
|
20
|
+
protected _type: ConstraintType;
|
|
20
21
|
/**
|
|
21
22
|
* Constructs a new constraint for the physics constraint.
|
|
22
23
|
* @param type The type of constraint to create.
|
|
@@ -28,176 +29,248 @@ export declare class PhysicsConstraint {
|
|
|
28
29
|
*/
|
|
29
30
|
constructor(type: ConstraintType, options: PhysicsConstraintParameters, scene: Scene);
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
-
* @param body - The parent body to set.
|
|
32
|
+
* Gets the type of the constraint.
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
* This allows the engine to accurately simulate the motion of the body in relation to its parent body.
|
|
36
|
-
* For example, if the parent body is a planet, the engine can accurately simulate the motion of the body in relation to the planet's gravity.
|
|
37
|
-
*/
|
|
38
|
-
setParentBody(body: PhysicsBody): void;
|
|
39
|
-
/**
|
|
40
|
-
* Retrieves the parent body of the current physics constraint.
|
|
34
|
+
* @returns The type of the constraint.
|
|
41
35
|
*
|
|
42
|
-
* @returns The parent body of the current physics constraint, or `undefined` if the
|
|
43
|
-
* current constraint does not have a parent body.
|
|
44
36
|
*/
|
|
45
|
-
|
|
37
|
+
getType(): ConstraintType;
|
|
46
38
|
/**
|
|
47
|
-
*
|
|
39
|
+
* Retrieves the options of the physics constraint.
|
|
48
40
|
*
|
|
49
|
-
* @
|
|
41
|
+
* @returns The physics constraint parameters.
|
|
50
42
|
*
|
|
51
|
-
* This method is useful for setting the child body of the current body in a physics engine.
|
|
52
|
-
* This allows for the creation of complex structures of bodies that interact with each other in a realistic way.
|
|
53
43
|
*/
|
|
54
|
-
|
|
44
|
+
getOptions(): PhysicsConstraintParameters;
|
|
55
45
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* @returns The child body of the current physics constraint, or `undefined` if no
|
|
59
|
-
* child body is present.
|
|
60
|
-
*/
|
|
61
|
-
getChildBody(): PhysicsBody | undefined;
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
* @param pivot +
|
|
65
|
-
* @param axisX
|
|
66
|
-
* @param axisY
|
|
67
|
-
*/
|
|
68
|
-
setAnchorInParent(pivot: Vector3, axisX: Vector3, axisY: Vector3): void;
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* @param pivot
|
|
72
|
-
* @param axisX
|
|
73
|
-
* @param axisY
|
|
74
|
-
*/
|
|
75
|
-
setAnchorInChild(pivot: Vector3, axisX: Vector3, axisY: Vector3): void;
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
* @param isEnabled
|
|
46
|
+
* Enable/disable the constraint
|
|
47
|
+
* @param isEnabled value for the constraint
|
|
79
48
|
*/
|
|
80
49
|
setEnabled(isEnabled: boolean): void;
|
|
81
50
|
/**
|
|
82
51
|
*
|
|
83
|
-
* @returns
|
|
52
|
+
* @returns true if constraint is enabled
|
|
84
53
|
*/
|
|
85
54
|
getEnabled(): boolean;
|
|
86
55
|
/**
|
|
56
|
+
* Enables or disables collisions for the physics engine.
|
|
57
|
+
*
|
|
58
|
+
* @param isEnabled - A boolean value indicating whether collisions should be enabled or disabled.
|
|
87
59
|
*
|
|
88
|
-
* @param isEnabled
|
|
89
60
|
*/
|
|
90
61
|
setCollisionsEnabled(isEnabled: boolean): void;
|
|
91
62
|
/**
|
|
63
|
+
* Gets whether collisions are enabled for this physics object.
|
|
64
|
+
*
|
|
65
|
+
* @returns `true` if collisions are enabled, `false` otherwise.
|
|
92
66
|
*
|
|
93
|
-
* @returns
|
|
94
67
|
*/
|
|
95
68
|
getCollisionsEnabled(): boolean;
|
|
96
69
|
/**
|
|
70
|
+
* Sets the friction of the given axis of the physics engine.
|
|
71
|
+
* @param axis - The axis of the physics engine to set the friction for.
|
|
72
|
+
* @param friction - The friction to set for the given axis.
|
|
97
73
|
*
|
|
98
|
-
* @param axis
|
|
99
|
-
* @param friction
|
|
100
74
|
*/
|
|
101
75
|
setAxisFriction(axis: ConstraintAxis, friction: number): void;
|
|
102
76
|
/**
|
|
77
|
+
* Gets the friction of the given axis of the physics engine.
|
|
78
|
+
* @param axis - The axis of the physics engine.
|
|
79
|
+
* @returns The friction of the given axis.
|
|
103
80
|
*
|
|
104
|
-
* @param axis
|
|
105
|
-
* @returns
|
|
106
81
|
*/
|
|
107
82
|
getAxisFriction(axis: ConstraintAxis): number;
|
|
108
83
|
/**
|
|
84
|
+
* Sets the limit mode for the given axis of the constraint.
|
|
85
|
+
* @param axis The axis to set the limit mode for.
|
|
86
|
+
* @param limitMode The limit mode to set.
|
|
109
87
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
88
|
+
* This method is useful for setting the limit mode for a given axis of the constraint. This is important for
|
|
89
|
+
* controlling the behavior of the physics engine when the constraint is reached. By setting the limit mode,
|
|
90
|
+
* the engine can be configured to either stop the motion of the objects, or to allow them to continue
|
|
91
|
+
* moving beyond the constraint.
|
|
112
92
|
*/
|
|
113
93
|
setAxisMode(axis: ConstraintAxis, limitMode: ConstraintAxisLimitMode): void;
|
|
114
94
|
/**
|
|
95
|
+
* Gets the limit mode of the given axis of the constraint.
|
|
96
|
+
*
|
|
97
|
+
* @param axis - The axis of the constraint.
|
|
98
|
+
* @returns The limit mode of the given axis.
|
|
115
99
|
*
|
|
116
|
-
* @param axis
|
|
117
100
|
*/
|
|
118
101
|
getAxisMode(axis: ConstraintAxis): ConstraintAxisLimitMode;
|
|
119
102
|
/**
|
|
103
|
+
* Sets the minimum limit of a given axis of a constraint.
|
|
104
|
+
* @param axis - The axis of the constraint.
|
|
105
|
+
* @param minLimit - The minimum limit of the axis.
|
|
120
106
|
*
|
|
121
107
|
*/
|
|
122
108
|
setAxisMinLimit(axis: ConstraintAxis, minLimit: number): void;
|
|
123
109
|
/**
|
|
110
|
+
* Gets the minimum limit of the given axis of the physics engine.
|
|
111
|
+
* @param axis - The axis of the physics engine.
|
|
112
|
+
* @returns The minimum limit of the given axis.
|
|
124
113
|
*
|
|
125
114
|
*/
|
|
126
115
|
getAxisMinLimit(axis: ConstraintAxis): number;
|
|
127
116
|
/**
|
|
117
|
+
* Sets the maximum limit of the given axis for the physics engine.
|
|
118
|
+
* @param axis - The axis to set the limit for.
|
|
119
|
+
* @param limit - The maximum limit of the axis.
|
|
128
120
|
*
|
|
121
|
+
* This method is useful for setting the maximum limit of the given axis for the physics engine,
|
|
122
|
+
* which can be used to control the movement of the physics object. This helps to ensure that the
|
|
123
|
+
* physics object does not move beyond the given limit.
|
|
129
124
|
*/
|
|
130
125
|
setAxisMaxLimit(axis: ConstraintAxis, limit: number): void;
|
|
131
126
|
/**
|
|
127
|
+
* Gets the maximum limit of the given axis of the physics engine.
|
|
128
|
+
* @param axis - The axis of the physics engine.
|
|
129
|
+
* @returns The maximum limit of the given axis.
|
|
132
130
|
*
|
|
133
131
|
*/
|
|
134
132
|
getAxisMaxLimit(axis: ConstraintAxis): number;
|
|
135
133
|
/**
|
|
134
|
+
* Sets the motor type of the given axis of the constraint.
|
|
135
|
+
* @param axis - The axis of the constraint.
|
|
136
|
+
* @param motorType - The type of motor to use.
|
|
137
|
+
* @returns void
|
|
136
138
|
*
|
|
137
139
|
*/
|
|
138
140
|
setAxisMotorType(axis: ConstraintAxis, motorType: ConstraintMotorType): void;
|
|
139
141
|
/**
|
|
142
|
+
* Gets the motor type of the specified axis of the constraint.
|
|
143
|
+
*
|
|
144
|
+
* @param axis - The axis of the constraint.
|
|
145
|
+
* @returns The motor type of the specified axis.
|
|
140
146
|
*
|
|
141
147
|
*/
|
|
142
148
|
getAxisMotorType(axis: ConstraintAxis): ConstraintMotorType;
|
|
143
149
|
/**
|
|
150
|
+
* Sets the target velocity of the motor associated with the given axis of the constraint.
|
|
151
|
+
* @param axis - The axis of the constraint.
|
|
152
|
+
* @param target - The target velocity of the motor.
|
|
144
153
|
*
|
|
154
|
+
* This method is useful for setting the target velocity of the motor associated with the given axis of the constraint.
|
|
145
155
|
*/
|
|
146
156
|
setAxisMotorTarget(axis: ConstraintAxis, target: number): void;
|
|
147
157
|
/**
|
|
158
|
+
* Gets the target velocity of the motor associated to the given constraint axis.
|
|
159
|
+
* @param axis - The constraint axis associated to the motor.
|
|
160
|
+
* @returns The target velocity of the motor.
|
|
148
161
|
*
|
|
149
162
|
*/
|
|
150
163
|
getAxisMotorTarget(axis: ConstraintAxis): number;
|
|
151
164
|
/**
|
|
165
|
+
* Sets the maximum force of the motor of the given axis of the constraint.
|
|
166
|
+
* @param axis - The axis of the constraint.
|
|
167
|
+
* @param maxForce - The maximum force of the motor.
|
|
152
168
|
*
|
|
153
169
|
*/
|
|
154
170
|
setAxisMotorMaxForce(axis: ConstraintAxis, maxForce: number): void;
|
|
155
171
|
/**
|
|
172
|
+
* Gets the maximum force of the motor of the given axis of the constraint.
|
|
173
|
+
* @param axis - The axis of the constraint.
|
|
174
|
+
* @returns The maximum force of the motor.
|
|
156
175
|
*
|
|
157
176
|
*/
|
|
158
177
|
getAxisMotorMaxForce(axis: ConstraintAxis): number;
|
|
159
178
|
/**
|
|
179
|
+
* Disposes the constraint from the physics engine.
|
|
160
180
|
*
|
|
181
|
+
* This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.
|
|
161
182
|
*/
|
|
162
183
|
dispose(): void;
|
|
163
184
|
}
|
|
164
185
|
/**
|
|
186
|
+
* Represents a Ball and Socket Constraint, used to simulate a joint
|
|
165
187
|
*
|
|
188
|
+
* @param pivotA - The first pivot, defined locally in the first body frame
|
|
189
|
+
* @param pivotB - The second pivot, defined locally in the second body frame
|
|
190
|
+
* @param axisA - The axis of the first body
|
|
191
|
+
* @param axisB - The axis of the second body
|
|
192
|
+
* @param scene - The scene the constraint is applied to
|
|
193
|
+
* @returns The Ball and Socket Constraint
|
|
194
|
+
*
|
|
195
|
+
* This class is useful for simulating a joint between two bodies in a physics engine.
|
|
196
|
+
* It allows for the two bodies to move relative to each other in a way that mimics a ball and socket joint, such as a shoulder or hip joint.
|
|
166
197
|
*/
|
|
167
|
-
|
|
168
|
-
export declare class PhysicsConstraintBallAndSocket extends PhysicsConstraint {
|
|
169
|
-
/** @internal */
|
|
198
|
+
export declare class BallAndSocketConstraint extends PhysicsConstraint {
|
|
170
199
|
constructor(pivotA: Vector3, pivotB: Vector3, axisA: Vector3, axisB: Vector3, scene: Scene);
|
|
171
200
|
}
|
|
172
201
|
/**
|
|
202
|
+
* Creates a distance constraint.
|
|
203
|
+
* @param maxDistance distance between bodies
|
|
204
|
+
* @param scene The scene the constraint belongs to
|
|
205
|
+
* @returns DistanceConstraint
|
|
206
|
+
*
|
|
207
|
+
* This code is useful for creating a distance constraint in a physics engine.
|
|
208
|
+
* A distance constraint is a type of constraint that keeps two objects at a certain distance from each other.
|
|
209
|
+
* The scene is used to add the constraint to the physics engine.
|
|
210
|
+
*/
|
|
211
|
+
export declare class DistanceConstraint extends PhysicsConstraint {
|
|
212
|
+
constructor(maxDistance: number, scene: Scene);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Creates a HingeConstraint, which is a type of PhysicsConstraint.
|
|
216
|
+
*
|
|
217
|
+
* @param pivotA - The first pivot point, in world space.
|
|
218
|
+
* @param pivotB - The second pivot point, in world space.
|
|
219
|
+
* @param scene - The scene the constraint is used in.
|
|
220
|
+
* @returns The new HingeConstraint.
|
|
173
221
|
*
|
|
222
|
+
* This code is useful for creating a HingeConstraint, which is a type of PhysicsConstraint.
|
|
223
|
+
* This constraint is used to simulate a hinge joint between two rigid bodies, allowing them to rotate around a single axis.
|
|
174
224
|
*/
|
|
175
|
-
|
|
176
|
-
export declare class PhysicsConstraintDistance extends PhysicsConstraint {
|
|
177
|
-
/** @internal */
|
|
225
|
+
export declare class HingeConstraint extends PhysicsConstraint {
|
|
178
226
|
constructor(pivotA: Vector3, pivotB: Vector3, axisA: Vector3, axisB: Vector3, scene: Scene);
|
|
179
227
|
}
|
|
180
228
|
/**
|
|
229
|
+
* Creates a SliderConstraint, which is a type of PhysicsConstraint.
|
|
181
230
|
*
|
|
231
|
+
* @param pivotA - The first pivot of the constraint, in world space.
|
|
232
|
+
* @param pivotB - The second pivot of the constraint, in world space.
|
|
233
|
+
* @param axisA - The first axis of the constraint, in world space.
|
|
234
|
+
* @param axisB - The second axis of the constraint, in world space.
|
|
235
|
+
* @param scene - The scene the constraint belongs to.
|
|
236
|
+
* @returns The created SliderConstraint.
|
|
237
|
+
*
|
|
238
|
+
* This code is useful for creating a SliderConstraint, which is a type of PhysicsConstraint.
|
|
239
|
+
* It allows the user to specify the two pivots and two axes of the constraint in world space, as well as the scene the constraint belongs to.
|
|
240
|
+
* This is useful for creating a constraint between two rigid bodies that allows them to move along a certain axis.
|
|
182
241
|
*/
|
|
183
|
-
|
|
184
|
-
export declare class PhysicsConstraintHinge extends PhysicsConstraint {
|
|
185
|
-
/** @internal */
|
|
242
|
+
export declare class SliderConstraint extends PhysicsConstraint {
|
|
186
243
|
constructor(pivotA: Vector3, pivotB: Vector3, axisA: Vector3, axisB: Vector3, scene: Scene);
|
|
187
244
|
}
|
|
188
245
|
/**
|
|
246
|
+
* Creates a LockConstraint, which is a type of PhysicsConstraint.
|
|
247
|
+
*
|
|
248
|
+
* @param pivotA - The first pivot of the constraint in local space.
|
|
249
|
+
* @param pivotB - The second pivot of the constraint in local space.
|
|
250
|
+
* @param axisA - The first axis of the constraint in local space.
|
|
251
|
+
* @param axisB - The second axis of the constraint in local space.
|
|
252
|
+
* @param scene - The scene the constraint belongs to.
|
|
253
|
+
* @returns The created LockConstraint.
|
|
189
254
|
*
|
|
255
|
+
* This code is useful for creating a LockConstraint, which is a type of PhysicsConstraint.
|
|
256
|
+
* It takes in two pivots and two axes in local space, as well as the scene the constraint belongs to, and creates a LockConstraint.
|
|
190
257
|
*/
|
|
191
|
-
|
|
192
|
-
export declare class PhysicsConstraintSlider extends PhysicsConstraint {
|
|
193
|
-
/** @internal */
|
|
258
|
+
export declare class LockConstraint extends PhysicsConstraint {
|
|
194
259
|
constructor(pivotA: Vector3, pivotB: Vector3, axisA: Vector3, axisB: Vector3, scene: Scene);
|
|
195
260
|
}
|
|
196
261
|
/**
|
|
262
|
+
* Creates a PrismaticConstraint, which is a type of PhysicsConstraint.
|
|
263
|
+
*
|
|
264
|
+
* @param pivotA - The first pivot of the constraint in local space.
|
|
265
|
+
* @param pivotB - The second pivot of the constraint in local space.
|
|
266
|
+
* @param axisA - The first axis of the constraint in local space.
|
|
267
|
+
* @param axisB - The second axis of the constraint in local space.
|
|
268
|
+
* @param scene - The scene the constraint belongs to.
|
|
269
|
+
* @returns The created LockConstraint.
|
|
197
270
|
*
|
|
271
|
+
* This code is useful for creating a PrismaticConstraint, which is a type of PhysicsConstraint.
|
|
272
|
+
* It takes in two pivots and two axes in local space, as well as the scene the constraint belongs to, and creates a PrismaticConstraint.
|
|
198
273
|
*/
|
|
199
|
-
|
|
200
|
-
export declare class PhysicsConstraintLock extends PhysicsConstraint {
|
|
201
|
-
/** @internal */
|
|
274
|
+
export declare class PrismaticConstraint extends PhysicsConstraint {
|
|
202
275
|
constructor(pivotA: Vector3, pivotB: Vector3, axisA: Vector3, axisB: Vector3, scene: Scene);
|
|
203
276
|
}
|