@babylonjs/core 7.3.1 → 7.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Actions/condition.js.map +1 -1
- package/Actions/directActions.js.map +1 -1
- package/Actions/directAudioActions.js.map +1 -1
- package/Actions/interpolateValueAction.js.map +1 -1
- package/Animations/easing.js.map +1 -1
- package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
- package/Bones/bone.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphArcRotateCamera.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphFreeCamera.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphGamepadCamera.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphUniversalCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicFreeCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicGamepadCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.js.map +1 -1
- package/Cameras/VR/vrDeviceOrientationArcRotateCamera.js.map +1 -1
- package/Cameras/VR/vrDeviceOrientationFreeCamera.js.map +1 -1
- package/Cameras/VR/vrDeviceOrientationGamepadCamera.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.js.map +1 -1
- package/Cameras/deviceOrientationCamera.js.map +1 -1
- package/Cameras/flyCamera.js.map +1 -1
- package/Cameras/followCamera.js.map +1 -1
- package/Cameras/freeCamera.js.map +1 -1
- package/Cameras/freeCameraInputsManager.js.map +1 -1
- package/Cameras/gamepadCamera.js.map +1 -1
- package/Cameras/targetCamera.js.map +1 -1
- package/Cameras/touchCamera.js.map +1 -1
- package/Cameras/universalCamera.js.map +1 -1
- package/Cameras/virtualJoysticksCamera.js.map +1 -1
- package/Compute/computeEffect.js +4 -4
- package/Compute/computeEffect.js.map +1 -1
- package/Debug/boneAxesViewer.js.map +1 -1
- package/Engines/IPipelineContext.d.ts +3 -0
- package/Engines/IPipelineContext.js.map +1 -1
- package/Engines/Native/nativePipelineContext.d.ts +2 -0
- package/Engines/Native/nativePipelineContext.js +3 -0
- package/Engines/Native/nativePipelineContext.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Processors/Expressions/Operators/shaderDefineAndOperator.js.map +1 -1
- package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js.map +1 -1
- package/Engines/Processors/Expressions/Operators/shaderDefineIsDefinedOperator.js.map +1 -1
- package/Engines/Processors/Expressions/Operators/shaderDefineOrOperator.js.map +1 -1
- package/Engines/Processors/iShaderProcessor.d.ts +3 -2
- package/Engines/Processors/iShaderProcessor.js.map +1 -1
- package/Engines/Processors/shaderCodeConditionNode.js.map +1 -1
- package/Engines/Processors/shaderCodeTestNode.js.map +1 -1
- package/Engines/Processors/shaderProcessor.d.ts +15 -23
- package/Engines/Processors/shaderProcessor.js +332 -320
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGLPipelineContext.d.ts +2 -0
- package/Engines/WebGL/webGLPipelineContext.js +3 -0
- package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGL/webGLShaderProcessors.d.ts +3 -2
- package/Engines/WebGL/webGLShaderProcessors.js +2 -2
- package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +10 -10
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js.map +1 -1
- package/Engines/WebGPU/webgpuDepthCullingState.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.d.ts +2 -0
- package/Engines/WebGPU/webgpuHardwareTexture.js +2 -0
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuPipelineContext.d.ts +2 -0
- package/Engines/WebGPU/webgpuPipelineContext.js +3 -0
- package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.d.ts +3 -2
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +2 -4
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuStencilStateComposer.js.map +1 -1
- package/Engines/abstractEngine.d.ts +10 -5
- package/Engines/abstractEngine.functions.d.ts +38 -0
- package/Engines/abstractEngine.functions.js +75 -0
- package/Engines/abstractEngine.functions.js.map +1 -0
- package/Engines/abstractEngine.js +34 -14
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +2 -0
- package/Engines/constants.js +2 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +0 -8
- package/Engines/engine.js +0 -28
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +11 -6
- package/Engines/thinEngine.functions.d.ts +96 -0
- package/Engines/thinEngine.functions.js +249 -0
- package/Engines/thinEngine.functions.js.map +1 -0
- package/Engines/thinEngine.js +50 -129
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +5 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/keyboardEvents.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/Gamepads/dualShockGamepad.js.map +1 -1
- package/Gamepads/gamepad.js.map +1 -1
- package/Gamepads/xboxGamepad.js.map +1 -1
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/cameraGizmo.js.map +1 -1
- package/Gizmos/lightGizmo.js.map +1 -1
- package/Gizmos/planeDragGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Gizmos/positionGizmo.js.map +1 -1
- package/Gizmos/rotationGizmo.js.map +1 -1
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Helpers/photoDome.js.map +1 -1
- package/Helpers/textureDome.js.map +1 -1
- package/Helpers/videoDome.js.map +1 -1
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/hemisphericLight.js.map +1 -1
- package/Lights/light.js.map +1 -1
- package/Lights/pointLight.js.map +1 -1
- package/Lights/shadowLight.js.map +1 -1
- package/Lights/spotLight.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +3 -3
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/derivativeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/discardBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/shadowMapBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/twirlBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/addBlock.js.map +1 -1
- package/Materials/Node/Blocks/arcTan2Block.js.map +1 -1
- package/Materials/Node/Blocks/biPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/clampBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorSplitterBlock.js.map +1 -1
- package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
- package/Materials/Node/Blocks/crossBlock.js.map +1 -1
- package/Materials/Node/Blocks/curveBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/desaturateBlock.js.map +1 -1
- package/Materials/Node/Blocks/distanceBlock.js.map +1 -1
- package/Materials/Node/Blocks/divideBlock.js.map +1 -1
- package/Materials/Node/Blocks/dotBlock.js.map +1 -1
- package/Materials/Node/Blocks/elbowBlock.js.map +1 -1
- package/Materials/Node/Blocks/fresnelBlock.js.map +1 -1
- package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
- package/Materials/Node/Blocks/lengthBlock.js.map +1 -1
- package/Materials/Node/Blocks/lerpBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixDeterminantBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixTransposeBlock.js.map +1 -1
- package/Materials/Node/Blocks/maxBlock.js.map +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
- package/Materials/Node/Blocks/minBlock.js.map +1 -1
- package/Materials/Node/Blocks/modBlock.js.map +1 -1
- package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/nLerpBlock.js.map +1 -1
- package/Materials/Node/Blocks/negateBlock.js.map +1 -1
- package/Materials/Node/Blocks/normalBlendBlock.js.map +1 -1
- package/Materials/Node/Blocks/normalizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/oneMinusBlock.js.map +1 -1
- package/Materials/Node/Blocks/posterizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/powBlock.js.map +1 -1
- package/Materials/Node/Blocks/randomNumberBlock.js.map +1 -1
- package/Materials/Node/Blocks/reciprocalBlock.js.map +1 -1
- package/Materials/Node/Blocks/reflectBlock.js.map +1 -1
- package/Materials/Node/Blocks/refractBlock.js.map +1 -1
- package/Materials/Node/Blocks/remapBlock.js.map +1 -1
- package/Materials/Node/Blocks/replaceColorBlock.js.map +1 -1
- package/Materials/Node/Blocks/rotate2dBlock.js.map +1 -1
- package/Materials/Node/Blocks/scaleBlock.js.map +1 -1
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
- package/Materials/Node/Blocks/smoothStepBlock.js.map +1 -1
- package/Materials/Node/Blocks/stepBlock.js.map +1 -1
- package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
- package/Materials/Node/Blocks/transformBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/trigonometryBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorSplitterBlock.js.map +1 -1
- package/Materials/Node/Blocks/viewDirectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/voronoiNoiseBlock.js.map +1 -1
- package/Materials/Node/Blocks/waveBlock.js.map +1 -1
- package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialConnectionPointCustomObject.js.map +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/MultiviewRenderTarget.js.map +1 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/noiseProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.d.ts +9 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +16 -0
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/colorGradingTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/dynamicTexture.js.map +1 -1
- package/Materials/Textures/equiRectangularCubeTexture.js +1 -1
- package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/prePassRenderTarget.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/Textures/refractionTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/effect.d.ts +11 -6
- package/Materials/effect.functions.d.ts +86 -0
- package/Materials/effect.functions.js +185 -0
- package/Materials/effect.functions.js.map +1 -0
- package/Materials/effect.js +94 -153
- package/Materials/effect.js.map +1 -1
- package/Materials/effect.webgl.functions.d.ts +13 -0
- package/Materials/effect.webgl.functions.js +83 -0
- package/Materials/effect.webgl.functions.js.map +1 -0
- package/Materials/material.decalMapConfiguration.js.map +1 -1
- package/Materials/material.detailMapConfiguration.js.map +1 -1
- package/Materials/materialPluginManager.js +2 -2
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/meshDebugPluginMaterial.js.map +1 -1
- package/Materials/multiMaterial.js.map +1 -1
- package/Materials/pushMaterial.js.map +1 -1
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/Compression/dracoCompressionWorker.d.ts +1 -1
- package/Meshes/Compression/dracoCompressionWorker.js +21 -10
- package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateLinearBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateRadialBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Matrices/alignBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Matrices/rotationXBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Matrices/rotationYBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Matrices/rotationZBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Matrices/scalingBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Matrices/translationBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/nullBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/boundingBlock.js.map +1 -1
- package/Meshes/Node/Blocks/computeNormalsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/debugBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryArcTan2Block.js.map +1 -1
- package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCrossBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryDesaturateBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryDistanceBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryDotBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryElbowBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryInfoBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryLengthBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryLerpBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryModBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryNLerpBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOutputBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryPosterizeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryPowBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryReplaceColorBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryRotate2dBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometrySmoothStepBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryStepBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/intFloatConverterBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mapRangeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
- package/Meshes/Node/Blocks/matrixComposeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/noiseBlock.js.map +1 -1
- package/Meshes/Node/Blocks/normalizeVectorBlock.js.map +1 -1
- package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
- package/Meshes/Node/Blocks/vectorConverterBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.js +1 -0
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/WebGL/webGLDataBuffer.js.map +1 -1
- package/Meshes/WebGPU/webgpuDataBuffer.js.map +1 -1
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geodesicMesh.js.map +1 -1
- package/Meshes/goldbergMesh.js.map +1 -1
- package/Meshes/groundMesh.js.map +1 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/linesMesh.js.map +1 -1
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/trailMesh.js.map +1 -1
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/depthReducer.js.map +1 -1
- package/Misc/fileTools.js +4 -3
- package/Misc/fileTools.js.map +1 -1
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/smartArray.js.map +1 -1
- package/Misc/workerPool.js.map +1 -1
- package/Particles/EmitterTypes/cylinderParticleEmitter.js.map +1 -1
- package/Particles/EmitterTypes/sphereParticleEmitter.js.map +1 -1
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.js.map +1 -1
- package/Physics/physicsRaycastResult.js.map +1 -1
- package/Physics/proximityCastResult.js.map +1 -1
- package/Physics/v1/physicsJoint.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js.map +1 -1
- package/PostProcesses/anaglyphPostProcess.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/bloomMergePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/convolutionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/displayPassPostProcess.js.map +1 -1
- package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
- package/PostProcesses/filterPostProcess.js.map +1 -1
- package/PostProcesses/fxaaPostProcess.js.map +1 -1
- package/PostProcesses/grainPostProcess.js.map +1 -1
- package/PostProcesses/highlightsPostProcess.js.map +1 -1
- package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/refractionPostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.js.map +1 -1
- package/PostProcesses/stereoscopicInterlacePostProcess.js.map +1 -1
- package/PostProcesses/subSurfaceScatteringPostProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/PostProcesses/vrDistortionCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/vrMultiviewToSingleviewPostProcess.js.map +1 -1
- package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/reflectiveShadowMap.js.map +1 -1
- package/Sprites/sprite.js.map +1 -1
- package/Sprites/spritePackedManager.js.map +1 -1
- package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
- package/XR/features/Layers/WebXRProjectionLayer.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRBackgroundRemover.js.map +1 -1
- package/XR/features/WebXRControllerMovement.js.map +1 -1
- package/XR/features/WebXRControllerPhysics.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/features/WebXRDOMOverlay.js.map +1 -1
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXREyeTracking.js.map +1 -1
- package/XR/features/WebXRFeaturePointSystem.js.map +1 -1
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRHitTest.js.map +1 -1
- package/XR/features/WebXRHitTestLegacy.js.map +1 -1
- package/XR/features/WebXRImageTracking.js.map +1 -1
- package/XR/features/WebXRLayers.js.map +1 -1
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRMeshDetector.js.map +1 -1
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/features/WebXRPlaneDetector.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.js.map +1 -1
- package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
- package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
- package/XR/native/nativeXRRenderTarget.js.map +1 -1
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXRWebGLLayer.js.map +1 -1
- package/assets/Draco/draco_wasm_wrapper.js +115 -115
- package/package.json +1 -1
- package/scene.js.map +1 -1
package/Bones/bone.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bone.js","sourceRoot":"","sources":["../../../../dev/core/src/Bones/bone.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAK3C;;;GAGG;AACH,MAAM,OAAO,IAAK,SAAQ,IAAI;IA+C1B,gBAAgB;IAChB,IAAI,OAAO;QACP,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,gBAAgB;IAChB,IAAI,OAAO,CAAC,KAAa;QACrB,oCAAoC;QACpC,IAAI,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC,YAAY,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YAC3E,OAAO;SACV;QAED,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC,sCAAsC;QAEnE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACpC,CAAC;IAED;;;;;;;;;OASG;IACH;IACI;;OAEG;IACI,IAAY,EACnB,QAAkB,EAClB,aAA6B,IAAI,EACjC,cAAgC,IAAI,EACpC,aAA+B,IAAI,EACnC,aAA+B,IAAI,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from \"../Misc/arrayTools\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport { Node } from \"../node\";\r\nimport { Space } from \"../Maths/math.axis\";\r\n\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { AnimationPropertiesOverride } from \"../Animations/animationPropertiesOverride\";\r\n\r\n/**\r\n * Class used to store bone information\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons\r\n */\r\nexport class Bone extends Node {\r\n private static _TmpVecs: Vector3[] = ArrayTools.BuildArray(2, Vector3.Zero);\r\n private static _TmpQuat = Quaternion.Identity();\r\n private static _TmpMats: Matrix[] = ArrayTools.BuildArray(5, Matrix.Identity);\r\n\r\n /**\r\n * Gets the list of child bones\r\n */\r\n public children: Bone[] = [];\r\n\r\n /** Gets the animations associated with this bone */\r\n public animations: Animation[] = [];\r\n\r\n /**\r\n * Gets or sets bone length\r\n */\r\n public length: number;\r\n\r\n /**\r\n * @internal Internal only\r\n * Set this value to map this bone to a different index in the transform matrices\r\n * Set this value to -1 to exclude the bone from the transform matrices\r\n */\r\n public _index: Nullable<number> = null;\r\n\r\n private _skeleton: Skeleton;\r\n private _localMatrix: Matrix; // transformation of the bone, in local space\r\n private _absoluteMatrix: Matrix; // transformation of the bone, in world space (relative to the skeleton root)\r\n private _bindMatrix: Matrix; // the bind matrix, in local space\r\n private _absoluteBindMatrix: Matrix; // the bind matrix, in world space (relative to the skeleton root)\r\n private _absoluteInverseBindMatrix: Matrix; // the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n private _finalMatrix: Matrix; // the final matrix used to transform vertices of the mesh according to the bone, in world space (relative to the skeleton root). It is the multiplication of _absoluteInverseBindMatrix with _absoluteMatrix.\r\n private _restMatrix: Matrix; // a matrix for the exclusive use of the end user (not used internally by the framework), in local space\r\n private _scalingDeterminant = 1;\r\n\r\n private _localScaling: Vector3;\r\n private _localRotation: Quaternion;\r\n private _localPosition: Vector3;\r\n private _needToDecompose = true;\r\n private _needToCompose = false;\r\n\r\n /** @internal */\r\n public _linkedTransformNode: Nullable<TransformNode> = null;\r\n\r\n /** @internal */\r\n public _waitingTransformNodeId: Nullable<string> = null;\r\n\r\n /** @internal */\r\n get _matrix(): Matrix {\r\n this._compose();\r\n return this._localMatrix;\r\n }\r\n\r\n /** @internal */\r\n set _matrix(value: Matrix) {\r\n // skip if the matrices are the same\r\n if (value.updateFlag === this._localMatrix.updateFlag && !this._needToCompose) {\r\n return;\r\n }\r\n\r\n this._needToCompose = false; // in case there was a pending compose\r\n\r\n this._localMatrix.copyFrom(value);\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n /**\r\n * Create a new bone\r\n * @param name defines the bone name\r\n * @param skeleton defines the parent skeleton\r\n * @param parentBone defines the parent (can be null if the bone is the root)\r\n * @param localMatrix defines the local matrix (default: identity)\r\n * @param restMatrix defines the rest matrix (default: localMatrix)\r\n * @param bindMatrix defines the bind matrix (default: localMatrix)\r\n * @param index defines index of the bone in the hierarchy (default: null)\r\n */\r\n constructor(\r\n /**\r\n * defines the bone name\r\n */\r\n public name: string,\r\n skeleton: Skeleton,\r\n parentBone: Nullable<Bone> = null,\r\n localMatrix: Nullable<Matrix> = null,\r\n restMatrix: Nullable<Matrix> = null,\r\n bindMatrix: Nullable<Matrix> = null,\r\n index: Nullable<number> = null\r\n ) {\r\n super(name, skeleton.getScene());\r\n this._skeleton = skeleton;\r\n this._localMatrix = localMatrix?.clone() ?? Matrix.Identity();\r\n this._restMatrix = restMatrix ?? this._localMatrix.clone();\r\n this._bindMatrix = bindMatrix ?? this._localMatrix.clone();\r\n this._index = index;\r\n\r\n this._absoluteMatrix = new Matrix();\r\n this._absoluteBindMatrix = new Matrix();\r\n this._absoluteInverseBindMatrix = new Matrix();\r\n this._finalMatrix = new Matrix();\r\n\r\n skeleton.bones.push(this);\r\n\r\n this.setParent(parentBone, false);\r\n\r\n this._updateAbsoluteBindMatrices();\r\n }\r\n\r\n /**\r\n * Gets the current object class name.\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"Bone\";\r\n }\r\n\r\n // Members\r\n\r\n /**\r\n * Gets the parent skeleton\r\n * @returns a skeleton\r\n */\r\n public getSkeleton(): Skeleton {\r\n return this._skeleton;\r\n }\r\n\r\n public get parent(): Bone {\r\n return this._parentNode as Bone;\r\n }\r\n\r\n /**\r\n * Gets parent bone\r\n * @returns a bone or null if the bone is the root of the bone hierarchy\r\n */\r\n public getParent(): Nullable<Bone> {\r\n return this.parent;\r\n }\r\n\r\n /**\r\n * Returns an array containing the children of the bone\r\n * @returns an array containing the children of the bone (can be empty if the bone has no children)\r\n */\r\n public getChildren(): Array<Bone> {\r\n return this.children;\r\n }\r\n\r\n /**\r\n * Gets the node index in matrix array generated for rendering\r\n * @returns the node index\r\n */\r\n public getIndex(): number {\r\n return this._index === null ? this.getSkeleton().bones.indexOf(this) : this._index;\r\n }\r\n\r\n public set parent(newParent: Nullable<Bone>) {\r\n this.setParent(newParent);\r\n }\r\n\r\n /**\r\n * Sets the parent bone\r\n * @param parent defines the parent (can be null if the bone is the root)\r\n * @param updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be updated\r\n */\r\n public setParent(parent: Nullable<Bone>, updateAbsoluteBindMatrices: boolean = true): void {\r\n if (this.parent === parent) {\r\n return;\r\n }\r\n\r\n if (this.parent) {\r\n const index = this.parent.children.indexOf(this);\r\n if (index !== -1) {\r\n this.parent.children.splice(index, 1);\r\n }\r\n }\r\n\r\n this._parentNode = parent;\r\n\r\n if (this.parent) {\r\n this.parent.children.push(this);\r\n }\r\n\r\n if (updateAbsoluteBindMatrices) {\r\n this._updateAbsoluteBindMatrices();\r\n }\r\n\r\n this.markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the local matrix\r\n * @returns the local matrix\r\n */\r\n public getLocalMatrix(): Matrix {\r\n this._compose();\r\n return this._localMatrix;\r\n }\r\n\r\n /**\r\n * Gets the bind matrix\r\n * @returns the bind matrix\r\n */\r\n public getBindMatrix(): Matrix {\r\n return this._bindMatrix;\r\n }\r\n\r\n /**\r\n * Gets the bind matrix.\r\n * @returns the bind matrix\r\n * @deprecated Please use getBindMatrix instead\r\n */\r\n public getBaseMatrix(): Matrix {\r\n return this.getBindMatrix();\r\n }\r\n\r\n /**\r\n * Gets the rest matrix\r\n * @returns the rest matrix\r\n */\r\n public getRestMatrix(): Matrix {\r\n return this._restMatrix;\r\n }\r\n\r\n /**\r\n * Gets the rest matrix\r\n * @returns the rest matrix\r\n * @deprecated Please use getRestMatrix instead\r\n */\r\n public getRestPose(): Matrix {\r\n return this.getRestMatrix();\r\n }\r\n\r\n /**\r\n * Sets the rest matrix\r\n * @param matrix the local-space rest matrix to set for this bone\r\n */\r\n public setRestMatrix(matrix: Matrix): void {\r\n this._restMatrix.copyFrom(matrix);\r\n }\r\n\r\n /**\r\n * Sets the rest matrix\r\n * @param matrix the local-space rest to set for this bone\r\n * @deprecated Please use setRestMatrix instead\r\n */\r\n public setRestPose(matrix: Matrix): void {\r\n this.setRestMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets the bind matrix\r\n * @returns the bind matrix\r\n * @deprecated Please use getBindMatrix instead\r\n */\r\n public getBindPose(): Matrix {\r\n return this.getBindMatrix();\r\n }\r\n\r\n /**\r\n * Sets the bind matrix\r\n * This will trigger a recomputation of the absolute bind and absolute inverse bind matrices for this bone and its children\r\n * Note that the local matrix will also be set with the matrix passed in parameter!\r\n * @param matrix the local-space bind matrix to set for this bone\r\n */\r\n public setBindMatrix(matrix: Matrix): void {\r\n this.updateMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Sets the bind matrix\r\n * @param matrix the local-space bind to set for this bone\r\n * @deprecated Please use setBindMatrix instead\r\n */\r\n public setBindPose(matrix: Matrix): void {\r\n this.setBindMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)\r\n * @returns the final world matrix\r\n */\r\n public getFinalMatrix(): Matrix {\r\n return this._finalMatrix;\r\n }\r\n\r\n /**\r\n * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)\r\n * @deprecated Please use getFinalMatrix instead\r\n * @returns the final world matrix\r\n */\r\n public getWorldMatrix(): Matrix {\r\n return this.getFinalMatrix();\r\n }\r\n\r\n /**\r\n * Sets the local matrix to the rest matrix\r\n */\r\n public returnToRest(): void {\r\n if (this._linkedTransformNode) {\r\n const localScaling = TmpVectors.Vector3[0];\r\n const localRotation = TmpVectors.Quaternion[0];\r\n const localPosition = TmpVectors.Vector3[1];\r\n\r\n this.getRestMatrix().decompose(localScaling, localRotation, localPosition);\r\n\r\n this._linkedTransformNode.position.copyFrom(localPosition);\r\n this._linkedTransformNode.rotationQuaternion = this._linkedTransformNode.rotationQuaternion ?? Quaternion.Identity();\r\n this._linkedTransformNode.rotationQuaternion.copyFrom(localRotation);\r\n this._linkedTransformNode.scaling.copyFrom(localScaling);\r\n } else {\r\n this._matrix = this._restMatrix;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n * @returns the inverse bind matrix, in world space\r\n */\r\n public getAbsoluteInverseBindMatrix(): Matrix {\r\n return this._absoluteInverseBindMatrix;\r\n }\r\n\r\n /**\r\n * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n * @returns the inverse bind matrix, in world space\r\n * @deprecated Please use getAbsoluteInverseBindMatrix instead\r\n */\r\n public getInvertedAbsoluteTransform(): Matrix {\r\n return this.getAbsoluteInverseBindMatrix();\r\n }\r\n\r\n /**\r\n * Gets the bone matrix, in world space (relative to the skeleton root)\r\n * @returns the bone matrix, in world space\r\n */\r\n public getAbsoluteMatrix(): Matrix {\r\n return this._absoluteMatrix;\r\n }\r\n\r\n /**\r\n * Gets the bone matrix, in world space (relative to the skeleton root)\r\n * @returns the bone matrix, in world space\r\n * @deprecated Please use getAbsoluteMatrix instead\r\n */\r\n public getAbsoluteTransform(): Matrix {\r\n return this._absoluteMatrix;\r\n }\r\n\r\n /**\r\n * Links with the given transform node.\r\n * The local matrix of this bone is overwritten by the transform of the node every frame.\r\n * @param transformNode defines the transform node to link to\r\n */\r\n public linkTransformNode(transformNode: Nullable<TransformNode>): void {\r\n if (this._linkedTransformNode) {\r\n this._skeleton._numBonesWithLinkedTransformNode--;\r\n }\r\n\r\n this._linkedTransformNode = transformNode;\r\n\r\n if (this._linkedTransformNode) {\r\n this._skeleton._numBonesWithLinkedTransformNode++;\r\n }\r\n }\r\n\r\n // Properties (matches TransformNode properties)\r\n\r\n /**\r\n * Gets the node used to drive the bone's transformation\r\n * @returns a transform node or null\r\n */\r\n public getTransformNode() {\r\n return this._linkedTransformNode;\r\n }\r\n\r\n /** Gets or sets current position (in local space) */\r\n public get position(): Vector3 {\r\n this._decompose();\r\n return this._localPosition;\r\n }\r\n\r\n public set position(newPosition: Vector3) {\r\n this._decompose();\r\n this._localPosition.copyFrom(newPosition);\r\n\r\n this._markAsDirtyAndCompose();\r\n }\r\n\r\n /** Gets or sets current rotation (in local space) */\r\n public get rotation(): Vector3 {\r\n return this.getRotation();\r\n }\r\n\r\n public set rotation(newRotation: Vector3) {\r\n this.setRotation(newRotation);\r\n }\r\n\r\n /** Gets or sets current rotation quaternion (in local space) */\r\n public get rotationQuaternion() {\r\n this._decompose();\r\n return this._localRotation;\r\n }\r\n\r\n public set rotationQuaternion(newRotation: Quaternion) {\r\n this.setRotationQuaternion(newRotation);\r\n }\r\n\r\n /** Gets or sets current scaling (in local space) */\r\n public get scaling(): Vector3 {\r\n return this.getScale();\r\n }\r\n\r\n public set scaling(newScaling: Vector3) {\r\n this.setScale(newScaling);\r\n }\r\n\r\n /**\r\n * Gets the animation properties override\r\n */\r\n public get animationPropertiesOverride(): Nullable<AnimationPropertiesOverride> {\r\n return this._skeleton.animationPropertiesOverride;\r\n }\r\n\r\n // Methods\r\n private _decompose() {\r\n if (!this._needToDecompose) {\r\n return;\r\n }\r\n\r\n this._needToDecompose = false;\r\n\r\n if (!this._localScaling) {\r\n this._localScaling = Vector3.Zero();\r\n this._localRotation = Quaternion.Zero();\r\n this._localPosition = Vector3.Zero();\r\n }\r\n this._localMatrix.decompose(this._localScaling, this._localRotation, this._localPosition);\r\n }\r\n\r\n private _compose() {\r\n if (!this._needToCompose) {\r\n return;\r\n }\r\n\r\n if (!this._localScaling) {\r\n this._needToCompose = false;\r\n return;\r\n }\r\n\r\n this._needToCompose = false;\r\n Matrix.ComposeToRef(this._localScaling, this._localRotation, this._localPosition, this._localMatrix);\r\n }\r\n\r\n /**\r\n * Update the bind (and optionally the local) matrix\r\n * @param bindMatrix defines the new matrix to set to the bind/local matrix, in local space\r\n * @param updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be recomputed (default: true)\r\n * @param updateLocalMatrix defines if the local matrix should also be updated with the matrix passed in parameter (default: true)\r\n */\r\n public updateMatrix(bindMatrix: Matrix, updateAbsoluteBindMatrices = true, updateLocalMatrix = true): void {\r\n this._bindMatrix.copyFrom(bindMatrix);\r\n\r\n if (updateAbsoluteBindMatrices) {\r\n this._updateAbsoluteBindMatrices();\r\n }\r\n\r\n if (updateLocalMatrix) {\r\n this._matrix = bindMatrix;\r\n } else {\r\n this.markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateAbsoluteBindMatrices(bindMatrix?: Matrix, updateChildren = true): void {\r\n if (!bindMatrix) {\r\n bindMatrix = this._bindMatrix;\r\n }\r\n\r\n if (this.parent) {\r\n bindMatrix.multiplyToRef(this.parent._absoluteBindMatrix, this._absoluteBindMatrix);\r\n } else {\r\n this._absoluteBindMatrix.copyFrom(bindMatrix);\r\n }\r\n\r\n this._absoluteBindMatrix.invertToRef(this._absoluteInverseBindMatrix);\r\n\r\n if (updateChildren) {\r\n for (let index = 0; index < this.children.length; index++) {\r\n this.children[index]._updateAbsoluteBindMatrices();\r\n }\r\n }\r\n\r\n this._scalingDeterminant = this._absoluteBindMatrix.determinant() < 0 ? -1 : 1;\r\n }\r\n\r\n /**\r\n * Flag the bone as dirty (Forcing it to update everything)\r\n * @returns this bone\r\n */\r\n public markAsDirty(): Bone {\r\n this._currentRenderId++;\r\n this._childUpdateId++;\r\n this._skeleton._markAsDirty();\r\n return this;\r\n }\r\n\r\n /** @internal */\r\n public _markAsDirtyAndCompose() {\r\n this.markAsDirty();\r\n this._needToCompose = true;\r\n }\r\n\r\n private _markAsDirtyAndDecompose() {\r\n this.markAsDirty();\r\n this._needToDecompose = true;\r\n }\r\n\r\n private _updatePosition(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode, translationMode = true): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\r\n if (translationMode) {\r\n lm.addAtIndex(12, vec.x);\r\n lm.addAtIndex(13, vec.y);\r\n lm.addAtIndex(14, vec.z);\r\n } else {\r\n lm.setTranslationFromFloats(vec.x, vec.y, vec.z);\r\n }\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n const tvec = Bone._TmpVecs[0];\r\n\r\n if (this.parent) {\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.parent.getAbsoluteMatrix());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteMatrix());\r\n }\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n if (translationMode) {\r\n tmat.setTranslationFromFloats(0, 0, 0);\r\n }\r\n tmat.invert();\r\n Vector3.TransformCoordinatesToRef(vec, tmat, tvec);\r\n\r\n if (translationMode) {\r\n lm.addAtIndex(12, tvec.x);\r\n lm.addAtIndex(13, tvec.y);\r\n lm.addAtIndex(14, tvec.z);\r\n } else {\r\n lm.setTranslationFromFloats(tvec.x, tvec.y, tvec.z);\r\n }\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n /**\r\n * Translate the bone in local or world space\r\n * @param vec The amount to translate the bone\r\n * @param space The space that the translation is in (default: Space.LOCAL)\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public translate(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this._updatePosition(vec, space, tNode, true);\r\n }\r\n\r\n /**\r\n * Set the position of the bone in local or world space\r\n * @param position The position to set the bone\r\n * @param space The space that the position is in (default: Space.LOCAL)\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setPosition(position: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this._updatePosition(position, space, tNode, false);\r\n }\r\n\r\n /**\r\n * Set the absolute position of the bone (world space)\r\n * @param position The position to set the bone\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setAbsolutePosition(position: Vector3, tNode?: TransformNode) {\r\n this.setPosition(position, Space.WORLD, tNode);\r\n }\r\n\r\n /**\r\n * Scale the bone on the x, y and z axes (in local space)\r\n * @param x The amount to scale the bone on the x axis\r\n * @param y The amount to scale the bone on the y axis\r\n * @param z The amount to scale the bone on the z axis\r\n * @param scaleChildren sets this to true if children of the bone should be scaled as well (false by default)\r\n */\r\n public scale(x: number, y: number, z: number, scaleChildren = false): void {\r\n const locMat = this.getLocalMatrix();\r\n\r\n // Apply new scaling on top of current local matrix\r\n const scaleMat = Bone._TmpMats[0];\r\n Matrix.ScalingToRef(x, y, z, scaleMat);\r\n scaleMat.multiplyToRef(locMat, locMat);\r\n\r\n // Invert scaling matrix and apply the inverse to all children\r\n scaleMat.invert();\r\n\r\n for (const child of this.children) {\r\n const cm = child.getLocalMatrix();\r\n cm.multiplyToRef(scaleMat, cm);\r\n cm.multiplyAtIndex(12, x);\r\n cm.multiplyAtIndex(13, y);\r\n cm.multiplyAtIndex(14, z);\r\n\r\n child._markAsDirtyAndDecompose();\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\r\n\r\n if (scaleChildren) {\r\n for (const child of this.children) {\r\n child.scale(x, y, z, scaleChildren);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Set the bone scaling in local space\r\n * @param scale defines the scaling vector\r\n */\r\n public setScale(scale: Vector3): void {\r\n this._decompose();\r\n this._localScaling.copyFrom(scale);\r\n this._markAsDirtyAndCompose();\r\n }\r\n\r\n /**\r\n * Gets the current scaling in local space\r\n * @returns the current scaling vector\r\n */\r\n public getScale(): Vector3 {\r\n this._decompose();\r\n return this._localScaling;\r\n }\r\n\r\n /**\r\n * Gets the current scaling in local space and stores it in a target vector\r\n * @param result defines the target vector\r\n */\r\n public getScaleToRef(result: Vector3) {\r\n this._decompose();\r\n result.copyFrom(this._localScaling);\r\n }\r\n\r\n /**\r\n * Set the yaw, pitch, and roll of the bone in local or world space\r\n * @param yaw The rotation of the bone on the y axis\r\n * @param pitch The rotation of the bone on the x axis\r\n * @param roll The rotation of the bone on the z axis\r\n * @param space The space that the axes of rotation are in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setYawPitchRoll(yaw: number, pitch: number, roll: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, quat);\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Add a rotation to the bone on an axis in local or world space\r\n * @param axis The axis to rotate the bone on\r\n * @param amount The amount to rotate the bone\r\n * @param space The space that the axis is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public rotate(axis: Vector3, amount: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const rmat = Bone._TmpMats[0];\r\n rmat.setTranslationFromFloats(0, 0, 0);\r\n Matrix.RotationAxisToRef(axis, amount, rmat);\r\n this._rotateWithMatrix(rmat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the rotation of the bone to a particular axis angle in local or world space\r\n * @param axis The axis to rotate the bone on\r\n * @param angle The angle that the bone should be rotated to\r\n * @param space The space that the axis is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setAxisAngle(axis: Vector3, angle: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.RotationAxisToRef(axis, angle, quat);\r\n\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.RotationAxisToRef(axis, angle, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the euler rotation of the bone in local or world space\r\n * @param rotation The euler rotation that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setRotation(rotation: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this.setYawPitchRoll(rotation.y, rotation.x, rotation.z, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the quaternion rotation of the bone in local or world space\r\n * @param quat The quaternion rotation that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setRotationQuaternion(quat: Quaternion, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n this._decompose();\r\n this._localRotation.copyFrom(quat);\r\n\r\n this._markAsDirtyAndCompose();\r\n\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.FromQuaternionToRef(quat, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the rotation matrix of the bone in local or world space\r\n * @param rotMat The rotation matrix that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setRotationMatrix(rotMat: Matrix, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.FromRotationMatrixToRef(rotMat, quat);\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat2 = Bone._TmpMats[1];\r\n rotMat2.copyFrom(rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat2);\r\n\r\n this._rotateWithMatrix(rotMat2, space, tNode);\r\n }\r\n\r\n private _rotateWithMatrix(rmat: Matrix, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lmat = this.getLocalMatrix();\r\n const lx = lmat.m[12];\r\n const ly = lmat.m[13];\r\n const lz = lmat.m[14];\r\n const parent = this.getParent();\r\n const parentScale = Bone._TmpMats[3];\r\n const parentScaleInv = Bone._TmpMats[4];\r\n\r\n if (parent && space == Space.WORLD) {\r\n if (tNode) {\r\n parentScale.copyFrom(tNode.getWorldMatrix());\r\n parent.getAbsoluteMatrix().multiplyToRef(parentScale, parentScale);\r\n } else {\r\n parentScale.copyFrom(parent.getAbsoluteMatrix());\r\n }\r\n parentScaleInv.copyFrom(parentScale);\r\n parentScaleInv.invert();\r\n lmat.multiplyToRef(parentScale, lmat);\r\n lmat.multiplyToRef(rmat, lmat);\r\n lmat.multiplyToRef(parentScaleInv, lmat);\r\n } else {\r\n if (space == Space.WORLD && tNode) {\r\n parentScale.copyFrom(tNode.getWorldMatrix());\r\n parentScaleInv.copyFrom(parentScale);\r\n parentScaleInv.invert();\r\n lmat.multiplyToRef(parentScale, lmat);\r\n lmat.multiplyToRef(rmat, lmat);\r\n lmat.multiplyToRef(parentScaleInv, lmat);\r\n } else {\r\n lmat.multiplyToRef(rmat, lmat);\r\n }\r\n }\r\n\r\n lmat.setTranslationFromFloats(lx, ly, lz);\r\n\r\n this.computeAbsoluteMatrices();\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n private _getAbsoluteInverseMatrixUnscaledToRef(rotMatInv: Matrix, tNode?: TransformNode): boolean {\r\n const scaleMatrix = Bone._TmpMats[2];\r\n rotMatInv.copyFrom(this.getAbsoluteMatrix());\r\n\r\n if (tNode) {\r\n rotMatInv.multiplyToRef(tNode.getWorldMatrix(), rotMatInv);\r\n Matrix.ScalingToRef(tNode.scaling.x, tNode.scaling.y, tNode.scaling.z, scaleMatrix);\r\n } else {\r\n Matrix.IdentityToRef(scaleMatrix);\r\n }\r\n\r\n rotMatInv.invert();\r\n if (isNaN(rotMatInv.m[0])) {\r\n // Matrix failed to invert.\r\n // This can happen if scale is zero for example.\r\n return false;\r\n }\r\n\r\n scaleMatrix.multiplyAtIndex(0, this._scalingDeterminant);\r\n rotMatInv.multiplyToRef(scaleMatrix, rotMatInv);\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Get the position of the bone in local or world space\r\n * @param space The space that the returned position is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The position of the bone\r\n */\r\n public getPosition(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const pos = Vector3.Zero();\r\n\r\n this.getPositionToRef(space, tNode, pos);\r\n\r\n return pos;\r\n }\r\n\r\n /**\r\n * Copy the position of the bone to a vector3 in local or world space\r\n * @param space The space that the returned position is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 to copy the position to\r\n */\r\n public getPositionToRef(space = Space.LOCAL, tNode: Nullable<TransformNode>, result: Vector3): void {\r\n if (space == Space.LOCAL) {\r\n const lm = this.getLocalMatrix();\r\n\r\n result.x = lm.m[12];\r\n result.y = lm.m[13];\r\n result.z = lm.m[14];\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteMatrix());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteMatrix();\r\n }\r\n\r\n result.x = tmat.m[12];\r\n result.y = tmat.m[13];\r\n result.z = tmat.m[14];\r\n }\r\n }\r\n\r\n /**\r\n * Get the absolute position of the bone (world space)\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The absolute position of the bone\r\n */\r\n public getAbsolutePosition(tNode: Nullable<TransformNode> = null): Vector3 {\r\n const pos = Vector3.Zero();\r\n\r\n this.getPositionToRef(Space.WORLD, tNode, pos);\r\n\r\n return pos;\r\n }\r\n\r\n /**\r\n * Copy the absolute position of the bone (world space) to the result param\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 to copy the absolute position to\r\n */\r\n public getAbsolutePositionToRef(tNode: TransformNode, result: Vector3) {\r\n this.getPositionToRef(Space.WORLD, tNode, result);\r\n }\r\n\r\n /**\r\n * Compute the absolute matrices of this bone and its children\r\n */\r\n public computeAbsoluteMatrices(): void {\r\n this._compose();\r\n\r\n if (this.parent) {\r\n this._localMatrix.multiplyToRef(this.parent._absoluteMatrix, this._absoluteMatrix);\r\n } else {\r\n this._absoluteMatrix.copyFrom(this._localMatrix);\r\n\r\n const poseMatrix = this._skeleton.getPoseMatrix();\r\n\r\n if (poseMatrix) {\r\n this._absoluteMatrix.multiplyToRef(poseMatrix, this._absoluteMatrix);\r\n }\r\n }\r\n\r\n const children = this.children;\r\n const len = children.length;\r\n\r\n for (let i = 0; i < len; i++) {\r\n children[i].computeAbsoluteMatrices();\r\n }\r\n }\r\n\r\n /**\r\n * Compute the absolute matrices of this bone and its children\r\n * @deprecated Please use computeAbsoluteMatrices instead\r\n */\r\n public computeAbsoluteTransforms(): void {\r\n this.computeAbsoluteMatrices();\r\n }\r\n\r\n /**\r\n * Get the world direction from an axis that is in the local space of the bone\r\n * @param localAxis The local direction that is used to compute the world direction\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The world direction\r\n */\r\n public getDirection(localAxis: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getDirectionToRef(localAxis, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the world direction to a vector3 from an axis that is in the local space of the bone\r\n * @param localAxis The local direction that is used to compute the world direction\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 that the world direction will be copied to\r\n */\r\n public getDirectionToRef(localAxis: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const mat = Bone._TmpMats[0];\r\n\r\n mat.copyFrom(this.getAbsoluteMatrix());\r\n\r\n if (tNode && wm) {\r\n mat.multiplyToRef(wm, mat);\r\n }\r\n\r\n Vector3.TransformNormalToRef(localAxis, mat, result);\r\n\r\n result.normalize();\r\n }\r\n\r\n /**\r\n * Get the euler rotation of the bone in local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The euler rotation\r\n */\r\n public getRotation(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getRotationToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the euler rotation of the bone to a vector3. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 that the rotation should be copied to\r\n */\r\n public getRotationToRef(space = Space.LOCAL, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n const quat = Bone._TmpQuat;\r\n\r\n this.getRotationQuaternionToRef(space, tNode, quat);\r\n\r\n quat.toEulerAnglesToRef(result);\r\n }\r\n\r\n /**\r\n * Get the quaternion rotation of the bone in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The quaternion rotation\r\n */\r\n public getRotationQuaternion(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Quaternion {\r\n const result = Quaternion.Identity();\r\n\r\n this.getRotationQuaternionToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the quaternion rotation of the bone to a quaternion. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The quaternion that the rotation should be copied to\r\n */\r\n public getRotationQuaternionToRef(space = Space.LOCAL, tNode: Nullable<TransformNode> = null, result: Quaternion): void {\r\n if (space == Space.LOCAL) {\r\n this._decompose();\r\n result.copyFrom(this._localRotation);\r\n } else {\r\n const mat = Bone._TmpMats[0];\r\n const amat = this.getAbsoluteMatrix();\r\n\r\n if (tNode) {\r\n amat.multiplyToRef(tNode.getWorldMatrix(), mat);\r\n } else {\r\n mat.copyFrom(amat);\r\n }\r\n\r\n mat.multiplyAtIndex(0, this._scalingDeterminant);\r\n mat.multiplyAtIndex(1, this._scalingDeterminant);\r\n mat.multiplyAtIndex(2, this._scalingDeterminant);\r\n\r\n mat.decompose(undefined, result, undefined);\r\n }\r\n }\r\n\r\n /**\r\n * Get the rotation matrix of the bone in local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The rotation matrix\r\n */\r\n public getRotationMatrix(space = Space.LOCAL, tNode: TransformNode): Matrix {\r\n const result = Matrix.Identity();\r\n\r\n this.getRotationMatrixToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the rotation matrix of the bone to a matrix. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The quaternion that the rotation should be copied to\r\n */\r\n public getRotationMatrixToRef(space = Space.LOCAL, tNode: TransformNode, result: Matrix): void {\r\n if (space == Space.LOCAL) {\r\n this.getLocalMatrix().getRotationMatrixToRef(result);\r\n } else {\r\n const mat = Bone._TmpMats[0];\r\n const amat = this.getAbsoluteMatrix();\r\n\r\n if (tNode) {\r\n amat.multiplyToRef(tNode.getWorldMatrix(), mat);\r\n } else {\r\n mat.copyFrom(amat);\r\n }\r\n\r\n mat.multiplyAtIndex(0, this._scalingDeterminant);\r\n mat.multiplyAtIndex(1, this._scalingDeterminant);\r\n mat.multiplyAtIndex(2, this._scalingDeterminant);\r\n\r\n mat.getRotationMatrixToRef(result);\r\n }\r\n }\r\n\r\n /**\r\n * Get the world position of a point that is in the local space of the bone\r\n * @param position The local position\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The world position\r\n */\r\n public getAbsolutePositionFromLocal(position: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getAbsolutePositionFromLocalToRef(position, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get the world position of a point that is in the local space of the bone and copy it to the result param\r\n * @param position The local position\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 that the world position should be copied to\r\n */\r\n public getAbsolutePositionFromLocalToRef(position: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteMatrix());\r\n\r\n if (tNode && wm) {\r\n tmat.multiplyToRef(wm, tmat);\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, result);\r\n }\r\n\r\n /**\r\n * Get the local position of a point that is in world space\r\n * @param position The world position\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The local position\r\n */\r\n public getLocalPositionFromAbsolute(position: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getLocalPositionFromAbsoluteToRef(position, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get the local position of a point that is in world space and copy it to the result param\r\n * @param position The world position\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 that the local position should be copied to\r\n */\r\n public getLocalPositionFromAbsoluteToRef(position: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteMatrix());\r\n\r\n if (tNode && wm) {\r\n tmat.multiplyToRef(wm, tmat);\r\n }\r\n\r\n tmat.invert();\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, result);\r\n }\r\n\r\n /**\r\n * Set the current local matrix as the restMatrix for this bone.\r\n */\r\n public setCurrentPoseAsRest(): void {\r\n this.setRestMatrix(this.getLocalMatrix());\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"bone.js","sourceRoot":"","sources":["../../../../dev/core/src/Bones/bone.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAK3C;;;GAGG;AACH,MAAM,OAAO,IAAK,SAAQ,IAAI;IA+C1B,gBAAgB;IAChB,IAAI,OAAO;QACP,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;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AE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,oBAAoB;QACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9C,CAAC;;AA/rCc,aAAQ,GAAc,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,AAApD,CAAqD;AAC7D,aAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,AAAxB,CAAyB;AACjC,aAAQ,GAAa,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,AAAtD,CAAuD","sourcesContent":["import type { Skeleton } from \"./skeleton\";\r\nimport { Vector3, Quaternion, Matrix, TmpVectors } from \"../Maths/math.vector\";\r\nimport { ArrayTools } from \"../Misc/arrayTools\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport { Node } from \"../node\";\r\nimport { Space } from \"../Maths/math.axis\";\r\n\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { AnimationPropertiesOverride } from \"../Animations/animationPropertiesOverride\";\r\n\r\n/**\r\n * Class used to store bone information\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons\r\n */\r\nexport class Bone extends Node {\r\n private static _TmpVecs: Vector3[] = ArrayTools.BuildArray(2, Vector3.Zero);\r\n private static _TmpQuat = Quaternion.Identity();\r\n private static _TmpMats: Matrix[] = ArrayTools.BuildArray(5, Matrix.Identity);\r\n\r\n /**\r\n * Gets the list of child bones\r\n */\r\n public children: Bone[] = [];\r\n\r\n /** Gets the animations associated with this bone */\r\n public override animations: Animation[] = [];\r\n\r\n /**\r\n * Gets or sets bone length\r\n */\r\n public length: number;\r\n\r\n /**\r\n * @internal Internal only\r\n * Set this value to map this bone to a different index in the transform matrices\r\n * Set this value to -1 to exclude the bone from the transform matrices\r\n */\r\n public _index: Nullable<number> = null;\r\n\r\n private _skeleton: Skeleton;\r\n private _localMatrix: Matrix; // transformation of the bone, in local space\r\n private _absoluteMatrix: Matrix; // transformation of the bone, in world space (relative to the skeleton root)\r\n private _bindMatrix: Matrix; // the bind matrix, in local space\r\n private _absoluteBindMatrix: Matrix; // the bind matrix, in world space (relative to the skeleton root)\r\n private _absoluteInverseBindMatrix: Matrix; // the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n private _finalMatrix: Matrix; // the final matrix used to transform vertices of the mesh according to the bone, in world space (relative to the skeleton root). It is the multiplication of _absoluteInverseBindMatrix with _absoluteMatrix.\r\n private _restMatrix: Matrix; // a matrix for the exclusive use of the end user (not used internally by the framework), in local space\r\n private _scalingDeterminant = 1;\r\n\r\n private _localScaling: Vector3;\r\n private _localRotation: Quaternion;\r\n private _localPosition: Vector3;\r\n private _needToDecompose = true;\r\n private _needToCompose = false;\r\n\r\n /** @internal */\r\n public _linkedTransformNode: Nullable<TransformNode> = null;\r\n\r\n /** @internal */\r\n public _waitingTransformNodeId: Nullable<string> = null;\r\n\r\n /** @internal */\r\n get _matrix(): Matrix {\r\n this._compose();\r\n return this._localMatrix;\r\n }\r\n\r\n /** @internal */\r\n set _matrix(value: Matrix) {\r\n // skip if the matrices are the same\r\n if (value.updateFlag === this._localMatrix.updateFlag && !this._needToCompose) {\r\n return;\r\n }\r\n\r\n this._needToCompose = false; // in case there was a pending compose\r\n\r\n this._localMatrix.copyFrom(value);\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n /**\r\n * Create a new bone\r\n * @param name defines the bone name\r\n * @param skeleton defines the parent skeleton\r\n * @param parentBone defines the parent (can be null if the bone is the root)\r\n * @param localMatrix defines the local matrix (default: identity)\r\n * @param restMatrix defines the rest matrix (default: localMatrix)\r\n * @param bindMatrix defines the bind matrix (default: localMatrix)\r\n * @param index defines index of the bone in the hierarchy (default: null)\r\n */\r\n constructor(\r\n /**\r\n * defines the bone name\r\n */\r\n public override name: string,\r\n skeleton: Skeleton,\r\n parentBone: Nullable<Bone> = null,\r\n localMatrix: Nullable<Matrix> = null,\r\n restMatrix: Nullable<Matrix> = null,\r\n bindMatrix: Nullable<Matrix> = null,\r\n index: Nullable<number> = null\r\n ) {\r\n super(name, skeleton.getScene());\r\n this._skeleton = skeleton;\r\n this._localMatrix = localMatrix?.clone() ?? Matrix.Identity();\r\n this._restMatrix = restMatrix ?? this._localMatrix.clone();\r\n this._bindMatrix = bindMatrix ?? this._localMatrix.clone();\r\n this._index = index;\r\n\r\n this._absoluteMatrix = new Matrix();\r\n this._absoluteBindMatrix = new Matrix();\r\n this._absoluteInverseBindMatrix = new Matrix();\r\n this._finalMatrix = new Matrix();\r\n\r\n skeleton.bones.push(this);\r\n\r\n this.setParent(parentBone, false);\r\n\r\n this._updateAbsoluteBindMatrices();\r\n }\r\n\r\n /**\r\n * Gets the current object class name.\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return \"Bone\";\r\n }\r\n\r\n // Members\r\n\r\n /**\r\n * Gets the parent skeleton\r\n * @returns a skeleton\r\n */\r\n public getSkeleton(): Skeleton {\r\n return this._skeleton;\r\n }\r\n\r\n public override get parent(): Bone {\r\n return this._parentNode as Bone;\r\n }\r\n\r\n /**\r\n * Gets parent bone\r\n * @returns a bone or null if the bone is the root of the bone hierarchy\r\n */\r\n public getParent(): Nullable<Bone> {\r\n return this.parent;\r\n }\r\n\r\n /**\r\n * Returns an array containing the children of the bone\r\n * @returns an array containing the children of the bone (can be empty if the bone has no children)\r\n */\r\n public override getChildren(): Array<Bone> {\r\n return this.children;\r\n }\r\n\r\n /**\r\n * Gets the node index in matrix array generated for rendering\r\n * @returns the node index\r\n */\r\n public getIndex(): number {\r\n return this._index === null ? this.getSkeleton().bones.indexOf(this) : this._index;\r\n }\r\n\r\n public override set parent(newParent: Nullable<Bone>) {\r\n this.setParent(newParent);\r\n }\r\n\r\n /**\r\n * Sets the parent bone\r\n * @param parent defines the parent (can be null if the bone is the root)\r\n * @param updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be updated\r\n */\r\n public setParent(parent: Nullable<Bone>, updateAbsoluteBindMatrices: boolean = true): void {\r\n if (this.parent === parent) {\r\n return;\r\n }\r\n\r\n if (this.parent) {\r\n const index = this.parent.children.indexOf(this);\r\n if (index !== -1) {\r\n this.parent.children.splice(index, 1);\r\n }\r\n }\r\n\r\n this._parentNode = parent;\r\n\r\n if (this.parent) {\r\n this.parent.children.push(this);\r\n }\r\n\r\n if (updateAbsoluteBindMatrices) {\r\n this._updateAbsoluteBindMatrices();\r\n }\r\n\r\n this.markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the local matrix\r\n * @returns the local matrix\r\n */\r\n public getLocalMatrix(): Matrix {\r\n this._compose();\r\n return this._localMatrix;\r\n }\r\n\r\n /**\r\n * Gets the bind matrix\r\n * @returns the bind matrix\r\n */\r\n public getBindMatrix(): Matrix {\r\n return this._bindMatrix;\r\n }\r\n\r\n /**\r\n * Gets the bind matrix.\r\n * @returns the bind matrix\r\n * @deprecated Please use getBindMatrix instead\r\n */\r\n public getBaseMatrix(): Matrix {\r\n return this.getBindMatrix();\r\n }\r\n\r\n /**\r\n * Gets the rest matrix\r\n * @returns the rest matrix\r\n */\r\n public getRestMatrix(): Matrix {\r\n return this._restMatrix;\r\n }\r\n\r\n /**\r\n * Gets the rest matrix\r\n * @returns the rest matrix\r\n * @deprecated Please use getRestMatrix instead\r\n */\r\n public getRestPose(): Matrix {\r\n return this.getRestMatrix();\r\n }\r\n\r\n /**\r\n * Sets the rest matrix\r\n * @param matrix the local-space rest matrix to set for this bone\r\n */\r\n public setRestMatrix(matrix: Matrix): void {\r\n this._restMatrix.copyFrom(matrix);\r\n }\r\n\r\n /**\r\n * Sets the rest matrix\r\n * @param matrix the local-space rest to set for this bone\r\n * @deprecated Please use setRestMatrix instead\r\n */\r\n public setRestPose(matrix: Matrix): void {\r\n this.setRestMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets the bind matrix\r\n * @returns the bind matrix\r\n * @deprecated Please use getBindMatrix instead\r\n */\r\n public getBindPose(): Matrix {\r\n return this.getBindMatrix();\r\n }\r\n\r\n /**\r\n * Sets the bind matrix\r\n * This will trigger a recomputation of the absolute bind and absolute inverse bind matrices for this bone and its children\r\n * Note that the local matrix will also be set with the matrix passed in parameter!\r\n * @param matrix the local-space bind matrix to set for this bone\r\n */\r\n public setBindMatrix(matrix: Matrix): void {\r\n this.updateMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Sets the bind matrix\r\n * @param matrix the local-space bind to set for this bone\r\n * @deprecated Please use setBindMatrix instead\r\n */\r\n public setBindPose(matrix: Matrix): void {\r\n this.setBindMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)\r\n * @returns the final world matrix\r\n */\r\n public getFinalMatrix(): Matrix {\r\n return this._finalMatrix;\r\n }\r\n\r\n /**\r\n * Gets the matrix used to store the final world transformation of the bone (ie. the matrix sent to shaders)\r\n * @deprecated Please use getFinalMatrix instead\r\n * @returns the final world matrix\r\n */\r\n public override getWorldMatrix(): Matrix {\r\n return this.getFinalMatrix();\r\n }\r\n\r\n /**\r\n * Sets the local matrix to the rest matrix\r\n */\r\n public returnToRest(): void {\r\n if (this._linkedTransformNode) {\r\n const localScaling = TmpVectors.Vector3[0];\r\n const localRotation = TmpVectors.Quaternion[0];\r\n const localPosition = TmpVectors.Vector3[1];\r\n\r\n this.getRestMatrix().decompose(localScaling, localRotation, localPosition);\r\n\r\n this._linkedTransformNode.position.copyFrom(localPosition);\r\n this._linkedTransformNode.rotationQuaternion = this._linkedTransformNode.rotationQuaternion ?? Quaternion.Identity();\r\n this._linkedTransformNode.rotationQuaternion.copyFrom(localRotation);\r\n this._linkedTransformNode.scaling.copyFrom(localScaling);\r\n } else {\r\n this._matrix = this._restMatrix;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n * @returns the inverse bind matrix, in world space\r\n */\r\n public getAbsoluteInverseBindMatrix(): Matrix {\r\n return this._absoluteInverseBindMatrix;\r\n }\r\n\r\n /**\r\n * Gets the inverse of the bind matrix, in world space (relative to the skeleton root)\r\n * @returns the inverse bind matrix, in world space\r\n * @deprecated Please use getAbsoluteInverseBindMatrix instead\r\n */\r\n public getInvertedAbsoluteTransform(): Matrix {\r\n return this.getAbsoluteInverseBindMatrix();\r\n }\r\n\r\n /**\r\n * Gets the bone matrix, in world space (relative to the skeleton root)\r\n * @returns the bone matrix, in world space\r\n */\r\n public getAbsoluteMatrix(): Matrix {\r\n return this._absoluteMatrix;\r\n }\r\n\r\n /**\r\n * Gets the bone matrix, in world space (relative to the skeleton root)\r\n * @returns the bone matrix, in world space\r\n * @deprecated Please use getAbsoluteMatrix instead\r\n */\r\n public getAbsoluteTransform(): Matrix {\r\n return this._absoluteMatrix;\r\n }\r\n\r\n /**\r\n * Links with the given transform node.\r\n * The local matrix of this bone is overwritten by the transform of the node every frame.\r\n * @param transformNode defines the transform node to link to\r\n */\r\n public linkTransformNode(transformNode: Nullable<TransformNode>): void {\r\n if (this._linkedTransformNode) {\r\n this._skeleton._numBonesWithLinkedTransformNode--;\r\n }\r\n\r\n this._linkedTransformNode = transformNode;\r\n\r\n if (this._linkedTransformNode) {\r\n this._skeleton._numBonesWithLinkedTransformNode++;\r\n }\r\n }\r\n\r\n // Properties (matches TransformNode properties)\r\n\r\n /**\r\n * Gets the node used to drive the bone's transformation\r\n * @returns a transform node or null\r\n */\r\n public getTransformNode() {\r\n return this._linkedTransformNode;\r\n }\r\n\r\n /** Gets or sets current position (in local space) */\r\n public get position(): Vector3 {\r\n this._decompose();\r\n return this._localPosition;\r\n }\r\n\r\n public set position(newPosition: Vector3) {\r\n this._decompose();\r\n this._localPosition.copyFrom(newPosition);\r\n\r\n this._markAsDirtyAndCompose();\r\n }\r\n\r\n /** Gets or sets current rotation (in local space) */\r\n public get rotation(): Vector3 {\r\n return this.getRotation();\r\n }\r\n\r\n public set rotation(newRotation: Vector3) {\r\n this.setRotation(newRotation);\r\n }\r\n\r\n /** Gets or sets current rotation quaternion (in local space) */\r\n public get rotationQuaternion() {\r\n this._decompose();\r\n return this._localRotation;\r\n }\r\n\r\n public set rotationQuaternion(newRotation: Quaternion) {\r\n this.setRotationQuaternion(newRotation);\r\n }\r\n\r\n /** Gets or sets current scaling (in local space) */\r\n public get scaling(): Vector3 {\r\n return this.getScale();\r\n }\r\n\r\n public set scaling(newScaling: Vector3) {\r\n this.setScale(newScaling);\r\n }\r\n\r\n /**\r\n * Gets the animation properties override\r\n */\r\n public override get animationPropertiesOverride(): Nullable<AnimationPropertiesOverride> {\r\n return this._skeleton.animationPropertiesOverride;\r\n }\r\n\r\n // Methods\r\n private _decompose() {\r\n if (!this._needToDecompose) {\r\n return;\r\n }\r\n\r\n this._needToDecompose = false;\r\n\r\n if (!this._localScaling) {\r\n this._localScaling = Vector3.Zero();\r\n this._localRotation = Quaternion.Zero();\r\n this._localPosition = Vector3.Zero();\r\n }\r\n this._localMatrix.decompose(this._localScaling, this._localRotation, this._localPosition);\r\n }\r\n\r\n private _compose() {\r\n if (!this._needToCompose) {\r\n return;\r\n }\r\n\r\n if (!this._localScaling) {\r\n this._needToCompose = false;\r\n return;\r\n }\r\n\r\n this._needToCompose = false;\r\n Matrix.ComposeToRef(this._localScaling, this._localRotation, this._localPosition, this._localMatrix);\r\n }\r\n\r\n /**\r\n * Update the bind (and optionally the local) matrix\r\n * @param bindMatrix defines the new matrix to set to the bind/local matrix, in local space\r\n * @param updateAbsoluteBindMatrices defines if the absolute bind and absolute inverse bind matrices must be recomputed (default: true)\r\n * @param updateLocalMatrix defines if the local matrix should also be updated with the matrix passed in parameter (default: true)\r\n */\r\n public updateMatrix(bindMatrix: Matrix, updateAbsoluteBindMatrices = true, updateLocalMatrix = true): void {\r\n this._bindMatrix.copyFrom(bindMatrix);\r\n\r\n if (updateAbsoluteBindMatrices) {\r\n this._updateAbsoluteBindMatrices();\r\n }\r\n\r\n if (updateLocalMatrix) {\r\n this._matrix = bindMatrix;\r\n } else {\r\n this.markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateAbsoluteBindMatrices(bindMatrix?: Matrix, updateChildren = true): void {\r\n if (!bindMatrix) {\r\n bindMatrix = this._bindMatrix;\r\n }\r\n\r\n if (this.parent) {\r\n bindMatrix.multiplyToRef(this.parent._absoluteBindMatrix, this._absoluteBindMatrix);\r\n } else {\r\n this._absoluteBindMatrix.copyFrom(bindMatrix);\r\n }\r\n\r\n this._absoluteBindMatrix.invertToRef(this._absoluteInverseBindMatrix);\r\n\r\n if (updateChildren) {\r\n for (let index = 0; index < this.children.length; index++) {\r\n this.children[index]._updateAbsoluteBindMatrices();\r\n }\r\n }\r\n\r\n this._scalingDeterminant = this._absoluteBindMatrix.determinant() < 0 ? -1 : 1;\r\n }\r\n\r\n /**\r\n * Flag the bone as dirty (Forcing it to update everything)\r\n * @returns this bone\r\n */\r\n public override markAsDirty(): Bone {\r\n this._currentRenderId++;\r\n this._childUpdateId++;\r\n this._skeleton._markAsDirty();\r\n return this;\r\n }\r\n\r\n /** @internal */\r\n public _markAsDirtyAndCompose() {\r\n this.markAsDirty();\r\n this._needToCompose = true;\r\n }\r\n\r\n private _markAsDirtyAndDecompose() {\r\n this.markAsDirty();\r\n this._needToDecompose = true;\r\n }\r\n\r\n private _updatePosition(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode, translationMode = true): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\r\n if (translationMode) {\r\n lm.addAtIndex(12, vec.x);\r\n lm.addAtIndex(13, vec.y);\r\n lm.addAtIndex(14, vec.z);\r\n } else {\r\n lm.setTranslationFromFloats(vec.x, vec.y, vec.z);\r\n }\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n const tvec = Bone._TmpVecs[0];\r\n\r\n if (this.parent) {\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.parent.getAbsoluteMatrix());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteMatrix());\r\n }\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n if (translationMode) {\r\n tmat.setTranslationFromFloats(0, 0, 0);\r\n }\r\n tmat.invert();\r\n Vector3.TransformCoordinatesToRef(vec, tmat, tvec);\r\n\r\n if (translationMode) {\r\n lm.addAtIndex(12, tvec.x);\r\n lm.addAtIndex(13, tvec.y);\r\n lm.addAtIndex(14, tvec.z);\r\n } else {\r\n lm.setTranslationFromFloats(tvec.x, tvec.y, tvec.z);\r\n }\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n /**\r\n * Translate the bone in local or world space\r\n * @param vec The amount to translate the bone\r\n * @param space The space that the translation is in (default: Space.LOCAL)\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public translate(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this._updatePosition(vec, space, tNode, true);\r\n }\r\n\r\n /**\r\n * Set the position of the bone in local or world space\r\n * @param position The position to set the bone\r\n * @param space The space that the position is in (default: Space.LOCAL)\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setPosition(position: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this._updatePosition(position, space, tNode, false);\r\n }\r\n\r\n /**\r\n * Set the absolute position of the bone (world space)\r\n * @param position The position to set the bone\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setAbsolutePosition(position: Vector3, tNode?: TransformNode) {\r\n this.setPosition(position, Space.WORLD, tNode);\r\n }\r\n\r\n /**\r\n * Scale the bone on the x, y and z axes (in local space)\r\n * @param x The amount to scale the bone on the x axis\r\n * @param y The amount to scale the bone on the y axis\r\n * @param z The amount to scale the bone on the z axis\r\n * @param scaleChildren sets this to true if children of the bone should be scaled as well (false by default)\r\n */\r\n public scale(x: number, y: number, z: number, scaleChildren = false): void {\r\n const locMat = this.getLocalMatrix();\r\n\r\n // Apply new scaling on top of current local matrix\r\n const scaleMat = Bone._TmpMats[0];\r\n Matrix.ScalingToRef(x, y, z, scaleMat);\r\n scaleMat.multiplyToRef(locMat, locMat);\r\n\r\n // Invert scaling matrix and apply the inverse to all children\r\n scaleMat.invert();\r\n\r\n for (const child of this.children) {\r\n const cm = child.getLocalMatrix();\r\n cm.multiplyToRef(scaleMat, cm);\r\n cm.multiplyAtIndex(12, x);\r\n cm.multiplyAtIndex(13, y);\r\n cm.multiplyAtIndex(14, z);\r\n\r\n child._markAsDirtyAndDecompose();\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\r\n\r\n if (scaleChildren) {\r\n for (const child of this.children) {\r\n child.scale(x, y, z, scaleChildren);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Set the bone scaling in local space\r\n * @param scale defines the scaling vector\r\n */\r\n public setScale(scale: Vector3): void {\r\n this._decompose();\r\n this._localScaling.copyFrom(scale);\r\n this._markAsDirtyAndCompose();\r\n }\r\n\r\n /**\r\n * Gets the current scaling in local space\r\n * @returns the current scaling vector\r\n */\r\n public getScale(): Vector3 {\r\n this._decompose();\r\n return this._localScaling;\r\n }\r\n\r\n /**\r\n * Gets the current scaling in local space and stores it in a target vector\r\n * @param result defines the target vector\r\n */\r\n public getScaleToRef(result: Vector3) {\r\n this._decompose();\r\n result.copyFrom(this._localScaling);\r\n }\r\n\r\n /**\r\n * Set the yaw, pitch, and roll of the bone in local or world space\r\n * @param yaw The rotation of the bone on the y axis\r\n * @param pitch The rotation of the bone on the x axis\r\n * @param roll The rotation of the bone on the z axis\r\n * @param space The space that the axes of rotation are in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setYawPitchRoll(yaw: number, pitch: number, roll: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, quat);\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Add a rotation to the bone on an axis in local or world space\r\n * @param axis The axis to rotate the bone on\r\n * @param amount The amount to rotate the bone\r\n * @param space The space that the axis is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public rotate(axis: Vector3, amount: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const rmat = Bone._TmpMats[0];\r\n rmat.setTranslationFromFloats(0, 0, 0);\r\n Matrix.RotationAxisToRef(axis, amount, rmat);\r\n this._rotateWithMatrix(rmat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the rotation of the bone to a particular axis angle in local or world space\r\n * @param axis The axis to rotate the bone on\r\n * @param angle The angle that the bone should be rotated to\r\n * @param space The space that the axis is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setAxisAngle(axis: Vector3, angle: number, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.RotationAxisToRef(axis, angle, quat);\r\n\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.RotationAxisToRef(axis, angle, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the euler rotation of the bone in local or world space\r\n * @param rotation The euler rotation that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setRotation(rotation: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n this.setYawPitchRoll(rotation.y, rotation.x, rotation.z, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the quaternion rotation of the bone in local or world space\r\n * @param quat The quaternion rotation that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setRotationQuaternion(quat: Quaternion, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n this._decompose();\r\n this._localRotation.copyFrom(quat);\r\n\r\n this._markAsDirtyAndCompose();\r\n\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat = Bone._TmpMats[1];\r\n Matrix.FromQuaternionToRef(quat, rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat);\r\n\r\n this._rotateWithMatrix(rotMat, space, tNode);\r\n }\r\n\r\n /**\r\n * Set the rotation matrix of the bone in local or world space\r\n * @param rotMat The rotation matrix that the bone should be set to\r\n * @param space The space that the rotation is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n */\r\n public setRotationMatrix(rotMat: Matrix, space = Space.LOCAL, tNode?: TransformNode): void {\r\n if (space === Space.LOCAL) {\r\n const quat = Bone._TmpQuat;\r\n Quaternion.FromRotationMatrixToRef(rotMat, quat);\r\n this.setRotationQuaternion(quat, space, tNode);\r\n return;\r\n }\r\n\r\n const rotMatInv = Bone._TmpMats[0];\r\n if (!this._getAbsoluteInverseMatrixUnscaledToRef(rotMatInv, tNode)) {\r\n return;\r\n }\r\n\r\n const rotMat2 = Bone._TmpMats[1];\r\n rotMat2.copyFrom(rotMat);\r\n\r\n rotMatInv.multiplyToRef(rotMat, rotMat2);\r\n\r\n this._rotateWithMatrix(rotMat2, space, tNode);\r\n }\r\n\r\n private _rotateWithMatrix(rmat: Matrix, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lmat = this.getLocalMatrix();\r\n const lx = lmat.m[12];\r\n const ly = lmat.m[13];\r\n const lz = lmat.m[14];\r\n const parent = this.getParent();\r\n const parentScale = Bone._TmpMats[3];\r\n const parentScaleInv = Bone._TmpMats[4];\r\n\r\n if (parent && space == Space.WORLD) {\r\n if (tNode) {\r\n parentScale.copyFrom(tNode.getWorldMatrix());\r\n parent.getAbsoluteMatrix().multiplyToRef(parentScale, parentScale);\r\n } else {\r\n parentScale.copyFrom(parent.getAbsoluteMatrix());\r\n }\r\n parentScaleInv.copyFrom(parentScale);\r\n parentScaleInv.invert();\r\n lmat.multiplyToRef(parentScale, lmat);\r\n lmat.multiplyToRef(rmat, lmat);\r\n lmat.multiplyToRef(parentScaleInv, lmat);\r\n } else {\r\n if (space == Space.WORLD && tNode) {\r\n parentScale.copyFrom(tNode.getWorldMatrix());\r\n parentScaleInv.copyFrom(parentScale);\r\n parentScaleInv.invert();\r\n lmat.multiplyToRef(parentScale, lmat);\r\n lmat.multiplyToRef(rmat, lmat);\r\n lmat.multiplyToRef(parentScaleInv, lmat);\r\n } else {\r\n lmat.multiplyToRef(rmat, lmat);\r\n }\r\n }\r\n\r\n lmat.setTranslationFromFloats(lx, ly, lz);\r\n\r\n this.computeAbsoluteMatrices();\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n private _getAbsoluteInverseMatrixUnscaledToRef(rotMatInv: Matrix, tNode?: TransformNode): boolean {\r\n const scaleMatrix = Bone._TmpMats[2];\r\n rotMatInv.copyFrom(this.getAbsoluteMatrix());\r\n\r\n if (tNode) {\r\n rotMatInv.multiplyToRef(tNode.getWorldMatrix(), rotMatInv);\r\n Matrix.ScalingToRef(tNode.scaling.x, tNode.scaling.y, tNode.scaling.z, scaleMatrix);\r\n } else {\r\n Matrix.IdentityToRef(scaleMatrix);\r\n }\r\n\r\n rotMatInv.invert();\r\n if (isNaN(rotMatInv.m[0])) {\r\n // Matrix failed to invert.\r\n // This can happen if scale is zero for example.\r\n return false;\r\n }\r\n\r\n scaleMatrix.multiplyAtIndex(0, this._scalingDeterminant);\r\n rotMatInv.multiplyToRef(scaleMatrix, rotMatInv);\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Get the position of the bone in local or world space\r\n * @param space The space that the returned position is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The position of the bone\r\n */\r\n public getPosition(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const pos = Vector3.Zero();\r\n\r\n this.getPositionToRef(space, tNode, pos);\r\n\r\n return pos;\r\n }\r\n\r\n /**\r\n * Copy the position of the bone to a vector3 in local or world space\r\n * @param space The space that the returned position is in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 to copy the position to\r\n */\r\n public getPositionToRef(space = Space.LOCAL, tNode: Nullable<TransformNode>, result: Vector3): void {\r\n if (space == Space.LOCAL) {\r\n const lm = this.getLocalMatrix();\r\n\r\n result.x = lm.m[12];\r\n result.y = lm.m[13];\r\n result.z = lm.m[14];\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteMatrix());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteMatrix();\r\n }\r\n\r\n result.x = tmat.m[12];\r\n result.y = tmat.m[13];\r\n result.z = tmat.m[14];\r\n }\r\n }\r\n\r\n /**\r\n * Get the absolute position of the bone (world space)\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The absolute position of the bone\r\n */\r\n public getAbsolutePosition(tNode: Nullable<TransformNode> = null): Vector3 {\r\n const pos = Vector3.Zero();\r\n\r\n this.getPositionToRef(Space.WORLD, tNode, pos);\r\n\r\n return pos;\r\n }\r\n\r\n /**\r\n * Copy the absolute position of the bone (world space) to the result param\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 to copy the absolute position to\r\n */\r\n public getAbsolutePositionToRef(tNode: TransformNode, result: Vector3) {\r\n this.getPositionToRef(Space.WORLD, tNode, result);\r\n }\r\n\r\n /**\r\n * Compute the absolute matrices of this bone and its children\r\n */\r\n public computeAbsoluteMatrices(): void {\r\n this._compose();\r\n\r\n if (this.parent) {\r\n this._localMatrix.multiplyToRef(this.parent._absoluteMatrix, this._absoluteMatrix);\r\n } else {\r\n this._absoluteMatrix.copyFrom(this._localMatrix);\r\n\r\n const poseMatrix = this._skeleton.getPoseMatrix();\r\n\r\n if (poseMatrix) {\r\n this._absoluteMatrix.multiplyToRef(poseMatrix, this._absoluteMatrix);\r\n }\r\n }\r\n\r\n const children = this.children;\r\n const len = children.length;\r\n\r\n for (let i = 0; i < len; i++) {\r\n children[i].computeAbsoluteMatrices();\r\n }\r\n }\r\n\r\n /**\r\n * Compute the absolute matrices of this bone and its children\r\n * @deprecated Please use computeAbsoluteMatrices instead\r\n */\r\n public computeAbsoluteTransforms(): void {\r\n this.computeAbsoluteMatrices();\r\n }\r\n\r\n /**\r\n * Get the world direction from an axis that is in the local space of the bone\r\n * @param localAxis The local direction that is used to compute the world direction\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The world direction\r\n */\r\n public getDirection(localAxis: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getDirectionToRef(localAxis, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the world direction to a vector3 from an axis that is in the local space of the bone\r\n * @param localAxis The local direction that is used to compute the world direction\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 that the world direction will be copied to\r\n */\r\n public getDirectionToRef(localAxis: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const mat = Bone._TmpMats[0];\r\n\r\n mat.copyFrom(this.getAbsoluteMatrix());\r\n\r\n if (tNode && wm) {\r\n mat.multiplyToRef(wm, mat);\r\n }\r\n\r\n Vector3.TransformNormalToRef(localAxis, mat, result);\r\n\r\n result.normalize();\r\n }\r\n\r\n /**\r\n * Get the euler rotation of the bone in local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The euler rotation\r\n */\r\n public getRotation(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getRotationToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the euler rotation of the bone to a vector3. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 that the rotation should be copied to\r\n */\r\n public getRotationToRef(space = Space.LOCAL, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n const quat = Bone._TmpQuat;\r\n\r\n this.getRotationQuaternionToRef(space, tNode, quat);\r\n\r\n quat.toEulerAnglesToRef(result);\r\n }\r\n\r\n /**\r\n * Get the quaternion rotation of the bone in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The quaternion rotation\r\n */\r\n public getRotationQuaternion(space = Space.LOCAL, tNode: Nullable<TransformNode> = null): Quaternion {\r\n const result = Quaternion.Identity();\r\n\r\n this.getRotationQuaternionToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the quaternion rotation of the bone to a quaternion. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The quaternion that the rotation should be copied to\r\n */\r\n public getRotationQuaternionToRef(space = Space.LOCAL, tNode: Nullable<TransformNode> = null, result: Quaternion): void {\r\n if (space == Space.LOCAL) {\r\n this._decompose();\r\n result.copyFrom(this._localRotation);\r\n } else {\r\n const mat = Bone._TmpMats[0];\r\n const amat = this.getAbsoluteMatrix();\r\n\r\n if (tNode) {\r\n amat.multiplyToRef(tNode.getWorldMatrix(), mat);\r\n } else {\r\n mat.copyFrom(amat);\r\n }\r\n\r\n mat.multiplyAtIndex(0, this._scalingDeterminant);\r\n mat.multiplyAtIndex(1, this._scalingDeterminant);\r\n mat.multiplyAtIndex(2, this._scalingDeterminant);\r\n\r\n mat.decompose(undefined, result, undefined);\r\n }\r\n }\r\n\r\n /**\r\n * Get the rotation matrix of the bone in local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The rotation matrix\r\n */\r\n public getRotationMatrix(space = Space.LOCAL, tNode: TransformNode): Matrix {\r\n const result = Matrix.Identity();\r\n\r\n this.getRotationMatrixToRef(space, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the rotation matrix of the bone to a matrix. The rotation can be in either local or world space\r\n * @param space The space that the rotation should be in\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The quaternion that the rotation should be copied to\r\n */\r\n public getRotationMatrixToRef(space = Space.LOCAL, tNode: TransformNode, result: Matrix): void {\r\n if (space == Space.LOCAL) {\r\n this.getLocalMatrix().getRotationMatrixToRef(result);\r\n } else {\r\n const mat = Bone._TmpMats[0];\r\n const amat = this.getAbsoluteMatrix();\r\n\r\n if (tNode) {\r\n amat.multiplyToRef(tNode.getWorldMatrix(), mat);\r\n } else {\r\n mat.copyFrom(amat);\r\n }\r\n\r\n mat.multiplyAtIndex(0, this._scalingDeterminant);\r\n mat.multiplyAtIndex(1, this._scalingDeterminant);\r\n mat.multiplyAtIndex(2, this._scalingDeterminant);\r\n\r\n mat.getRotationMatrixToRef(result);\r\n }\r\n }\r\n\r\n /**\r\n * Get the world position of a point that is in the local space of the bone\r\n * @param position The local position\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The world position\r\n */\r\n public getAbsolutePositionFromLocal(position: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getAbsolutePositionFromLocalToRef(position, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get the world position of a point that is in the local space of the bone and copy it to the result param\r\n * @param position The local position\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 that the world position should be copied to\r\n */\r\n public getAbsolutePositionFromLocalToRef(position: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteMatrix());\r\n\r\n if (tNode && wm) {\r\n tmat.multiplyToRef(wm, tmat);\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, result);\r\n }\r\n\r\n /**\r\n * Get the local position of a point that is in world space\r\n * @param position The world position\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @returns The local position\r\n */\r\n public getLocalPositionFromAbsolute(position: Vector3, tNode: Nullable<TransformNode> = null): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getLocalPositionFromAbsoluteToRef(position, tNode, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get the local position of a point that is in world space and copy it to the result param\r\n * @param position The world position\r\n * @param tNode A TransformNode whose world matrix is to be applied to the calculated absolute matrix. In most cases, you'll want to pass the mesh associated with the skeleton from which this bone comes. Used only when space=Space.WORLD\r\n * @param result The vector3 that the local position should be copied to\r\n */\r\n public getLocalPositionFromAbsoluteToRef(position: Vector3, tNode: Nullable<TransformNode> = null, result: Vector3): void {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteMatrices()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteMatrices();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteMatrix());\r\n\r\n if (tNode && wm) {\r\n tmat.multiplyToRef(wm, tmat);\r\n }\r\n\r\n tmat.invert();\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, result);\r\n }\r\n\r\n /**\r\n * Set the current local matrix as the restMatrix for this bone.\r\n */\r\n public setCurrentPoseAsRest(): void {\r\n this.setRestMatrix(this.getLocalMatrix());\r\n }\r\n}\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CAAC;QACzB,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC7B,CAAC;;AA3OD;;GAEG;AACW,kDAAqB,GAAW,KAAK,AAAhB,CAAiB;AAc7C;IADN,SAAS,EAAE;6DACe;AAOpB;IADN,SAAS,EAAE;yEACwB;AAO7B;IADN,SAAS,EAAE;yEACwB;AAM7B;IADN,SAAS,EAAE;oEACiB;AAStB;IADN,SAAS,EAAE;0EACoB;AASzB;IADN,SAAS,EAAE;yEACgC;AAMrC;IADN,SAAS,EAAE;+DACqB;AAM1B;IADN,SAAS,EAAE;wEAC+B;AAMpC;IADN,SAAS,EAAE;uEAC6B;AAOlC;IADN,SAAS,EAAE;0EACgC;AA6J1C,gBAAiB,CAAC,8BAA8B,CAAC,GAAG,4BAA4B,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport type { ArcRotateCamera } from \"../../Cameras/arcRotateCamera\";\r\nimport { CameraInputTypes } from \"../../Cameras/cameraInputsManager\";\r\nimport { BaseCameraPointersInput } from \"../../Cameras/Inputs/BaseCameraPointersInput\";\r\nimport type { PointerTouch } from \"../../Events/pointerEvents\";\r\nimport type { IPointerEvent } from \"../../Events/deviceInputEvents\";\r\n\r\n/**\r\n * Manage the pointers inputs to control an arc rotate camera.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs\r\n */\r\nexport class ArcRotateCameraPointersInput extends BaseCameraPointersInput {\r\n /**\r\n * Defines the camera the input is attached to.\r\n */\r\n public camera: ArcRotateCamera;\r\n\r\n /**\r\n * The minimum radius used for pinch, to avoid radius lock at 0\r\n */\r\n public static MinimumRadiusForPinch: number = 0.001;\r\n\r\n /**\r\n * Gets the class name of the current input.\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"ArcRotateCameraPointersInput\";\r\n }\r\n\r\n /**\r\n * Defines the buttons associated with the input to handle camera move.\r\n */\r\n @serialize()\r\n public buttons = [0, 1, 2];\r\n\r\n /**\r\n * Defines the pointer angular sensibility along the X axis or how fast is\r\n * the camera rotating.\r\n */\r\n @serialize()\r\n public angularSensibilityX = 1000.0;\r\n\r\n /**\r\n * Defines the pointer angular sensibility along the Y axis or how fast is\r\n * the camera rotating.\r\n */\r\n @serialize()\r\n public angularSensibilityY = 1000.0;\r\n\r\n /**\r\n * Defines the pointer pinch precision or how fast is the camera zooming.\r\n */\r\n @serialize()\r\n public pinchPrecision = 12.0;\r\n\r\n /**\r\n * pinchDeltaPercentage will be used instead of pinchPrecision if different\r\n * from 0.\r\n * It defines the percentage of current camera.radius to use as delta when\r\n * pinch zoom is used.\r\n */\r\n @serialize()\r\n public pinchDeltaPercentage = 0;\r\n\r\n /**\r\n * When useNaturalPinchZoom is true, multi touch zoom will zoom in such\r\n * that any object in the plane at the camera's target point will scale\r\n * perfectly with finger motion.\r\n * Overrides pinchDeltaPercentage and pinchPrecision.\r\n */\r\n @serialize()\r\n public useNaturalPinchZoom: boolean = false;\r\n\r\n /**\r\n * Defines whether zoom (2 fingers pinch) is enabled through multitouch\r\n */\r\n @serialize()\r\n public pinchZoom: boolean = true;\r\n\r\n /**\r\n * Defines the pointer panning sensibility or how fast is the camera moving.\r\n */\r\n @serialize()\r\n public panningSensibility: number = 1000.0;\r\n\r\n /**\r\n * Defines whether panning (2 fingers swipe) is enabled through multitouch.\r\n */\r\n @serialize()\r\n public multiTouchPanning: boolean = true;\r\n\r\n /**\r\n * Defines whether panning is enabled for both pan (2 fingers swipe) and\r\n * zoom (pinch) through multitouch.\r\n */\r\n @serialize()\r\n public multiTouchPanAndZoom: boolean = true;\r\n\r\n /**\r\n * Revers pinch action direction.\r\n */\r\n public pinchInwards = true;\r\n\r\n private _isPanClick: boolean = false;\r\n private _twoFingerActivityCount: number = 0;\r\n private _isPinching: boolean = false;\r\n\r\n /**\r\n * Move camera from multi touch panning positions.\r\n * @param previousMultiTouchPanPosition\r\n * @param multiTouchPanPosition\r\n */\r\n private _computeMultiTouchPanning(previousMultiTouchPanPosition: Nullable<PointerTouch>, multiTouchPanPosition: Nullable<PointerTouch>): void {\r\n if (this.panningSensibility !== 0 && previousMultiTouchPanPosition && multiTouchPanPosition) {\r\n const moveDeltaX = multiTouchPanPosition.x - previousMultiTouchPanPosition.x;\r\n const moveDeltaY = multiTouchPanPosition.y - previousMultiTouchPanPosition.y;\r\n this.camera.inertialPanningX += -moveDeltaX / this.panningSensibility;\r\n this.camera.inertialPanningY += moveDeltaY / this.panningSensibility;\r\n }\r\n }\r\n\r\n /**\r\n * Move camera from pinch zoom distances.\r\n * @param previousPinchSquaredDistance\r\n * @param pinchSquaredDistance\r\n */\r\n private _computePinchZoom(previousPinchSquaredDistance: number, pinchSquaredDistance: number): void {\r\n const radius = this.camera.radius || ArcRotateCameraPointersInput.MinimumRadiusForPinch;\r\n if (this.useNaturalPinchZoom) {\r\n this.camera.radius = (radius * Math.sqrt(previousPinchSquaredDistance)) / Math.sqrt(pinchSquaredDistance);\r\n } else if (this.pinchDeltaPercentage) {\r\n this.camera.inertialRadiusOffset += (pinchSquaredDistance - previousPinchSquaredDistance) * 0.001 * radius * this.pinchDeltaPercentage;\r\n } else {\r\n this.camera.inertialRadiusOffset +=\r\n (pinchSquaredDistance - previousPinchSquaredDistance) /\r\n ((this.pinchPrecision * (this.pinchInwards ? 1 : -1) * (this.angularSensibilityX + this.angularSensibilityY)) / 2);\r\n }\r\n }\r\n\r\n /**\r\n * Called on pointer POINTERMOVE event if only a single touch is active.\r\n * @param point current touch point\r\n * @param offsetX offset on X\r\n * @param offsetY offset on Y\r\n */\r\n public onTouch(point: Nullable<PointerTouch>, offsetX: number, offsetY: number): void {\r\n if (this.panningSensibility !== 0 && ((this._ctrlKey && this.camera._useCtrlForPanning) || this._isPanClick)) {\r\n this.camera.inertialPanningX += -offsetX / this.panningSensibility;\r\n this.camera.inertialPanningY += offsetY / this.panningSensibility;\r\n } else {\r\n this.camera.inertialAlphaOffset -= offsetX / this.angularSensibilityX;\r\n this.camera.inertialBetaOffset -= offsetY / this.angularSensibilityY;\r\n }\r\n }\r\n\r\n /**\r\n * Called on pointer POINTERDOUBLETAP event.\r\n */\r\n public onDoubleTap() {\r\n if (this.camera.useInputToRestoreState) {\r\n this.camera.restoreState();\r\n }\r\n }\r\n\r\n /**\r\n * Called on pointer POINTERMOVE event if multiple touches are active.\r\n * @param pointA point A\r\n * @param pointB point B\r\n * @param previousPinchSquaredDistance distance between points in previous pinch\r\n * @param pinchSquaredDistance distance between points in current pinch\r\n * @param previousMultiTouchPanPosition multi-touch position in previous step\r\n * @param multiTouchPanPosition multi-touch position in current step\r\n */\r\n public onMultiTouch(\r\n pointA: Nullable<PointerTouch>,\r\n pointB: Nullable<PointerTouch>,\r\n previousPinchSquaredDistance: number,\r\n pinchSquaredDistance: number,\r\n previousMultiTouchPanPosition: Nullable<PointerTouch>,\r\n multiTouchPanPosition: Nullable<PointerTouch>\r\n ): void {\r\n if (previousPinchSquaredDistance === 0 && previousMultiTouchPanPosition === null) {\r\n // First time this method is called for new pinch.\r\n // Next time this is called there will be a\r\n // previousPinchSquaredDistance and pinchSquaredDistance to compare.\r\n return;\r\n }\r\n if (pinchSquaredDistance === 0 && multiTouchPanPosition === null) {\r\n // Last time this method is called at the end of a pinch.\r\n return;\r\n }\r\n\r\n // Zoom and panning enabled together\r\n if (this.multiTouchPanAndZoom) {\r\n this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance);\r\n this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition);\r\n\r\n // Zoom and panning enabled but only one at a time\r\n } else if (this.multiTouchPanning && this.pinchZoom) {\r\n this._twoFingerActivityCount++;\r\n\r\n if (\r\n this._isPinching ||\r\n (this._twoFingerActivityCount < 20 && Math.abs(Math.sqrt(pinchSquaredDistance) - Math.sqrt(previousPinchSquaredDistance)) > this.camera.pinchToPanMaxDistance)\r\n ) {\r\n // Since pinch has not been active long, assume we intend to zoom.\r\n this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance);\r\n\r\n // Since we are pinching, remain pinching on next iteration.\r\n this._isPinching = true;\r\n } else {\r\n // Pause between pinch starting and moving implies not a zoom event. Pan instead.\r\n this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition);\r\n }\r\n\r\n // Panning enabled, zoom disabled\r\n } else if (this.multiTouchPanning) {\r\n this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition);\r\n\r\n // Zoom enabled, panning disabled\r\n } else if (this.pinchZoom) {\r\n this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance);\r\n }\r\n }\r\n\r\n /**\r\n * Called each time a new POINTERDOWN event occurs. Ie, for each button\r\n * press.\r\n * @param evt Defines the event to track\r\n */\r\n public onButtonDown(evt: IPointerEvent): void {\r\n this._isPanClick = evt.button === this.camera._panningMouseButton;\r\n }\r\n\r\n /**\r\n * Called each time a new POINTERUP event occurs. Ie, for each button\r\n * release.\r\n * @param _evt Defines the event to track\r\n */\r\n public onButtonUp(_evt: IPointerEvent): void {\r\n this._twoFingerActivityCount = 0;\r\n this._isPinching = false;\r\n }\r\n\r\n /**\r\n * Called when window becomes inactive.\r\n */\r\n public onLostFocus(): void {\r\n this._isPanClick = false;\r\n this._twoFingerActivityCount = 0;\r\n this._isPinching = false;\r\n }\r\n}\r\n(<any>CameraInputTypes)[\"ArcRotateCameraPointersInput\"] = ArcRotateCameraPointersInput;\r\n"]}
|
|
1
|
+
{"version":3,"file":"arcRotateCameraPointersInput.js","sourceRoot":"","sources":["../../../../../dev/core/src/Cameras/Inputs/arcRotateCameraPointersInput.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAIvF;;;GAGG;AACH,MAAM,OAA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AS,EAAE;yEACgC;AAMrC;IADN,SAAS,EAAE;+DACqB;AAM1B;IADN,SAAS,EAAE;wEAC+B;AAMpC;IADN,SAAS,EAAE;uEAC6B;AAOlC;IADN,SAAS,EAAE;0EACgC;AA6J1C,gBAAiB,CAAC,8BAA8B,CAAC,GAAG,4BAA4B,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport type { ArcRotateCamera } from \"../../Cameras/arcRotateCamera\";\r\nimport { CameraInputTypes } from \"../../Cameras/cameraInputsManager\";\r\nimport { BaseCameraPointersInput } from \"../../Cameras/Inputs/BaseCameraPointersInput\";\r\nimport type { PointerTouch } from \"../../Events/pointerEvents\";\r\nimport type { IPointerEvent } from \"../../Events/deviceInputEvents\";\r\n\r\n/**\r\n * Manage the pointers inputs to control an arc rotate camera.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs\r\n */\r\nexport class ArcRotateCameraPointersInput extends BaseCameraPointersInput {\r\n /**\r\n * Defines the camera the input is attached to.\r\n */\r\n public camera: ArcRotateCamera;\r\n\r\n /**\r\n * The minimum radius used for pinch, to avoid radius lock at 0\r\n */\r\n public static MinimumRadiusForPinch: number = 0.001;\r\n\r\n /**\r\n * Gets the class name of the current input.\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return \"ArcRotateCameraPointersInput\";\r\n }\r\n\r\n /**\r\n * Defines the buttons associated with the input to handle camera move.\r\n */\r\n @serialize()\r\n public override buttons = [0, 1, 2];\r\n\r\n /**\r\n * Defines the pointer angular sensibility along the X axis or how fast is\r\n * the camera rotating.\r\n */\r\n @serialize()\r\n public angularSensibilityX = 1000.0;\r\n\r\n /**\r\n * Defines the pointer angular sensibility along the Y axis or how fast is\r\n * the camera rotating.\r\n */\r\n @serialize()\r\n public angularSensibilityY = 1000.0;\r\n\r\n /**\r\n * Defines the pointer pinch precision or how fast is the camera zooming.\r\n */\r\n @serialize()\r\n public pinchPrecision = 12.0;\r\n\r\n /**\r\n * pinchDeltaPercentage will be used instead of pinchPrecision if different\r\n * from 0.\r\n * It defines the percentage of current camera.radius to use as delta when\r\n * pinch zoom is used.\r\n */\r\n @serialize()\r\n public pinchDeltaPercentage = 0;\r\n\r\n /**\r\n * When useNaturalPinchZoom is true, multi touch zoom will zoom in such\r\n * that any object in the plane at the camera's target point will scale\r\n * perfectly with finger motion.\r\n * Overrides pinchDeltaPercentage and pinchPrecision.\r\n */\r\n @serialize()\r\n public useNaturalPinchZoom: boolean = false;\r\n\r\n /**\r\n * Defines whether zoom (2 fingers pinch) is enabled through multitouch\r\n */\r\n @serialize()\r\n public pinchZoom: boolean = true;\r\n\r\n /**\r\n * Defines the pointer panning sensibility or how fast is the camera moving.\r\n */\r\n @serialize()\r\n public panningSensibility: number = 1000.0;\r\n\r\n /**\r\n * Defines whether panning (2 fingers swipe) is enabled through multitouch.\r\n */\r\n @serialize()\r\n public multiTouchPanning: boolean = true;\r\n\r\n /**\r\n * Defines whether panning is enabled for both pan (2 fingers swipe) and\r\n * zoom (pinch) through multitouch.\r\n */\r\n @serialize()\r\n public multiTouchPanAndZoom: boolean = true;\r\n\r\n /**\r\n * Revers pinch action direction.\r\n */\r\n public pinchInwards = true;\r\n\r\n private _isPanClick: boolean = false;\r\n private _twoFingerActivityCount: number = 0;\r\n private _isPinching: boolean = false;\r\n\r\n /**\r\n * Move camera from multi touch panning positions.\r\n * @param previousMultiTouchPanPosition\r\n * @param multiTouchPanPosition\r\n */\r\n private _computeMultiTouchPanning(previousMultiTouchPanPosition: Nullable<PointerTouch>, multiTouchPanPosition: Nullable<PointerTouch>): void {\r\n if (this.panningSensibility !== 0 && previousMultiTouchPanPosition && multiTouchPanPosition) {\r\n const moveDeltaX = multiTouchPanPosition.x - previousMultiTouchPanPosition.x;\r\n const moveDeltaY = multiTouchPanPosition.y - previousMultiTouchPanPosition.y;\r\n this.camera.inertialPanningX += -moveDeltaX / this.panningSensibility;\r\n this.camera.inertialPanningY += moveDeltaY / this.panningSensibility;\r\n }\r\n }\r\n\r\n /**\r\n * Move camera from pinch zoom distances.\r\n * @param previousPinchSquaredDistance\r\n * @param pinchSquaredDistance\r\n */\r\n private _computePinchZoom(previousPinchSquaredDistance: number, pinchSquaredDistance: number): void {\r\n const radius = this.camera.radius || ArcRotateCameraPointersInput.MinimumRadiusForPinch;\r\n if (this.useNaturalPinchZoom) {\r\n this.camera.radius = (radius * Math.sqrt(previousPinchSquaredDistance)) / Math.sqrt(pinchSquaredDistance);\r\n } else if (this.pinchDeltaPercentage) {\r\n this.camera.inertialRadiusOffset += (pinchSquaredDistance - previousPinchSquaredDistance) * 0.001 * radius * this.pinchDeltaPercentage;\r\n } else {\r\n this.camera.inertialRadiusOffset +=\r\n (pinchSquaredDistance - previousPinchSquaredDistance) /\r\n ((this.pinchPrecision * (this.pinchInwards ? 1 : -1) * (this.angularSensibilityX + this.angularSensibilityY)) / 2);\r\n }\r\n }\r\n\r\n /**\r\n * Called on pointer POINTERMOVE event if only a single touch is active.\r\n * @param point current touch point\r\n * @param offsetX offset on X\r\n * @param offsetY offset on Y\r\n */\r\n public override onTouch(point: Nullable<PointerTouch>, offsetX: number, offsetY: number): void {\r\n if (this.panningSensibility !== 0 && ((this._ctrlKey && this.camera._useCtrlForPanning) || this._isPanClick)) {\r\n this.camera.inertialPanningX += -offsetX / this.panningSensibility;\r\n this.camera.inertialPanningY += offsetY / this.panningSensibility;\r\n } else {\r\n this.camera.inertialAlphaOffset -= offsetX / this.angularSensibilityX;\r\n this.camera.inertialBetaOffset -= offsetY / this.angularSensibilityY;\r\n }\r\n }\r\n\r\n /**\r\n * Called on pointer POINTERDOUBLETAP event.\r\n */\r\n public override onDoubleTap() {\r\n if (this.camera.useInputToRestoreState) {\r\n this.camera.restoreState();\r\n }\r\n }\r\n\r\n /**\r\n * Called on pointer POINTERMOVE event if multiple touches are active.\r\n * @param pointA point A\r\n * @param pointB point B\r\n * @param previousPinchSquaredDistance distance between points in previous pinch\r\n * @param pinchSquaredDistance distance between points in current pinch\r\n * @param previousMultiTouchPanPosition multi-touch position in previous step\r\n * @param multiTouchPanPosition multi-touch position in current step\r\n */\r\n public override onMultiTouch(\r\n pointA: Nullable<PointerTouch>,\r\n pointB: Nullable<PointerTouch>,\r\n previousPinchSquaredDistance: number,\r\n pinchSquaredDistance: number,\r\n previousMultiTouchPanPosition: Nullable<PointerTouch>,\r\n multiTouchPanPosition: Nullable<PointerTouch>\r\n ): void {\r\n if (previousPinchSquaredDistance === 0 && previousMultiTouchPanPosition === null) {\r\n // First time this method is called for new pinch.\r\n // Next time this is called there will be a\r\n // previousPinchSquaredDistance and pinchSquaredDistance to compare.\r\n return;\r\n }\r\n if (pinchSquaredDistance === 0 && multiTouchPanPosition === null) {\r\n // Last time this method is called at the end of a pinch.\r\n return;\r\n }\r\n\r\n // Zoom and panning enabled together\r\n if (this.multiTouchPanAndZoom) {\r\n this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance);\r\n this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition);\r\n\r\n // Zoom and panning enabled but only one at a time\r\n } else if (this.multiTouchPanning && this.pinchZoom) {\r\n this._twoFingerActivityCount++;\r\n\r\n if (\r\n this._isPinching ||\r\n (this._twoFingerActivityCount < 20 && Math.abs(Math.sqrt(pinchSquaredDistance) - Math.sqrt(previousPinchSquaredDistance)) > this.camera.pinchToPanMaxDistance)\r\n ) {\r\n // Since pinch has not been active long, assume we intend to zoom.\r\n this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance);\r\n\r\n // Since we are pinching, remain pinching on next iteration.\r\n this._isPinching = true;\r\n } else {\r\n // Pause between pinch starting and moving implies not a zoom event. Pan instead.\r\n this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition);\r\n }\r\n\r\n // Panning enabled, zoom disabled\r\n } else if (this.multiTouchPanning) {\r\n this._computeMultiTouchPanning(previousMultiTouchPanPosition, multiTouchPanPosition);\r\n\r\n // Zoom enabled, panning disabled\r\n } else if (this.pinchZoom) {\r\n this._computePinchZoom(previousPinchSquaredDistance, pinchSquaredDistance);\r\n }\r\n }\r\n\r\n /**\r\n * Called each time a new POINTERDOWN event occurs. Ie, for each button\r\n * press.\r\n * @param evt Defines the event to track\r\n */\r\n public override onButtonDown(evt: IPointerEvent): void {\r\n this._isPanClick = evt.button === this.camera._panningMouseButton;\r\n }\r\n\r\n /**\r\n * Called each time a new POINTERUP event occurs. Ie, for each button\r\n * release.\r\n * @param _evt Defines the event to track\r\n */\r\n public override onButtonUp(_evt: IPointerEvent): void {\r\n this._twoFingerActivityCount = 0;\r\n this._isPinching = false;\r\n }\r\n\r\n /**\r\n * Called when window becomes inactive.\r\n */\r\n public override onLostFocus(): void {\r\n this._isPanClick = false;\r\n this._twoFingerActivityCount = 0;\r\n this._isPinching = false;\r\n }\r\n}\r\n(<any>CameraInputTypes)[\"ArcRotateCameraPointersInput\"] = ArcRotateCameraPointersInput;\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"followCameraPointersInput.js","sourceRoot":"","sources":["../../../../../dev/core/src/Cameras/Inputs/followCameraPointersInput.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,OAAO,EAAE,MAAM,EAAE,6BAAyB;AAE1C;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,uBAAuB;IAAtE;;QAcI;;;;WAIG;QAEI,wBAAmB,GAAG,CAAC,CAAC;QAE/B;;;;WAIG;QAEI,wBAAmB,GAAG,CAAC,CAAC;QAE/B;;;WAGG;QAEI,mBAAc,GAAG,OAAO,CAAC;QAEhC;;;;;WAKG;QAEI,yBAAoB,GAAG,CAAC,CAAC;QAEhC;;WAEG;QAEI,uBAAkB,GAAY,KA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AAI,CACP,IAAI;gBACA,4BAA4B;gBAC5B,IAAI,CAAC,wBAAwB;gBAC7B,4BAA4B;gBAC5B,IAAI,CAAC,sBAAsB;gBAC3B,4BAA4B;gBAC5B,IAAI,CAAC,sBAAsB,CAClC,CAAC;SACL;IACL,CAAC;CACJ;AApMU;IADN,SAAS,EAAE;sEACmB;AAQxB;IADN,SAAS,EAAE;sEACmB;AAOxB;IADN,SAAS,EAAE;iEACoB;AASzB;IADN,SAAS,EAAE;uEACoB;AAMzB;IADN,SAAS,EAAE;qEAC+B;AAMpC;IADN,SAAS,EAAE;qEAC+B;AAMpC;IADN,SAAS,EAAE;uEACgC;AAMrC;IADN,SAAS,EAAE;qEAC+B;AAMpC;IADN,SAAS,EAAE;qEAC8B;AAMnC;IADN,SAAS,EAAE;uEACiC;AAMtC;IADN,SAAS,EAAE;yEACkC;AAMvC;IADN,SAAS,EAAE;yEACmC;AAMxC;IADN,SAAS,EAAE;2EACqC;AAuH/C,gBAAiB,CAAC,2BAA2B,CAAC,GAAG,yBAAyB,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport type { FollowCamera } from \"../../Cameras/followCamera\";\r\nimport { CameraInputTypes } from \"../../Cameras/cameraInputsManager\";\r\nimport { BaseCameraPointersInput } from \"../../Cameras/Inputs/BaseCameraPointersInput\";\r\nimport type { PointerTouch } from \"../../Events/pointerEvents\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/**\r\n * Manage the pointers inputs to control an follow camera.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs\r\n */\r\nexport class FollowCameraPointersInput extends BaseCameraPointersInput {\r\n /**\r\n * Defines the camera the input is attached to.\r\n */\r\n public camera: FollowCamera;\r\n\r\n /**\r\n * Gets the class name of the current input.\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"FollowCameraPointersInput\";\r\n }\r\n\r\n /**\r\n * Defines the pointer angular sensibility along the X axis or how fast is\r\n * the camera rotating.\r\n * A negative number will reverse the axis direction.\r\n */\r\n @serialize()\r\n public angularSensibilityX = 1;\r\n\r\n /**\r\n * Defines the pointer angular sensibility along the Y axis or how fast is\r\n * the camera rotating.\r\n * A negative number will reverse the axis direction.\r\n */\r\n @serialize()\r\n public angularSensibilityY = 1;\r\n\r\n /**\r\n * Defines the pointer pinch precision or how fast is the camera zooming.\r\n * A negative number will reverse the axis direction.\r\n */\r\n @serialize()\r\n public pinchPrecision = 10000.0;\r\n\r\n /**\r\n * pinchDeltaPercentage will be used instead of pinchPrecision if different\r\n * from 0.\r\n * It defines the percentage of current camera.radius to use as delta when\r\n * pinch zoom is used.\r\n */\r\n @serialize()\r\n public pinchDeltaPercentage = 0;\r\n\r\n /**\r\n * Pointer X axis controls zoom. (X axis modifies camera.radius value.)\r\n */\r\n @serialize()\r\n public axisXControlRadius: boolean = false;\r\n\r\n /**\r\n * Pointer X axis controls height. (X axis modifies camera.heightOffset value.)\r\n */\r\n @serialize()\r\n public axisXControlHeight: boolean = false;\r\n\r\n /**\r\n * Pointer X axis controls angle. (X axis modifies camera.rotationOffset value.)\r\n */\r\n @serialize()\r\n public axisXControlRotation: boolean = true;\r\n\r\n /**\r\n * Pointer Y axis controls zoom. (Y axis modifies camera.radius value.)\r\n */\r\n @serialize()\r\n public axisYControlRadius: boolean = false;\r\n\r\n /**\r\n * Pointer Y axis controls height. (Y axis modifies camera.heightOffset value.)\r\n */\r\n @serialize()\r\n public axisYControlHeight: boolean = true;\r\n\r\n /**\r\n * Pointer Y axis controls angle. (Y axis modifies camera.rotationOffset value.)\r\n */\r\n @serialize()\r\n public axisYControlRotation: boolean = false;\r\n\r\n /**\r\n * Pinch controls zoom. (Pinch modifies camera.radius value.)\r\n */\r\n @serialize()\r\n public axisPinchControlRadius: boolean = true;\r\n\r\n /**\r\n * Pinch controls height. (Pinch modifies camera.heightOffset value.)\r\n */\r\n @serialize()\r\n public axisPinchControlHeight: boolean = false;\r\n\r\n /**\r\n * Pinch controls angle. (Pinch modifies camera.rotationOffset value.)\r\n */\r\n @serialize()\r\n public axisPinchControlRotation: boolean = false;\r\n\r\n /**\r\n * Log error messages if basic misconfiguration has occurred.\r\n */\r\n public warningEnable: boolean = true;\r\n\r\n public onTouch(pointA: Nullable<PointerTouch>, offsetX: number, offsetY: number): void {\r\n this._warning();\r\n\r\n if (this.axisXControlRotation) {\r\n this.camera.rotationOffset += offsetX / this.angularSensibilityX;\r\n } else if (this.axisYControlRotation) {\r\n this.camera.rotationOffset += offsetY / this.angularSensibilityX;\r\n }\r\n\r\n if (this.axisXControlHeight) {\r\n this.camera.heightOffset += offsetX / this.angularSensibilityY;\r\n } else if (this.axisYControlHeight) {\r\n this.camera.heightOffset += offsetY / this.angularSensibilityY;\r\n }\r\n\r\n if (this.axisXControlRadius) {\r\n this.camera.radius -= offsetX / this.angularSensibilityY;\r\n } else if (this.axisYControlRadius) {\r\n this.camera.radius -= offsetY / this.angularSensibilityY;\r\n }\r\n }\r\n\r\n public onMultiTouch(\r\n pointA: Nullable<PointerTouch>,\r\n pointB: Nullable<PointerTouch>,\r\n previousPinchSquaredDistance: number,\r\n pinchSquaredDistance: number,\r\n previousMultiTouchPanPosition: Nullable<PointerTouch>,\r\n multiTouchPanPosition: Nullable<PointerTouch>\r\n ): void {\r\n if (previousPinchSquaredDistance === 0 && previousMultiTouchPanPosition === null) {\r\n // First time this method is called for new pinch.\r\n // Next time this is called there will be a\r\n // previousPinchSquaredDistance and pinchSquaredDistance to compare.\r\n return;\r\n }\r\n if (pinchSquaredDistance === 0 && multiTouchPanPosition === null) {\r\n // Last time this method is called at the end of a pinch.\r\n return;\r\n }\r\n let pinchDelta = (pinchSquaredDistance - previousPinchSquaredDistance) / ((this.pinchPrecision * (this.angularSensibilityX + this.angularSensibilityY)) / 2);\r\n\r\n if (this.pinchDeltaPercentage) {\r\n pinchDelta *= 0.01 * this.pinchDeltaPercentage;\r\n if (this.axisPinchControlRotation) {\r\n this.camera.rotationOffset += pinchDelta * this.camera.rotationOffset;\r\n }\r\n if (this.axisPinchControlHeight) {\r\n this.camera.heightOffset += pinchDelta * this.camera.heightOffset;\r\n }\r\n if (this.axisPinchControlRadius) {\r\n this.camera.radius -= pinchDelta * this.camera.radius;\r\n }\r\n } else {\r\n if (this.axisPinchControlRotation) {\r\n this.camera.rotationOffset += pinchDelta;\r\n }\r\n\r\n if (this.axisPinchControlHeight) {\r\n this.camera.heightOffset += pinchDelta;\r\n }\r\n\r\n if (this.axisPinchControlRadius) {\r\n this.camera.radius -= pinchDelta;\r\n }\r\n }\r\n }\r\n\r\n /* Check for obvious misconfiguration. */\r\n private _warningCounter: number = 0;\r\n private _warning(): void {\r\n if (!this.warningEnable || this._warningCounter++ % 100 !== 0) {\r\n return;\r\n }\r\n const warn =\r\n \"It probably only makes sense to control ONE camera \" + \"property with each pointer axis. Set 'warningEnable = false' \" + \"if you are sure. Currently enabled: \";\r\n\r\n if (+this.axisXControlRotation + +this.axisXControlHeight + +this.axisXControlRadius <= 1) {\r\n Logger.Warn(\r\n warn +\r\n \"axisXControlRotation: \" +\r\n this.axisXControlRotation +\r\n \", axisXControlHeight: \" +\r\n this.axisXControlHeight +\r\n \", axisXControlRadius: \" +\r\n this.axisXControlRadius\r\n );\r\n }\r\n if (+this.axisYControlRotation + +this.axisYControlHeight + +this.axisYControlRadius <= 1) {\r\n Logger.Warn(\r\n warn +\r\n \"axisYControlRotation: \" +\r\n this.axisYControlRotation +\r\n \", axisYControlHeight: \" +\r\n this.axisYControlHeight +\r\n \", axisYControlRadius: \" +\r\n this.axisYControlRadius\r\n );\r\n }\r\n if (+this.axisPinchControlRotation + +this.axisPinchControlHeight + +this.axisPinchControlRadius <= 1) {\r\n Logger.Warn(\r\n warn +\r\n \"axisPinchControlRotation: \" +\r\n this.axisPinchControlRotation +\r\n \", axisPinchControlHeight: \" +\r\n this.axisPinchControlHeight +\r\n \", axisPinchControlRadius: \" +\r\n this.axisPinchControlRadius\r\n );\r\n }\r\n }\r\n}\r\n(<any>CameraInputTypes)[\"FollowCameraPointersInput\"] = FollowCameraPointersInput;\r\n"]}
|
|
1
|
+
{"version":3,"file":"followCameraPointersInput.js","sourceRoot":"","sources":["../../../../../dev/core/src/Cameras/Inputs/followCameraPointersInput.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,OAAO,EAAE,MAAM,EAAE,6BAAyB;AAE1C;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,uBAAuB;IAAtE;;QAcI;;;;WAIG;QAEI,wBAAmB,GAAG,CAAC,CAAC;QAE/B;;;;WAIG;QAEI,wBAAmB,GAAG,CAAC,CAAC;QAE/B;;;WAGG;QAEI,mBAAc,GAAG,OAAO,CAAC;QAEhC;;;;;WAKG;QAEI,yBAAoB,GAAG,CAAC,CAAC;QAEhC;;WAEG;QAEI,uBAAkB,GAAY,KAAK,CAAC;QAE3C;;WAEG;QAEI,uBAAkB,GAAY,KAAK,CAAC;QAE3C;;WAEG;QAEI,yBAAoB,GAAY,IAAI,CAAC;QAE5C;;WAEG;QAEI,uBAAkB,GAAY,KAAK,CAAC;QAE3C;;WAEG;QAEI,uBAAkB,GAAY,IAAI,CAAC;QAE1C;;WAEG;QAEI,yBAAoB,GAAY,KAAK,CAAC;QAE7C;;WAEG;QAEI,2BAAsB,GAAY,IAAI,CAAC;QAE9C;;WAEG;QAEI,2BAAsB,GAAY,KAAK,CAAC;QAE/C;;WAEG;QAEI,6BAAwB,GAAY,KAAK,CAAC;QAEjD;;WAEG;QACI,kBAAa,GAAY,IAAI,CAAC;QAsErC,yCAAyC;QACjC,oBAAe,GAAW,CAAC,CAAC;IA0CxC,CAAC;IAlNG;;;OAGG;IACa,YAAY;QACxB,OAAO,2BAA2B,CAAC;IACvC,C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EAAE;yEACmC;AAMxC;IADN,SAAS,EAAE;2EACqC;AAuH/C,gBAAiB,CAAC,2BAA2B,CAAC,GAAG,yBAAyB,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport type { FollowCamera } from \"../../Cameras/followCamera\";\r\nimport { CameraInputTypes } from \"../../Cameras/cameraInputsManager\";\r\nimport { BaseCameraPointersInput } from \"../../Cameras/Inputs/BaseCameraPointersInput\";\r\nimport type { PointerTouch } from \"../../Events/pointerEvents\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/**\r\n * Manage the pointers inputs to control an follow camera.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs\r\n */\r\nexport class FollowCameraPointersInput extends BaseCameraPointersInput {\r\n /**\r\n * Defines the camera the input is attached to.\r\n */\r\n public camera: FollowCamera;\r\n\r\n /**\r\n * Gets the class name of the current input.\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return \"FollowCameraPointersInput\";\r\n }\r\n\r\n /**\r\n * Defines the pointer angular sensibility along the X axis or how fast is\r\n * the camera rotating.\r\n * A negative number will reverse the axis direction.\r\n */\r\n @serialize()\r\n public angularSensibilityX = 1;\r\n\r\n /**\r\n * Defines the pointer angular sensibility along the Y axis or how fast is\r\n * the camera rotating.\r\n * A negative number will reverse the axis direction.\r\n */\r\n @serialize()\r\n public angularSensibilityY = 1;\r\n\r\n /**\r\n * Defines the pointer pinch precision or how fast is the camera zooming.\r\n * A negative number will reverse the axis direction.\r\n */\r\n @serialize()\r\n public pinchPrecision = 10000.0;\r\n\r\n /**\r\n * pinchDeltaPercentage will be used instead of pinchPrecision if different\r\n * from 0.\r\n * It defines the percentage of current camera.radius to use as delta when\r\n * pinch zoom is used.\r\n */\r\n @serialize()\r\n public pinchDeltaPercentage = 0;\r\n\r\n /**\r\n * Pointer X axis controls zoom. (X axis modifies camera.radius value.)\r\n */\r\n @serialize()\r\n public axisXControlRadius: boolean = false;\r\n\r\n /**\r\n * Pointer X axis controls height. (X axis modifies camera.heightOffset value.)\r\n */\r\n @serialize()\r\n public axisXControlHeight: boolean = false;\r\n\r\n /**\r\n * Pointer X axis controls angle. (X axis modifies camera.rotationOffset value.)\r\n */\r\n @serialize()\r\n public axisXControlRotation: boolean = true;\r\n\r\n /**\r\n * Pointer Y axis controls zoom. (Y axis modifies camera.radius value.)\r\n */\r\n @serialize()\r\n public axisYControlRadius: boolean = false;\r\n\r\n /**\r\n * Pointer Y axis controls height. (Y axis modifies camera.heightOffset value.)\r\n */\r\n @serialize()\r\n public axisYControlHeight: boolean = true;\r\n\r\n /**\r\n * Pointer Y axis controls angle. (Y axis modifies camera.rotationOffset value.)\r\n */\r\n @serialize()\r\n public axisYControlRotation: boolean = false;\r\n\r\n /**\r\n * Pinch controls zoom. (Pinch modifies camera.radius value.)\r\n */\r\n @serialize()\r\n public axisPinchControlRadius: boolean = true;\r\n\r\n /**\r\n * Pinch controls height. (Pinch modifies camera.heightOffset value.)\r\n */\r\n @serialize()\r\n public axisPinchControlHeight: boolean = false;\r\n\r\n /**\r\n * Pinch controls angle. (Pinch modifies camera.rotationOffset value.)\r\n */\r\n @serialize()\r\n public axisPinchControlRotation: boolean = false;\r\n\r\n /**\r\n * Log error messages if basic misconfiguration has occurred.\r\n */\r\n public warningEnable: boolean = true;\r\n\r\n public override onTouch(pointA: Nullable<PointerTouch>, offsetX: number, offsetY: number): void {\r\n this._warning();\r\n\r\n if (this.axisXControlRotation) {\r\n this.camera.rotationOffset += offsetX / this.angularSensibilityX;\r\n } else if (this.axisYControlRotation) {\r\n this.camera.rotationOffset += offsetY / this.angularSensibilityX;\r\n }\r\n\r\n if (this.axisXControlHeight) {\r\n this.camera.heightOffset += offsetX / this.angularSensibilityY;\r\n } else if (this.axisYControlHeight) {\r\n this.camera.heightOffset += offsetY / this.angularSensibilityY;\r\n }\r\n\r\n if (this.axisXControlRadius) {\r\n this.camera.radius -= offsetX / this.angularSensibilityY;\r\n } else if (this.axisYControlRadius) {\r\n this.camera.radius -= offsetY / this.angularSensibilityY;\r\n }\r\n }\r\n\r\n public override onMultiTouch(\r\n pointA: Nullable<PointerTouch>,\r\n pointB: Nullable<PointerTouch>,\r\n previousPinchSquaredDistance: number,\r\n pinchSquaredDistance: number,\r\n previousMultiTouchPanPosition: Nullable<PointerTouch>,\r\n multiTouchPanPosition: Nullable<PointerTouch>\r\n ): void {\r\n if (previousPinchSquaredDistance === 0 && previousMultiTouchPanPosition === null) {\r\n // First time this method is called for new pinch.\r\n // Next time this is called there will be a\r\n // previousPinchSquaredDistance and pinchSquaredDistance to compare.\r\n return;\r\n }\r\n if (pinchSquaredDistance === 0 && multiTouchPanPosition === null) {\r\n // Last time this method is called at the end of a pinch.\r\n return;\r\n }\r\n let pinchDelta = (pinchSquaredDistance - previousPinchSquaredDistance) / ((this.pinchPrecision * (this.angularSensibilityX + this.angularSensibilityY)) / 2);\r\n\r\n if (this.pinchDeltaPercentage) {\r\n pinchDelta *= 0.01 * this.pinchDeltaPercentage;\r\n if (this.axisPinchControlRotation) {\r\n this.camera.rotationOffset += pinchDelta * this.camera.rotationOffset;\r\n }\r\n if (this.axisPinchControlHeight) {\r\n this.camera.heightOffset += pinchDelta * this.camera.heightOffset;\r\n }\r\n if (this.axisPinchControlRadius) {\r\n this.camera.radius -= pinchDelta * this.camera.radius;\r\n }\r\n } else {\r\n if (this.axisPinchControlRotation) {\r\n this.camera.rotationOffset += pinchDelta;\r\n }\r\n\r\n if (this.axisPinchControlHeight) {\r\n this.camera.heightOffset += pinchDelta;\r\n }\r\n\r\n if (this.axisPinchControlRadius) {\r\n this.camera.radius -= pinchDelta;\r\n }\r\n }\r\n }\r\n\r\n /* Check for obvious misconfiguration. */\r\n private _warningCounter: number = 0;\r\n private _warning(): void {\r\n if (!this.warningEnable || this._warningCounter++ % 100 !== 0) {\r\n return;\r\n }\r\n const warn =\r\n \"It probably only makes sense to control ONE camera \" + \"property with each pointer axis. Set 'warningEnable = false' \" + \"if you are sure. Currently enabled: \";\r\n\r\n if (+this.axisXControlRotation + +this.axisXControlHeight + +this.axisXControlRadius <= 1) {\r\n Logger.Warn(\r\n warn +\r\n \"axisXControlRotation: \" +\r\n this.axisXControlRotation +\r\n \", axisXControlHeight: \" +\r\n this.axisXControlHeight +\r\n \", axisXControlRadius: \" +\r\n this.axisXControlRadius\r\n );\r\n }\r\n if (+this.axisYControlRotation + +this.axisYControlHeight + +this.axisYControlRadius <= 1) {\r\n Logger.Warn(\r\n warn +\r\n \"axisYControlRotation: \" +\r\n this.axisYControlRotation +\r\n \", axisYControlHeight: \" +\r\n this.axisYControlHeight +\r\n \", axisYControlRadius: \" +\r\n this.axisYControlRadius\r\n );\r\n }\r\n if (+this.axisPinchControlRotation + +this.axisPinchControlHeight + +this.axisPinchControlRadius <= 1) {\r\n Logger.Warn(\r\n warn +\r\n \"axisPinchControlRotation: \" +\r\n this.axisPinchControlRotation +\r\n \", axisPinchControlHeight: \" +\r\n this.axisPinchControlHeight +\r\n \", axisPinchControlRadius: \" +\r\n this.axisPinchControlRadius\r\n );\r\n }\r\n }\r\n}\r\n(<any>CameraInputTypes)[\"FollowCameraPointersInput\"] = FollowCameraPointersInput;\r\n"]}
|