@babylonjs/core 6.8.1 → 6.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Actions/action.d.ts +4 -5
- package/Actions/action.js.map +1 -1
- package/Actions/condition.d.ts +1 -2
- package/Actions/condition.js.map +1 -1
- package/Actions/directActions.d.ts +1 -2
- package/Actions/directActions.js.map +1 -1
- package/Animations/animatable.interface.d.ts +1 -2
- package/Animations/animatable.interface.js.map +1 -1
- package/Animations/animation.d.ts +3 -4
- package/Animations/animation.js.map +1 -1
- package/Animations/runtimeAnimation.d.ts +1 -2
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Bones/bone.d.ts +3 -3
- package/Bones/bone.js.map +1 -1
- package/Cameras/arcRotateCamera.d.ts +1 -2
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +6 -7
- package/Cameras/camera.js.map +1 -1
- package/Cameras/flyCamera.js.map +1 -1
- package/Cameras/freeCamera.js.map +1 -1
- package/Collisions/meshCollisionData.d.ts +1 -2
- package/Collisions/meshCollisionData.js.map +1 -1
- package/Collisions/pickingInfo.d.ts +1 -2
- package/Collisions/pickingInfo.js.map +1 -1
- package/Compute/computeEffect.d.ts +1 -2
- package/Compute/computeEffect.js.map +1 -1
- package/Culling/Octrees/octreeSceneComponent.d.ts +1 -2
- package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
- package/Culling/boundingBox.d.ts +1 -2
- package/Culling/boundingBox.js.map +1 -1
- package/Culling/boundingInfo.d.ts +1 -2
- package/Culling/boundingInfo.js.map +1 -1
- package/Culling/ray.js.map +1 -1
- package/Engines/Extensions/engine.storageBuffer.d.ts +1 -2
- package/Engines/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/Extensions/engine.textureSampler.d.ts +1 -2
- package/Engines/Extensions/engine.textureSampler.js.map +1 -1
- package/Engines/Processors/iShaderProcessor.d.ts +1 -2
- package/Engines/Processors/iShaderProcessor.js.map +1 -1
- package/Engines/Processors/shaderProcessor.d.ts +5 -6
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGLShaderProcessors.d.ts +1 -2
- package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.d.ts +1 -2
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.textureSampler.d.ts +1 -2
- package/Engines/WebGPU/Extensions/engine.textureSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.d.ts +1 -2
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/engine.d.ts +3 -3
- package/Engines/engine.js.map +1 -1
- package/Engines/engineStore.d.ts +4 -5
- package/Engines/engineStore.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +1 -2
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/pointerEvents.d.ts +1 -2
- package/Events/pointerEvents.js.map +1 -1
- package/Helpers/textureDome.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +1 -2
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +3 -4
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.d.ts +1 -2
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialDecorator.d.ts +2 -3
- package/Materials/Node/nodeMaterialDecorator.js.map +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSheenConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +3 -4
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +2 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.d.ts +2 -3
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +3 -4
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/rawTexture.d.ts +1 -2
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.d.ts +1 -2
- package/Materials/Textures/rawTexture2DArray.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +1 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +4 -5
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/drawWrapper.d.ts +3 -4
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.d.ts +5 -6
- package/Materials/effect.js.map +1 -1
- package/Materials/effectFallbacks.d.ts +2 -3
- package/Materials/effectFallbacks.js.map +1 -1
- package/Materials/iEffectFallbacks.d.ts +1 -2
- package/Materials/iEffectFallbacks.js.map +1 -1
- package/Materials/imageProcessingConfiguration.d.ts +2 -3
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Materials/material.d.ts +3 -4
- package/Materials/material.detailMapConfiguration.d.ts +4 -5
- package/Materials/material.detailMapConfiguration.js.map +1 -1
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginBase.d.ts +11 -12
- package/Materials/materialPluginBase.js.map +1 -1
- package/Materials/materialPluginEvent.d.ts +8 -9
- package/Materials/materialPluginEvent.js.map +1 -1
- package/Materials/materialPluginFactoryExport.d.ts +1 -2
- package/Materials/materialPluginFactoryExport.js.map +1 -1
- package/Materials/materialPluginManager.d.ts +3 -4
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/materialStencilState.d.ts +1 -2
- package/Materials/materialStencilState.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +1 -2
- package/Materials/shaderMaterial.js.map +1 -1
- package/Meshes/Builders/linesBuilder.d.ts +1 -2
- package/Meshes/Builders/linesBuilder.js.map +1 -1
- package/Meshes/Builders/textBuilder.d.ts +34 -0
- package/Meshes/Builders/textBuilder.js +10 -2
- package/Meshes/Builders/textBuilder.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +5 -5
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +1 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.d.ts +6 -6
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.d.ts +2 -3
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/subMesh.d.ts +7 -8
- package/Meshes/subMesh.js.map +1 -1
- package/Misc/copyTools.d.ts +1 -2
- package/Misc/copyTools.js.map +1 -1
- package/Misc/decorators.d.ts +5 -6
- package/Misc/decorators.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +12 -0
- package/Misc/greasedLineTools.js +36 -0
- package/Misc/greasedLineTools.js.map +1 -1
- package/Misc/rgbdTextureTools.d.ts +3 -4
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/Misc/screenshotTools.d.ts +1 -2
- package/Misc/screenshotTools.js.map +1 -1
- package/Morph/morphTarget.d.ts +2 -1
- package/Morph/morphTarget.js.map +1 -1
- package/Particles/EmitterTypes/IParticleEmitterType.d.ts +1 -2
- package/Particles/EmitterTypes/IParticleEmitterType.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +2 -3
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +1 -2
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particle.js.map +1 -1
- package/Particles/particleSystem.d.ts +1 -2
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/subEmitter.d.ts +2 -3
- package/Particles/subEmitter.js.map +1 -1
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.d.ts +1 -2
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.d.ts +1 -2
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.d.ts +1 -2
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.d.ts +1 -2
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +1 -2
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.d.ts +1 -2
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/colorCorrectionPostProcess.d.ts +1 -2
- package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/convolutionPostProcess.d.ts +1 -2
- package/PostProcesses/convolutionPostProcess.js.map +1 -1
- package/PostProcesses/displayPassPostProcess.d.ts +1 -2
- package/PostProcesses/displayPassPostProcess.js.map +1 -1
- package/PostProcesses/filterPostProcess.d.ts +1 -2
- package/PostProcesses/filterPostProcess.js.map +1 -1
- package/PostProcesses/fxaaPostProcess.d.ts +1 -2
- package/PostProcesses/fxaaPostProcess.js.map +1 -1
- package/PostProcesses/grainPostProcess.d.ts +1 -2
- package/PostProcesses/grainPostProcess.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.d.ts +2 -3
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/passPostProcess.d.ts +1 -2
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +6 -6
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/postProcessManager.d.ts +1 -2
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/PostProcesses/refractionPostProcess.d.ts +1 -2
- package/PostProcesses/refractionPostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.d.ts +2 -3
- package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.d.ts +2 -3
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.d.ts +2 -3
- package/PostProcesses/sharpenPostProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.d.ts +1 -2
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +1 -2
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/depthRenderer.d.ts +2 -3
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +2 -2
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/renderingManager.d.ts +5 -6
- package/Rendering/renderingManager.js.map +1 -1
- package/Sprites/sprite.d.ts +1 -2
- package/Sprites/sprite.js.map +1 -1
- package/Sprites/spriteManager.d.ts +1 -2
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.d.ts +2 -3
- package/Sprites/spriteRenderer.js.map +1 -1
- package/XR/webXRExperienceHelper.js +1 -0
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/abstractScene.d.ts +3 -3
- package/abstractScene.js.map +1 -1
- package/node.d.ts +6 -7
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +49 -50
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +6 -7
- package/sceneComponent.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeAnimation.js","sourceRoot":"","sources":["../../../../lts/core/generated/Animations/runtimeAnimation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAOxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,8CAA8C;AAE9C,aAAa;AACb,MAAM,4BAA4B,GAA8B,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE1G,UAAU;AACV,MAAM,yBAAyB,GAA2B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAExF,UAAU;AACV,MAAM,yBAAyB,GAA2B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAExF,OAAO;AACP,MAAM,sBAAsB,GAAwB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAE/E,SAAS;AACT,MAAM,wBAAwB,GAA0B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAA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;QAEpC,eAAe;QACf,IAAI,MAAM,CAAC,MAAM,EAAE;YACf,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBAChD,kGAAkG;gBAClG,mDAAmD;gBACnD,IACI,CAAC,KAAK,GAAG,CAAC,IAAI,YAAY,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC;oBACjF,CAAC,KAAK,GAAG,CAAC,IAAI,YAAY,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,EACnF;oBACE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;oBAC5B,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;wBACf,gDAAgD;wBAChD,IAAI,KAAK,CAAC,QAAQ,EAAE;4BAChB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;4BACxB,KAAK,EAAE,CAAC;yBACX;wBACD,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;wBACpB,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;qBAC9B,CAAC,sDAAsD;iBAC3D;aACJ;SACJ;QAED,IAAI,CAAC,WAAW,EAAE;YACd,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;SACxB;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;CACJ","sourcesContent":["import type { DeepImmutable, Nullable } from \"../types\";\r\nimport { Quaternion, Vector3, Vector2, Matrix } from \"../Maths/math.vector\";\r\nimport { Color3 } from \"../Maths/math.color\";\r\nimport type { _IAnimationState } from \"./animation\";\r\nimport { Animation } from \"./animation\";\r\nimport type { AnimationEvent } from \"./animationEvent\";\r\n\r\ndeclare type Animatable = import(\"./animatable\").Animatable;\r\n\r\nimport type { Scene } from \"../scene\";\r\nimport type { IAnimationKey } from \"./animationKey\";\r\nimport { Size } from \"../Maths/math.size\";\r\n\r\n// Static values to help the garbage collector\r\n\r\n// Quaternion\r\nconst _staticOffsetValueQuaternion: DeepImmutable<Quaternion> = Object.freeze(new Quaternion(0, 0, 0, 0));\r\n\r\n// Vector3\r\nconst _staticOffsetValueVector3: DeepImmutable<Vector3> = Object.freeze(Vector3.Zero());\r\n\r\n// Vector2\r\nconst _staticOffsetValueVector2: DeepImmutable<Vector2> = Object.freeze(Vector2.Zero());\r\n\r\n// Size\r\nconst _staticOffsetValueSize: DeepImmutable<Size> = Object.freeze(Size.Zero());\r\n\r\n// Color3\r\nconst _staticOffsetValueColor3: DeepImmutable<Color3> = Object.freeze(Color3.Black());\r\n\r\n/**\r\n * Defines a runtime animation\r\n */\r\nexport class RuntimeAnimation {\r\n private _events = new Array<AnimationEvent>();\r\n\r\n /**\r\n * The current frame of the runtime animation\r\n */\r\n private _currentFrame: number = 0;\r\n\r\n /**\r\n * The animation used by the runtime animation\r\n */\r\n private _animation: Animation;\r\n\r\n /**\r\n * The target of the runtime animation\r\n */\r\n private _target: any;\r\n\r\n /**\r\n * The initiating animatable\r\n */\r\n private _host: Animatable;\r\n\r\n /**\r\n * The original value of the runtime animation\r\n */\r\n private _originalValue = new Array<any>();\r\n\r\n /**\r\n * The original blend value of the runtime animation\r\n */\r\n private _originalBlendValue: Nullable<any> = null;\r\n\r\n /**\r\n * The offsets cache of the runtime animation\r\n */\r\n private _offsetsCache: { [key: string]: any } = {};\r\n\r\n /**\r\n * The high limits cache of the runtime animation\r\n */\r\n private _highLimitsCache: { [key: string]: any } = {};\r\n\r\n /**\r\n * Specifies if the runtime animation has been stopped\r\n */\r\n private _stopped = false;\r\n\r\n /**\r\n * The blending factor of the runtime animation\r\n */\r\n private _blendingFactor = 0;\r\n\r\n /**\r\n * The BabylonJS scene\r\n */\r\n private _scene: Scene;\r\n\r\n /**\r\n * The current value of the runtime animation\r\n */\r\n private _currentValue: Nullable<any> = null;\r\n\r\n /** @internal */\r\n public _animationState: _IAnimationState;\r\n\r\n /**\r\n * The active target of the runtime animation\r\n */\r\n private _activeTargets: any[];\r\n private _currentActiveTarget: Nullable<any> = null;\r\n private _directTarget: Nullable<any> = null;\r\n\r\n /**\r\n * The target path of the runtime animation\r\n */\r\n private _targetPath: string = \"\";\r\n\r\n /**\r\n * The weight of the runtime animation\r\n */\r\n private _weight = 1.0;\r\n\r\n /**\r\n * The ratio offset of the runtime animation\r\n */\r\n private _ratioOffset = 0;\r\n\r\n /**\r\n * The previous delay of the runtime animation\r\n */\r\n private _previousDelay: number = 0;\r\n\r\n /**\r\n * The previous ratio of the runtime animation\r\n */\r\n private _previousRatio: number = 0;\r\n\r\n private _enableBlending: boolean;\r\n\r\n private _keys: IAnimationKey[];\r\n private _minFrame: number;\r\n private _maxFrame: number;\r\n private _minValue: any;\r\n private _maxValue: any;\r\n private _targetIsArray = false;\r\n\r\n /**\r\n * Gets the current frame of the runtime animation\r\n */\r\n public get currentFrame(): number {\r\n return this._currentFrame;\r\n }\r\n\r\n /**\r\n * Gets the weight of the runtime animation\r\n */\r\n public get weight(): number {\r\n return this._weight;\r\n }\r\n\r\n /**\r\n * Gets the current value of the runtime animation\r\n */\r\n public get currentValue(): any {\r\n return this._currentValue;\r\n }\r\n\r\n /**\r\n * Gets or sets the target path of the runtime animation\r\n */\r\n public get targetPath(): string {\r\n return this._targetPath;\r\n }\r\n\r\n /**\r\n * Gets the actual target of the runtime animation\r\n */\r\n public get target(): any {\r\n return this._currentActiveTarget;\r\n }\r\n\r\n /**\r\n * Gets the additive state of the runtime animation\r\n */\r\n public get isAdditive(): boolean {\r\n return this._host && this._host.isAdditive;\r\n }\r\n\r\n /** @internal */\r\n public _onLoop: () => void;\r\n\r\n /**\r\n * Create a new RuntimeAnimation object\r\n * @param target defines the target of the animation\r\n * @param animation defines the source animation object\r\n * @param scene defines the hosting scene\r\n * @param host defines the initiating Animatable\r\n */\r\n public constructor(target: any, animation: Animation, scene: Scene, host: Animatable) {\r\n this._animation = animation;\r\n this._target = target;\r\n this._scene = scene;\r\n this._host = host;\r\n this._activeTargets = [];\r\n\r\n animation._runtimeAnimations.push(this);\r\n\r\n // State\r\n this._animationState = {\r\n key: 0,\r\n repeatCount: 0,\r\n loopMode: this._getCorrectLoopMode(),\r\n };\r\n\r\n if (this._animation.dataType === Animation.ANIMATIONTYPE_MATRIX) {\r\n this._animationState.workValue = Matrix.Zero();\r\n }\r\n\r\n // Limits\r\n this._keys = this._animation.getKeys();\r\n this._minFrame = this._keys[0].frame;\r\n this._maxFrame = this._keys[this._keys.length - 1].frame;\r\n this._minValue = this._keys[0].value;\r\n this._maxValue = this._keys[this._keys.length - 1].value;\r\n\r\n // Add a start key at frame 0 if missing\r\n if (this._minFrame !== 0) {\r\n const newKey = { frame: 0, value: this._minValue };\r\n this._keys.splice(0, 0, newKey);\r\n }\r\n\r\n // Check data\r\n if (this._target instanceof Array) {\r\n let index = 0;\r\n for (const target of this._target) {\r\n this._preparePath(target, index);\r\n this._getOriginalValues(index);\r\n index++;\r\n }\r\n this._targetIsArray = true;\r\n } else {\r\n this._preparePath(this._target);\r\n this._getOriginalValues();\r\n this._targetIsArray = false;\r\n this._directTarget = this._activeTargets[0];\r\n }\r\n\r\n // Cloning events locally\r\n const events = animation.getEvents();\r\n if (events && events.length > 0) {\r\n events.forEach((e) => {\r\n this._events.push(e._clone());\r\n });\r\n }\r\n\r\n this._enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;\r\n }\r\n\r\n private _preparePath(target: any, targetIndex = 0) {\r\n const targetPropertyPath = this._animation.targetPropertyPath;\r\n\r\n if (targetPropertyPath.length > 1) {\r\n let property = target[targetPropertyPath[0]];\r\n\r\n for (let index = 1; index < targetPropertyPath.length - 1; index++) {\r\n property = property[targetPropertyPath[index]];\r\n }\r\n\r\n this._targetPath = targetPropertyPath[targetPropertyPath.length - 1];\r\n this._activeTargets[targetIndex] = property;\r\n } else {\r\n this._targetPath = targetPropertyPath[0];\r\n this._activeTargets[targetIndex] = target;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the animation from the runtime animation\r\n */\r\n public get animation(): Animation {\r\n return this._animation;\r\n }\r\n\r\n /**\r\n * Resets the runtime animation to the beginning\r\n * @param restoreOriginal defines whether to restore the target property to the original value\r\n */\r\n public reset(restoreOriginal = false): void {\r\n if (restoreOriginal) {\r\n if (this._target instanceof Array) {\r\n let index = 0;\r\n for (const target of this._target) {\r\n if (this._originalValue[index] !== undefined) {\r\n this._setValue(target, this._activeTargets[index], this._originalValue[index], -1, index);\r\n }\r\n index++;\r\n }\r\n } else {\r\n if (this._originalValue[0] !== undefined) {\r\n this._setValue(this._target, this._directTarget, this._originalValue[0], -1, 0);\r\n }\r\n }\r\n }\r\n\r\n this._offsetsCache = {};\r\n this._highLimitsCache = {};\r\n this._currentFrame = 0;\r\n this._blendingFactor = 0;\r\n\r\n // Events\r\n for (let index = 0; index < this._events.length; index++) {\r\n this._events[index].isDone = false;\r\n }\r\n }\r\n\r\n /**\r\n * Specifies if the runtime animation is stopped\r\n * @returns Boolean specifying if the runtime animation is stopped\r\n */\r\n public isStopped(): boolean {\r\n return this._stopped;\r\n }\r\n\r\n /**\r\n * Disposes of the runtime animation\r\n */\r\n public dispose(): void {\r\n const index = this._animation.runtimeAnimations.indexOf(this);\r\n\r\n if (index > -1) {\r\n this._animation.runtimeAnimations.splice(index, 1);\r\n }\r\n }\r\n\r\n /**\r\n * Apply the interpolated value to the target\r\n * @param currentValue defines the value computed by the animation\r\n * @param weight defines the weight to apply to this value (Defaults to 1.0)\r\n */\r\n public setValue(currentValue: any, weight: number) {\r\n if (this._targetIsArray) {\r\n for (let index = 0; index < this._target.length; index++) {\r\n const target = this._target[index];\r\n this._setValue(target, this._activeTargets[index], currentValue, weight, index);\r\n }\r\n return;\r\n }\r\n this._setValue(this._target, this._directTarget, currentValue, weight, 0);\r\n }\r\n\r\n private _getOriginalValues(targetIndex = 0) {\r\n let originalValue: any;\r\n const target = this._activeTargets[targetIndex];\r\n\r\n if (target.getRestPose && this._targetPath === \"_matrix\") {\r\n // For bones\r\n originalValue = target.getRestPose();\r\n } else {\r\n originalValue = target[this._targetPath];\r\n }\r\n\r\n if (originalValue && originalValue.clone) {\r\n this._originalValue[targetIndex] = originalValue.clone();\r\n } else {\r\n this._originalValue[targetIndex] = originalValue;\r\n }\r\n }\r\n\r\n private _setValue(target: any, destination: any, currentValue: any, weight: number, targetIndex: number): void {\r\n // Set value\r\n this._currentActiveTarget = destination;\r\n\r\n this._weight = weight;\r\n\r\n if (this._enableBlending && this._blendingFactor <= 1.0) {\r\n if (!this._originalBlendValue) {\r\n const originalValue = destination[this._targetPath];\r\n\r\n if (originalValue.clone) {\r\n this._originalBlendValue = originalValue.clone();\r\n } else {\r\n this._originalBlendValue = originalValue;\r\n }\r\n }\r\n\r\n if (this._originalBlendValue.m) {\r\n // Matrix\r\n if (Animation.AllowMatrixDecomposeForInterpolation) {\r\n if (this._currentValue) {\r\n Matrix.DecomposeLerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue);\r\n } else {\r\n this._currentValue = Matrix.DecomposeLerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n } else {\r\n if (this._currentValue) {\r\n Matrix.LerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue);\r\n } else {\r\n this._currentValue = Matrix.Lerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n }\r\n } else {\r\n this._currentValue = Animation._UniversalLerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n\r\n const blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;\r\n this._blendingFactor += blendingSpeed;\r\n } else {\r\n if (!this._currentValue) {\r\n if (currentValue?.clone) {\r\n this._currentValue = currentValue.clone();\r\n } else {\r\n this._currentValue = currentValue;\r\n }\r\n } else if (this._currentValue.copyFrom) {\r\n this._currentValue.copyFrom(currentValue);\r\n } else {\r\n this._currentValue = currentValue;\r\n }\r\n }\r\n\r\n if (weight !== -1.0) {\r\n this._scene._registerTargetForLateAnimationBinding(this, this._originalValue[targetIndex]);\r\n } else {\r\n destination[this._targetPath] = this._currentValue;\r\n }\r\n\r\n if (target.markAsDirty) {\r\n target.markAsDirty(this._animation.targetProperty);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the loop pmode of the runtime animation\r\n * @returns Loop Mode\r\n */\r\n private _getCorrectLoopMode(): number | undefined {\r\n if (this._target && this._target.animationPropertiesOverride) {\r\n return this._target.animationPropertiesOverride.loopMode;\r\n }\r\n\r\n return this._animation.loopMode;\r\n }\r\n\r\n /**\r\n * Move the current animation to a given frame\r\n * @param frame defines the frame to move to\r\n */\r\n public goToFrame(frame: number): void {\r\n const keys = this._animation.getKeys();\r\n\r\n if (frame < keys[0].frame) {\r\n frame = keys[0].frame;\r\n } else if (frame > keys[keys.length - 1].frame) {\r\n frame = keys[keys.length - 1].frame;\r\n }\r\n\r\n // Need to reset animation events\r\n const events = this._events;\r\n if (events.length) {\r\n for (let index = 0; index < events.length; index++) {\r\n if (!events[index].onlyOnce) {\r\n // reset events in the future\r\n events[index].isDone = events[index].frame < frame;\r\n }\r\n }\r\n }\r\n\r\n this._currentFrame = frame;\r\n const currentValue = this._animation._interpolate(frame, this._animationState);\r\n\r\n this.setValue(currentValue, -1);\r\n }\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _prepareForSpeedRatioChange(newSpeedRatio: number): void {\r\n const newRatio = (this._previousDelay * (this._animation.framePerSecond * newSpeedRatio)) / 1000.0;\r\n\r\n this._ratioOffset = this._previousRatio - newRatio;\r\n }\r\n\r\n /**\r\n * Execute the current animation\r\n * @param delay defines the delay to add to the current frame\r\n * @param from defines the lower bound of the animation range\r\n * @param to defines the upper bound of the animation range\r\n * @param loop defines if the current animation must loop\r\n * @param speedRatio defines the current speed ratio\r\n * @param weight defines the weight of the animation (default is -1 so no weight)\r\n * @returns a boolean indicating if the animation is running\r\n */\r\n public animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number, weight = -1.0): boolean {\r\n const animation = this._animation;\r\n const targetPropertyPath = animation.targetPropertyPath;\r\n if (!targetPropertyPath || targetPropertyPath.length < 1) {\r\n this._stopped = true;\r\n return false;\r\n }\r\n\r\n let returnValue = true;\r\n\r\n // Check limits\r\n if (from < this._minFrame || from > this._maxFrame) {\r\n from = this._minFrame;\r\n }\r\n if (to < this._minFrame || to > this._maxFrame) {\r\n to = this._maxFrame;\r\n }\r\n\r\n const range = to - from;\r\n let offsetValue: any;\r\n\r\n // Compute ratio which represents the frame delta between from and to\r\n let ratio = (delay * (animation.framePerSecond * speedRatio)) / 1000.0 + this._ratioOffset;\r\n let highLimitValue = 0;\r\n\r\n // Apply the yoyo function if required\r\n if (loop && this._animationState.loopMode === Animation.ANIMATIONLOOPMODE_YOYO) {\r\n const position = (ratio - from) / range;\r\n\r\n // Apply the yoyo curve\r\n const yoyoPosition = Math.abs(Math.sin(position * Math.PI));\r\n\r\n // Map the yoyo position back to the range\r\n ratio = yoyoPosition * range + from;\r\n }\r\n\r\n this._previousDelay = delay;\r\n this._previousRatio = ratio;\r\n\r\n if (!loop && to >= from && ratio >= range) {\r\n // If we are out of range and not looping get back to caller\r\n returnValue = false;\r\n highLimitValue = animation._getKeyValue(this._maxValue);\r\n } else if (!loop && from >= to && ratio <= range) {\r\n returnValue = false;\r\n highLimitValue = animation._getKeyValue(this._minValue);\r\n } else if (this._animationState.loopMode !== Animation.ANIMATIONLOOPMODE_CYCLE) {\r\n const keyOffset = to.toString() + from.toString();\r\n if (!this._offsetsCache[keyOffset]) {\r\n this._animationState.repeatCount = 0;\r\n this._animationState.loopMode = Animation.ANIMATIONLOOPMODE_CYCLE;\r\n const fromValue = animation._interpolate(from, this._animationState);\r\n const toValue = animation._interpolate(to, this._animationState);\r\n\r\n this._animationState.loopMode = this._getCorrectLoopMode();\r\n switch (animation.dataType) {\r\n // Float\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n this._offsetsCache[keyOffset] = toValue - fromValue;\r\n break;\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n this._highLimitsCache[keyOffset] = toValue;\r\n }\r\n\r\n highLimitValue = this._highLimitsCache[keyOffset];\r\n offsetValue = this._offsetsCache[keyOffset];\r\n }\r\n\r\n if (offsetValue === undefined) {\r\n switch (animation.dataType) {\r\n // Float\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n offsetValue = 0;\r\n break;\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n offsetValue = _staticOffsetValueQuaternion;\r\n break;\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n offsetValue = _staticOffsetValueVector3;\r\n break;\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n offsetValue = _staticOffsetValueVector2;\r\n break;\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE:\r\n offsetValue = _staticOffsetValueSize;\r\n break;\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n offsetValue = _staticOffsetValueColor3;\r\n }\r\n }\r\n\r\n // Compute value\r\n let currentFrame: number;\r\n\r\n if (this._host && this._host.syncRoot) {\r\n const syncRoot = this._host.syncRoot;\r\n const hostNormalizedFrame = (syncRoot.masterFrame - syncRoot.fromFrame) / (syncRoot.toFrame - syncRoot.fromFrame);\r\n currentFrame = from + (to - from) * hostNormalizedFrame;\r\n } else {\r\n if ((ratio > 0 && from > to) || (ratio < 0 && from < to)) {\r\n currentFrame = returnValue && range !== 0 ? to + (ratio % range) : from;\r\n } else {\r\n currentFrame = returnValue && range !== 0 ? from + (ratio % range) : to;\r\n }\r\n }\r\n\r\n const events = this._events;\r\n\r\n // Reset event/state if looping\r\n if ((speedRatio > 0 && this.currentFrame > currentFrame) || (speedRatio < 0 && this.currentFrame < currentFrame)) {\r\n this._onLoop();\r\n\r\n // Need to reset animation events\r\n for (let index = 0; index < events.length; index++) {\r\n if (!events[index].onlyOnce) {\r\n // reset event, the animation is looping\r\n events[index].isDone = false;\r\n }\r\n }\r\n\r\n this._animationState.key = speedRatio > 0 ? 0 : animation.getKeys().length - 1;\r\n }\r\n this._currentFrame = currentFrame;\r\n this._animationState.repeatCount = range === 0 ? 0 : (ratio / range) >> 0;\r\n this._animationState.highLimitValue = highLimitValue;\r\n this._animationState.offsetValue = offsetValue;\r\n\r\n const currentValue = animation._interpolate(currentFrame, this._animationState);\r\n\r\n // Set value\r\n this.setValue(currentValue, weight);\r\n\r\n // Check events\r\n if (events.length) {\r\n for (let index = 0; index < events.length; index++) {\r\n // Make sure current frame has passed event frame and that event frame is within the current range\r\n // Also, handle both forward and reverse animations\r\n if (\r\n (range > 0 && currentFrame >= events[index].frame && events[index].frame >= from) ||\r\n (range < 0 && currentFrame <= events[index].frame && events[index].frame <= from)\r\n ) {\r\n const event = events[index];\r\n if (!event.isDone) {\r\n // If event should be done only once, remove it.\r\n if (event.onlyOnce) {\r\n events.splice(index, 1);\r\n index--;\r\n }\r\n event.isDone = true;\r\n event.action(currentFrame);\r\n } // Don't do anything if the event has already be done.\r\n }\r\n }\r\n }\r\n\r\n if (!returnValue) {\r\n this._stopped = true;\r\n }\r\n\r\n return returnValue;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"runtimeAnimation.js","sourceRoot":"","sources":["../../../../lts/core/generated/Animations/runtimeAnimation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAOxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,8CAA8C;AAE9C,aAAa;AACb,MAAM,4BAA4B,GAA8B,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE1G,UAAU;AACV,MAAM,yBAAyB,GAA2B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAExF,UAAU;AACV,MAAM,yBAAyB,GAA2B,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAExF,OAAO;AACP,MAAM,sBAAsB,GAAwB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAE/E,SAAS;AACT,MAAM,wBAAwB,GAA0B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AAEtF;;GAEG;AACH,MAAM,OAAO,gBAAgB;IA2GzB;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH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C,KAAK,IAAI,IAAI,CAAC;oBACjF,CAAC,KAAK,GAAG,CAAC,IAAI,YAAY,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,EACnF;oBACE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;oBAC5B,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;wBACf,gDAAgD;wBAChD,IAAI,KAAK,CAAC,QAAQ,EAAE;4BAChB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;4BACxB,KAAK,EAAE,CAAC;yBACX;wBACD,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;wBACpB,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;qBAC9B,CAAC,sDAAsD;iBAC3D;aACJ;SACJ;QAED,IAAI,CAAC,WAAW,EAAE;YACd,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;SACxB;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;CACJ","sourcesContent":["import type { DeepImmutable, Nullable } from \"../types\";\r\nimport { Quaternion, Vector3, Vector2, Matrix } from \"../Maths/math.vector\";\r\nimport { Color3 } from \"../Maths/math.color\";\r\nimport type { _IAnimationState } from \"./animation\";\r\nimport { Animation } from \"./animation\";\r\nimport type { AnimationEvent } from \"./animationEvent\";\r\n\r\nimport type { Animatable } from \"./animatable\";\r\n\r\nimport type { Scene } from \"../scene\";\r\nimport type { IAnimationKey } from \"./animationKey\";\r\nimport { Size } from \"../Maths/math.size\";\r\n\r\n// Static values to help the garbage collector\r\n\r\n// Quaternion\r\nconst _staticOffsetValueQuaternion: DeepImmutable<Quaternion> = Object.freeze(new Quaternion(0, 0, 0, 0));\r\n\r\n// Vector3\r\nconst _staticOffsetValueVector3: DeepImmutable<Vector3> = Object.freeze(Vector3.Zero());\r\n\r\n// Vector2\r\nconst _staticOffsetValueVector2: DeepImmutable<Vector2> = Object.freeze(Vector2.Zero());\r\n\r\n// Size\r\nconst _staticOffsetValueSize: DeepImmutable<Size> = Object.freeze(Size.Zero());\r\n\r\n// Color3\r\nconst _staticOffsetValueColor3: DeepImmutable<Color3> = Object.freeze(Color3.Black());\r\n\r\n/**\r\n * Defines a runtime animation\r\n */\r\nexport class RuntimeAnimation {\r\n private _events = new Array<AnimationEvent>();\r\n\r\n /**\r\n * The current frame of the runtime animation\r\n */\r\n private _currentFrame: number = 0;\r\n\r\n /**\r\n * The animation used by the runtime animation\r\n */\r\n private _animation: Animation;\r\n\r\n /**\r\n * The target of the runtime animation\r\n */\r\n private _target: any;\r\n\r\n /**\r\n * The initiating animatable\r\n */\r\n private _host: Animatable;\r\n\r\n /**\r\n * The original value of the runtime animation\r\n */\r\n private _originalValue = new Array<any>();\r\n\r\n /**\r\n * The original blend value of the runtime animation\r\n */\r\n private _originalBlendValue: Nullable<any> = null;\r\n\r\n /**\r\n * The offsets cache of the runtime animation\r\n */\r\n private _offsetsCache: { [key: string]: any } = {};\r\n\r\n /**\r\n * The high limits cache of the runtime animation\r\n */\r\n private _highLimitsCache: { [key: string]: any } = {};\r\n\r\n /**\r\n * Specifies if the runtime animation has been stopped\r\n */\r\n private _stopped = false;\r\n\r\n /**\r\n * The blending factor of the runtime animation\r\n */\r\n private _blendingFactor = 0;\r\n\r\n /**\r\n * The BabylonJS scene\r\n */\r\n private _scene: Scene;\r\n\r\n /**\r\n * The current value of the runtime animation\r\n */\r\n private _currentValue: Nullable<any> = null;\r\n\r\n /** @internal */\r\n public _animationState: _IAnimationState;\r\n\r\n /**\r\n * The active target of the runtime animation\r\n */\r\n private _activeTargets: any[];\r\n private _currentActiveTarget: Nullable<any> = null;\r\n private _directTarget: Nullable<any> = null;\r\n\r\n /**\r\n * The target path of the runtime animation\r\n */\r\n private _targetPath: string = \"\";\r\n\r\n /**\r\n * The weight of the runtime animation\r\n */\r\n private _weight = 1.0;\r\n\r\n /**\r\n * The ratio offset of the runtime animation\r\n */\r\n private _ratioOffset = 0;\r\n\r\n /**\r\n * The previous delay of the runtime animation\r\n */\r\n private _previousDelay: number = 0;\r\n\r\n /**\r\n * The previous ratio of the runtime animation\r\n */\r\n private _previousRatio: number = 0;\r\n\r\n private _enableBlending: boolean;\r\n\r\n private _keys: IAnimationKey[];\r\n private _minFrame: number;\r\n private _maxFrame: number;\r\n private _minValue: any;\r\n private _maxValue: any;\r\n private _targetIsArray = false;\r\n\r\n /**\r\n * Gets the current frame of the runtime animation\r\n */\r\n public get currentFrame(): number {\r\n return this._currentFrame;\r\n }\r\n\r\n /**\r\n * Gets the weight of the runtime animation\r\n */\r\n public get weight(): number {\r\n return this._weight;\r\n }\r\n\r\n /**\r\n * Gets the current value of the runtime animation\r\n */\r\n public get currentValue(): any {\r\n return this._currentValue;\r\n }\r\n\r\n /**\r\n * Gets or sets the target path of the runtime animation\r\n */\r\n public get targetPath(): string {\r\n return this._targetPath;\r\n }\r\n\r\n /**\r\n * Gets the actual target of the runtime animation\r\n */\r\n public get target(): any {\r\n return this._currentActiveTarget;\r\n }\r\n\r\n /**\r\n * Gets the additive state of the runtime animation\r\n */\r\n public get isAdditive(): boolean {\r\n return this._host && this._host.isAdditive;\r\n }\r\n\r\n /** @internal */\r\n public _onLoop: () => void;\r\n\r\n /**\r\n * Create a new RuntimeAnimation object\r\n * @param target defines the target of the animation\r\n * @param animation defines the source animation object\r\n * @param scene defines the hosting scene\r\n * @param host defines the initiating Animatable\r\n */\r\n public constructor(target: any, animation: Animation, scene: Scene, host: Animatable) {\r\n this._animation = animation;\r\n this._target = target;\r\n this._scene = scene;\r\n this._host = host;\r\n this._activeTargets = [];\r\n\r\n animation._runtimeAnimations.push(this);\r\n\r\n // State\r\n this._animationState = {\r\n key: 0,\r\n repeatCount: 0,\r\n loopMode: this._getCorrectLoopMode(),\r\n };\r\n\r\n if (this._animation.dataType === Animation.ANIMATIONTYPE_MATRIX) {\r\n this._animationState.workValue = Matrix.Zero();\r\n }\r\n\r\n // Limits\r\n this._keys = this._animation.getKeys();\r\n this._minFrame = this._keys[0].frame;\r\n this._maxFrame = this._keys[this._keys.length - 1].frame;\r\n this._minValue = this._keys[0].value;\r\n this._maxValue = this._keys[this._keys.length - 1].value;\r\n\r\n // Add a start key at frame 0 if missing\r\n if (this._minFrame !== 0) {\r\n const newKey = { frame: 0, value: this._minValue };\r\n this._keys.splice(0, 0, newKey);\r\n }\r\n\r\n // Check data\r\n if (this._target instanceof Array) {\r\n let index = 0;\r\n for (const target of this._target) {\r\n this._preparePath(target, index);\r\n this._getOriginalValues(index);\r\n index++;\r\n }\r\n this._targetIsArray = true;\r\n } else {\r\n this._preparePath(this._target);\r\n this._getOriginalValues();\r\n this._targetIsArray = false;\r\n this._directTarget = this._activeTargets[0];\r\n }\r\n\r\n // Cloning events locally\r\n const events = animation.getEvents();\r\n if (events && events.length > 0) {\r\n events.forEach((e) => {\r\n this._events.push(e._clone());\r\n });\r\n }\r\n\r\n this._enableBlending = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;\r\n }\r\n\r\n private _preparePath(target: any, targetIndex = 0) {\r\n const targetPropertyPath = this._animation.targetPropertyPath;\r\n\r\n if (targetPropertyPath.length > 1) {\r\n let property = target[targetPropertyPath[0]];\r\n\r\n for (let index = 1; index < targetPropertyPath.length - 1; index++) {\r\n property = property[targetPropertyPath[index]];\r\n }\r\n\r\n this._targetPath = targetPropertyPath[targetPropertyPath.length - 1];\r\n this._activeTargets[targetIndex] = property;\r\n } else {\r\n this._targetPath = targetPropertyPath[0];\r\n this._activeTargets[targetIndex] = target;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the animation from the runtime animation\r\n */\r\n public get animation(): Animation {\r\n return this._animation;\r\n }\r\n\r\n /**\r\n * Resets the runtime animation to the beginning\r\n * @param restoreOriginal defines whether to restore the target property to the original value\r\n */\r\n public reset(restoreOriginal = false): void {\r\n if (restoreOriginal) {\r\n if (this._target instanceof Array) {\r\n let index = 0;\r\n for (const target of this._target) {\r\n if (this._originalValue[index] !== undefined) {\r\n this._setValue(target, this._activeTargets[index], this._originalValue[index], -1, index);\r\n }\r\n index++;\r\n }\r\n } else {\r\n if (this._originalValue[0] !== undefined) {\r\n this._setValue(this._target, this._directTarget, this._originalValue[0], -1, 0);\r\n }\r\n }\r\n }\r\n\r\n this._offsetsCache = {};\r\n this._highLimitsCache = {};\r\n this._currentFrame = 0;\r\n this._blendingFactor = 0;\r\n\r\n // Events\r\n for (let index = 0; index < this._events.length; index++) {\r\n this._events[index].isDone = false;\r\n }\r\n }\r\n\r\n /**\r\n * Specifies if the runtime animation is stopped\r\n * @returns Boolean specifying if the runtime animation is stopped\r\n */\r\n public isStopped(): boolean {\r\n return this._stopped;\r\n }\r\n\r\n /**\r\n * Disposes of the runtime animation\r\n */\r\n public dispose(): void {\r\n const index = this._animation.runtimeAnimations.indexOf(this);\r\n\r\n if (index > -1) {\r\n this._animation.runtimeAnimations.splice(index, 1);\r\n }\r\n }\r\n\r\n /**\r\n * Apply the interpolated value to the target\r\n * @param currentValue defines the value computed by the animation\r\n * @param weight defines the weight to apply to this value (Defaults to 1.0)\r\n */\r\n public setValue(currentValue: any, weight: number) {\r\n if (this._targetIsArray) {\r\n for (let index = 0; index < this._target.length; index++) {\r\n const target = this._target[index];\r\n this._setValue(target, this._activeTargets[index], currentValue, weight, index);\r\n }\r\n return;\r\n }\r\n this._setValue(this._target, this._directTarget, currentValue, weight, 0);\r\n }\r\n\r\n private _getOriginalValues(targetIndex = 0) {\r\n let originalValue: any;\r\n const target = this._activeTargets[targetIndex];\r\n\r\n if (target.getRestPose && this._targetPath === \"_matrix\") {\r\n // For bones\r\n originalValue = target.getRestPose();\r\n } else {\r\n originalValue = target[this._targetPath];\r\n }\r\n\r\n if (originalValue && originalValue.clone) {\r\n this._originalValue[targetIndex] = originalValue.clone();\r\n } else {\r\n this._originalValue[targetIndex] = originalValue;\r\n }\r\n }\r\n\r\n private _setValue(target: any, destination: any, currentValue: any, weight: number, targetIndex: number): void {\r\n // Set value\r\n this._currentActiveTarget = destination;\r\n\r\n this._weight = weight;\r\n\r\n if (this._enableBlending && this._blendingFactor <= 1.0) {\r\n if (!this._originalBlendValue) {\r\n const originalValue = destination[this._targetPath];\r\n\r\n if (originalValue.clone) {\r\n this._originalBlendValue = originalValue.clone();\r\n } else {\r\n this._originalBlendValue = originalValue;\r\n }\r\n }\r\n\r\n if (this._originalBlendValue.m) {\r\n // Matrix\r\n if (Animation.AllowMatrixDecomposeForInterpolation) {\r\n if (this._currentValue) {\r\n Matrix.DecomposeLerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue);\r\n } else {\r\n this._currentValue = Matrix.DecomposeLerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n } else {\r\n if (this._currentValue) {\r\n Matrix.LerpToRef(this._originalBlendValue, currentValue, this._blendingFactor, this._currentValue);\r\n } else {\r\n this._currentValue = Matrix.Lerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n }\r\n } else {\r\n this._currentValue = Animation._UniversalLerp(this._originalBlendValue, currentValue, this._blendingFactor);\r\n }\r\n\r\n const blendingSpeed = target && target.animationPropertiesOverride ? target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;\r\n this._blendingFactor += blendingSpeed;\r\n } else {\r\n if (!this._currentValue) {\r\n if (currentValue?.clone) {\r\n this._currentValue = currentValue.clone();\r\n } else {\r\n this._currentValue = currentValue;\r\n }\r\n } else if (this._currentValue.copyFrom) {\r\n this._currentValue.copyFrom(currentValue);\r\n } else {\r\n this._currentValue = currentValue;\r\n }\r\n }\r\n\r\n if (weight !== -1.0) {\r\n this._scene._registerTargetForLateAnimationBinding(this, this._originalValue[targetIndex]);\r\n } else {\r\n destination[this._targetPath] = this._currentValue;\r\n }\r\n\r\n if (target.markAsDirty) {\r\n target.markAsDirty(this._animation.targetProperty);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the loop pmode of the runtime animation\r\n * @returns Loop Mode\r\n */\r\n private _getCorrectLoopMode(): number | undefined {\r\n if (this._target && this._target.animationPropertiesOverride) {\r\n return this._target.animationPropertiesOverride.loopMode;\r\n }\r\n\r\n return this._animation.loopMode;\r\n }\r\n\r\n /**\r\n * Move the current animation to a given frame\r\n * @param frame defines the frame to move to\r\n */\r\n public goToFrame(frame: number): void {\r\n const keys = this._animation.getKeys();\r\n\r\n if (frame < keys[0].frame) {\r\n frame = keys[0].frame;\r\n } else if (frame > keys[keys.length - 1].frame) {\r\n frame = keys[keys.length - 1].frame;\r\n }\r\n\r\n // Need to reset animation events\r\n const events = this._events;\r\n if (events.length) {\r\n for (let index = 0; index < events.length; index++) {\r\n if (!events[index].onlyOnce) {\r\n // reset events in the future\r\n events[index].isDone = events[index].frame < frame;\r\n }\r\n }\r\n }\r\n\r\n this._currentFrame = frame;\r\n const currentValue = this._animation._interpolate(frame, this._animationState);\r\n\r\n this.setValue(currentValue, -1);\r\n }\r\n\r\n /**\r\n * @internal Internal use only\r\n */\r\n public _prepareForSpeedRatioChange(newSpeedRatio: number): void {\r\n const newRatio = (this._previousDelay * (this._animation.framePerSecond * newSpeedRatio)) / 1000.0;\r\n\r\n this._ratioOffset = this._previousRatio - newRatio;\r\n }\r\n\r\n /**\r\n * Execute the current animation\r\n * @param delay defines the delay to add to the current frame\r\n * @param from defines the lower bound of the animation range\r\n * @param to defines the upper bound of the animation range\r\n * @param loop defines if the current animation must loop\r\n * @param speedRatio defines the current speed ratio\r\n * @param weight defines the weight of the animation (default is -1 so no weight)\r\n * @returns a boolean indicating if the animation is running\r\n */\r\n public animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number, weight = -1.0): boolean {\r\n const animation = this._animation;\r\n const targetPropertyPath = animation.targetPropertyPath;\r\n if (!targetPropertyPath || targetPropertyPath.length < 1) {\r\n this._stopped = true;\r\n return false;\r\n }\r\n\r\n let returnValue = true;\r\n\r\n // Check limits\r\n if (from < this._minFrame || from > this._maxFrame) {\r\n from = this._minFrame;\r\n }\r\n if (to < this._minFrame || to > this._maxFrame) {\r\n to = this._maxFrame;\r\n }\r\n\r\n const range = to - from;\r\n let offsetValue: any;\r\n\r\n // Compute ratio which represents the frame delta between from and to\r\n let ratio = (delay * (animation.framePerSecond * speedRatio)) / 1000.0 + this._ratioOffset;\r\n let highLimitValue = 0;\r\n\r\n // Apply the yoyo function if required\r\n if (loop && this._animationState.loopMode === Animation.ANIMATIONLOOPMODE_YOYO) {\r\n const position = (ratio - from) / range;\r\n\r\n // Apply the yoyo curve\r\n const yoyoPosition = Math.abs(Math.sin(position * Math.PI));\r\n\r\n // Map the yoyo position back to the range\r\n ratio = yoyoPosition * range + from;\r\n }\r\n\r\n this._previousDelay = delay;\r\n this._previousRatio = ratio;\r\n\r\n if (!loop && to >= from && ratio >= range) {\r\n // If we are out of range and not looping get back to caller\r\n returnValue = false;\r\n highLimitValue = animation._getKeyValue(this._maxValue);\r\n } else if (!loop && from >= to && ratio <= range) {\r\n returnValue = false;\r\n highLimitValue = animation._getKeyValue(this._minValue);\r\n } else if (this._animationState.loopMode !== Animation.ANIMATIONLOOPMODE_CYCLE) {\r\n const keyOffset = to.toString() + from.toString();\r\n if (!this._offsetsCache[keyOffset]) {\r\n this._animationState.repeatCount = 0;\r\n this._animationState.loopMode = Animation.ANIMATIONLOOPMODE_CYCLE;\r\n const fromValue = animation._interpolate(from, this._animationState);\r\n const toValue = animation._interpolate(to, this._animationState);\r\n\r\n this._animationState.loopMode = this._getCorrectLoopMode();\r\n switch (animation.dataType) {\r\n // Float\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n this._offsetsCache[keyOffset] = toValue - fromValue;\r\n break;\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n this._offsetsCache[keyOffset] = toValue.subtract(fromValue);\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n this._highLimitsCache[keyOffset] = toValue;\r\n }\r\n\r\n highLimitValue = this._highLimitsCache[keyOffset];\r\n offsetValue = this._offsetsCache[keyOffset];\r\n }\r\n\r\n if (offsetValue === undefined) {\r\n switch (animation.dataType) {\r\n // Float\r\n case Animation.ANIMATIONTYPE_FLOAT:\r\n offsetValue = 0;\r\n break;\r\n // Quaternion\r\n case Animation.ANIMATIONTYPE_QUATERNION:\r\n offsetValue = _staticOffsetValueQuaternion;\r\n break;\r\n // Vector3\r\n case Animation.ANIMATIONTYPE_VECTOR3:\r\n offsetValue = _staticOffsetValueVector3;\r\n break;\r\n // Vector2\r\n case Animation.ANIMATIONTYPE_VECTOR2:\r\n offsetValue = _staticOffsetValueVector2;\r\n break;\r\n // Size\r\n case Animation.ANIMATIONTYPE_SIZE:\r\n offsetValue = _staticOffsetValueSize;\r\n break;\r\n // Color3\r\n case Animation.ANIMATIONTYPE_COLOR3:\r\n offsetValue = _staticOffsetValueColor3;\r\n }\r\n }\r\n\r\n // Compute value\r\n let currentFrame: number;\r\n\r\n if (this._host && this._host.syncRoot) {\r\n const syncRoot = this._host.syncRoot;\r\n const hostNormalizedFrame = (syncRoot.masterFrame - syncRoot.fromFrame) / (syncRoot.toFrame - syncRoot.fromFrame);\r\n currentFrame = from + (to - from) * hostNormalizedFrame;\r\n } else {\r\n if ((ratio > 0 && from > to) || (ratio < 0 && from < to)) {\r\n currentFrame = returnValue && range !== 0 ? to + (ratio % range) : from;\r\n } else {\r\n currentFrame = returnValue && range !== 0 ? from + (ratio % range) : to;\r\n }\r\n }\r\n\r\n const events = this._events;\r\n\r\n // Reset event/state if looping\r\n if ((speedRatio > 0 && this.currentFrame > currentFrame) || (speedRatio < 0 && this.currentFrame < currentFrame)) {\r\n this._onLoop();\r\n\r\n // Need to reset animation events\r\n for (let index = 0; index < events.length; index++) {\r\n if (!events[index].onlyOnce) {\r\n // reset event, the animation is looping\r\n events[index].isDone = false;\r\n }\r\n }\r\n\r\n this._animationState.key = speedRatio > 0 ? 0 : animation.getKeys().length - 1;\r\n }\r\n this._currentFrame = currentFrame;\r\n this._animationState.repeatCount = range === 0 ? 0 : (ratio / range) >> 0;\r\n this._animationState.highLimitValue = highLimitValue;\r\n this._animationState.offsetValue = offsetValue;\r\n\r\n const currentValue = animation._interpolate(currentFrame, this._animationState);\r\n\r\n // Set value\r\n this.setValue(currentValue, weight);\r\n\r\n // Check events\r\n if (events.length) {\r\n for (let index = 0; index < events.length; index++) {\r\n // Make sure current frame has passed event frame and that event frame is within the current range\r\n // Also, handle both forward and reverse animations\r\n if (\r\n (range > 0 && currentFrame >= events[index].frame && events[index].frame >= from) ||\r\n (range < 0 && currentFrame <= events[index].frame && events[index].frame <= from)\r\n ) {\r\n const event = events[index];\r\n if (!event.isDone) {\r\n // If event should be done only once, remove it.\r\n if (event.onlyOnce) {\r\n events.splice(index, 1);\r\n index--;\r\n }\r\n event.isDone = true;\r\n event.action(currentFrame);\r\n } // Don't do anything if the event has already be done.\r\n }\r\n }\r\n }\r\n\r\n if (!returnValue) {\r\n this._stopped = true;\r\n }\r\n\r\n return returnValue;\r\n }\r\n}\r\n"]}
|
package/Bones/bone.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import type { Nullable } from "../types";
|
|
|
4
4
|
import type { TransformNode } from "../Meshes/transformNode";
|
|
5
5
|
import { Node } from "../node";
|
|
6
6
|
import { Space } from "../Maths/math.axis";
|
|
7
|
-
|
|
7
|
+
import type { Animation } from "../Animations/animation";
|
|
8
|
+
import type { AnimationPropertiesOverride } from "../Animations/animationPropertiesOverride";
|
|
8
9
|
/**
|
|
9
10
|
* Class used to store bone information
|
|
10
11
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
|
|
@@ -22,7 +23,7 @@ export declare class Bone extends Node {
|
|
|
22
23
|
*/
|
|
23
24
|
children: Bone[];
|
|
24
25
|
/** Gets the animations associated with this bone */
|
|
25
|
-
animations:
|
|
26
|
+
animations: Animation[];
|
|
26
27
|
/**
|
|
27
28
|
* Gets or sets bone length
|
|
28
29
|
*/
|
|
@@ -411,4 +412,3 @@ export declare class Bone extends Node {
|
|
|
411
412
|
*/
|
|
412
413
|
setCurrentPoseAsRest(): void;
|
|
413
414
|
}
|
|
414
|
-
export {};
|
package/Bones/bone.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bone.js","sourceRoot":"","sources":["../../../../lts/core/generated/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;IA8C1B,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,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC,sCAAsC;QAEnE,oCAAoC;QACpC,IAAI,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;YACnD,OAAO;SACV;QAED,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC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AAQ,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\ndeclare type Animation = import(\"../Animations/animation\").Animation;\r\ndeclare type AnimationPropertiesOverride = import(\"../Animations/animationPropertiesOverride\").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 = new Array<Bone>();\r\n\r\n /** Gets the animations associated with this bone */\r\n public animations = new Array<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;\r\n private _restPose: Matrix;\r\n private _baseMatrix: Matrix;\r\n private _absoluteTransform = new Matrix();\r\n private _invertedAbsoluteTransform = new Matrix();\r\n private _scalingDeterminant = 1;\r\n private _worldTransform = new Matrix();\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 this._needToCompose = false; // in case there was a pending compose\r\n\r\n // skip if the matrices are the same\r\n if (value.updateFlag === this._localMatrix.updateFlag) {\r\n return;\r\n }\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\r\n * @param restPose defines the rest pose matrix\r\n * @param baseMatrix defines the base matrix\r\n * @param index defines index of the bone in the hierarchy\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 restPose: Nullable<Matrix> = null,\r\n baseMatrix: 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 ? localMatrix.clone() : Matrix.Identity();\r\n this._restPose = restPose ? restPose : this._localMatrix.clone();\r\n this._baseMatrix = baseMatrix ? baseMatrix : this._localMatrix.clone();\r\n this._index = index;\r\n\r\n skeleton.bones.push(this);\r\n\r\n this.setParent(parentBone, false);\r\n\r\n if (baseMatrix || localMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\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 root bones\r\n * @returns an array containing the root bones\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 updateDifferenceMatrix defines if the difference matrix must be updated\r\n */\r\n public setParent(parent: Nullable<Bone>, updateDifferenceMatrix: 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 (updateDifferenceMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\r\n\r\n this.markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the local matrix\r\n * @returns a 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 base matrix (initial matrix which remains unchanged)\r\n * @returns the base matrix (as known as bind pose matrix)\r\n */\r\n public getBaseMatrix(): Matrix {\r\n return this._baseMatrix;\r\n }\r\n\r\n /**\r\n * Gets the rest pose matrix\r\n * @returns a matrix\r\n */\r\n public getRestPose(): Matrix {\r\n return this._restPose;\r\n }\r\n\r\n /**\r\n * Sets the rest pose matrix\r\n * @param matrix the local-space rest pose to set for this bone\r\n */\r\n public setRestPose(matrix: Matrix): void {\r\n this._restPose.copyFrom(matrix);\r\n }\r\n\r\n /**\r\n * Gets the bind pose matrix\r\n * @returns the bind pose matrix\r\n * @deprecated Please use getBaseMatrix instead\r\n */\r\n public getBindPose(): Matrix {\r\n return this._baseMatrix;\r\n }\r\n\r\n /**\r\n * Sets the bind pose matrix\r\n * @param matrix the local-space bind pose to set for this bone\r\n * @deprecated Please use updateMatrix instead\r\n */\r\n public setBindPose(matrix: Matrix): void {\r\n this.updateMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets a matrix used to store world matrix (ie. the matrix sent to shaders)\r\n */\r\n public getWorldMatrix(): Matrix {\r\n return this._worldTransform;\r\n }\r\n\r\n /**\r\n * Sets the local matrix to rest pose 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.getRestPose().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._restPose;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the inverse of the absolute transform matrix.\r\n * This matrix will be multiplied by local matrix to get the difference matrix (ie. the difference between original state and current state)\r\n * @returns a matrix\r\n */\r\n public getInvertedAbsoluteTransform(): Matrix {\r\n return this._invertedAbsoluteTransform;\r\n }\r\n\r\n /**\r\n * Gets the absolute transform matrix (ie base matrix * parent world matrix)\r\n * @returns a matrix\r\n */\r\n public getAbsoluteTransform(): Matrix {\r\n return this._absoluteTransform;\r\n }\r\n\r\n /**\r\n * Links with the given transform node.\r\n * The local matrix of this bone is copied from the transform 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 base and local matrices\r\n * @param matrix defines the new base or local matrix\r\n * @param updateDifferenceMatrix defines if the difference matrix must be updated\r\n * @param updateLocalMatrix defines if the local matrix should be updated\r\n */\r\n public updateMatrix(matrix: Matrix, updateDifferenceMatrix = true, updateLocalMatrix = true): void {\r\n this._baseMatrix.copyFrom(matrix);\r\n\r\n if (updateDifferenceMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\r\n\r\n if (updateLocalMatrix) {\r\n this._matrix = matrix;\r\n } else {\r\n this.markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateDifferenceMatrix(rootMatrix?: Matrix, updateChildren = true): void {\r\n if (!rootMatrix) {\r\n rootMatrix = this._baseMatrix;\r\n }\r\n\r\n if (this.parent) {\r\n rootMatrix.multiplyToRef(this.parent._absoluteTransform, this._absoluteTransform);\r\n } else {\r\n this._absoluteTransform.copyFrom(rootMatrix);\r\n }\r\n\r\n this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform);\r\n\r\n if (updateChildren) {\r\n for (let index = 0; index < this.children.length; index++) {\r\n this.children[index]._updateDifferenceMatrix();\r\n }\r\n }\r\n\r\n this._scalingDeterminant = this._absoluteTransform.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 /**\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\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public translate(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\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 let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\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.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n }\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n tmat.setTranslationFromFloats(0, 0, 0);\r\n tmat.invert();\r\n Vector3.TransformCoordinatesToRef(vec, tmat, tvec);\r\n\r\n lm.addAtIndex(12, tvec.x);\r\n lm.addAtIndex(13, tvec.y);\r\n lm.addAtIndex(14, tvec.z);\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\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\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setPosition(position: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\r\n lm.setTranslationFromFloats(position.x, position.y, position.z);\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n const vec = Bone._TmpVecs[0];\r\n\r\n if (this.parent) {\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n }\r\n tmat.invert();\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, vec);\r\n lm.setTranslationFromFloats(vec.x, vec.y, vec.z);\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\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 The TransformNode that this bone is attached to\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 The TransformNode that this bone is attached to. This is only used in world space\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._getNegativeRotationToRef(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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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._getNegativeRotationToRef(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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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._getNegativeRotationToRef(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 The TransformNode that this bone is attached to. This is only used in world space\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._getNegativeRotationToRef(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.getAbsoluteTransform().multiplyToRef(parentScale, parentScale);\r\n } else {\r\n parentScale.copyFrom(parent.getAbsoluteTransform());\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.computeAbsoluteTransforms();\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n private _getNegativeRotationToRef(rotMatInv: Matrix, tNode?: TransformNode): boolean {\r\n const scaleMatrix = Bone._TmpMats[2];\r\n rotMatInv.copyFrom(this.getAbsoluteTransform());\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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteTransform();\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 The TransformNode that this bone is attached to\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 The TransformNode that this bone is attached to\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 transforms of this bone and its children\r\n */\r\n public computeAbsoluteTransforms(): void {\r\n this._compose();\r\n\r\n if (this.parent) {\r\n this._localMatrix.multiplyToRef(this.parent._absoluteTransform, this._absoluteTransform);\r\n } else {\r\n this._absoluteTransform.copyFrom(this._localMatrix);\r\n\r\n const poseMatrix = this._skeleton.getPoseMatrix();\r\n\r\n if (poseMatrix) {\r\n this._absoluteTransform.multiplyToRef(poseMatrix, this._absoluteTransform);\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].computeAbsoluteTransforms();\r\n }\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 The TransformNode that this bone is attached to\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 The TransformNode that this bone is attached to\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.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const mat = Bone._TmpMats[0];\r\n\r\n mat.copyFrom(this.getAbsoluteTransform());\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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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.getAbsoluteTransform();\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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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.getAbsoluteTransform();\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 The TransformNode that this bone is attached to\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 The TransformNode that this bone is attached to\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.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteTransform();\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 The TransformNode that this bone is attached to\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 The TransformNode that this bone is attached to\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.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteTransform());\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 restPose for this bone.\r\n */\r\n public setCurrentPoseAsRest(): void {\r\n this.setRestPose(this.getLocalMatrix());\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"bone.js","sourceRoot":"","sources":["../../../../lts/core/generated/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;IA8C1B,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,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC,sCAAsC;QAEnE,oCAAoC;QACpC,IAAI,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;YACnD,OAAO;SACV;QAED,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,WAA6B,IAAI,EACjC,aAA+B,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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 = new Array<Bone>();\r\n\r\n /** Gets the animations associated with this bone */\r\n public animations = new Array<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;\r\n private _restPose: Matrix;\r\n private _baseMatrix: Matrix;\r\n private _absoluteTransform = new Matrix();\r\n private _invertedAbsoluteTransform = new Matrix();\r\n private _scalingDeterminant = 1;\r\n private _worldTransform = new Matrix();\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 this._needToCompose = false; // in case there was a pending compose\r\n\r\n // skip if the matrices are the same\r\n if (value.updateFlag === this._localMatrix.updateFlag) {\r\n return;\r\n }\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\r\n * @param restPose defines the rest pose matrix\r\n * @param baseMatrix defines the base matrix\r\n * @param index defines index of the bone in the hierarchy\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 restPose: Nullable<Matrix> = null,\r\n baseMatrix: 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 ? localMatrix.clone() : Matrix.Identity();\r\n this._restPose = restPose ? restPose : this._localMatrix.clone();\r\n this._baseMatrix = baseMatrix ? baseMatrix : this._localMatrix.clone();\r\n this._index = index;\r\n\r\n skeleton.bones.push(this);\r\n\r\n this.setParent(parentBone, false);\r\n\r\n if (baseMatrix || localMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\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 root bones\r\n * @returns an array containing the root bones\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 updateDifferenceMatrix defines if the difference matrix must be updated\r\n */\r\n public setParent(parent: Nullable<Bone>, updateDifferenceMatrix: 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 (updateDifferenceMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\r\n\r\n this.markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets the local matrix\r\n * @returns a 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 base matrix (initial matrix which remains unchanged)\r\n * @returns the base matrix (as known as bind pose matrix)\r\n */\r\n public getBaseMatrix(): Matrix {\r\n return this._baseMatrix;\r\n }\r\n\r\n /**\r\n * Gets the rest pose matrix\r\n * @returns a matrix\r\n */\r\n public getRestPose(): Matrix {\r\n return this._restPose;\r\n }\r\n\r\n /**\r\n * Sets the rest pose matrix\r\n * @param matrix the local-space rest pose to set for this bone\r\n */\r\n public setRestPose(matrix: Matrix): void {\r\n this._restPose.copyFrom(matrix);\r\n }\r\n\r\n /**\r\n * Gets the bind pose matrix\r\n * @returns the bind pose matrix\r\n * @deprecated Please use getBaseMatrix instead\r\n */\r\n public getBindPose(): Matrix {\r\n return this._baseMatrix;\r\n }\r\n\r\n /**\r\n * Sets the bind pose matrix\r\n * @param matrix the local-space bind pose to set for this bone\r\n * @deprecated Please use updateMatrix instead\r\n */\r\n public setBindPose(matrix: Matrix): void {\r\n this.updateMatrix(matrix);\r\n }\r\n\r\n /**\r\n * Gets a matrix used to store world matrix (ie. the matrix sent to shaders)\r\n */\r\n public getWorldMatrix(): Matrix {\r\n return this._worldTransform;\r\n }\r\n\r\n /**\r\n * Sets the local matrix to rest pose 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.getRestPose().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._restPose;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the inverse of the absolute transform matrix.\r\n * This matrix will be multiplied by local matrix to get the difference matrix (ie. the difference between original state and current state)\r\n * @returns a matrix\r\n */\r\n public getInvertedAbsoluteTransform(): Matrix {\r\n return this._invertedAbsoluteTransform;\r\n }\r\n\r\n /**\r\n * Gets the absolute transform matrix (ie base matrix * parent world matrix)\r\n * @returns a matrix\r\n */\r\n public getAbsoluteTransform(): Matrix {\r\n return this._absoluteTransform;\r\n }\r\n\r\n /**\r\n * Links with the given transform node.\r\n * The local matrix of this bone is copied from the transform 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 base and local matrices\r\n * @param matrix defines the new base or local matrix\r\n * @param updateDifferenceMatrix defines if the difference matrix must be updated\r\n * @param updateLocalMatrix defines if the local matrix should be updated\r\n */\r\n public updateMatrix(matrix: Matrix, updateDifferenceMatrix = true, updateLocalMatrix = true): void {\r\n this._baseMatrix.copyFrom(matrix);\r\n\r\n if (updateDifferenceMatrix) {\r\n this._updateDifferenceMatrix();\r\n }\r\n\r\n if (updateLocalMatrix) {\r\n this._matrix = matrix;\r\n } else {\r\n this.markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateDifferenceMatrix(rootMatrix?: Matrix, updateChildren = true): void {\r\n if (!rootMatrix) {\r\n rootMatrix = this._baseMatrix;\r\n }\r\n\r\n if (this.parent) {\r\n rootMatrix.multiplyToRef(this.parent._absoluteTransform, this._absoluteTransform);\r\n } else {\r\n this._absoluteTransform.copyFrom(rootMatrix);\r\n }\r\n\r\n this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform);\r\n\r\n if (updateChildren) {\r\n for (let index = 0; index < this.children.length; index++) {\r\n this.children[index]._updateDifferenceMatrix();\r\n }\r\n }\r\n\r\n this._scalingDeterminant = this._absoluteTransform.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 /**\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\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public translate(vec: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\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 let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\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.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n }\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n tmat.setTranslationFromFloats(0, 0, 0);\r\n tmat.invert();\r\n Vector3.TransformCoordinatesToRef(vec, tmat, tvec);\r\n\r\n lm.addAtIndex(12, tvec.x);\r\n lm.addAtIndex(13, tvec.y);\r\n lm.addAtIndex(14, tvec.z);\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\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\r\n * @param tNode The TransformNode that this bone is attached to. This is only used in world space\r\n */\r\n public setPosition(position: Vector3, space = Space.LOCAL, tNode?: TransformNode): void {\r\n const lm = this.getLocalMatrix();\r\n\r\n if (space == Space.LOCAL) {\r\n lm.setTranslationFromFloats(position.x, position.y, position.z);\r\n } else {\r\n let wm: Nullable<Matrix> = null;\r\n\r\n //tNode.getWorldMatrix() needs to be called before skeleton.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n const vec = Bone._TmpVecs[0];\r\n\r\n if (this.parent) {\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat.copyFrom(this.parent.getAbsoluteTransform());\r\n }\r\n tmat.invert();\r\n } else {\r\n Matrix.IdentityToRef(tmat);\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(position, tmat, vec);\r\n lm.setTranslationFromFloats(vec.x, vec.y, vec.z);\r\n }\r\n\r\n this._markAsDirtyAndDecompose();\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 The TransformNode that this bone is attached to\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 The TransformNode that this bone is attached to. This is only used in world space\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._getNegativeRotationToRef(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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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._getNegativeRotationToRef(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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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._getNegativeRotationToRef(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 The TransformNode that this bone is attached to. This is only used in world space\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._getNegativeRotationToRef(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.getAbsoluteTransform().multiplyToRef(parentScale, parentScale);\r\n } else {\r\n parentScale.copyFrom(parent.getAbsoluteTransform());\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.computeAbsoluteTransforms();\r\n this._markAsDirtyAndDecompose();\r\n }\r\n\r\n private _getNegativeRotationToRef(rotMatInv: Matrix, tNode?: TransformNode): boolean {\r\n const scaleMatrix = Bone._TmpMats[2];\r\n rotMatInv.copyFrom(this.getAbsoluteTransform());\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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteTransform();\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 The TransformNode that this bone is attached to\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 The TransformNode that this bone is attached to\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 transforms of this bone and its children\r\n */\r\n public computeAbsoluteTransforms(): void {\r\n this._compose();\r\n\r\n if (this.parent) {\r\n this._localMatrix.multiplyToRef(this.parent._absoluteTransform, this._absoluteTransform);\r\n } else {\r\n this._absoluteTransform.copyFrom(this._localMatrix);\r\n\r\n const poseMatrix = this._skeleton.getPoseMatrix();\r\n\r\n if (poseMatrix) {\r\n this._absoluteTransform.multiplyToRef(poseMatrix, this._absoluteTransform);\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].computeAbsoluteTransforms();\r\n }\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 The TransformNode that this bone is attached to\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 The TransformNode that this bone is attached to\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.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const mat = Bone._TmpMats[0];\r\n\r\n mat.copyFrom(this.getAbsoluteTransform());\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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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.getAbsoluteTransform();\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 The TransformNode that this bone is attached to. This is only used in world space\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 The TransformNode that this bone is attached to. This is only used in world space\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.getAbsoluteTransform();\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 The TransformNode that this bone is attached to\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 The TransformNode that this bone is attached to\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.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n let tmat = Bone._TmpMats[0];\r\n\r\n if (tNode && wm) {\r\n tmat.copyFrom(this.getAbsoluteTransform());\r\n tmat.multiplyToRef(wm, tmat);\r\n } else {\r\n tmat = this.getAbsoluteTransform();\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 The TransformNode that this bone is attached to\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 The TransformNode that this bone is attached to\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.computeAbsoluteTransforms()\r\n if (tNode) {\r\n wm = tNode.getWorldMatrix();\r\n }\r\n\r\n this._skeleton.computeAbsoluteTransforms();\r\n\r\n const tmat = Bone._TmpMats[0];\r\n\r\n tmat.copyFrom(this.getAbsoluteTransform());\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 restPose for this bone.\r\n */\r\n public setCurrentPoseAsRest(): void {\r\n this.setRestPose(this.getLocalMatrix());\r\n }\r\n}\r\n"]}
|
|
@@ -9,7 +9,7 @@ import { FramingBehavior } from "../Behaviors/Cameras/framingBehavior";
|
|
|
9
9
|
import { Camera } from "./camera";
|
|
10
10
|
import { TargetCamera } from "./targetCamera";
|
|
11
11
|
import { ArcRotateCameraInputsManager } from "../Cameras/arcRotateCameraInputsManager";
|
|
12
|
-
|
|
12
|
+
import type { Collider } from "../Collisions/collider";
|
|
13
13
|
/**
|
|
14
14
|
* This represents an orbital type of camera.
|
|
15
15
|
*
|
|
@@ -456,4 +456,3 @@ export declare class ArcRotateCamera extends TargetCamera {
|
|
|
456
456
|
*/
|
|
457
457
|
getClassName(): string;
|
|
458
458
|
}
|
|
459
|
-
export {};
|