@onerjs/core 8.56.4 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animatable.core.js +36 -0
- package/Animations/animatable.core.js.map +1 -1
- package/Animations/animationGroup.pure.d.ts +61 -1
- package/Animations/animationGroup.pure.js +191 -2
- package/Animations/animationGroup.pure.js.map +1 -1
- package/Animations/index.d.ts +1 -0
- package/Animations/index.js +1 -0
- package/Animations/index.js.map +1 -1
- package/Animations/pure.d.ts +1 -0
- package/Animations/pure.js +1 -0
- package/Animations/pure.js.map +1 -1
- package/Animations/rootMotion.d.ts +560 -0
- package/Animations/rootMotion.js +1709 -0
- package/Animations/rootMotion.js.map +1 -0
- package/Animations/runtimeAnimation.d.ts +57 -0
- package/Animations/runtimeAnimation.js +127 -3
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Cameras/arcRotateCamera.pure.d.ts +2 -0
- package/Cameras/arcRotateCamera.pure.js +2 -0
- package/Cameras/arcRotateCamera.pure.js.map +1 -1
- package/Cameras/targetCamera.pure.d.ts +2 -0
- package/Cameras/targetCamera.pure.js +7 -1
- package/Cameras/targetCamera.pure.js.map +1 -1
- package/Collisions/gpuPicker.js +5 -5
- package/Collisions/gpuPicker.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.query.pure.js +4 -2
- package/Engines/AbstractEngine/abstractEngine.query.pure.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.query.types.d.ts +11 -2
- package/Engines/AbstractEngine/abstractEngine.query.types.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js +1 -0
- package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.pure.js +63 -0
- package/Engines/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.types.d.ts +13 -0
- package/Engines/Extensions/engine.multiRender.types.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +2 -2
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.types.d.ts +2 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.types.js.map +1 -1
- package/Engines/Extensions/index.d.ts +1 -0
- package/Engines/Extensions/index.js +1 -0
- package/Engines/Extensions/index.js.map +1 -1
- package/Engines/Extensions/pure.d.ts +1 -1
- package/Engines/Extensions/pure.js +1 -1
- package/Engines/Extensions/pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +88 -39
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.d.ts +20 -2
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +4 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.types.d.ts +13 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.types.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.pure.js +11 -3
- package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/index.d.ts +1 -0
- package/Engines/WebGPU/Extensions/index.js +1 -0
- package/Engines/WebGPU/Extensions/index.js.map +1 -1
- package/Engines/WebGPU/Extensions/pure.d.ts +1 -1
- package/Engines/WebGPU/Extensions/pure.js +1 -1
- package/Engines/WebGPU/Extensions/pure.js.map +1 -1
- package/Engines/WebGPU/webgpuBundleList.d.ts +2 -0
- package/Engines/WebGPU/webgpuBundleList.js +4 -0
- package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +5 -2
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +3 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuSnapshotRendering.d.ts +4 -0
- package/Engines/WebGPU/webgpuSnapshotRendering.js +40 -7
- package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +2 -2
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -0
- package/Engines/WebGPU/webgpuTextureManager.js +286 -13
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.pure.d.ts +2 -0
- package/Engines/abstractEngine.pure.js +7 -3
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/constants.d.ts +4 -0
- package/Engines/constants.js +4 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/thinEngine.pure.d.ts +14 -0
- package/Engines/thinEngine.pure.js +48 -12
- package/Engines/thinEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +1 -0
- package/Engines/thinNativeEngine.pure.js +7 -1
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/thinWebGPUEngine.d.ts +4 -0
- package/Engines/thinWebGPUEngine.js +10 -1
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +5 -2
- package/Engines/webgpuEngine.pure.js +48 -13
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js +2 -2
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.d.ts +11 -2
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js +1 -1
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.d.ts +9 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js +6 -8
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.d.ts +9 -0
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js +34 -9
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js +4 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +4 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js +19 -7
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +20 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +53 -10
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.d.ts +16 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js +64 -14
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js +64 -16
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +4 -0
- package/FlowGraph/flowGraph.js +38 -7
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphBlock.js +3 -0
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +7 -0
- package/FlowGraph/flowGraphConnection.js +7 -0
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +2 -1
- package/FlowGraph/flowGraphContext.js +4 -3
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +15 -1
- package/FlowGraph/flowGraphCoordinator.js +47 -16
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +5 -0
- package/FlowGraph/flowGraphEventBlock.js +7 -0
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphHostResolver.d.ts +2 -1
- package/FlowGraph/flowGraphHostResolver.js.map +1 -1
- package/FlowGraph/flowGraphParser.js +60 -2
- package/FlowGraph/flowGraphParser.js.map +1 -1
- package/FlowGraph/serialization.d.ts +2 -0
- package/FlowGraph/serialization.js +10 -22
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +8 -0
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.d.ts +5 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js +8 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.d.ts +87 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js +295 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.js +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +4 -4
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.d.ts +5 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +13 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/allBlocks.pure.js +2 -0
- package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.pure.js +20 -1
- package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/pure.js +1 -0
- package/FrameGraph/Node/Blocks/pure.js.map +1 -1
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/Layers/selectionOutlineTask.js +1 -0
- package/FrameGraph/Tasks/Layers/selectionOutlineTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js +5 -1
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +1 -0
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.d.ts +69 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js +223 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +25 -3
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +69 -33
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +3 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/frameGraphObjectList.d.ts +6 -1
- package/FrameGraph/frameGraphObjectList.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +3 -1
- package/FrameGraph/frameGraphRenderContext.js +5 -5
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/index.d.ts +1 -0
- package/FrameGraph/index.js +1 -0
- package/FrameGraph/index.js.map +1 -1
- package/FrameGraph/pure.d.ts +1 -0
- package/FrameGraph/pure.js +1 -0
- package/FrameGraph/pure.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +4 -0
- package/Inputs/scene.inputManager.js +50 -8
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +5 -5
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +5 -5
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +26 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +151 -47
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +5 -5
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +11 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +17 -2
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +2 -2
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
- package/Materials/Node/nodeMaterial.pure.d.ts +4 -0
- package/Materials/Node/nodeMaterial.pure.js +4 -0
- package/Materials/Node/nodeMaterial.pure.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +25 -3
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.pure.d.ts +2 -0
- package/Materials/PBR/pbrBaseMaterial.pure.d.ts +2 -0
- package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +13 -14
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js +6 -6
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
- package/Materials/Textures/baseTexture.pure.js +3 -0
- package/Materials/Textures/baseTexture.pure.js.map +1 -1
- package/Materials/Textures/cubeTexture.pure.js +1 -1
- package/Materials/Textures/cubeTexture.pure.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +8 -1
- package/Materials/Textures/internalTexture.js +9 -2
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.functions.d.ts +3 -3
- package/Materials/Textures/rawTexture2DArray.functions.js.map +1 -1
- package/Materials/Textures/rawTexture3D.d.ts +1 -1
- package/Materials/Textures/rawTexture3D.js +1 -1
- package/Materials/Textures/rawTexture3D.js.map +1 -1
- package/Materials/Textures/textureHelper.functions.d.ts +14 -0
- package/Materials/Textures/textureHelper.functions.js +24 -0
- package/Materials/Textures/textureHelper.functions.js.map +1 -1
- package/Materials/ditheredTileFadeMaterialPlugin.d.ts +210 -0
- package/Materials/ditheredTileFadeMaterialPlugin.js +509 -0
- package/Materials/ditheredTileFadeMaterialPlugin.js.map +1 -0
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.d.ts +46 -1
- package/Materials/materialHelper.geometryrendering.js +105 -8
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Materials/prepass.defines.d.ts +2 -0
- package/Materials/prepass.defines.js +2 -0
- package/Materials/prepass.defines.js.map +1 -1
- package/Materials/pure.d.ts +1 -0
- package/Materials/pure.js +1 -0
- package/Materials/pure.js.map +1 -1
- package/Materials/standardMaterial.pure.d.ts +2 -0
- package/Materials/standardMaterial.pure.js +6 -3
- package/Materials/standardMaterial.pure.js.map +1 -1
- package/Meshes/Builders/polygonBuilder.pure.d.ts +4 -0
- package/Meshes/Builders/polygonBuilder.pure.js +4 -1
- package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.d.ts +19 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.js +23 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +3 -14
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +20 -24
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +2 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +11 -4
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/abstractMesh.pure.d.ts +18 -0
- package/Meshes/abstractMesh.pure.js +22 -0
- package/Meshes/abstractMesh.pure.js.map +1 -1
- package/Meshes/index.d.ts +1 -0
- package/Meshes/index.js +1 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/instancedMesh.pure.d.ts +5 -0
- package/Meshes/instancedMesh.pure.js +12 -0
- package/Meshes/instancedMesh.pure.js.map +1 -1
- package/Meshes/mesh.pure.js +23 -8
- package/Meshes/mesh.pure.js.map +1 -1
- package/Meshes/meshBlendingTag.d.ts +47 -0
- package/Meshes/meshBlendingTag.js +64 -0
- package/Meshes/meshBlendingTag.js.map +1 -0
- package/Meshes/polygonMesh.js +2 -2
- package/Meshes/polygonMesh.js.map +1 -1
- package/Meshes/pure.d.ts +1 -0
- package/Meshes/pure.js +1 -0
- package/Meshes/pure.js.map +1 -1
- package/Misc/fileTools.pure.js +21 -0
- package/Misc/fileTools.pure.js.map +1 -1
- package/Misc/snapshotRenderingHelper.js +2 -2
- package/Misc/snapshotRenderingHelper.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/gpuParticleSystem.pure.d.ts +2 -0
- package/Particles/gpuParticleSystem.pure.js +89 -28
- package/Particles/gpuParticleSystem.pure.js.map +1 -1
- package/Particles/thinParticleSystem.pure.d.ts +2 -0
- package/Particles/thinParticleSystem.pure.js +84 -19
- package/Particles/thinParticleSystem.pure.js.map +1 -1
- package/Particles/webgl2ParticleSystem.pure.d.ts +1 -0
- package/Particles/webgl2ParticleSystem.pure.js +12 -4
- package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js +7 -0
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js.map +1 -1
- package/PostProcesses/index.d.ts +2 -0
- package/PostProcesses/index.js +2 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/meshBlendingBlueNoise.d.ts +15 -0
- package/PostProcesses/meshBlendingBlueNoise.js +77 -0
- package/PostProcesses/meshBlendingBlueNoise.js.map +1 -0
- package/PostProcesses/meshBlendingPostProcess.d.ts +131 -0
- package/PostProcesses/meshBlendingPostProcess.js +315 -0
- package/PostProcesses/meshBlendingPostProcess.js.map +1 -0
- package/PostProcesses/pure.d.ts +2 -0
- package/PostProcesses/pure.js +2 -0
- package/PostProcesses/pure.js.map +1 -1
- package/PostProcesses/thinMeshBlendingPostProcess.d.ts +339 -0
- package/PostProcesses/thinMeshBlendingPostProcess.js +771 -0
- package/PostProcesses/thinMeshBlendingPostProcess.js.map +1 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +6 -6
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +8 -8
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
- package/Rendering/boundingBoxRenderer.pure.js +2 -1
- package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
- package/Rendering/depthRenderer.pure.js +3 -4
- package/Rendering/depthRenderer.pure.js.map +1 -1
- package/Rendering/edgesRenderer.pure.d.ts +4 -2
- package/Rendering/edgesRenderer.pure.js +11 -2
- package/Rendering/edgesRenderer.pure.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +10 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js +20 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +9 -3
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +14 -9
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/geometryBufferRenderer.pure.d.ts +38 -4
- package/Rendering/geometryBufferRenderer.pure.js +126 -17
- package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +7 -1
- package/Rendering/objectRenderer.js +45 -7
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.pure.js +6 -2
- package/Rendering/outlineRenderer.pure.js.map +1 -1
- package/Rendering/renderingManager.d.ts +1 -1
- package/Rendering/renderingManager.js +5 -4
- package/Rendering/renderingManager.js.map +1 -1
- package/Shaders/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
- package/Shaders/ShadersInclude/defaultFragmentAlpha.js +34 -0
- package/Shaders/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +5 -1
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/geometryRenderingFragment.d.ts +5 -0
- package/Shaders/ShadersInclude/geometryRenderingFragment.js +74 -0
- package/Shaders/ShadersInclude/geometryRenderingFragment.js.map +1 -0
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js +89 -0
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js +24 -17
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +27 -20
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDebug.js +6 -2
- package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
- package/Shaders/ShadersInclude/prePassDeclaration.js +95 -2
- package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/Shaders/default.fragment.js +31 -40
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/depthOfField.fragment.js +13 -9
- package/Shaders/depthOfField.fragment.js.map +1 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js +16 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js +16 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/Shaders/gaussianSplatting.fragment.js +63 -3
- package/Shaders/gaussianSplatting.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +80 -0
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/geometry.fragment.js +17 -11
- package/Shaders/geometry.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.fragment.js +43 -1
- package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.vertex.js +96 -16
- package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
- package/Shaders/meshBlending.fragment.d.ts +5 -0
- package/Shaders/meshBlending.fragment.js +519 -0
- package/Shaders/meshBlending.fragment.js.map +1 -0
- package/Shaders/particles.fragment.js +43 -1
- package/Shaders/particles.fragment.js.map +1 -1
- package/Shaders/particles.vertex.js +84 -3
- package/Shaders/particles.vertex.js.map +1 -1
- package/Shaders/sprites.fragment.js +52 -2
- package/Shaders/sprites.fragment.js.map +1 -1
- package/Shaders/sprites.vertex.js +62 -1
- package/Shaders/sprites.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js +33 -0
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.d.ts +6 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js +76 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightFragment.js +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js +18 -0
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +11 -25
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +11 -25
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDebug.js +5 -1
- package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +6 -1
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +17 -48
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +15 -2
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -2
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.fragment.js +63 -2
- package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +80 -0
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/geometry.fragment.js +37 -2
- package/ShadersWGSL/geometry.fragment.js.map +1 -1
- package/ShadersWGSL/gpuRenderParticles.fragment.js +47 -2
- package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -1
- package/ShadersWGSL/gpuRenderParticles.vertex.js +110 -7
- package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -1
- package/ShadersWGSL/meshBlending.fragment.d.ts +5 -0
- package/ShadersWGSL/meshBlending.fragment.js +576 -0
- package/ShadersWGSL/meshBlending.fragment.js.map +1 -0
- package/ShadersWGSL/openpbr.fragment.js +2 -1
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/particles.fragment.js +45 -1
- package/ShadersWGSL/particles.fragment.js.map +1 -1
- package/ShadersWGSL/particles.vertex.js +86 -4
- package/ShadersWGSL/particles.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +2 -1
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/sprites.fragment.js +56 -2
- package/ShadersWGSL/sprites.fragment.js.map +1 -1
- package/ShadersWGSL/sprites.vertex.js +62 -1
- package/ShadersWGSL/sprites.vertex.js.map +1 -1
- package/Sprites/spriteManager.d.ts +13 -0
- package/Sprites/spriteManager.js +15 -0
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.d.ts +24 -1
- package/Sprites/spriteRenderer.js +368 -50
- package/Sprites/spriteRenderer.js.map +1 -1
- package/Sprites/thinSprite.d.ts +4 -0
- package/Sprites/thinSprite.js +4 -0
- package/Sprites/thinSprite.js.map +1 -1
- package/States/alphaCullingState.d.ts +3 -1
- package/States/alphaCullingState.js +18 -3
- package/States/alphaCullingState.js.map +1 -1
- package/XR/webXRDefaultExperience.d.ts +5 -1
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXREnterExitUI.d.ts +2 -1
- package/XR/webXREnterExitUI.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +23 -0
- package/scene.pure.js +35 -0
- package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C,IAAI,YAAY,YAAY,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC5B,OAAO,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import {\n type Animatable,\n type AnimationGroup,\n type Bone,\n type IAnimationKey,\n type IDisposable,\n type Node,\n type Nullable,\n type Observer,\n type RuntimeAnimation,\n type Scene,\n} from \"core/index\";\nimport { Animation } from \"./animation.pure\";\nimport { Matrix, Quaternion, TmpVectors, Vector3 } from \"../Maths/math.vector.pure\";\nimport { Observable } from \"../Misc/observable.pure\";\nimport { Logger } from \"../Misc/logger\";\nimport { TransformNode } from \"../Meshes/transformNode.pure\";\nimport { AbstractMesh } from \"../Meshes/abstractMesh.pure\";\n\n/**\n * Where the travel of a {@link RootMotionClip} comes from.\n */\nexport const enum RootMotionSource {\n /**\n * No motion was found: the clip neither moves its root nor walks its contact nodes.\n */\n None = 0,\n /**\n * The root node's own animation - the clip's ground truth. Its travel (and turning, when extracted) is left out of\n * the in-place animation group and applied to the character node instead.\n */\n Root = 1,\n /**\n * Deduced from the contact nodes (usually the feet) of an in-place clip: whatever a planted contact gives up in\n * character space, the character travels. The travel is not in the clip, so nothing is left out of it.\n */\n FootContact = 2,\n}\n\n/**\n * Options for {@link RootMotionClip}.\n */\nexport interface IRootMotionClipOptions {\n /**\n * The root node, usually the hips or a dedicated root bone, whose own travel is tried first. A bone is resolved to\n * its linked transform node. Defaults to the position-animated node with the most animated descendants in the group.\n * A node the group does not animate is accepted as the base of the animated hierarchy: the travel then comes from\n * the contact nodes under it, and {@link RootMotionSource.Root} cannot be forced.\n */\n rootNode?: TransformNode | Bone;\n /**\n * The node that receives the motion and whose local space the motion is measured in. Defaults to the topmost\n * ancestor of the root node (the \"__root__\" node of a glTF asset). The group must not animate its position or\n * rotation, since the motion applied to it would be overwritten.\n */\n characterNode?: TransformNode;\n /**\n * The nodes that touch the ground, used when the root does not travel. A bone is resolved to its linked\n * transform node. Defaults to the leaf nodes under the root that come closest to the ground during the clip.\n */\n contactNodes?: Array<TransformNode | Bone>;\n /**\n * Forces the source of the travel instead of trying {@link RootMotionSource.Root} first and falling back to\n * {@link RootMotionSource.FootContact}.\n */\n source?: RootMotionSource;\n /**\n * Whether the root's turning about the up axis is extracted and applied to the character. By default it is when\n * a cycle leaves the character facing at least {@link IRootMotionClipOptions.minimumTurn} away from where it\n * started, so a walk's hip twist - or a dance that spins round to face the front again - stays in the pose while a\n * turning clip turns the character.\n */\n extractRotation?: boolean;\n /**\n * How densely the clip is sampled during analysis. Default is 60 samples per second of animation.\n */\n samplesPerSecond?: number;\n /**\n * Travel below this share of the character's height over a cycle is treated as the clip standing still: root\n * sway rather than root motion. Default is 0.1.\n */\n minimumTravel?: number;\n /**\n * Turning below this angle over a cycle, in radians, is treated as twist rather than a turn. Default is 10 degrees.\n */\n minimumTurn?: number;\n /**\n * A straight clip whose direction of travel is within this angle of a character space axis, in radians, travels\n * along that axis; 0 keeps the measured direction. Ignored when lateral motion is extracted.\n *\n * By default a root clip keeps its direction (0): its travel is authored or captured, and a deliberate veer is data.\n * Travel deduced from contacts snaps within 10 degrees: an in-place clip is meant to travel straight, and the\n * deduced direction is an estimate - Xbot's run deduces 3.5 degrees off straight from feet that slide 1 degree off.\n */\n directionSnapAngle?: number;\n /**\n * When false (the default) only the travel along the clip's direction of travel is extracted, leaving the\n * side-to-side sway of the root in the animation. Set to true to extract all horizontal motion, for strafing\n * clips. Turning clips always extract all horizontal motion, since their direction of travel changes.\n */\n extractLateralMotion?: boolean;\n /**\n * The up axis in character space. Default is +Y.\n */\n upAxis?: Vector3;\n /**\n * The name of the in-place animation group. Defaults to the source group's name followed by \" (in place)\".\n */\n name?: string;\n /**\n * Whether every animation is cloned into the in-place animation group. By default (false) only the root channels\n * the extraction rewrites are cloned, and the animations it leaves untouched are shared with the source group, as\n * {@link AnimationGroup.clone} shares them. Set it to true before changing the in-place group's animations in place\n * - with {@link AnimationGroup.MakeAnimationAdditive} or {@link AnimationGroup.normalize} for example - so the\n * source group's animations are not changed with them.\n */\n cloneAnimations?: boolean;\n}\n\ninterface INodeChannels {\n position?: Animation;\n rotationQuaternion?: Animation;\n rotation?: Animation;\n scaling?: Animation;\n}\n\n/**\n * What the animation mixer wrote to a root channel in the last animation step - the writes its late bindings read,\n * those made after them belonging to the step that follows - gathered for every clip that follows that channel.\n */\ninterface IChannelWriters {\n /** The property of the channel. */\n property: string;\n /** The weights of the weighted animatables writing the channel, additive ones aside. */\n total: number;\n /** Whether any weighted animatable writes the channel. */\n weighted: boolean;\n /** The last runtime animation writing the channel unweighted, whose value is the pose unless a weighted one replaces it. */\n lastDirect: Nullable<RuntimeAnimation>;\n /** The writes to the channel this step, in order: the runtime animation of each, which may write more than once. */\n current: RuntimeAnimation[];\n /** The weight of each write, -1 for a direct one. */\n currentWeights: number[];\n /** Whether each write was additive. */\n currentAdditive: boolean[];\n /** The factor each write blended in with, one once the animation writing it has blended in. */\n currentBlending: number[];\n}\n\n/**\n * The channel of a node to run a clip's motion on: the one of its position, rotation and scaling channels preferred by\n * {@link ClockBeats}.\n * @param channels defines the node's channels\n * @param fromFrame defines the first frame of the range played\n * @param toFrame defines the last frame of the range played\n * @returns the channel and the frames its keys span\n */\nfunction ClockChannel(channels: INodeChannels, fromFrame: number, toFrame: number): IClockCandidate {\n let best: Nullable<IClockCandidate> = null;\n for (const animation of [channels.position, channels.rotationQuaternion, channels.rotation, channels.scaling]) {\n if (!animation) {\n continue;\n }\n const keys = animation.getKeys();\n const first = keys.length ? keys[0].frame : 0;\n const last = keys.length ? keys[keys.length - 1].frame : 0;\n const candidate = { animation, span: last - first, covers: last > first && first <= fromFrame && last >= toFrame };\n if (!best || ClockBeats(candidate, best)) {\n best = candidate;\n }\n }\n return best!;\n}\n\n/** A channel a clip's motion could run on. */\ninterface IClockCandidate {\n /** The channel. */\n animation: Animation;\n /** The frames its keys span. */\n span: number;\n /** Whether its keys cover the range played. */\n covers: boolean;\n}\n\n/**\n * Whether one channel is to run a clip's motion rather than another: one whose keys cover the range played before one\n * whose keys do not; among channels that cover it a position channel first, the channel the mixer weighs linearly, then\n * the widest; among channels that do not, the widest, since a channel keyed shorter clamps the analysis to its keys,\n * then a position channel.\n * @param candidate defines the channel considered\n * @param other defines the channel preferred so far\n * @returns whether the channel considered is preferred\n */\nfunction ClockBeats(candidate: IClockCandidate, other: IClockCandidate): boolean {\n if (candidate.covers !== other.covers) {\n return candidate.covers;\n }\n const position = candidate.animation.targetProperty === \"position\";\n const otherPosition = other.animation.targetProperty === \"position\";\n if (candidate.covers && position !== otherPosition) {\n return position;\n }\n if (candidate.span !== other.span) {\n return candidate.span > other.span;\n }\n return position && !otherPosition;\n}\n\n/** Contact candidates must come this close to the lowest one during the clip, as a share of the character's height. */\nconst ContactHeightBand = 0.1;\n/** A contact counts as on the ground within this share of the character's height above its own lowest point. */\nconst PlantedHeightBand = 0.05;\n/** Values per sample in the motion track: translation x, y, z and the turn about the up axis. */\nconst TrackStride = 4;\n/**\n * Deduced travel counts only if its steps mostly head the same way: net travel over the length of the path stepped.\n * Walks and runs measure 0.99 and more; a dance or an idle that shuffles about on the spot measures under 0.3.\n */\nconst MinimumStraightness = 0.8;\n/** Default snap of a direction of travel deduced from contacts, in radians. */\nconst DeducedDirectionSnapAngle = Math.PI / 18;\n/** Frame step for the numeric tangents of rewritten cubic spline keys. */\nconst TangentDelta = 1e-3;\n/** The root motion of each scene, updating the scene's controllers in one pass after animations. */\nconst SceneRootMotions = new WeakMap<Scene, SceneRootMotion>();\n\n/**\n * The root motion of an animation group: how far the clip carries the character over a cycle, and how far it turns it,\n * so that the character can be moved by it and its feet stay planted instead of skating.\n *\n * The clip is analyzed once, when the RootMotionClip is created, without playing the group or changing it:\n * 1. The root node's own animation is tried first, as the ground truth. If the root ends a cycle a meaningful distance\n * from where it started, that travel is the root motion. Turning is read from the root the same way.\n * 2. Otherwise the clip is treated as an in-place cycle and the travel is deduced from its contact nodes: a planted\n * contact stays put in the world, so in character space it moves opposite to the character, and whatever it gives\n * up the character gains. The direction of travel falls out of the same measurement, so the forward axis of\n * the rig does not have to be known.\n *\n * The source group is never changed. The clip owns {@link RootMotionClip.animationGroup}, a clone of the source in\n * which the root's travel and turning are left out, so it plays and loops in place: play that group, and give the clip\n * to the {@link RootMotionController} of the character so the motion is applied to the character node instead.\n *\n * ```ts\n * const walk = new RootMotionClip(walkGroup);\n * const controller = new RootMotionController(walk.characterNode, [walk]);\n * walk.animationGroup.start(true);\n * ```\n *\n * The in-place group is a group of the scene, not of the source's asset container, so dispose the clip when it is done\n * with; disposing the container does not. To play a clip additively, build it from the source as it is and make the\n * in-place group additive: `AnimationGroup.MakeAnimationAdditive(clip.animationGroup, { referenceFrame: 0 })`, with\n * {@link IRootMotionClipOptions.cloneAnimations} set so the source keeps its keys.\n */\nexport class RootMotionClip implements IDisposable {\n /**\n * @internal\n * The node of the clip's clock: the channel whose runtime animation the controller reads the evaluated progress\n * from and turns into motion. It is the root node, or the first animated transform node when the group animates\n * no position.\n */\n public _clockNode: Nullable<TransformNode> = null;\n /** @internal The property of the clock's channel. */\n public _clockProperty = \"position\";\n /** @internal The very channel of the in-place group the analysis ran on, which another of the same property must not be taken for. */\n public _clockAnimation: Nullable<Animation> = null;\n /** @internal The runtime animation of the clock the controller followed last. */\n public _clockRuntime: Nullable<RuntimeAnimation> = null;\n /** @internal The animatable of the clock the controller followed last. */\n public _clockAnimatable: Nullable<Animatable> = null;\n /** @internal The animatable the last search for the clock found. */\n public _foundAnimatable: Nullable<Animatable> = null;\n /** @internal The animatable the clock's playback was synchronized with last, and the runtime animation of that root. */\n public _syncRoot: Nullable<Animatable> = null;\n /** @internal The runtime animation the clock was synchronized with last. */\n public _syncRuntime: Nullable<RuntimeAnimation> = null;\n /** @internal The progress of the clock the controller consumed last. */\n public _lastProgress: Nullable<number> = null;\n /** @internal Whether the clock has been left unevaluated at a weight of zero since the progress consumed last. */\n public _parked = false;\n /** @internal The clock's runtime animation at the last reset, whose evaluation of then is not where the playback carries on from. */\n public _staleRuntime: Nullable<RuntimeAnimation> = null;\n /** @internal Its progress then. */\n public _staleProgress: Nullable<number> = null;\n /** @internal What the mixer wrote to the clock's channel this frame. */\n public _writers: Nullable<IChannelWriters> = null;\n /** @internal The controller the clip belongs to. */\n public _controller: Nullable<RootMotionController> = null;\n\n private readonly _sourceGroup: AnimationGroup;\n private readonly _group: AnimationGroup;\n private readonly _characterNode: TransformNode;\n private readonly _upAxis: Vector3;\n private readonly _extractLateral: boolean;\n private readonly _directionSnapAngle: number | undefined;\n /** Sideways travel over a cycle left in the root's keys after snapping the direction, removed without being applied. */\n private readonly _lateralDrift = Vector3.Zero();\n private readonly _channels = new Map<Node, INodeChannels>();\n private _source = RootMotionSource.None;\n private _rootNode: Nullable<TransformNode> = null;\n private _contactNodes: TransformNode[] = [];\n private readonly _travelDirection = new Vector3(0, 0, 1);\n private readonly _cycleOffset = Vector3.Zero();\n private _cycleRotation = 0;\n private _turns = false;\n private _duration = 0;\n private _characterHeight = 0;\n private _fromFrame = 0;\n private _toFrame = 0;\n private _sampleCount = 1;\n private _track = new Float32Array(2 * TrackStride);\n /** Whether the root's own travel is left out of the in-place group - not so for a clip that only turns on the spot. */\n private _removesRootTravel = false;\n /** Whether the motion is a turn about the root's starting point: a clip that only turns on the spot. */\n private _pivots = false;\n /** The root's position before the clip, when the in-place group animates a position the source leaves alone. */\n private _restoredPosition: Nullable<Vector3> = null;\n private _clockIndex = -1;\n private _sampleBlend = 0;\n private readonly _lastOffset = Vector3.Zero();\n private readonly _rangeStart = Vector3.Zero();\n private readonly _rangeCycle = Vector3.Zero();\n private readonly _cyclesOffset = Vector3.Zero();\n private readonly _planarStep = Vector3.Zero();\n private readonly _yawQuaternion = new Quaternion();\n private readonly _yawMatrix = new Matrix();\n\n /**\n * The animation group the clip was analyzed from. It is never changed.\n */\n public get sourceAnimationGroup(): AnimationGroup {\n return this._sourceGroup;\n }\n\n /**\n * The in-place animation group to play: a clone of the source with the root motion left out of the root's keys.\n * Animations the extraction does not rewrite are shared with the source unless the clip was created with\n * {@link IRootMotionClipOptions.cloneAnimations}. It belongs to the scene, and is disposed with the clip.\n */\n public get animationGroup(): AnimationGroup {\n return this._group;\n }\n\n /**\n * The controller the clip was added to, if any.\n */\n public get controller(): Nullable<RootMotionController> {\n return this._controller;\n }\n\n /**\n * Where the travel comes from. {@link RootMotionSource.None} when no motion was found.\n */\n public get source(): RootMotionSource {\n return this._source;\n }\n\n /**\n * The root node the clip was analyzed with, or null when the group animates no position. It carries the motion\n * only when {@link RootMotionClip.source} is {@link RootMotionSource.Root}.\n */\n public get rootNode(): Nullable<TransformNode> {\n return this._rootNode;\n }\n\n /**\n * The node the motion is measured in the local space of, and that a controller moves.\n */\n public get characterNode(): TransformNode {\n return this._characterNode;\n }\n\n /**\n * The contact nodes used to deduce the travel. Empty unless the source is {@link RootMotionSource.FootContact}.\n */\n public get contactNodes(): ReadonlyArray<TransformNode> {\n return this._contactNodes;\n }\n\n /**\n * The up axis in character space (unit length).\n */\n public get upAxis(): Vector3 {\n return this._upAxis;\n }\n\n /**\n * The first frame of the range the clip is analyzed over: the group's range, with a bound outside the clock\n * channel's keys replaced by that channel's first or last key, as playback does.\n */\n public get fromFrame(): number {\n return this._fromFrame;\n }\n\n /**\n * The last frame of the range the clip is analyzed over.\n */\n public get toFrame(): number {\n return this._toFrame;\n }\n\n /**\n * The direction the clip travels in over a cycle, in character space (unit length).\n */\n public get travelDirection(): Vector3 {\n return this._travelDirection;\n }\n\n /**\n * The travel covered by one cycle of the clip, in character space.\n */\n public get cycleOffset(): Vector3 {\n return this._cycleOffset;\n }\n\n /**\n * The distance covered by one cycle of the clip along the direction of travel, in character space units.\n */\n public get cycleDistance(): number {\n return Vector3.Dot(this._cycleOffset, this._travelDirection);\n }\n\n /**\n * The turn covered by one cycle of the clip about the up axis, in radians. Zero unless rotation is extracted.\n */\n public get cycleRotation(): number {\n return this._cycleRotation;\n }\n\n /**\n * Whether the root's turning is extracted and applied to the character.\n */\n public get extractsRotation(): boolean {\n return this._turns;\n }\n\n /**\n * The length of one cycle of the clip in seconds, at a speed ratio of 1.\n */\n public get duration(): number {\n return this._duration;\n }\n\n /**\n * The speed the clip implies at a speed ratio of 1, in character space units per second.\n */\n public get averageSpeed(): number {\n return this._duration > 0 ? this.cycleDistance / this._duration : 0;\n }\n\n /**\n * The vertical extent of the animated hierarchy at the first frame, in character space units. Thresholds are\n * relative to it.\n */\n public get characterHeight(): number {\n return this._characterHeight;\n }\n\n /**\n * Analyzes an animation group and builds the in-place animation group to play instead of it.\n * @param animationGroup defines the animation group to extract the root motion of; it is not changed\n * @param options defines how the root motion is extracted\n * @throws when the group has nothing to analyze, is additive, or animates the character node itself\n */\n public constructor(animationGroup: AnimationGroup, options: IRootMotionClipOptions = {}) {\n this._sourceGroup = animationGroup;\n this._upAxis = (options.upAxis ?? Vector3.UpReadOnly).normalizeToNew();\n this._extractLateral = !!options.extractLateralMotion;\n this._directionSnapAngle = options.directionSnapAngle;\n const name = options.name ?? `${animationGroup.name} (in place)`;\n\n if (animationGroup.isAdditive) {\n throw new Error(\n `RootMotionClip: animation group \"${animationGroup.name}\" is additive. Build the clip from the group it was made additive from, then make the clip's in-place group additive.`\n );\n }\n const targetedAnimations = animationGroup.targetedAnimations;\n if (!targetedAnimations.length) {\n throw new Error(`RootMotionClip: animation group \"${animationGroup.name}\" has no animations.`);\n }\n for (const targetedAnimation of targetedAnimations) {\n const target = targetedAnimation.target;\n const property = targetedAnimation.animation.targetProperty;\n if (!(target instanceof TransformNode)) {\n continue;\n }\n if (property === \"position\" || property === \"rotationQuaternion\" || property === \"rotation\" || property === \"scaling\") {\n let channels = this._channels.get(target);\n if (!channels) {\n channels = {};\n this._channels.set(target, channels);\n }\n channels[property] = targetedAnimation.animation;\n }\n }\n\n // The character node is where the motion goes; an animation of its position or rotation, or of a part of them,\n // would overwrite it every frame.\n const refuseAnimatedReceiver = (node: TransformNode) => {\n if (\n targetedAnimations.some(\n (targetedAnimation) => targetedAnimation.target === node && /^(position|rotationQuaternion|rotation)(\\.|$)/.test(targetedAnimation.animation.targetProperty)\n )\n ) {\n throw new Error(\n `RootMotionClip: animation group \"${animationGroup.name}\" animates the character node \"${node.name}\", which is to receive the motion. Parent the character under a node the group does not animate, or pass such an ancestor as characterNode.`\n );\n }\n };\n if (options.characterNode) {\n refuseAnimatedReceiver(options.characterNode);\n }\n this._rootNode = options.rootNode ? this._resolveNode(options.rootNode) : this._findRootNode();\n const anchor = this._rootNode ?? this._firstAnimatedNode();\n if (!anchor) {\n throw new Error(`RootMotionClip: animation group \"${animationGroup.name}\" does not animate any transform node.`);\n }\n let character = options.characterNode ?? null;\n if (!character || character === anchor || !anchor.isDescendantOf(character)) {\n if (character) {\n Logger.Warn(`RootMotionClip: the character node \"${character.name}\" is not an ancestor of the root node \"${anchor.name}\"; using the topmost ancestor instead.`);\n }\n character = this._topmostAncestor(anchor);\n }\n if (character === anchor) {\n throw new Error(`RootMotionClip: the root node \"${anchor.name}\" has no parent to carry its motion. Parent the character under a node of its own.`);\n }\n refuseAnimatedReceiver(character);\n this._characterNode = character;\n\n // The motion runs on the root's own animation - its frame rate, its range and at runtime its playback - rather than\n // whichever track happens to be first in the group, which could be a morph target at another frame rate: the\n // channel of the root that covers the range played, since one keyed shorter would clamp the analysis to its own\n // keys. A root the group does not animate, passed as the base of the hierarchy, runs on such a channel of an\n // animated descendant: a position channel before any other, the channel the mixer weighs linearly, and the\n // widest among those.\n const playedFrom = animationGroup.from;\n const playedTo = animationGroup.to;\n let clockNode: Nullable<TransformNode> = null;\n let clock: Nullable<Animation> = null;\n const anchorChannels = this._channels.get(anchor);\n const anchorClock = anchorChannels ? ClockChannel(anchorChannels, playedFrom, playedTo) : null;\n if (anchorClock && anchorClock.span > 0) {\n clockNode = anchor;\n clock = anchorClock.animation;\n } else {\n // The root has nothing to run on - it is not animated at all, or only by channels of a single key - so the\n // clip runs on a channel of the hierarchy under it, itself as the last resort, chosen across those nodes by\n // the same preference as among the channels of one.\n let best: Nullable<IClockCandidate> = null;\n for (const [node, channels] of this._channels) {\n if (node !== anchor && !node.isDescendantOf(anchor)) {\n continue;\n }\n const candidate = ClockChannel(channels, playedFrom, playedTo);\n if (!best || ClockBeats(candidate, best)) {\n best = candidate;\n clockNode = node as TransformNode;\n clock = candidate.animation;\n }\n }\n }\n if (!clockNode || !clock) {\n throw new Error(`RootMotionClip: animation group \"${animationGroup.name}\" animates neither the root node \"${anchor.name}\" nor any node under it.`);\n }\n this._clockNode = clockNode;\n this._clockProperty = clock.targetProperty;\n // The group's range clamped to the clock's keys, the way playback clamps it: another track may run longer.\n const keys = clock.getKeys();\n const firstKey = keys[0].frame;\n const lastKey = keys[keys.length - 1].frame;\n this._fromFrame = animationGroup.from < firstKey || animationGroup.from > lastKey ? firstKey : animationGroup.from;\n this._toFrame = animationGroup.to < firstKey || animationGroup.to > lastKey ? lastKey : animationGroup.to;\n const framePerSecond = clock.framePerSecond;\n this._duration = framePerSecond > 0 ? (this._toFrame - this._fromFrame) / framePerSecond : 0;\n this._sampleCount = Math.max(2, Math.ceil(this._duration * (options.samplesPerSecond ?? 60)));\n\n this._characterHeight = this._measureHeight(this._rootNode ?? this._characterNode);\n const scale = this._characterHeight > 0 ? this._characterHeight : 1;\n const minimumTravel = (options.minimumTravel ?? 0.1) * scale;\n const minimumTurn = options.minimumTurn ?? Math.PI / 18;\n const source = options.source;\n const root = this._rootNode;\n const rootChannels = root ? this._channels.get(root) : undefined;\n const samples = this._sampleCount;\n\n // Turning is only ever in the root's own rotation.\n let yaw: Nullable<Float32Array> = null;\n if (root && options.extractRotation !== false && (rootChannels?.rotationQuaternion || rootChannels?.rotation)) {\n const measured = this._measureRootYaw();\n // By the turn a loop leaves the character facing: a dance that spins twice ends facing the way it began and\n // loops seamlessly as it is, while a 90 degree turn has to carry the character round.\n if (options.extractRotation === true || Math.abs(WrapAngle(measured[samples])) >= minimumTurn) {\n yaw = measured;\n }\n }\n this._turns = !!yaw;\n\n if (source === RootMotionSource.Root && !rootChannels?.position) {\n throw new Error(\n `RootMotionClip: the root node \"${root!.name}\" has no position animation to take the travel from. Omit the source to deduce it from the contact nodes, or pass another rootNode.`\n );\n }\n let translation: Nullable<Float32Array> = null;\n if ((source === undefined || source === RootMotionSource.Root) && root && rootChannels?.position) {\n translation = this._measureRootTravel(yaw, minimumTravel, source === RootMotionSource.Root);\n if (translation) {\n this._source = RootMotionSource.Root;\n this._removesRootTravel = true;\n }\n }\n if (!translation && (source === undefined || source === RootMotionSource.FootContact)) {\n translation = this._measureContactTravel(yaw, options.contactNodes, minimumTravel, source === RootMotionSource.FootContact);\n if (translation) {\n this._source = RootMotionSource.FootContact;\n }\n }\n if (!translation && yaw) {\n // Turning on the spot: the root keeps its travel, sway included; only the turn is taken out.\n translation = new Float32Array((samples + 1) * 3);\n this._source = RootMotionSource.Root;\n }\n if (translation && yaw && !this._removesRootTravel) {\n // A turn that is not in the root's travel turns the character about the root's starting point, so a root off\n // the character's axis stays where the clip has it, in place from one cycle to the next.\n const start = this._positionInCharacter(root!, this._fromFrame, new Vector3());\n const pivot = new Vector3();\n for (let i = 0; i <= samples; i++) {\n this._rootTravelAt(start, start, yaw[i], true, pivot);\n translation[i * 3] += pivot.x;\n translation[i * 3 + 1] += pivot.y;\n translation[i * 3 + 2] += pivot.z;\n }\n this._pivots = true;\n }\n if (translation) {\n this._track = new Float32Array((samples + 1) * TrackStride);\n for (let i = 0; i <= samples; i++) {\n this._track[i * TrackStride] = translation[i * 3];\n this._track[i * TrackStride + 1] = translation[i * 3 + 1];\n this._track[i * TrackStride + 2] = translation[i * 3 + 2];\n this._track[i * TrackStride + 3] = yaw ? yaw[i] : 0;\n }\n this._cycleOffset.fromArray(translation, samples * 3);\n this._cycleRotation = yaw ? yaw[samples] : 0;\n } else {\n this._turns = false;\n this._travelDirection.set(0, 0, 1);\n this._lateralDrift.setAll(0);\n }\n\n this._group = this._buildInPlaceGroup(name, !!options.cloneAnimations);\n // The very channel of the in-place group the motion runs on - the last of that node and property, as the\n // analysis took it - so that another channel of the same property is not followed in its place.\n for (const targetedAnimation of this._group.targetedAnimations) {\n if (targetedAnimation.target === this._clockNode && targetedAnimation.animation.targetProperty === this._clockProperty) {\n this._clockAnimation = targetedAnimation.animation;\n }\n }\n }\n\n /**\n * Gets the travel reached at a frame of the clip, relative to its first frame, in character space.\n * @param frame defines the frame to sample\n * @param result defines the vector receiving the travel\n * @returns the result vector\n */\n public getOffsetAtFrame(frame: number, result: Vector3): Vector3 {\n const a = this._sampleAt(frame) * TrackStride;\n const b = a + TrackStride;\n const blend = this._sampleBlend;\n const track = this._track;\n return result.set(track[a] + (track[b] - track[a]) * blend, track[a + 1] + (track[b + 1] - track[a + 1]) * blend, track[a + 2] + (track[b + 2] - track[a + 2]) * blend);\n }\n\n /**\n * Gets the turn reached at a frame of the clip about the up axis, relative to its first frame, in radians.\n * @param frame defines the frame to sample\n * @returns the turn in radians\n */\n public getRotationAtFrame(frame: number): number {\n const a = this._sampleAt(frame) * TrackStride + 3;\n return this._track[a] + (this._track[a + TrackStride] - this._track[a]) * this._sampleBlend;\n }\n\n /**\n * Removes the clip from its controller and disposes the in-place animation group. The source group is untouched.\n * When the in-place group animates the root's position although the source does not (a root that only turns), the\n * root's position is put back to what it was when the clip was created.\n */\n public dispose(): void {\n this._controller?.removeClip(this);\n this._group.dispose();\n if (this._restoredPosition && this._rootNode) {\n this._rootNode.position = this._restoredPosition.clone();\n }\n }\n\n /**\n * @internal\n * Finds the runtime animation of the clock in the in-place group's current playback, leaving its animatable in\n * _foundAnimatable.\n * @returns the runtime animation once it has been evaluated, or null when the group is not playing the clock\n */\n public _findClock(): Nullable<RuntimeAnimation> {\n const animatables = this._group.animatables;\n const cached = this._clockAnimatable;\n if (cached && this._clockRuntime && animatables[this._clockIndex] === cached) {\n this._foundAnimatable = cached;\n return this._clockRuntime;\n }\n for (let i = 0; i < animatables.length; i++) {\n const animatable = animatables[i];\n if (animatable.target !== this._clockNode) {\n continue;\n }\n const runtimes = animatable.getAnimations();\n for (let j = 0; j < runtimes.length; j++) {\n const runtime = runtimes[j];\n if (runtime.target && (this._clockAnimation ? runtime.animation === this._clockAnimation : runtime.animation.targetProperty === this._clockProperty)) {\n this._foundAnimatable = animatable;\n this._clockIndex = i;\n return runtime;\n }\n }\n }\n this._foundAnimatable = null;\n return null;\n }\n\n /**\n * @internal\n * Forgets the playback the controller was following.\n */\n public _forgetPlayback(): void {\n this._clockRuntime = null;\n this._clockAnimatable = null;\n this._syncRoot = null;\n this._syncRuntime = null;\n this._lastProgress = null;\n this._parked = false;\n this._staleRuntime = null;\n this._staleProgress = null;\n }\n\n /**\n * @internal\n * The motion between two progresses of a playback over a range, as a turn and then a translation in the character\n * space of the earlier progress. Progress is unwrapped: whole cycles are in it, however many passed.\n * @param from defines the first frame of the played range\n * @param to defines the last frame of the played range\n * @param lastProgress defines the earlier progress, in frames from the first frame\n * @param progress defines the later progress, in frames from the first frame\n * @param result defines the vector receiving the translation\n * @returns the turn in radians\n */\n public _motionBetween(from: number, to: number, lastProgress: number, progress: number, result: Vector3): number {\n const range = to - from;\n if (range === 0 || (this._source === RootMotionSource.None && !this._turns)) {\n result.setAll(0);\n return 0;\n }\n const lastCycle = Math.floor(lastProgress / range);\n const cycle = Math.floor(progress / range);\n const lastFrame = from + lastProgress - lastCycle * range;\n const frame = from + progress - cycle * range;\n const cycles = cycle - lastCycle;\n\n // The motion within the played range, relative to its start - a range played on its own loops by its own stride,\n // not the whole clip's.\n const startYaw = this.getRotationAtFrame(from);\n const startOffset = this.getOffsetAtFrame(from, this._rangeStart);\n const lastYaw = this._motionInRange(lastFrame, startYaw, startOffset, this._lastOffset);\n let yaw = this._motionInRange(frame, startYaw, startOffset, result);\n\n if (cycles !== 0) {\n // Whole cycles passed: now = cycle^cycles, then the motion within the range.\n const stepYaw = this._motionInRange(to, startYaw, startOffset, this._rangeCycle);\n const cyclesYaw = this._cyclePower(cycles, this._rangeCycle, stepYaw, this._cyclesOffset);\n this._rotateAboutUp(result, cyclesYaw, result).addInPlace(this._cyclesOffset);\n yaw += cyclesYaw;\n }\n\n // Relative to where the character was: undo the turn it had already made.\n this._rotateAboutUp(result.subtractInPlace(this._lastOffset), -lastYaw, result);\n return yaw - lastYaw;\n }\n\n /**\n * The motion at a frame relative to the motion at the start of the played range.\n * @param frame defines the frame\n * @param startYaw defines the turn at the start of the range\n * @param startOffset defines the travel at the start of the range\n * @param result defines the vector receiving the travel\n * @returns the turn\n */\n private _motionInRange(frame: number, startYaw: number, startOffset: Vector3, result: Vector3): number {\n this._rotateAboutUp(this.getOffsetAtFrame(frame, result).subtractInPlace(startOffset), -startYaw, result);\n return this.getRotationAtFrame(frame) - startYaw;\n }\n\n /**\n * A whole number of cycles of a planar motion - a turn about the up axis and then a translation - in closed form,\n * for any number of cycles, forwards or back: the sum of the horizontal translation turned 0, 1, ... n-1 times is\n * the translation turned (n - 1) / 2 times, sin(n * turn / 2) / sin(turn / 2) times as long, and n times the\n * translation when there is no turn. The vertical part adds up. Nothing here is a matter of precision: no series\n * is summed and no small angle is divided by.\n * @param cycles defines the number of cycles, negative to go back\n * @param step defines the translation of one cycle\n * @param stepYaw defines the turn of one cycle\n * @param result defines the vector receiving the translation of all the cycles\n * @returns the turn of all the cycles\n */\n private _cyclePower(cycles: number, step: Vector3, stepYaw: number, result: Vector3): number {\n // The turn only matters modulo a revolution; wrapped, whole revolutions read as no turn at all.\n const turn = WrapAngle(stepYaw);\n const halfSine = Math.sin(turn / 2);\n const length = halfSine === 0 ? cycles : Math.sin((cycles * turn) / 2) / halfSine;\n const up = this._upAxis;\n const rise = Vector3.Dot(step, up) * cycles;\n this._rotateAboutUp(this._horizontal(step, this._planarStep), ((cycles - 1) * turn) / 2, result).scaleInPlace(length);\n result.addInPlace(up.scale(rise));\n return cycles * stepYaw;\n }\n\n private _measureRootYaw(): Float32Array {\n const root = this._rootNode!;\n const samples = this._sampleCount;\n const reference = this._rotationInCharacter(root, this._fromFrame, new Quaternion());\n reference.conjugateInPlace();\n const rotation = new Quaternion();\n const yaw = new Float32Array(samples + 1);\n let previous = 0;\n for (let i = 0; i <= samples; i++) {\n const wrapped = this._twist(this._rotationInCharacter(root, this._frameAt(i), rotation), reference);\n // Unwrap, so a clip that turns past half a revolution keeps counting instead of jumping back.\n previous = i === 0 ? wrapped : previous + WrapAngle(wrapped - WrapAngle(previous));\n yaw[i] = previous;\n }\n return yaw;\n }\n\n private _measureRootTravel(yaw: Nullable<Float32Array>, minimumTravel: number, forced: boolean): Nullable<Float32Array> {\n const root = this._rootNode!;\n const samples = this._sampleCount;\n const positions: Vector3[] = [];\n for (let i = 0; i <= samples; i++) {\n positions.push(this._positionInCharacter(root, this._frameAt(i), new Vector3()));\n }\n\n const start = positions[0];\n // Net travel over the cycle, not how far the root strays: an in-place loop returns to where it started however\n // much its hips surge and sway (a lurching walk can surge a fifth of the character's height), while a clip that\n // really travels ends a stride or more away. A clip that travels and comes back, like a circle, reads as in place,\n // which is safe: its feet do not slide either, so nothing is applied twice.\n const net = this._horizontal(positions[samples].subtract(start), new Vector3());\n if (!forced && net.length() < minimumTravel) {\n return null;\n }\n if (net.lengthSquared() > 0) {\n this._travelDirection.copyFrom(net).normalize();\n }\n if (!yaw && !this._extractLateral) {\n this._snapTravelDirection(0);\n // Whatever the root still drifts sideways of a snapped direction over a cycle would stay in the pose and pop\n // back at every loop, so it is removed from the keys too, evenly over the cycle - but not applied.\n this._horizontal(net, this._lateralDrift).subtractInPlace(this._travelDirection.scale(Vector3.Dot(net, this._travelDirection)));\n }\n\n const translation = new Float32Array((samples + 1) * 3);\n const offset = new Vector3();\n for (let i = 0; i <= samples; i++) {\n this._rootTravelAt(positions[i], start, yaw ? yaw[i] : 0, !!yaw, offset).toArray(translation, i * 3);\n }\n return translation;\n }\n\n /**\n * The travel removed from the root at a pose, so that the in-place root keeps the start position (turning) or its\n * sway (straight).\n * @param position defines the root position in character space\n * @param start defines the root position in character space at the first frame\n * @param yaw defines the turn at this pose\n * @param turning defines whether turning is extracted\n * @param result defines the vector receiving the travel\n * @returns the result vector\n */\n private _rootTravelAt(position: Vector3, start: Vector3, yaw: number, turning: boolean, result: Vector3): Vector3 {\n if (turning) {\n // Every horizontal move, since the direction of travel is turning with the character.\n const pivot = this._rotateAboutUp(this._horizontal(start, TmpVectors.Vector3[3]), yaw, TmpVectors.Vector3[3]);\n return this._horizontal(position, result).subtractInPlace(pivot);\n }\n return this._project(position.subtractToRef(start, result), result);\n }\n\n private _measureContactTravel(\n yaw: Nullable<Float32Array>,\n explicitContacts: Array<TransformNode | Bone> | undefined,\n minimumTravel: number,\n forced: boolean\n ): Nullable<Float32Array> {\n const samples = this._sampleCount;\n const up = this._upAxis;\n let contacts: TransformNode[];\n if (explicitContacts) {\n contacts = explicitContacts.map((node) => this._resolveNode(node)).filter((node): node is TransformNode => !!node);\n } else {\n const base = this._rootNode ?? this._characterNode;\n contacts = base.getDescendants(false, IsJoint).filter((node) => !node.getChildren(IsJoint, true).length) as TransformNode[];\n }\n if (!contacts.length) {\n return null;\n }\n\n // Every candidate across the whole clip: a run starts with a foot in the air, so one frame cannot tell which\n // nodes ever reach the ground.\n const positions = contacts.map(() => [] as Vector3[]);\n const lowest = contacts.map(() => Number.POSITIVE_INFINITY);\n for (let i = 0; i <= samples; i++) {\n const frame = this._frameAt(i);\n for (let c = 0; c < contacts.length; c++) {\n const position = this._positionInCharacter(contacts[c], frame, new Vector3());\n positions[c].push(position);\n lowest[c] = Math.min(lowest[c], Vector3.Dot(position, up));\n }\n }\n if (!explicitContacts) {\n const ground = Math.min(...lowest);\n const kept = contacts.map((_, c) => lowest[c] <= ground + ContactHeightBand * this._characterHeight);\n contacts = contacts.filter((_, c) => kept[c]);\n const keptPositions = positions.filter((_, c) => kept[c]);\n const keptLowest = lowest.filter((_, c) => kept[c]);\n positions.length = 0;\n positions.push(...keptPositions);\n lowest.length = 0;\n lowest.push(...keptLowest);\n }\n\n // A planted contact does not move in the world, so in character space it moves at exactly the opposite of the\n // character's own velocity - and that velocity changes smoothly. A swinging contact sweeps forwards, even while\n // touching down, when it can already be the lowest; a contact of a clip whose root carries the travel stands\n // still. So each interval takes the contact on the ground whose step is closest to the ground speed of the\n // interval before, starting from the clip's average ground speed measured with the slowest contact on the\n // ground. With no contact on the ground - the flight of a run - the ground speed carries on.\n // Steps are compared with the turn so far undone, so a turning path keeps a steady ground speed.\n const tolerance = PlantedHeightBand * this._characterHeight;\n const step = new Vector3();\n const unturned = new Vector3();\n const reference = new Vector3();\n const translation = new Float32Array((samples + 1) * 3);\n const travelled = Vector3.Zero();\n const heading = Vector3.Zero();\n let pathLength = 0;\n const walk = (tracking: boolean) => {\n const previous = reference.clone();\n const sum = Vector3.Zero();\n let grounded = 0;\n travelled.setAll(0);\n heading.setAll(0);\n pathLength = 0;\n for (let i = 1; i <= samples; i++) {\n const turn = yaw ? yaw[i] : 0;\n let best = Number.POSITIVE_INFINITY;\n const chosen = new Vector3();\n for (let c = 0; c < contacts.length; c++) {\n const before = positions[c][i - 1];\n const after = positions[c][i];\n if (Vector3.Dot(before, up) > lowest[c] + tolerance || Vector3.Dot(after, up) > lowest[c] + tolerance) {\n continue;\n }\n this._rotateAboutUp(this._horizontal(before.subtractToRef(after, step), step), -turn, unturned);\n const score = tracking ? Vector3.DistanceSquared(unturned, previous) : unturned.lengthSquared();\n if (score < best) {\n best = score;\n chosen.copyFrom(unturned);\n }\n }\n if (best === Number.POSITIVE_INFINITY) {\n chosen.copyFrom(previous);\n } else {\n sum.addInPlace(chosen);\n grounded++;\n }\n if (tracking) {\n previous.copyFrom(chosen);\n }\n heading.addInPlace(chosen);\n pathLength += chosen.length();\n travelled.addInPlace(this._rotateAboutUp(chosen, turn, step)).toArray(translation, i * 3);\n }\n if (!tracking && grounded > 0) {\n reference.copyFrom(sum).scaleInPlace(1 / grounded);\n }\n };\n walk(false);\n walk(true);\n const straightness = pathLength > 0 ? heading.length() / pathLength : 0;\n\n if (travelled.lengthSquared() > 0) {\n this._travelDirection.copyFrom(travelled).normalize();\n }\n const distance = Vector3.Dot(travelled, this._travelDirection);\n if (!forced && (distance < minimumTravel || straightness < MinimumStraightness)) {\n return null;\n }\n if (!yaw) {\n // Straight: only the travel along the direction, like the root path.\n if (!this._extractLateral) {\n this._snapTravelDirection(DeducedDirectionSnapAngle);\n }\n for (let i = 0; i <= samples; i++) {\n step.fromArray(translation, i * 3);\n this._travelDirection.scaleToRef(Vector3.Dot(step, this._travelDirection), step).toArray(translation, i * 3);\n }\n }\n this._contactNodes = contacts;\n return translation;\n }\n\n /**\n * Clones the source group into the in-place group. When the root motion is in the root's keys, the root's channels\n * are cloned with the motion left out: each key's pose, in character space, has the motion at its frame undone. The\n * motion is the root's travel for a {@link RootMotionSource.Root} clip, plus the turn when rotation is extracted.\n * Everything is computed from the source keys, which are not touched.\n * @param name defines the name of the in-place group\n * @param cloneAnimations defines whether every animation is cloned rather than only the rewritten root channels\n * @returns the in-place group\n */\n private _buildInPlaceGroup(name: string, cloneAnimations: boolean): AnimationGroup {\n const group = this._sourceGroup.clone(name);\n // Cloning widens the range to the keys again; the in-place group plays what the source plays.\n group.from = this._sourceGroup.from;\n group.to = this._sourceGroup.to;\n if (cloneAnimations) {\n for (const targetedAnimation of group.targetedAnimations) {\n targetedAnimation.animation = CloneAnimation(targetedAnimation.animation, true);\n }\n }\n const root = this._rootNode;\n if (!root || (!this._removesRootTravel && !this._turns)) {\n return group;\n }\n\n const channels = this._channels.get(root)!;\n const parent = root.parent;\n const removesTravel = this._removesRootTravel;\n const range = Math.max(this._toFrame - this._fromFrame, 1e-6);\n const start = this._positionInCharacter(root, this._fromFrame, new Vector3());\n const reference = this._rotationInCharacter(root, this._fromFrame, new Quaternion());\n reference.conjugateInPlace();\n\n const motionMatrix = new Matrix();\n const rootMatrix = new Matrix();\n const parentMatrix = new Matrix();\n const localMatrix = new Matrix();\n const yawQuaternion = new Quaternion();\n const scratchPosition = new Vector3();\n const scratchRotation = new Quaternion();\n const travel = new Vector3();\n\n // The in-place local transform of the root at any frame, from the source keys.\n const inPlaceAt = (frame: number, position: Vector3, rotation: Quaternion) => {\n this._matrixToCharacter(root, frame, rootMatrix);\n this._matrixToCharacter(parent, frame, parentMatrix);\n let yaw = 0;\n if (this._turns) {\n // Exact at this frame; the track only settles which whole turn the angle is on.\n const wrapped = this._twist(this._rotationInCharacter(root, frame, scratchRotation), reference);\n const tracked = this.getRotationAtFrame(frame);\n yaw = wrapped + Math.round((tracked - wrapped) / (2 * Math.PI)) * 2 * Math.PI;\n }\n if (removesTravel) {\n rootMatrix.getTranslationToRef(scratchPosition);\n this._rootTravelAt(scratchPosition, start, yaw, this._turns, travel);\n if (!this._turns) {\n travel.addInPlace(this._lateralDrift.scale(Math.min(1, Math.max(0, (frame - this._fromFrame) / range))));\n }\n } else if (this._pivots) {\n this._rootTravelAt(start, start, yaw, true, travel);\n } else {\n travel.setAll(0);\n }\n // The motion maps the in-place pose onto the clip's pose: turn, then travel.\n Matrix.FromQuaternionToRef(Quaternion.RotationAxisToRef(this._upAxis, yaw, yawQuaternion), motionMatrix);\n motionMatrix.setTranslation(travel);\n motionMatrix.invertToRef(motionMatrix);\n rootMatrix.multiplyToRef(motionMatrix, localMatrix);\n parentMatrix.invertToRef(parentMatrix);\n localMatrix.multiplyToRef(parentMatrix, localMatrix);\n localMatrix.decompose(undefined, rotation, position);\n };\n\n const position = new Vector3();\n const rotation = new Quaternion();\n const before = { position: new Vector3(), rotation: new Quaternion() };\n const after = { position: new Vector3(), rotation: new Quaternion() };\n\n // The keys of a channel with the motion left out, at the frames of the source keys.\n const inPlaceKeys = (sourceKeys: IAnimationKey[], kind: \"position\" | \"rotationQuaternion\" | \"rotation\"): IAnimationKey[] => {\n const keys: IAnimationKey[] = [];\n let previousRotation: Nullable<Quaternion> = null;\n let previousEuler: Nullable<Vector3> = null;\n for (const key of sourceKeys) {\n inPlaceAt(key.frame, position, rotation);\n let value: any;\n if (kind === \"position\") {\n value = position.clone();\n } else {\n // Stay in the same hemisphere as the previous key, so interpolation does not take the long way round.\n if (previousRotation && Quaternion.Dot(previousRotation, rotation) < 0) {\n rotation.scaleInPlace(-1);\n }\n previousRotation = rotation.clone();\n if (kind === \"rotationQuaternion\") {\n value = previousRotation;\n } else {\n // Each angle continues from the previous key, so interpolation does not swing the long way round\n // where the conversion from a quaternion jumps between +PI and -PI.\n const euler = previousRotation.toEulerAngles();\n if (previousEuler) {\n euler.x += Math.round((previousEuler.x - euler.x) / (2 * Math.PI)) * 2 * Math.PI;\n euler.y += Math.round((previousEuler.y - euler.y) / (2 * Math.PI)) * 2 * Math.PI;\n euler.z += Math.round((previousEuler.z - euler.z) / (2 * Math.PI)) * 2 * Math.PI;\n }\n previousEuler = euler;\n value = euler;\n }\n }\n\n // Cubic spline tangents follow the rewritten curve. Straight travel is a linear removal, so the key's own\n // tangent is transformed exactly; a turn is not, so the tangents are measured from the curve either side.\n const tangent = (original: any, direction: number): any => {\n if (!original) {\n return original;\n }\n if (kind === \"position\" && !this._turns) {\n this._matrixToCharacter(parent, key.frame, parentMatrix);\n const inCharacter = Vector3.TransformNormal(original, parentMatrix);\n const removed = removesTravel ? this._project(inCharacter.clone(), new Vector3()).addInPlace(this._lateralDrift.scale(1 / range)) : Vector3.Zero();\n parentMatrix.invertToRef(parentMatrix);\n return original.subtract(Vector3.TransformNormal(removed, parentMatrix));\n }\n inPlaceAt(key.frame - TangentDelta, before.position, before.rotation);\n inPlaceAt(key.frame + TangentDelta, after.position, after.rotation);\n const low = direction < 0 ? before : { position, rotation };\n const high = direction < 0 ? { position, rotation } : after;\n if (kind === \"position\") {\n return high.position.subtract(low.position).scaleInPlace(1 / TangentDelta);\n }\n if (Quaternion.Dot(low.rotation, high.rotation) < 0) {\n high.rotation.scaleInPlace(-1);\n }\n const rate = high.rotation.subtract(low.rotation).scaleInPlace(1 / TangentDelta);\n return kind === \"rotationQuaternion\"\n ? rate\n : high.rotation\n .toEulerAngles()\n .subtract(low.rotation.toEulerAngles())\n .scaleInPlace(1 / TangentDelta);\n };\n\n keys.push({\n frame: key.frame,\n value,\n inTangent: tangent(key.inTangent, -1),\n outTangent: tangent(key.outTangent, 1),\n interpolation: key.interpolation,\n lockedTangent: key.lockedTangent,\n easingFunction: key.easingFunction,\n });\n }\n return keys;\n };\n\n // A rewritten channel replaces the source's in the in-place group; the source animation is not touched.\n const replace = (source: Animation, kind: \"position\" | \"rotationQuaternion\" | \"rotation\"): void => {\n const animation = CloneAnimation(source);\n animation.setKeys(inPlaceKeys(source.getKeys(), kind), true);\n // By animation and target both: the same animation may drive other nodes earlier in the group.\n const index = this._sourceGroup.targetedAnimations.findIndex((targetedAnimation) => targetedAnimation.animation === source && targetedAnimation.target === root);\n group.targetedAnimations[index].animation = animation;\n };\n\n if (channels.position) {\n replace(channels.position, \"position\");\n } else {\n // A root that only turns gets a position channel of its own, holding it at its starting point while the\n // character turns about that point. It is the clip's clock, the channel the mixer weighs every clip of the\n // character on, and it keeps the root in place when another clip animates the position. Its keys are as\n // dense as the analysis: an animated ancestor between the root and the character makes the position vary.\n const rotationChannel = (channels.rotationQuaternion ?? channels.rotation)!;\n const staticKeys: IAnimationKey[] = [];\n for (let i = 0; i <= this._sampleCount; i++) {\n staticKeys.push({ frame: this._frameAt(i), value: root.position });\n }\n const animation = new Animation(`${root.name} position`, \"position\", rotationChannel.framePerSecond, Animation.ANIMATIONTYPE_VECTOR3, rotationChannel.loopMode);\n animation.enableBlending = rotationChannel.enableBlending;\n animation.blendingSpeed = rotationChannel.blendingSpeed;\n animation.setKeys(inPlaceKeys(staticKeys, \"position\"), true);\n group.addTargetedAnimation(animation, root);\n this._restoredPosition = root.position.clone();\n this._clockProperty = \"position\";\n }\n if (this._turns) {\n if (channels.rotationQuaternion) {\n replace(channels.rotationQuaternion, \"rotationQuaternion\");\n } else if (channels.rotation) {\n replace(channels.rotation, \"rotation\");\n }\n }\n return group;\n }\n\n private _findRootNode(): Nullable<TransformNode> {\n const nodes = Array.from(this._channels.keys());\n let best: Nullable<TransformNode> = null;\n let bestCount = -1;\n for (const [node, channels] of this._channels) {\n if (!channels.position) {\n continue;\n }\n const count = nodes.filter((other) => other !== node && other.isDescendantOf(node)).length;\n if (count > bestCount || (count === bestCount && best && best.isDescendantOf(node))) {\n best = node as TransformNode;\n bestCount = count;\n }\n }\n return best;\n }\n\n private _measureHeight(base: TransformNode): number {\n const position = new Vector3();\n let lowest = Number.POSITIVE_INFINITY;\n let highest = Number.NEGATIVE_INFINITY;\n for (const node of [base, ...(base.getDescendants(false, IsJoint) as TransformNode[])]) {\n const height = Vector3.Dot(this._positionInCharacter(node, this._fromFrame, position), this._upAxis);\n lowest = Math.min(lowest, height);\n highest = Math.max(highest, height);\n }\n return highest - lowest;\n }\n\n /**\n * The track sample before a frame; the blend towards the next one is left in _sampleBlend.\n * @param frame defines the frame\n * @returns the sample index\n */\n private _sampleAt(frame: number): number {\n const range = this._toFrame - this._fromFrame;\n const samples = this._sampleCount;\n if (range <= 0 || (this._source === RootMotionSource.None && !this._turns)) {\n this._sampleBlend = 0;\n return 0;\n }\n const exact = Math.min(samples, Math.max(0, ((frame - this._fromFrame) / range) * samples));\n const index = Math.min(samples - 1, Math.floor(exact));\n this._sampleBlend = exact - index;\n return index;\n }\n\n private _frameAt(sample: number): number {\n return this._fromFrame + ((this._toFrame - this._fromFrame) * sample) / this._sampleCount;\n }\n\n private _horizontal(vector: Vector3, result: Vector3): Vector3 {\n const up = this._upAxis;\n const height = Vector3.Dot(vector, up);\n return result.set(vector.x - up.x * height, vector.y - up.y * height, vector.z - up.z * height);\n }\n\n private _project(vector: Vector3, result: Vector3): Vector3 {\n this._horizontal(vector, result);\n if (!this._extractLateral) {\n this._travelDirection.scaleToRef(Vector3.Dot(result, this._travelDirection), result);\n }\n return result;\n }\n\n /**\n * Snaps the direction of travel onto the nearest horizontal character space axis within the snap angle.\n * @param defaultAngle defines the snap angle when none was given in the options\n */\n private _snapTravelDirection(defaultAngle: number): void {\n const angle = this._directionSnapAngle ?? defaultAngle;\n if (angle <= 0) {\n return;\n }\n const up = this._upAxis;\n const axis = new Vector3();\n let best: Nullable<Vector3> = null;\n let bestDot = Math.cos(angle);\n for (const candidate of [Vector3.RightReadOnly, Vector3.UpReadOnly, Vector3.Forward(false)]) {\n if (Math.abs(Vector3.Dot(candidate, up)) > 0.5) {\n continue;\n }\n this._horizontal(candidate, axis).normalize();\n for (const sign of [1, -1]) {\n const dot = sign * Vector3.Dot(axis, this._travelDirection);\n if (dot >= bestDot) {\n bestDot = dot;\n best = axis.scale(sign);\n }\n }\n }\n if (best) {\n this._travelDirection.copyFrom(best);\n }\n }\n\n private _rotateAboutUp(vector: Vector3, angle: number, result: Vector3): Vector3 {\n if (angle === 0) {\n return result.copyFrom(vector);\n }\n Matrix.FromQuaternionToRef(Quaternion.RotationAxisToRef(this._upAxis, angle, this._yawQuaternion), this._yawMatrix);\n return Vector3.TransformNormalToRef(vector, this._yawMatrix, result);\n }\n\n /**\n * The turn about the up axis from a reference orientation to a rotation, both in character space: the angle of the\n * rotation about the up axis that best matches the change of orientation. Unlike the twist of a swing-twist split,\n * it stays well defined while the root pitches and rolls - a dancer's hips tilting through the vertical made the\n * twist jump by half turns.\n * @param rotation defines the rotation\n * @param referenceConjugate defines the conjugate of the reference rotation\n * @returns the angle in radians, between -PI and PI\n */\n private _twist(rotation: Quaternion, referenceConjugate: Quaternion): number {\n const delta = Matrix.FromQuaternionToRef(rotation.multiplyToRef(referenceConjugate, TmpVectors.Quaternion[1]), TmpVectors.Matrix[2]);\n const up = this._upAxis;\n // Two horizontal axes, right-handed with up the way +X, +Z are with +Y.\n const first = this._horizontal(Math.abs(up.x) < 0.9 ? Vector3.RightReadOnly : Vector3.Forward(false), TmpVectors.Vector3[5]).normalize();\n const second = Vector3.CrossToRef(first, up, TmpVectors.Vector3[6]);\n const turnedFirst = Vector3.TransformNormalToRef(first, delta, TmpVectors.Vector3[7]);\n const turnedSecond = Vector3.TransformNormalToRef(second, delta, TmpVectors.Vector3[8]);\n return WrapAngle(Math.atan2(Vector3.Dot(turnedSecond, first) - Vector3.Dot(turnedFirst, second), Vector3.Dot(turnedFirst, first) + Vector3.Dot(turnedSecond, second)));\n }\n\n private _positionInCharacter(node: TransformNode, frame: number, result: Vector3): Vector3 {\n const matrix = this._matrixToCharacter(node, frame, TmpVectors.Matrix[1]);\n return result.set(matrix.m[12], matrix.m[13], matrix.m[14]);\n }\n\n private _rotationInCharacter(node: TransformNode, frame: number, result: Quaternion): Quaternion {\n this._matrixToCharacter(node, frame, TmpVectors.Matrix[1]).decompose(undefined, result);\n return result;\n }\n\n /**\n * Composes a node's transform into character space at a frame of the clip, from the evaluated keys of animated\n * nodes and the current transform of the others. Nothing is played or written.\n * @param node defines the node, or null for the character space itself\n * @param frame defines the frame to evaluate\n * @param result defines the matrix receiving the transform\n * @returns the result matrix\n */\n private _matrixToCharacter(node: Nullable<Node>, frame: number, result: Matrix): Matrix {\n Matrix.IdentityToRef(result);\n const local = TmpVectors.Matrix[0];\n let current = node;\n while (current && current !== this._characterNode) {\n if (current instanceof TransformNode) {\n this._localMatrix(current, frame, local);\n result.multiplyToRef(local, result);\n }\n current = current.parent;\n }\n return result;\n }\n\n private _localMatrix(node: TransformNode, frame: number, result: Matrix): Matrix {\n const channels = this._channels.get(node);\n const scaling: Vector3 = channels?.scaling ? channels.scaling.evaluate(frame) : node.scaling;\n const position: Vector3 = channels?.position ? channels.position.evaluate(frame) : node.position;\n let rotation: Quaternion;\n if (channels?.rotationQuaternion) {\n rotation = channels.rotationQuaternion.evaluate(frame);\n } else if (channels?.rotation) {\n rotation = Quaternion.FromEulerVectorToRef(channels.rotation.evaluate(frame), TmpVectors.Quaternion[0]);\n } else {\n rotation = node.rotationQuaternion ?? Quaternion.FromEulerVectorToRef(node.rotation, TmpVectors.Quaternion[0]);\n }\n return Matrix.ComposeToRef(scaling, rotation, position, result);\n }\n\n private _resolveNode(node: TransformNode | Bone): Nullable<TransformNode> {\n if (node instanceof TransformNode) {\n return node;\n }\n const linked = node.getTransformNode();\n if (!linked) {\n throw new Error(`RootMotionClip: bone \"${node.name}\" has no linked transform node; pass the transform node the bone drives instead.`);\n }\n return linked;\n }\n\n private _firstAnimatedNode(): Nullable<TransformNode> {\n for (const node of this._channels.keys()) {\n return node as TransformNode;\n }\n return null;\n }\n\n private _topmostAncestor(node: TransformNode): TransformNode {\n let top = node;\n let current = node.parent;\n while (current) {\n if (current instanceof TransformNode) {\n top = current;\n }\n current = current.parent;\n }\n return top;\n }\n}\n\n/**\n * Moves and turns a character node by the root motion of the clips playing on it, once per animation step - from the\n * scene's onAfterAnimationsObservable, so after animations are evaluated and before the world matrices are computed.\n *\n * The motion of each clip follows the playback of its in-place group's root animation: the progress of the pose it\n * evaluated, so pausing, speed ratio changes, looping in every loop mode, forwards and backwards, playing a range,\n * synchronizing with another animatable and running to the end all move the character exactly as far as the pose went.\n * Clips playing together are blended the way the animation mixer blends their root pose: weighted animation groups\n * contribute their share, normalized once their weights add up to more than one, additive groups add theirs on top,\n * an unweighted group contributes its whole pose only while no weighted group animates the root (among unweighted\n * groups the last to write wins), and a group blending in contributes as much as it is blended in, so the character\n * moves with the blended pose whatever the clips do. The turn is blended as a weighted sum of the clips' turns.\n *\n * ```ts\n * const controller = new RootMotionController(character, [walk, run]);\n * walk.animationGroup.start(true);\n * run.animationGroup.start(true);\n * walk.animationGroup.weight = 0.3;\n * run.animationGroup.weight = 0.7;\n * ```\n */\nexport class RootMotionController implements IDisposable {\n /**\n * Gets or sets whether the motion is applied to the character node every frame. Set it to false to consume\n * {@link RootMotionController.deltaPosition} and {@link RootMotionController.deltaRotation} yourself, for example\n * to drive a physics character controller.\n */\n public applyToCharacter = true;\n\n /**\n * Notified every animation step the clips produce motion, after {@link RootMotionController.deltaPosition} and\n * {@link RootMotionController.deltaRotation} are updated.\n */\n public readonly onRootMotionObservable = new Observable<RootMotionController>();\n\n private readonly _characterNode: TransformNode;\n private readonly _clips: RootMotionClip[] = [];\n private readonly _sceneRootMotion: SceneRootMotion;\n private _upAxis: Nullable<Vector3> = null;\n private readonly _deltaPosition = Vector3.Zero();\n private _deltaRotation = 0;\n private readonly _frameDelta = Vector3.Zero();\n private _frameYaw = 0;\n private readonly _clipDelta = Vector3.Zero();\n\n /**\n * The node the motion is applied to.\n */\n public get characterNode(): TransformNode {\n return this._characterNode;\n }\n\n /**\n * The clips whose motion moves the character.\n */\n public get clips(): ReadonlyArray<RootMotionClip> {\n return this._clips;\n }\n\n /**\n * The travel of the last animation step, in world space; applied to the character unless\n * {@link RootMotionController.applyToCharacter} is false.\n */\n public get deltaPosition(): Vector3 {\n return this._deltaPosition;\n }\n\n /**\n * The turn of the last animation step about the up axis, in radians; applied to the character unless\n * {@link RootMotionController.applyToCharacter} is false.\n */\n public get deltaRotation(): number {\n return this._deltaRotation;\n }\n\n /**\n * Creates a controller for a character node.\n * @param characterNode defines the node to move: the character node of the clips\n * @param clips defines the clips to add\n */\n public constructor(characterNode: TransformNode, clips: RootMotionClip[] = []) {\n this._characterNode = characterNode;\n this._sceneRootMotion = SceneRootMotion.Get(characterNode.getScene());\n this._sceneRootMotion.add(this);\n for (const clip of clips) {\n this.addClip(clip);\n }\n }\n\n /**\n * Adds a clip, so the character moves while its in-place group plays.\n * @param clip defines the clip; its character node must be the controller's\n * @throws when the clip belongs to another controller, moves another node, or has another up axis than the clips\n * already added\n */\n public addClip(clip: RootMotionClip): void {\n if (clip._controller === this) {\n return;\n }\n if (clip._controller) {\n throw new Error(`RootMotionController: clip \"${clip.animationGroup.name}\" already belongs to another controller.`);\n }\n if (clip.characterNode !== this._characterNode) {\n throw new Error(\n `RootMotionController: clip \"${clip.animationGroup.name}\" moves \"${clip.characterNode.name}\", not \"${this._characterNode.name}\". Pass the controller's node as the clip's characterNode.`\n );\n }\n if (this._upAxis && !this._upAxis.equalsWithEpsilon(clip.upAxis)) {\n throw new Error(`RootMotionController: clip \"${clip.animationGroup.name}\" has another up axis than the clips already added.`);\n }\n this._upAxis = this._upAxis ?? clip.upAxis.clone();\n clip._controller = this;\n clip._forgetPlayback();\n this._clips.push(clip);\n this._sceneRootMotion.refresh();\n }\n\n /**\n * Removes a clip. Its in-place group keeps playing, in place.\n * @param clip defines the clip\n */\n public removeClip(clip: RootMotionClip): void {\n const index = this._clips.indexOf(clip);\n if (index < 0) {\n return;\n }\n this._clips.splice(index, 1);\n clip._controller = null;\n clip._writers = null;\n clip._forgetPlayback();\n if (!this._clips.length) {\n this._upAxis = null;\n }\n this._sceneRootMotion.refresh();\n }\n\n /**\n * Forgets where the playbacks were last measured. Call after jumping a group with goToFrame or resetting it, so the\n * jump is not read as motion. Starting a group again needs no reset.\n */\n public reset(): void {\n for (const clip of this._clips) {\n // Reset from an animation event, after the clock wrote the step: that evaluation predates the jump, and the\n // next one is the first to say where the playback carries on from.\n const runtime = clip._clockRuntime;\n clip._forgetPlayback();\n clip._staleRuntime = runtime;\n clip._staleProgress = runtime ? runtime._evaluatedProgress : null;\n }\n this._deltaPosition.setAll(0);\n this._deltaRotation = 0;\n }\n\n /**\n * Stops applying the motion and lets the clips go. The clips and their groups are not disposed.\n */\n public dispose(): void {\n for (const clip of this._clips) {\n clip._controller = null;\n clip._writers = null;\n clip._forgetPlayback();\n }\n this._clips.length = 0;\n this._upAxis = null;\n this._sceneRootMotion.remove(this);\n this.onRootMotionObservable.clear();\n }\n\n /**\n * @internal\n * Applies the motion of this frame, once the mixer's writers of the clips' channels are gathered.\n * @param animated defines whether the scene animated this step at all; when it did not, nothing moved and nothing\n * is read into the clips' playbacks\n */\n public _update(animated: boolean): void {\n const delta = this._frameDelta.setAll(0);\n this._frameYaw = 0;\n let moved = false;\n\n for (const clip of animated ? this._clips : []) {\n const writers = clip._writers;\n const previous = clip._clockRuntime;\n const found = clip._findClock();\n if (found !== previous) {\n // A runtime animation belongs to one playback. The previous playback's last evaluation is still to be\n // consumed if it wrote this step - it ran to its end, or a callback stopped it after it wrote - weighed\n // among the writers of this step like any other. One that did not write this step is forgotten: its\n // last evaluation was consumed in the step it wrote.\n if (previous && writers && clip._lastProgress !== null && !clip._parked && writers.current.indexOf(previous) >= 0) {\n moved = this._accumulate(clip, previous, clip._lastProgress, previous._evaluatedProgress) || moved;\n }\n clip._clockRuntime = found;\n clip._clockAnimatable = found ? clip._foundAnimatable : null;\n clip._syncRuntime = null;\n clip._lastProgress = null;\n clip._parked = false;\n }\n if (!found || !writers) {\n continue;\n }\n const animatable = clip._clockAnimatable!;\n if (writers.current.indexOf(found) < 0) {\n // Did not write this step. Paused, its clock stands still too, and carries on from here when it resumes.\n // Parked at a weight of zero, the scene skips it while its clock runs on: it starts again from wherever\n // it resumes. Passed over for any other reason - by the scene's loop after a callback removed the\n // animatable before it, or restarted after being passed over as paused - its next evaluation catches up,\n // and the character with it.\n if (!animatable.paused && animatable.weight === 0) {\n clip._parked = true;\n }\n continue;\n }\n if (clip._parked) {\n clip._parked = false;\n clip._lastProgress = null;\n }\n // The root the evaluation was actually clocked by, as it was made: a callback of this very step may have\n // synchronized the group afterwards, and this step's pose is still the one the old clock gave.\n const syncRoot = found._evaluatedSyncRoot;\n const syncRuntime = syncRoot ? (syncRoot.getAnimations()[0] ?? null) : null;\n if (syncRoot !== clip._syncRoot || syncRuntime !== clip._syncRuntime || found._evaluatedJump) {\n // Synchronized with another root, no longer synchronized at all and back on its own clock, or snapped\n // back by a root that cannot carry it to its end: the pose jumps, which is not travel.\n clip._syncRoot = syncRoot;\n clip._syncRuntime = syncRuntime;\n clip._lastProgress = null;\n }\n // The first evaluation of a playback only establishes where it began - unless the playback was reset since\n // that evaluation, by a callback in this step, in which case the next one does.\n const progress = found._evaluatedProgress;\n const lastProgress = clip._lastProgress;\n if (lastProgress === null && found === clip._staleRuntime && progress === clip._staleProgress) {\n continue;\n }\n clip._staleRuntime = null;\n clip._staleProgress = null;\n clip._lastProgress = progress;\n if (lastProgress !== null && progress !== lastProgress) {\n moved = this._accumulate(clip, found, lastProgress, progress) || moved;\n }\n }\n\n if (!moved) {\n this._deltaPosition.setAll(0);\n this._deltaRotation = 0;\n return;\n }\n const deltaYaw = this._frameYaw;\n this._deltaRotation = deltaYaw;\n\n const character = this._characterNode;\n const up = this._upAxis!;\n // Into the character's parent space through its own local rotation and scaling, not its world matrix: world\n // matrices are cached per render, so with fixed animation steps every step after the first in a frame would read\n // the facing from before the previous step's turn.\n const rotation = character.rotationQuaternion ?? Quaternion.FromEulerVectorToRef(character.rotation, TmpVectors.Quaternion[2]);\n Matrix.ComposeToRef(character.scaling, rotation, Vector3.ZeroReadOnly, TmpVectors.Matrix[3]);\n const parentDelta = Vector3.TransformNormalToRef(delta, TmpVectors.Matrix[3], TmpVectors.Vector3[4]);\n const parent = character.parent;\n if (parent) {\n // Computed now, not read from the cache: with several animation steps in a render the parent may have moved.\n Vector3.TransformNormalToRef(parentDelta, parent.computeWorldMatrix(true), this._deltaPosition);\n } else {\n this._deltaPosition.copyFrom(parentDelta);\n }\n\n if (this.applyToCharacter) {\n // Assigned rather than changed in place, so the node is marked dirty and renders where it now is.\n character.position = character.position.addInPlace(parentDelta);\n if (deltaYaw !== 0) {\n // The turn happens in character space, before the character's own scaling. A mirroring scale (the\n // handedness flip on a glTF __root__) reverses the sense of a turn once it is past that scaling.\n const scaling = character.scaling;\n const mirrored = scaling.x * scaling.y * scaling.z * (up.x * up.x * scaling.x + up.y * up.y * scaling.y + up.z * up.z * scaling.z) < 0;\n if (!character.rotationQuaternion) {\n character.rotationQuaternion = Quaternion.FromEulerVector(character.rotation);\n }\n const turned = character.rotationQuaternion;\n turned.multiplyToRef(Quaternion.RotationAxisToRef(up, mirrored ? -deltaYaw : deltaYaw, TmpVectors.Quaternion[2]), turned);\n character.rotationQuaternion = turned;\n }\n }\n\n if (this.onRootMotionObservable.hasObservers()) {\n this.onRootMotionObservable.notifyObservers(this);\n }\n }\n\n /**\n * Adds a clip's motion between two progresses of a playback into this frame's motion, weighted the way the mixer\n * weighs the pose of the playback.\n * @param clip defines the clip\n * @param runtime defines the runtime animation of the clip's clock\n * @param lastProgress defines the progress consumed before\n * @param progress defines the progress to consume\n * @returns whether anything was added\n */\n private _accumulate(clip: RootMotionClip, runtime: RuntimeAnimation, lastProgress: number, progress: number): boolean {\n if ((clip.source === RootMotionSource.None && !clip.extractsRotation) || !clip._writers) {\n return false;\n }\n const weight = this._effectiveWeight(clip._writers, runtime);\n if (weight === 0) {\n return false;\n }\n const yaw = clip._motionBetween(runtime._evaluatedFrom, runtime._evaluatedTo, lastProgress, progress, this._clipDelta);\n this._frameDelta.addInPlace(this._clipDelta.scaleInPlace(weight));\n this._frameYaw += yaw * weight;\n return true;\n }\n\n /**\n * The share of a playback in the pose the mixer wrote to its channel this step, following the late animation\n * bindings of the scene: an unweighted animatable writes directly and the last one wins, unless a weighted animatable\n * also animates the channel, in which case the weighted ones replace it - normalized once their weights add up to\n * more than one - and additive ones add their weight on top. A playback that ran to its end this step is among the\n * writers like any other, from its place in the order they wrote; one that did not write this step has no share;\n * one that wrote more than once - re-evaluated by an animation event, say - has the share of all its writes, as the\n * bindings add them up. A playback still blending in wrote that much of its pose, so the share follows the factor\n * its last write blended in with, taken from the record of that write rather than from the animation, whose own\n * factor a write made since the step may have moved on.\n * @param writers defines what the mixer wrote to the clip's channel this step\n * @param runtime defines the runtime animation of the clip's clock\n * @returns the share, between 0 and 1\n */\n private _effectiveWeight(writers: IChannelWriters, runtime: RuntimeAnimation): number {\n const runtimes = writers.current;\n let overrides = 0;\n let additives = 0;\n let direct = false;\n let weight = 0;\n let blending = 1;\n for (let i = 0; i < runtimes.length; i++) {\n if (runtimes[i] !== runtime) {\n continue;\n }\n // The bindings hold one entry per write, added up from the weights as written, but each entry is read with\n // the weight the runtime animation carries when the bindings are processed: that of its last write.\n weight = writers.currentWeights[i];\n blending = writers.currentBlending[i];\n if (weight < 0) {\n direct = true;\n } else if (writers.currentAdditive[i]) {\n additives++;\n } else {\n overrides++;\n }\n }\n let share = (overrides / Math.max(1, writers.total) + additives) * weight;\n if (direct && !writers.weighted && writers.lastDirect === runtime) {\n share += 1;\n }\n return share * blending;\n }\n}\n\n/**\n * The root motion controllers of a scene. After the scene's animations, one pass over the writes of the step - the\n * runtime animations that wrote, in that order, with the weights they wrote with, recorded as they did - gathers what\n * the mixer wrote to every channel a clip follows, then each controller applies its frame.\n */\nclass SceneRootMotion {\n private readonly _scene: Scene;\n private readonly _controllers: RootMotionController[] = [];\n private readonly _writers: IChannelWriters[] = [];\n private readonly _writersByNode = new Map<TransformNode, IChannelWriters[]>();\n private _observer: Nullable<Observer<Scene>>;\n\n /**\n * Gets the root motion of a scene, creating it if needed.\n * @param scene defines the scene\n * @returns the root motion of the scene\n */\n public static Get(scene: Scene): SceneRootMotion {\n let sceneRootMotion = SceneRootMotions.get(scene);\n if (!sceneRootMotion) {\n sceneRootMotion = new SceneRootMotion(scene);\n SceneRootMotions.set(scene, sceneRootMotion);\n }\n return sceneRootMotion;\n }\n\n private constructor(scene: Scene) {\n this._scene = scene;\n this._observer = scene.onAfterAnimationsObservable.add(() => this._update());\n }\n\n /**\n * Adds a controller, updated after those added before.\n * @param controller defines the controller\n */\n public add(controller: RootMotionController): void {\n this._controllers.push(controller);\n this.refresh();\n }\n\n /**\n * Removes a controller. The scene's root motion goes with its last controller.\n * @param controller defines the controller\n */\n public remove(controller: RootMotionController): void {\n const index = this._controllers.indexOf(controller);\n if (index >= 0) {\n this._controllers.splice(index, 1);\n }\n this.refresh();\n if (!this._controllers.length) {\n this._observer?.remove();\n this._observer = null;\n SceneRootMotions.delete(this._scene);\n }\n }\n\n /**\n * Gathers the channels the controllers' clips follow, once the clips of a controller change.\n */\n public refresh(): void {\n this._writers.length = 0;\n this._writersByNode.clear();\n for (const controller of this._controllers) {\n for (const clip of controller.clips) {\n const node = clip._clockNode;\n if (!node) {\n clip._writers = null;\n continue;\n }\n let entries = this._writersByNode.get(node);\n if (!entries) {\n entries = [];\n this._writersByNode.set(node, entries);\n }\n let entry = entries.find((candidate) => candidate.property === clip._clockProperty);\n if (!entry) {\n entry = {\n property: clip._clockProperty,\n total: 0,\n weighted: false,\n lastDirect: null,\n current: [],\n currentWeights: [],\n currentAdditive: [],\n currentBlending: [],\n };\n entries.push(entry);\n this._writers.push(entry);\n }\n clip._writers = entry;\n }\n }\n }\n\n private _update(): void {\n // A step the scene did not evaluate - its animations disabled when it began - wrote nothing and moved nothing,\n // and the clips' playbacks stand where they are: unlike a playback parked at a weight of zero, which an\n // evaluated step skips while its clock runs on. Whether the step evaluated is recorded by the step itself: a\n // callback may disable the animations after the step's writes, and the step still completes.\n const scene = this._scene;\n const animated = scene._animationStepEvaluated;\n const writers = this._writers;\n for (let i = 0; i < writers.length; i++) {\n const entry = writers[i];\n entry.total = 0;\n entry.weighted = false;\n entry.lastDirect = null;\n entry.current.length = 0;\n entry.currentWeights.length = 0;\n entry.currentAdditive.length = 0;\n entry.currentBlending.length = 0;\n }\n // What the mixer wrote this step: every write of a runtime animation to a target, in order, with the weight and\n // the mode it was made with, recorded as it was made rather than read back afterwards - one whose playback ran\n // to its end has left the active animatables, one stopped by a callback in the same step has lost its runtime\n // animations, one turned additive since was bound as it wrote, and an animation of several targets wrote each\n // of them. A paused animatable, one not started yet and one parked at a weight of zero wrote nothing.\n //\n // Only the writes the step's late bindings read: those of the step itself, up to the point the bindings were\n // processed. A write made after them - by an observer of this very notification, such as the one an animation\n // group started on a virtual timeline samples from, or by a callback between steps - reached no binding of this\n // step, so it says nothing about the pose the step blended. The scene holds such a write over to the front of\n // the next step's records, where it is read in its place: before that step's writes, which is where it stands\n // in the order the bindings resolve. Reading it here instead would make the frame's motion depend on whether\n // the controller was constructed before or after the observer that made it.\n const writes = scene._animationWrites;\n const count = animated ? scene._animationStepWriteCount : 0;\n for (let i = 0; i < count; i++) {\n const write = writes[i];\n const entries = this._writersByNode.get(write.target);\n if (!entries) {\n continue;\n }\n const runtime = write.runtimeAnimation!;\n const weight = write.weight;\n for (let k = 0; k < entries.length; k++) {\n const entry = entries[k];\n if (entry.property !== runtime.targetPath) {\n continue;\n }\n entry.current.push(runtime);\n entry.currentWeights.push(weight);\n entry.currentAdditive.push(write.additive);\n entry.currentBlending.push(write.blendingFactor);\n if (weight < 0) {\n // Direct writers overwrite one another in order, so the last one is the pose.\n entry.lastDirect = runtime;\n } else {\n entry.weighted = true;\n if (!write.additive) {\n entry.total += weight;\n }\n }\n }\n }\n for (let i = 0; i < this._controllers.length; i++) {\n this._controllers[i]._update(animated);\n }\n }\n}\n\n/**\n * Clones an animation as {@link Animation.clone} does, keeping the easing function and events with it.\n * @param source defines the animation to clone\n * @param cloneKeys defines whether the keys and their values are cloned too, rather than shared until replaced\n * @returns the clone\n */\nfunction CloneAnimation(source: Animation, cloneKeys = false): Animation {\n const animation = source.clone(cloneKeys);\n const easingFunction = source.getEasingFunction();\n if (easingFunction) {\n animation.setEasingFunction(easingFunction);\n }\n for (const event of source.getEvents()) {\n animation.addEvent(event);\n }\n return animation;\n}\n\nfunction IsJoint(node: Node): node is TransformNode {\n return node instanceof TransformNode && !(node instanceof AbstractMesh);\n}\n\nfunction WrapAngle(angle: number): number {\n return angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n}\n"]}
|
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
import { type Nullable } from "../types.js";
|
|
1
2
|
import { type _IAnimationState, Animation } from "./animation.pure.js";
|
|
2
3
|
import { type Animatable } from "./animatable.js";
|
|
3
4
|
import { type Scene } from "../scene.js";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
* A write of a runtime animation to one of its targets in an animation step, recorded as it is made.
|
|
8
|
+
*/
|
|
9
|
+
export interface IRuntimeAnimationWrite {
|
|
10
|
+
/** The runtime animation that wrote; null once the record is emptied, after its step. */
|
|
11
|
+
runtimeAnimation: Nullable<RuntimeAnimation>;
|
|
12
|
+
/** The object it wrote a property of; null once the record is emptied. */
|
|
13
|
+
target: any;
|
|
14
|
+
/** The weight it wrote with, -1 for a direct write. */
|
|
15
|
+
weight: number;
|
|
16
|
+
/** Whether it wrote additively. */
|
|
17
|
+
additive: boolean;
|
|
18
|
+
/** The factor the value it wrote was blended in with, one once the animation has blended in. */
|
|
19
|
+
blendingFactor: number;
|
|
20
|
+
/** Whether a step prologue has already held the record over; a direct write is held over one step and no more. */
|
|
21
|
+
carried: boolean;
|
|
22
|
+
}
|
|
4
23
|
/**
|
|
5
24
|
* Defines a runtime animation
|
|
6
25
|
*/
|
|
@@ -83,6 +102,14 @@ export declare class RuntimeAnimation {
|
|
|
83
102
|
* The previous absolute frame of the runtime animation (meaning, without taking into account the from/to values, only the elapsed time and the fps)
|
|
84
103
|
*/
|
|
85
104
|
private _previousAbsoluteFrame;
|
|
105
|
+
private _playbackFrom;
|
|
106
|
+
private _playbackTo;
|
|
107
|
+
private _playbackFrames;
|
|
108
|
+
private _playbackProgress;
|
|
109
|
+
private _playbackSyncRoot;
|
|
110
|
+
private _playbackJumped;
|
|
111
|
+
private _playbackSyncMasterPlayed;
|
|
112
|
+
private _playbackSyncMasterFrame;
|
|
86
113
|
private _enableBlending;
|
|
87
114
|
private _keys;
|
|
88
115
|
private _minFrame;
|
|
@@ -94,6 +121,36 @@ export declare class RuntimeAnimation {
|
|
|
94
121
|
* Gets the current frame of the runtime animation
|
|
95
122
|
*/
|
|
96
123
|
get currentFrame(): number;
|
|
124
|
+
/**
|
|
125
|
+
* @internal
|
|
126
|
+
* The first frame of the range the animation was last evaluated over: the requested range, clamped to its keys.
|
|
127
|
+
*/
|
|
128
|
+
get _evaluatedFrom(): number;
|
|
129
|
+
/**
|
|
130
|
+
* @internal
|
|
131
|
+
* The last frame of the range the animation was last evaluated over.
|
|
132
|
+
*/
|
|
133
|
+
get _evaluatedTo(): number;
|
|
134
|
+
/**
|
|
135
|
+
* @internal
|
|
136
|
+
* How far the pose last evaluated had played from _evaluatedFrom, in frames, unwrapped across loops: folding it into
|
|
137
|
+
* the range gives the frame that was evaluated, and dividing it by the range counts the whole cycles the pose has been
|
|
138
|
+
* through. It follows a synchronization root, swings with a yoyo loop and holds where a constant loop or a playback
|
|
139
|
+
* that does not loop holds its pose, so it always describes the pose that was evaluated.
|
|
140
|
+
*/
|
|
141
|
+
get _evaluatedProgress(): number;
|
|
142
|
+
/**
|
|
143
|
+
* @internal
|
|
144
|
+
* The animatable the evaluation was clocked by, captured as it was made: the pose of a step stays that of the root
|
|
145
|
+
* it was synchronized with then, whatever the host has been synchronized with since.
|
|
146
|
+
*/
|
|
147
|
+
get _evaluatedSyncRoot(): Nullable<Animatable>;
|
|
148
|
+
/**
|
|
149
|
+
* @internal
|
|
150
|
+
* Whether the evaluated progress jumped rather than playing on from the one before: the pose of a follower snapped
|
|
151
|
+
* back to the start of its range by a root whose own clock cannot carry it to the end.
|
|
152
|
+
*/
|
|
153
|
+
get _evaluatedJump(): boolean;
|
|
97
154
|
/**
|
|
98
155
|
* Gets the weight of the runtime animation
|
|
99
156
|
*/
|