@onerjs/core 8.41.5 → 8.41.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animation.d.ts +6 -2
- package/Animations/animation.js +28 -4
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.d.ts +2 -1
- package/Animations/animationGroup.js +3 -2
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/animatorAvatar.d.ts +161 -0
- package/Animations/animatorAvatar.js +573 -0
- package/Animations/animatorAvatar.js.map +1 -0
- package/Animations/index.d.ts +1 -0
- package/Animations/index.js +1 -0
- package/Animations/index.js.map +1 -1
- package/AudioV2/webAudio/webAudioSoundSource.d.ts +2 -2
- package/AudioV2/webAudio/webAudioSoundSource.js +12 -2
- package/AudioV2/webAudio/webAudioSoundSource.js.map +1 -1
- package/Bones/index.d.ts +1 -0
- package/Bones/index.js +1 -0
- package/Bones/index.js.map +1 -1
- package/Bones/skeleton.d.ts +13 -0
- package/Bones/skeleton.functions.d.ts +26 -0
- package/Bones/skeleton.functions.js +91 -0
- package/Bones/skeleton.functions.js.map +1 -0
- package/Bones/skeleton.js +26 -0
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/Inputs/geospatialCameraPointersInput.d.ts +16 -0
- package/Cameras/Inputs/geospatialCameraPointersInput.js +19 -3
- package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
- package/Cameras/Limits/geospatialLimits.d.ts +0 -6
- package/Cameras/Limits/geospatialLimits.js +0 -6
- package/Cameras/Limits/geospatialLimits.js.map +1 -1
- package/Cameras/geospatialCamera.d.ts +5 -0
- package/Cameras/geospatialCamera.js +54 -25
- package/Cameras/geospatialCamera.js.map +1 -1
- package/Cameras/geospatialCameraMovement.d.ts +8 -1
- package/Cameras/geospatialCameraMovement.js +29 -8
- package/Cameras/geospatialCameraMovement.js.map +1 -1
- package/Collisions/gpuPicker.d.ts +11 -0
- package/Collisions/gpuPicker.js +148 -19
- package/Collisions/gpuPicker.js.map +1 -1
- package/Debug/skeletonViewer.d.ts +4 -8
- package/Debug/skeletonViewer.js +13 -22
- package/Debug/skeletonViewer.js.map +1 -1
- package/Engines/Extensions/engine.multiview.d.ts +2 -0
- package/Engines/Extensions/engine.multiview.js +7 -3
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/abstractEngine.d.ts +2 -2
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.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/webgpuEngine.d.ts +1 -4
- package/Engines/webgpuEngine.js +8 -6
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/frameGraphContext.js +1 -1
- package/FrameGraph/frameGraphContext.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.js +2 -2
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/Instrumentation/engineInstrumentation.js +2 -1
- package/Instrumentation/engineInstrumentation.js.map +1 -1
- package/Layers/effectLayer.js +1 -3
- package/Layers/effectLayer.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +2 -2
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +3 -4
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/lightingVolume.js +1 -1
- package/Lights/lightingVolume.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +37 -2
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.d.ts +109 -0
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js +210 -0
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +71 -15
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.d.ts +86 -0
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js +161 -0
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js.map +1 -0
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +0 -6
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js +0 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js +0 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js.map +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.d.ts +14 -0
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +14 -0
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +20 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js +20 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/depthSourceBlock.d.ts +13 -0
- package/Materials/Node/Blocks/Dual/depthSourceBlock.js +13 -0
- package/Materials/Node/Blocks/Dual/depthSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.d.ts +21 -0
- package/Materials/Node/Blocks/Dual/fogBlock.js +21 -0
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.d.ts +21 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +21 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.d.ts +38 -0
- package/Materials/Node/Blocks/Dual/lightBlock.js +38 -0
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +29 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +29 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBlock.d.ts +5 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js +5 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.d.ts +16 -0
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +16 -0
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.d.ts +16 -0
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js +16 -0
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.d.ts +34 -0
- package/Materials/Node/Blocks/Dual/textureBlock.js +34 -0
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.d.ts +17 -0
- package/Materials/Node/Blocks/Fragment/TBNBlock.js +17 -2
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.d.ts +7 -0
- package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.js +7 -0
- package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +21 -0
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +21 -0
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.d.ts +10 -0
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +10 -0
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.d.ts +28 -0
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +28 -0
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +30 -0
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +30 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.d.ts +4 -0
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +4 -0
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSpaceBlock.d.ts +5 -0
- package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js +5 -0
- package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/twirlBlock.d.ts +3 -0
- package/Materials/Node/Blocks/Fragment/twirlBlock.js +3 -0
- package/Materials/Node/Blocks/Fragment/twirlBlock.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.d.ts +6 -0
- package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js +6 -0
- package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.d.ts +16 -0
- package/Materials/Node/Blocks/Input/inputBlock.js +16 -1
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.d.ts +5 -0
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js +5 -0
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +10 -0
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +10 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +23 -0
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +23 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.d.ts +17 -0
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js +17 -0
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.d.ts +41 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +41 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.d.ts +21 -0
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +21 -0
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.d.ts +29 -0
- package/Materials/Node/Blocks/PBR/refractionBlock.js +29 -0
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.d.ts +14 -0
- package/Materials/Node/Blocks/PBR/sheenBlock.js +14 -0
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.d.ts +7 -0
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +7 -0
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.d.ts +23 -0
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js +23 -0
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportInBlock.d.ts +6 -0
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js +6 -0
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.d.ts +17 -0
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js +17 -0
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/bonesBlock.d.ts +22 -0
- package/Materials/Node/Blocks/Vertex/bonesBlock.js +22 -0
- package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.d.ts +13 -0
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +13 -0
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.d.ts +20 -0
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +20 -0
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.d.ts +27 -0
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +27 -0
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/clampBlock.d.ts +10 -0
- package/Materials/Node/Blocks/clampBlock.js +10 -0
- package/Materials/Node/Blocks/clampBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.d.ts +10 -0
- package/Materials/Node/Blocks/cloudBlock.js +10 -0
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorMergerBlock.d.ts +10 -0
- package/Materials/Node/Blocks/colorMergerBlock.js +10 -0
- package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/conditionalBlock.d.ts +14 -0
- package/Materials/Node/Blocks/conditionalBlock.js +14 -0
- package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
- package/Materials/Node/Blocks/curveBlock.d.ts +10 -0
- package/Materials/Node/Blocks/curveBlock.js +10 -0
- package/Materials/Node/Blocks/curveBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.d.ts +10 -0
- package/Materials/Node/Blocks/customBlock.js +10 -0
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/debugBlock.d.ts +10 -0
- package/Materials/Node/Blocks/debugBlock.js +10 -0
- package/Materials/Node/Blocks/debugBlock.js.map +1 -1
- package/Materials/Node/Blocks/fresnelBlock.d.ts +4 -0
- package/Materials/Node/Blocks/fresnelBlock.js +4 -0
- package/Materials/Node/Blocks/fresnelBlock.js.map +1 -1
- package/Materials/Node/Blocks/gradientBlock.d.ts +10 -0
- package/Materials/Node/Blocks/gradientBlock.js +10 -0
- package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
- package/Materials/Node/Blocks/loopBlock.d.ts +10 -0
- package/Materials/Node/Blocks/loopBlock.js +10 -0
- package/Materials/Node/Blocks/loopBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.d.ts +1 -0
- package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -0
- package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.d.ts +10 -0
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js +10 -0
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
- package/Materials/Node/Blocks/pannerBlock.d.ts +5 -0
- package/Materials/Node/Blocks/pannerBlock.js +5 -0
- package/Materials/Node/Blocks/pannerBlock.js.map +1 -1
- package/Materials/Node/Blocks/remapBlock.d.ts +10 -0
- package/Materials/Node/Blocks/remapBlock.js +10 -0
- package/Materials/Node/Blocks/remapBlock.js.map +1 -1
- package/Materials/Node/Blocks/rotate2dBlock.d.ts +1 -0
- package/Materials/Node/Blocks/rotate2dBlock.js +1 -0
- package/Materials/Node/Blocks/rotate2dBlock.js.map +1 -1
- package/Materials/Node/Blocks/transformBlock.d.ts +10 -0
- package/Materials/Node/Blocks/transformBlock.js +10 -0
- package/Materials/Node/Blocks/transformBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.d.ts +22 -0
- package/Materials/Node/Blocks/triPlanarBlock.js +22 -0
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/trigonometryBlock.d.ts +10 -0
- package/Materials/Node/Blocks/trigonometryBlock.js +10 -0
- package/Materials/Node/Blocks/trigonometryBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorMergerBlock.d.ts +10 -0
- package/Materials/Node/Blocks/vectorMergerBlock.js +10 -0
- package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/viewDirectionBlock.d.ts +5 -0
- package/Materials/Node/Blocks/viewDirectionBlock.js +5 -0
- package/Materials/Node/Blocks/viewDirectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/waveBlock.d.ts +10 -0
- package/Materials/Node/Blocks/waveBlock.js +10 -0
- package/Materials/Node/Blocks/waveBlock.js.map +1 -1
- package/Materials/Node/Blocks/worleyNoise3DBlock.d.ts +1 -0
- package/Materials/Node/Blocks/worleyNoise3DBlock.js +1 -0
- package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +13 -0
- package/Materials/Node/nodeMaterial.js +14 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.d.ts +0 -3
- package/Materials/Node/nodeMaterialBlock.js +1 -6
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +1 -2
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +1 -1
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/index.d.ts +2 -0
- package/Materials/index.js +2 -0
- package/Materials/index.js.map +1 -1
- package/Maths/math.constants.d.ts +2 -1
- package/Maths/math.constants.js +3 -2
- package/Maths/math.constants.js.map +1 -1
- package/Meshes/Builders/capsuleBuilder.js +0 -3
- package/Meshes/Builders/capsuleBuilder.js.map +1 -1
- package/Meshes/Builders/cylinderBuilder.d.ts +1 -1
- package/Meshes/Builders/cylinderBuilder.js +1 -2
- package/Meshes/Builders/cylinderBuilder.js.map +1 -1
- package/Meshes/Builders/decalBuilder.js +2 -0
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/Builders/discBuilder.js +0 -1
- package/Meshes/Builders/discBuilder.js.map +1 -1
- package/Meshes/Builders/groundBuilder.d.ts +50 -54
- package/Meshes/Builders/groundBuilder.js +50 -54
- package/Meshes/Builders/groundBuilder.js.map +1 -1
- package/Meshes/Builders/tiledBoxBuilder.d.ts +0 -26
- package/Meshes/Builders/tiledBoxBuilder.js +0 -26
- package/Meshes/Builders/tiledBoxBuilder.js.map +1 -1
- package/Meshes/Builders/tiledPlaneBuilder.d.ts +0 -25
- package/Meshes/Builders/tiledPlaneBuilder.js +0 -25
- package/Meshes/Builders/tiledPlaneBuilder.js.map +1 -1
- package/Meshes/Builders/torusBuilder.d.ts +0 -13
- package/Meshes/Builders/torusBuilder.js +0 -13
- package/Meshes/Builders/torusBuilder.js.map +1 -1
- package/Meshes/Builders/torusKnotBuilder.d.ts +0 -19
- package/Meshes/Builders/torusKnotBuilder.js +0 -19
- package/Meshes/Builders/torusKnotBuilder.js.map +1 -1
- package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
- package/Meshes/Compression/dracoDecoder.js.map +1 -1
- package/Meshes/Compression/dracoDecoder.types.d.ts +11 -0
- package/Meshes/Compression/dracoDecoder.types.js.map +1 -1
- package/Meshes/Compression/dracoEncoder.js.map +1 -1
- package/Meshes/Compression/meshoptCompression.js +0 -2
- package/Meshes/Compression/meshoptCompression.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +17 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +0 -8
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +1 -0
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +1 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +1 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +1 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Matrices/scalingBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Matrices/scalingBlock.js +1 -0
- package/Meshes/Node/Blocks/Matrices/scalingBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Matrices/translationBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Matrices/translationBlock.js +1 -0
- package/Meshes/Node/Blocks/Matrices/translationBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/aggregatorBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Set/aggregatorBlock.js +1 -0
- package/Meshes/Node/Blocks/Set/aggregatorBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/latticeBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Set/latticeBlock.js +1 -0
- package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setColorsBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Set/setColorsBlock.js +1 -0
- package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setMaterialIDBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js +1 -0
- package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setNormalsBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Set/setNormalsBlock.js +1 -0
- package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setPositionsBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js +1 -0
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setTangentsBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Set/setTangentsBlock.js +1 -0
- package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setUVsBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Set/setUVsBlock.js +1 -0
- package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/boxBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/Sources/boxBlock.js +2 -0
- package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/capsuleBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/Sources/capsuleBlock.js +2 -0
- package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/cylinderBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/Sources/cylinderBlock.js +2 -0
- package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/discBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/Sources/discBlock.js +2 -0
- package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/gridBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/Sources/gridBlock.js +2 -0
- package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +2 -0
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/meshBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Sources/meshBlock.js +1 -0
- package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/planeBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/Sources/planeBlock.js +2 -0
- package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/pointListBlock.d.ts +2 -1
- package/Meshes/Node/Blocks/Sources/pointListBlock.js +2 -1
- package/Meshes/Node/Blocks/Sources/pointListBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/sphereBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/Sources/sphereBlock.js +2 -0
- package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/torusBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/Sources/torusBlock.js +2 -0
- package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Teleport/teleportInBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Teleport/teleportInBlock.js +1 -0
- package/Meshes/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Teleport/teleportOutBlock.d.ts +3 -0
- package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js +3 -0
- package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +1 -0
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/booleanGeometryBlock.js +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/cleanGeometryBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/cleanGeometryBlock.js +1 -0
- package/Meshes/Node/Blocks/cleanGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/conditionBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/conditionBlock.js +2 -0
- package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryClampBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/geometryClampBlock.js +1 -0
- package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCollectionBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/geometryCollectionBlock.js +1 -0
- package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCurveBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/geometryCurveBlock.js +2 -0
- package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryEaseBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/geometryEaseBlock.js +2 -0
- package/Meshes/Node/Blocks/geometryEaseBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryInputBlock.d.ts +3 -0
- package/Meshes/Node/Blocks/geometryInputBlock.js +3 -0
- package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js +1 -0
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTransformBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/geometryTransformBlock.js +1 -0
- package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +2 -0
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mappingBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/mappingBlock.js +1 -0
- package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mathBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/mathBlock.js +1 -0
- package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mergeGeometryBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/mergeGeometryBlock.js +1 -0
- package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/randomBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/randomBlock.js +2 -0
- package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
- package/Meshes/Node/Blocks/subdivideBlock.d.ts +1 -0
- package/Meshes/Node/Blocks/subdivideBlock.js +1 -0
- package/Meshes/Node/Blocks/subdivideBlock.js.map +1 -1
- package/Meshes/Node/Interfaces/nodeGeometryTextureData.d.ts +3 -0
- package/Meshes/Node/Interfaces/nodeGeometryTextureData.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +0 -2
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +0 -1
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
- package/Meshes/Node/nodeGeometryBuildState.js +0 -1
- package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
- package/Meshes/WebGL/webGLDataBuffer.d.ts +2 -0
- package/Meshes/WebGL/webGLDataBuffer.js +2 -0
- package/Meshes/WebGL/webGLDataBuffer.js.map +1 -1
- package/Meshes/WebGPU/webgpuDataBuffer.d.ts +4 -0
- package/Meshes/WebGPU/webgpuDataBuffer.js +4 -0
- package/Meshes/WebGPU/webgpuDataBuffer.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +1 -0
- package/Meshes/abstractMesh.decalMap.d.ts +1 -0
- package/Meshes/abstractMesh.decalMap.js.map +1 -1
- package/Meshes/abstractMesh.js +1 -6
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/csg.js +0 -6
- package/Meshes/csg.js.map +1 -1
- package/Meshes/csg2.js +1 -2
- package/Meshes/csg2.js.map +1 -1
- package/Meshes/geodesicMesh.d.ts +26 -0
- package/Meshes/geodesicMesh.js +18 -3
- package/Meshes/geodesicMesh.js.map +1 -1
- package/Meshes/groundMesh.d.ts +1 -0
- package/Meshes/groundMesh.js +1 -0
- package/Meshes/groundMesh.js.map +1 -1
- package/Meshes/index.js +0 -2
- package/Meshes/index.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +18 -3
- package/Meshes/instancedMesh.js +11 -3
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +291 -204
- package/Meshes/mesh.js +290 -213
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.d.ts +15 -19
- package/Meshes/mesh.vertexData.js +15 -19
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/meshSimplification.d.ts +0 -1
- package/Meshes/meshSimplification.js +6 -1
- package/Meshes/meshSimplification.js.map +1 -1
- package/Meshes/meshSimplificationSceneComponent.d.ts +2 -0
- package/Meshes/meshSimplificationSceneComponent.js.map +1 -1
- package/Meshes/meshUVSpaceRenderer.d.ts +1 -0
- package/Meshes/meshUVSpaceRenderer.js.map +1 -1
- package/Meshes/polygonMesh.js +4 -0
- package/Meshes/polygonMesh.js.map +1 -1
- package/Meshes/subMesh.project.d.ts +1 -0
- package/Meshes/subMesh.project.js.map +1 -1
- package/Meshes/thinInstanceMesh.d.ts +5 -0
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Meshes/transformNode.d.ts +1 -1
- package/Meshes/transformNode.js +1 -1
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/dataStorage.d.ts +13 -0
- package/Misc/dataStorage.js +25 -0
- package/Misc/dataStorage.js.map +1 -1
- package/Morph/morphTarget.d.ts +9 -5
- package/Morph/morphTarget.js +15 -7
- package/Morph/morphTarget.js.map +1 -1
- package/Morph/morphTargetManager.d.ts +3 -1
- package/Morph/morphTargetManager.js +5 -2
- package/Morph/morphTargetManager.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/boxShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/coneShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/coneShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/customShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/customShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/emitters.functions.js +3 -3
- package/Particles/Node/Blocks/Emitters/emitters.functions.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/meshShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/pointShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js +1 -1
- package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js.map +1 -1
- package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js +2 -2
- package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js +7 -7
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleLocalVariableBlock.js +2 -2
- package/Particles/Node/Blocks/particleLocalVariableBlock.js.map +1 -1
- package/Particles/Node/nodeParticleBuildState.js +7 -7
- package/Particles/Node/nodeParticleBuildState.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.helper.js +9 -4
- package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
- package/Particles/particle.d.ts +73 -61
- package/Particles/particle.js +106 -91
- package/Particles/particle.js.map +1 -1
- package/Particles/particleSystem.js +5 -5
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.function.js +83 -83
- package/Particles/thinParticleSystem.function.js.map +1 -1
- package/Particles/thinParticleSystem.js +8 -8
- package/Particles/thinParticleSystem.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.d.ts +89 -3
- package/Physics/v2/Plugins/havokPlugin.js +388 -53
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Probes/reflectionProbe.js +10 -7
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/depthRenderer.js +1 -1
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +3 -1
- package/Rendering/objectRenderer.js +28 -8
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/reflectiveShadowMap.js +1 -1
- package/Rendering/reflectiveShadowMap.js.map +1 -1
- package/Rendering/thinDepthPeelingRenderer.js +8 -0
- package/Rendering/thinDepthPeelingRenderer.js.map +1 -1
- package/Shaders/gaussianSplatting.fragment.js +8 -2
- package/Shaders/gaussianSplatting.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +8 -2
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.fragment.js +7 -1
- package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +8 -2
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +22 -4
- package/scene.js +33 -20
- package/scene.js.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animatorAvatar.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/animatorAvatar.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,gCAA+B;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAgFxC;;;GAGG;AACH,MAAM,OAAO,cAAc;IAcvB;;;OAGG;IACH,IAAW,+BAA+B;QACtC,IAAI,CAAC,IAAI,CAAC,gCAAgC,EAAE,CAAC;YACzC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,IAAI,CAAC,gCAAgC,CAAC;IACjD,CAAC;IAOD;;;;;OAKG;IACH,YACoB,IAAY,EACZ,QAAwB,EAChC,oBAAoB,IAAI;QAFhB,SAAI,GAAJ,IAAI,CAAQ;QACZ,aAAQ,GAAR,QAAQ,CAAgB;QAChC,sBAAiB,GAAjB,iBAAiB,CAAO;QAdpC;;WAEG;QACI,iBAAY,GAAG,IAAI,CAAC;QAavB,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAY,CAAC;QACrC,IAAI,CAAC,mBAAmB,GAAG,IAAI,GAAG,EAAsB,CAAC;QAEzD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,OAAO;QACX,CAAC;QAED,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC;YAC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n Immutable,\r\n Bone,\r\n Nullable,\r\n MorphTarget,\r\n AnimationGroup,\r\n Animation,\r\n Node,\r\n Skeleton,\r\n TargetedAnimation,\r\n} from \"core/index\";\r\nimport { Vector3, Quaternion, TmpVectors, Matrix } from \"core/Maths/math.vector\";\r\nimport { Logger } from \"../Misc/logger\";\r\n\r\n/**\r\n * Options for retargeting an animation group to an avatar.\r\n */\r\nexport interface IRetargetOptions {\r\n /**\r\n * The name to assign to the (cloned) retargeted animation group.\r\n * If not specified, the same name as the original animation group will be used.\r\n */\r\n animationGroupName?: string;\r\n\r\n /**\r\n * If true, the retargeted animations will be fixed to correct common issues like orthogonal quaternions.\r\n * Default is true.\r\n */\r\n fixAnimations?: boolean;\r\n\r\n /**\r\n * If true, the parent hierarchy of bones and transform nodes will be checked during retargeting.\r\n * Animations will be removed if the hierarchies don't match.\r\n * Default is true.\r\n */\r\n checkHierarchy?: boolean;\r\n\r\n /**\r\n * If true, the frame values in the animation keyframes will be adjusted during retargeting to account for differences\r\n * between the source and target bone transforms.\r\n * Default is true.\r\n */\r\n retargetAnimationKeys?: boolean;\r\n\r\n /**\r\n * If true, scales and adjusts the root position animation to account for size differences between the source and target avatars.\r\n * This helps maintain the relative motion of the character when retargeting between avatars of different proportions.\r\n * Default is true.\r\n */\r\n fixRootPosition?: boolean;\r\n\r\n /**\r\n * If true, adjusts the root position animation to correct for ground reference height differences between the source and target avatars.\r\n * This ensures that the animated character maintains proper contact with the ground during retargeting.\r\n * Default is true.\r\n */\r\n fixGroundReference?: boolean;\r\n\r\n /**\r\n * The name of the root transform node in the source animation group (typically \"Hips\" or similar).\r\n * If not specified, the system will attempt to automatically find the first bone without a parent.\r\n * This bone is used as a reference point for fixing root position during retargeting.\r\n * It's also used by the ground reference fixing processing.\r\n */\r\n rootNodeName?: string;\r\n\r\n /**\r\n * The name of the transform node in the source animation group used as a ground reference point (typically a foot bone like \"LeftFoot\" or \"RightFoot\").\r\n * This bone is used to determine the vertical offset needed to maintain proper ground contact during retargeting.\r\n * Required when fixGroundReference or fixRootPosition is enabled.\r\n */\r\n groundReferenceNodeName?: string;\r\n\r\n /**\r\n * Specifies which axis represents the vertical/up direction in the animation space.\r\n * Use \"X\", \"Y\", or \"Z\" to explicitly set the vertical axis, or \"\" (empty string) / undefined to auto-detect.\r\n * If not specified or empty, the system will automatically determine the vertical axis based on the difference\r\n * between the root node and ground reference node positions.\r\n * Default is undefined (auto-detect).\r\n */\r\n groundReferenceVerticalAxis?: \"\" | \"X\" | \"Y\" | \"Z\";\r\n\r\n /**\r\n * A map for renaming nodes during retargeting when the source transform node hierarchy and target skeleton use different naming conventions.\r\n * The map keys are the original node names from the source animation group, and the values are the corresponding\r\n * node names in the target skeleton. This is useful when bone names don't match between avatars.\r\n */\r\n mapNodeNames?: Map<string, string>;\r\n}\r\n\r\ntype TransformNodeNameToNode = Map<string, { node: TransformNode; initialTransformations: { position: Vector3; scaling: Vector3; quaternion: Quaternion } }>;\r\n\r\n/**\r\n * Represents an animator avatar that manages skeletons and morph target managers for a hierarchical transform node and mesh structure.\r\n * This class is used to group and manage animation-related resources (skeletons and morph targets) associated with a root transform node and its descendants.\r\n */\r\nexport class AnimatorAvatar {\r\n /**\r\n * Set of skeletons found in the mesh hierarchy.\r\n * Each skeleton in this set has its bones linked to corresponding transform nodes.\r\n */\r\n public skeletons: Set<Skeleton>;\r\n\r\n /**\r\n * Set of morph target managers found in the mesh hierarchy.\r\n * Each morph target manager is configured with the appropriate mesh name and influencer count.\r\n */\r\n public morphTargetManagers: Set<MorphTargetManager>;\r\n\r\n private _mapMorphTargetNameToMorphTarget: Map<string, MorphTarget>;\r\n /**\r\n * Map of morph target names to their corresponding MorphTarget instances.\r\n * The keys are constructed using the format \"meshName_morphTargetName\".\r\n */\r\n public get mapMorphTargetNameToMorphTarget(): Immutable<Map<string, MorphTarget>> {\r\n if (!this._mapMorphTargetNameToMorphTarget) {\r\n this._buildMorphTargetMap();\r\n }\r\n return this._mapMorphTargetNameToMorphTarget;\r\n }\r\n\r\n /**\r\n * Indicates whether to show warnings during retargeting operations.\r\n */\r\n public showWarnings = true;\r\n\r\n /**\r\n * Creates an instance of AnimatorAvatar.\r\n * @param name - The name to assign to this avatar and its root node\r\n * @param rootNode - The root node of the avatar hierarchy. This node and its descendants will be scanned for skeletons and morph target managers. If not provided, you are expected to manually manage skeletons and morph target managers.\r\n * @param _disposeResources - Indicates whether to dispose of resources (skeletons, morph target managers, root node and descendants + materials and textures) when the avatar is disposed (true by default)\r\n */\r\n constructor(\r\n public readonly name: string,\r\n public readonly rootNode?: TransformNode,\r\n private _disposeResources = true\r\n ) {\r\n this.skeletons = new Set<Skeleton>();\r\n this.morphTargetManagers = new Set<MorphTargetManager>();\r\n\r\n if (!rootNode) {\r\n return;\r\n }\r\n\r\n rootNode.name = name;\r\n\r\n if (!rootNode.rotationQuaternion) {\r\n rootNode.rotationQuaternion = new Quaternion();\r\n }\r\n\r\n rootNode\r\n .getChildMeshes(false, (node) => {\r\n const mesh = node as AbstractMesh;\r\n return mesh.getTotalVertices && mesh.getTotalVertices() > 0;\r\n })\r\n .forEach((mesh) => {\r\n if (mesh.skeleton) {\r\n this.skeletons.add(mesh.skeleton);\r\n }\r\n\r\n if (mesh.morphTargetManager) {\r\n mesh.morphTargetManager.meshName = mesh.name;\r\n mesh.morphTargetManager.numMaxInfluencers = mesh.morphTargetManager.numTargets;\r\n\r\n this.morphTargetManagers.add(mesh.morphTargetManager);\r\n }\r\n });\r\n\r\n this._computeBoneWorldMatrices();\r\n }\r\n\r\n /**\r\n * Finds a bone in the avatar's skeletons by its linked transform node or the name of the linked transform node.\r\n * @param nameOrTransformNode The linked transform node or the name of the linked transform node\r\n * @returns The found bone or null if not found\r\n */\r\n public findBone(nameOrTransformNode: string | TransformNode): Nullable<Bone> {\r\n const isName = !this._isTransformNode(nameOrTransformNode);\r\n const iterator = this.skeletons.keys();\r\n\r\n let bone: Nullable<Bone> = null;\r\n\r\n for (let key = iterator.next(); key.done !== true; key = iterator.next()) {\r\n const skeleton = key.value;\r\n\r\n if (isName) {\r\n bone = skeleton.findBoneFromLinkedTransformNodeName(nameOrTransformNode);\r\n } else {\r\n bone = skeleton.findBoneFromLinkedTransformNode(nameOrTransformNode);\r\n }\r\n\r\n if (bone) {\r\n return bone;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Make sures that the animation group passed as the first parameter will animate the bones in the skeleton(s) / the morphs in the morph target manager(s) of the avatar.\r\n * Retargeting is based on the names of the targets (TransformNode or MorphTarget) in the animation and the names of the bones in the skeleton / morph targets in the morph target manager.\r\n * Note that you can use the mapNodeNames option to specify a mapping between source transform node names and target bone names in case they are different.\r\n * If no bones with the same name as a target (TransformNode) of a targeted animation are found, the targeted animation is removed from the animation group.\r\n * Same for morph targets.\r\n * Note that for the time being, we only support a source animation group which animates transform nodes, not bones!\r\n * That's typically the case when the source animation group is created from a glTF file, as glTF animations always target transform nodes.\r\n * @param sourceAnimationGroup The animation group to retarget\r\n * @param options Options for retargeting the animation group (optional)\r\n * @returns The retargeted (new) animation group\r\n */\r\n public retargetAnimationGroup(sourceAnimationGroup: AnimationGroup, options?: IRetargetOptions): AnimationGroup {\r\n const localOptions: IRetargetOptions = {\r\n animationGroupName: sourceAnimationGroup.name,\r\n fixAnimations: true,\r\n checkHierarchy: true,\r\n retargetAnimationKeys: true,\r\n fixGroundReference: true,\r\n fixRootPosition: true,\r\n ...options,\r\n };\r\n\r\n // Make sure that all world matrices are up to date, both in the bone hierarchy and in the animation transform node hierarchy\r\n this._computeBoneWorldMatrices();\r\n\r\n const mapNodeNames = localOptions.mapNodeNames ?? new Map();\r\n const lstTransformNodes = new Set<TransformNode>();\r\n const sourceTransformNodeNameToNode: TransformNodeNameToNode = new Map();\r\n\r\n for (let i = 0; i < sourceAnimationGroup.targetedAnimations.length; ++i) {\r\n const ta = sourceAnimationGroup.targetedAnimations[i];\r\n if (ta.target.getClassName?.() === \"TransformNode\" && !lstTransformNodes.has(ta.target)) {\r\n const tn = ta.target as TransformNode;\r\n\r\n lstTransformNodes.add(tn);\r\n\r\n if (!tn.rotationQuaternion) {\r\n tn.rotationQuaternion = Quaternion.FromEulerAngles(tn.rotation.x, tn.rotation.y, tn.rotation.z);\r\n tn.rotation.setAll(0);\r\n }\r\n\r\n sourceTransformNodeNameToNode.set(mapNodeNames.get(tn.name) ?? tn.name, {\r\n node: tn,\r\n initialTransformations: {\r\n position: tn.position.clone(),\r\n scaling: tn.scaling.clone(),\r\n quaternion: tn.rotationQuaternion.clone(),\r\n },\r\n });\r\n }\r\n }\r\n\r\n lstTransformNodes.forEach((node) => {\r\n node.computeWorldMatrix(true);\r\n });\r\n\r\n // Clone the source animation and retarget it\r\n const animationGroup = sourceAnimationGroup.clone(localOptions.animationGroupName!, undefined, true, true);\r\n\r\n const mapTransformNodeToRootNode: Map<TransformNode, Node> = new Map<TransformNode, Node>();\r\n const lstAnims = new Set<Animation>();\r\n\r\n for (let i = 0; i < animationGroup.targetedAnimations.length; ++i) {\r\n const ta = animationGroup.targetedAnimations[i];\r\n const animation = ta.animation;\r\n\r\n if (lstAnims.has(animation)) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroup.name}': animation '${animation.name}' is used multiple times in the same animation group: duplicated animations are not supported, the retargeted animation may not work as expected.`\r\n );\r\n }\r\n }\r\n\r\n lstAnims.add(animation);\r\n\r\n switch (animation.targetProperty) {\r\n case \"influence\": {\r\n if (!this._retargetMorphTarget(ta, animationGroup.name)) {\r\n animationGroup.targetedAnimations.splice(i, 1);\r\n i--;\r\n }\r\n break;\r\n }\r\n case \"position\":\r\n case \"rotationQuaternion\":\r\n case \"scaling\": {\r\n if (ta.target.getClassName?.() !== \"TransformNode\") {\r\n break;\r\n }\r\n\r\n const sourceTransformNode = ta.target as TransformNode;\r\n const sourceTransformNodeName = mapNodeNames.get(sourceTransformNode.name) ?? sourceTransformNode.name;\r\n const targetBone = this.findBone(sourceTransformNodeName);\r\n\r\n if (!targetBone) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroup.name}': \"${sourceTransformNodeName}\" bone not found in any skeleton of avatar: animation removed.`\r\n );\r\n animationGroup.targetedAnimations.splice(i, 1);\r\n i--;\r\n }\r\n break;\r\n }\r\n\r\n if (!targetBone._linkedTransformNode) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroup.name}': bone \"${targetBone.name}\" has no linked transform node: skipping retargeting.`\r\n );\r\n }\r\n break;\r\n }\r\n\r\n if (\r\n !this._retargetTransformNodeToBone(\r\n ta,\r\n sourceTransformNode,\r\n targetBone,\r\n animationGroup.name,\r\n mapTransformNodeToRootNode,\r\n mapNodeNames,\r\n !!localOptions.checkHierarchy\r\n )\r\n ) {\r\n animationGroup.targetedAnimations.splice(i, 1);\r\n i--;\r\n } else if (localOptions.retargetAnimationKeys) {\r\n this._retargetAnimationKeys(ta.animation, sourceTransformNode, targetBone);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (localOptions.fixAnimations) {\r\n this._fixAnimationGroup(animationGroup);\r\n }\r\n\r\n if (localOptions.fixGroundReference || localOptions.fixRootPosition) {\r\n const msg =\r\n localOptions.fixGroundReference && localOptions.fixRootPosition\r\n ? \"Ground reference and root position fixing processes skipped.\"\r\n : localOptions.fixGroundReference\r\n ? \"Ground reference fixing process skipped.\"\r\n : \"Root position fixing process skipped.\";\r\n\r\n const res = this._findVerticalAxis(\r\n msg,\r\n animationGroup,\r\n mapNodeNames.get(localOptions.rootNodeName) ?? localOptions.rootNodeName,\r\n sourceTransformNodeNameToNode,\r\n mapNodeNames.get(localOptions.groundReferenceNodeName) ?? localOptions.groundReferenceNodeName,\r\n localOptions.groundReferenceVerticalAxis\r\n );\r\n\r\n if (res) {\r\n const {\r\n verticalAxis,\r\n sourceRootTransformNode,\r\n targetRootTransformNode,\r\n targetRootPositionAnimation,\r\n sourceGroundReferenceTransformNode,\r\n targetGroundReferenceTransformNode,\r\n proportionRatio,\r\n } = res;\r\n\r\n if (localOptions.fixRootPosition) {\r\n this._fixRootPosition(sourceAnimationGroup, animationGroup, sourceRootTransformNode, targetRootTransformNode, targetRootPositionAnimation, proportionRatio);\r\n this._resetStates(sourceTransformNodeNameToNode);\r\n }\r\n\r\n if (localOptions.fixGroundReference) {\r\n this._fixGroundReference(\r\n sourceAnimationGroup,\r\n animationGroup,\r\n verticalAxis,\r\n targetRootTransformNode,\r\n targetRootPositionAnimation,\r\n sourceGroundReferenceTransformNode,\r\n targetGroundReferenceTransformNode\r\n );\r\n this._resetStates(sourceTransformNodeNameToNode);\r\n }\r\n }\r\n }\r\n\r\n return animationGroup;\r\n }\r\n\r\n /**\r\n * Disposes of the avatar and releases all associated resources.\r\n * This will dispose all skeletons, morph target managers, and the root mesh with its descendants (including materials and textures).\r\n * If disposeResources was set to false in the constructor, this method does nothing.\r\n */\r\n public dispose(): void {\r\n if (!this._disposeResources) {\r\n return;\r\n }\r\n\r\n const iterator = this.skeletons.keys();\r\n for (let key = iterator.next(); key.done !== true; key = iterator.next()) {\r\n key.value.dispose();\r\n }\r\n\r\n const iterator2 = this.morphTargetManagers.keys();\r\n for (let key = iterator2.next(); key.done !== true; key = iterator2.next()) {\r\n key.value.dispose();\r\n }\r\n\r\n this.rootNode?.dispose(false, true);\r\n }\r\n\r\n private _computeBoneWorldMatrices() {\r\n this.skeletons.forEach((skeleton) => {\r\n skeleton.bones.forEach((bone) => {\r\n bone._linkedTransformNode?.computeWorldMatrix(true);\r\n });\r\n });\r\n }\r\n\r\n private _isTransformNode(nameOrTransformNode: string | TransformNode): nameOrTransformNode is TransformNode {\r\n return typeof nameOrTransformNode !== \"string\";\r\n }\r\n\r\n private _buildMorphTargetMap(): void {\r\n this._mapMorphTargetNameToMorphTarget = new Map<string, MorphTarget>();\r\n\r\n this.morphTargetManagers.forEach((manager) => {\r\n const numTargets = manager.numTargets;\r\n\r\n for (let t = 0; t < numTargets; ++t) {\r\n const target = manager.getTarget(t);\r\n const key = manager.meshName + \"_\" + target.name;\r\n\r\n this._mapMorphTargetNameToMorphTarget.set(key, target);\r\n }\r\n });\r\n }\r\n\r\n private _retargetMorphTarget(ta: TargetedAnimation, animationGroupName: string) {\r\n const morphTarget = ta.target as MorphTarget;\r\n const key = morphTarget.morphTargetManager?.meshName + \"_\" + morphTarget.name;\r\n\r\n if (!this.mapMorphTargetNameToMorphTarget.has(key)) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroupName}': \"${morphTarget.name}\" morph target not found in morph target manager of mesh \"${morphTarget.morphTargetManager?.meshName}\": animation removed`\r\n );\r\n }\r\n return false;\r\n }\r\n\r\n ta.target = this.mapMorphTargetNameToMorphTarget.get(key)!;\r\n\r\n return true;\r\n }\r\n\r\n private _retargetTransformNodeToBone(\r\n ta: TargetedAnimation,\r\n sourceTransformNode: TransformNode,\r\n targetBone: Bone,\r\n animationGroupName: string,\r\n mapTransformNodeToRootNode: Map<TransformNode, Node>,\r\n mapNodeNames: Map<string, string>,\r\n checkHierarchy: boolean\r\n ) {\r\n if (checkHierarchy) {\r\n let rootNode = mapTransformNodeToRootNode.get(sourceTransformNode);\r\n\r\n if (!rootNode) {\r\n rootNode = this._getRootNode(sourceTransformNode);\r\n mapTransformNodeToRootNode.set(sourceTransformNode, rootNode);\r\n }\r\n\r\n if (!this._checkParentHierarchy(targetBone, rootNode!, mapNodeNames)) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroupName}': parent hierarchy mismatch between bone \"${targetBone.name}\" and transform node \"${sourceTransformNode.name}\": animation removed`\r\n );\r\n }\r\n return false;\r\n }\r\n }\r\n\r\n ta.target = targetBone._linkedTransformNode;\r\n\r\n return true;\r\n }\r\n\r\n private _retargetAnimationKeys(animation: Animation, sourceTransformNode: TransformNode, targetBone: Bone) {\r\n const keys = animation.getKeys();\r\n const targetTransformNode = targetBone._linkedTransformNode!;\r\n\r\n const targetWorldMatrix = targetTransformNode.getWorldMatrix();\r\n const targetParentWorldMatrix = targetTransformNode.parent ? targetTransformNode.parent.getWorldMatrix() : Matrix.IdentityReadOnly;\r\n const targetParentInverseWorldMatrix = targetParentWorldMatrix.invertToRef(TmpVectors.Matrix[0]);\r\n\r\n const sourceInverseWorld = sourceTransformNode.getWorldMatrix().invertToRef(TmpVectors.Matrix[1]);\r\n const sourceParentWorld = sourceTransformNode.parent ? sourceTransformNode.parent.getWorldMatrix() : Matrix.IdentityReadOnly;\r\n\r\n switch (animation.targetProperty) {\r\n case \"rotationQuaternion\": {\r\n for (const key of keys) {\r\n const quaternion = key.value as Quaternion;\r\n\r\n const localMat = Matrix.ComposeToRef(sourceTransformNode.scaling, quaternion, sourceTransformNode.position, TmpVectors.Matrix[2]);\r\n\r\n sourceInverseWorld.multiplyToRef(localMat, localMat).multiplyToRef(sourceParentWorld, localMat);\r\n targetWorldMatrix.multiplyToRef(localMat, localMat).multiplyToRef(targetParentInverseWorldMatrix, localMat).decompose(undefined, quaternion, undefined);\r\n }\r\n break;\r\n }\r\n case \"position\": {\r\n for (const key of keys) {\r\n const position = key.value as Vector3;\r\n\r\n const localMat = Matrix.ComposeToRef(sourceTransformNode.scaling, sourceTransformNode.rotationQuaternion!, position, TmpVectors.Matrix[2]);\r\n\r\n sourceInverseWorld.multiplyToRef(localMat, localMat).multiplyToRef(sourceParentWorld, localMat);\r\n targetWorldMatrix.multiplyToRef(localMat, localMat).multiplyToRef(targetParentInverseWorldMatrix, localMat).decompose(undefined, undefined, position);\r\n }\r\n break;\r\n }\r\n case \"scaling\": {\r\n for (const key of keys) {\r\n const scaling = key.value as Vector3;\r\n\r\n const localMat = Matrix.ComposeToRef(scaling, sourceTransformNode.rotationQuaternion!, sourceTransformNode.position, TmpVectors.Matrix[2]);\r\n\r\n sourceInverseWorld.multiplyToRef(localMat, localMat).multiplyToRef(sourceParentWorld, localMat);\r\n targetWorldMatrix.multiplyToRef(localMat, localMat).multiplyToRef(targetParentInverseWorldMatrix, localMat).decompose(scaling, undefined, undefined);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * This method does two things:\r\n * - It deletes a targeted animation if a bone corresponding to the target cannot be found\r\n * - It corrects quaternion animations when two consecutive quaternions are orthogonal to each other. When this happens, in 99.99% of cases it's an error\r\n * in the animation data, as two consecutive rotations should normally be close to each other and not have a large gap.\r\n * The fix is to copy the first quaternion into the second.\r\n * @param animationGroup The animation group to fix\r\n * @internal\r\n */\r\n private _fixAnimationGroup(animationGroup: AnimationGroup) {\r\n for (let i = 0; i < animationGroup.targetedAnimations.length; ++i) {\r\n const ta = animationGroup.targetedAnimations[i];\r\n\r\n switch (ta.animation.targetProperty) {\r\n case \"position\":\r\n case \"rotationQuaternion\":\r\n case \"scaling\": {\r\n if (ta.target.getClassName() !== \"TransformNode\") {\r\n break;\r\n }\r\n\r\n const transformNode = ta.target as TransformNode;\r\n const bone = this.findBone(transformNode);\r\n\r\n if (!bone) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `FixAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroup.name}': no bone in any skeleton of the avatar ${this.name} animates the transform node ${transformNode.name}: animation removed`\r\n );\r\n }\r\n animationGroup.targetedAnimations.splice(i, 1);\r\n i--;\r\n continue;\r\n }\r\n\r\n ta.target = bone._linkedTransformNode;\r\n\r\n if (ta.animation.targetProperty === \"rotationQuaternion\") {\r\n this._fixAnimationQuaternion(ta.animation);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n private _fixAnimationQuaternion(animation: Animation, epsilon = 0.001) {\r\n const keys = animation.getKeys();\r\n\r\n for (let i = 0; i < keys.length - 1; ++i) {\r\n const curQuat = keys[i].value as Quaternion;\r\n const nextQuat = keys[i + 1].value as Quaternion;\r\n\r\n if (Math.abs(Quaternion.Dot(curQuat, nextQuat)) < epsilon) {\r\n keys[i + 1].value = curQuat.clone();\r\n i += 1;\r\n }\r\n }\r\n }\r\n\r\n private _getRootNode(node: Node): Node {\r\n let current: Node = node;\r\n\r\n while (current.parent) {\r\n current = current.parent;\r\n }\r\n\r\n return current;\r\n }\r\n\r\n /**\r\n * Checks whether the parent hierarchy of a bone matches that of a given transform node. Checks are performed by name.\r\n * It works by first finding the transform node in the descendants of the root transform node that matches the bone's linked transform node.\r\n * Then it traverses up the hierarchy of both the bone and the transform node, comparing their names at each level.\r\n * @param bone The bone to check\r\n * @param rootTransformNode The root transform node to check against\r\n * @returns True if the hierarchies match, false otherwise\r\n * @internal\r\n */\r\n private _checkParentHierarchy(bone: Bone, rootTransformNode: Node, mapNodeNames: Map<string, string>) {\r\n const children = rootTransformNode.getDescendants(false, (node) => (mapNodeNames.get(node.name) ?? node.name) === bone._linkedTransformNode!.name);\r\n if (!children || children.length !== 1) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', CheckParentHierarchy: unable to find a corresponding transform node to bone name ${bone._linkedTransformNode!.name} in the source animation.`\r\n );\r\n }\r\n return false;\r\n }\r\n\r\n let transformNode: Nullable<Node> = children[0];\r\n\r\n while (bone) {\r\n const name = mapNodeNames.get(transformNode?.name ?? \"\") ?? transformNode?.name;\r\n if (bone._linkedTransformNode!.name !== name) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', CheckParentHierarchy: bone name ${bone._linkedTransformNode!.name} is different from transform node name ${name}.`\r\n );\r\n }\r\n return false;\r\n }\r\n\r\n bone = bone.parent;\r\n transformNode = transformNode!.parent;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n private _getRootNodeName(rootNodeName: string | undefined, transformNodeNameToNode: TransformNodeNameToNode) {\r\n if (rootNodeName) {\r\n return rootNodeName;\r\n }\r\n\r\n // Look for the first bone that doesn't have a parent\r\n const iterator = this.skeletons.keys();\r\n for (let key = iterator.next(); key.done !== true; key = iterator.next()) {\r\n const skeleton = key.value;\r\n\r\n for (const bone of skeleton.bones) {\r\n if (!bone.parent) {\r\n // Make sure there's a transform node with that name in the source animation\r\n if (transformNodeNameToNode.get(bone.name)) {\r\n return bone.name;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return;\r\n }\r\n\r\n private _findVerticalAxis(\r\n msg: string,\r\n animationGroup: AnimationGroup,\r\n remappedRootNodeName: string | undefined,\r\n sourceTransformNodeNameToNode: TransformNodeNameToNode,\r\n remappedGroundReferenceNodeName?: string,\r\n groundReferenceVerticalAxis?: string\r\n ) {\r\n if (!remappedGroundReferenceNodeName) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroup.name}': you must provide the name of the ground reference node (option parameter \"groundReferenceNodeName\"). ${msg}`\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n remappedRootNodeName = this._getRootNodeName(remappedRootNodeName, sourceTransformNodeNameToNode);\r\n\r\n if (!remappedRootNodeName) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroup.name}': unable to find a suitable root node in the source animation. You should provide its name through the \"rootNodeName\" optional parameter. ${msg}`\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n const sourceRootTransformNode = sourceTransformNodeNameToNode.get(remappedRootNodeName)?.node;\r\n const sourceGroundReferenceTransformNode = sourceTransformNodeNameToNode.get(remappedGroundReferenceNodeName)?.node;\r\n\r\n if (!sourceRootTransformNode) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroup.name}': unable to find the transform node corresponding to \"${remappedRootNodeName}\" in the source animation. This transform node either doesn't exist or is not animated. ${msg}`\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n if (!sourceGroundReferenceTransformNode) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroup.name}': unable to find the transform node corresponding to \"${remappedGroundReferenceNodeName}\" in the source animation. This transform node either doesn't exist or is not animated. ${msg}`\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n // Look for the position animation + target node of the root node name (generally the hips) in the retargeted animation\r\n let targetRootPositionAnimation: Animation | undefined;\r\n let targetRootTransformNode: TransformNode | undefined;\r\n\r\n for (let i = 0; i < animationGroup.targetedAnimations.length; ++i) {\r\n const ta = animationGroup.targetedAnimations[i];\r\n const target = ta.target;\r\n const animation = ta.animation;\r\n\r\n if (target.name === remappedRootNodeName && animation.targetProperty === \"position\") {\r\n targetRootPositionAnimation = animation;\r\n targetRootTransformNode = ta.target;\r\n break;\r\n }\r\n }\r\n\r\n if (!targetRootPositionAnimation || !targetRootTransformNode) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroup.name}': unable to find a \"position\" animation for the node \"${remappedRootNodeName}\". ${msg}`\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n const targetGroundReferenceTransformNode = this.findBone(remappedGroundReferenceNodeName)?._linkedTransformNode!;\r\n\r\n if (!targetGroundReferenceTransformNode) {\r\n if (this.showWarnings) {\r\n Logger.Warn(\r\n `RetargetAnimationGroup - Avatar '${this.name}', AnimationGroup '${animationGroup.name}': unable to find the transform node corresponding to the bone \"${remappedGroundReferenceNodeName}\" in the avatar skeleton. Ensure that this bone exists and is linked to a transform node. ${msg}`\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n sourceRootTransformNode.computeWorldMatrix(true);\r\n sourceGroundReferenceTransformNode.computeWorldMatrix(true);\r\n\r\n // Determine the vertical axis\r\n const sourceRootGroundReferenceDiff = sourceRootTransformNode.getAbsolutePosition().subtract(sourceGroundReferenceTransformNode.getAbsolutePosition());\r\n\r\n let verticalAxis = 0;\r\n\r\n if (groundReferenceVerticalAxis) {\r\n switch (groundReferenceVerticalAxis) {\r\n case \"Y\":\r\n verticalAxis = 1;\r\n break;\r\n case \"Z\":\r\n verticalAxis = 2;\r\n break;\r\n }\r\n } else {\r\n // No axis provided: assume the vertical axis is the one with the larger difference between the reference and the ground reference transform nodes\r\n if (Math.abs(sourceRootGroundReferenceDiff.y) > Math.abs(sourceRootGroundReferenceDiff.x)) {\r\n verticalAxis = 1;\r\n }\r\n if (Math.abs(sourceRootGroundReferenceDiff.z) > Math.abs(sourceRootGroundReferenceDiff.y)) {\r\n verticalAxis = 2;\r\n }\r\n }\r\n\r\n const targetRootGroundReferenceDiff = targetRootTransformNode.getAbsolutePosition().subtract(targetGroundReferenceTransformNode.getAbsolutePosition());\r\n\r\n return {\r\n verticalAxis,\r\n sourceRootTransformNode,\r\n sourceGroundReferenceTransformNode,\r\n targetRootTransformNode,\r\n targetRootPositionAnimation,\r\n targetGroundReferenceTransformNode,\r\n proportionRatio:\r\n verticalAxis === 0\r\n ? targetRootGroundReferenceDiff.x / sourceRootGroundReferenceDiff.x\r\n : verticalAxis === 1\r\n ? targetRootGroundReferenceDiff.y / sourceRootGroundReferenceDiff.y\r\n : targetRootGroundReferenceDiff.z / sourceRootGroundReferenceDiff.z,\r\n };\r\n }\r\n\r\n private _resetStates(sourceTransformNodeNameToNode: TransformNodeNameToNode) {\r\n this.skeletons.forEach((skeleton) => skeleton.returnToRest());\r\n\r\n sourceTransformNodeNameToNode.forEach((data) => {\r\n const { node, initialTransformations } = data;\r\n node.position = initialTransformations.position;\r\n node.scaling = initialTransformations.scaling;\r\n node.rotationQuaternion = initialTransformations.quaternion;\r\n node.computeWorldMatrix(true);\r\n });\r\n }\r\n\r\n private _fixRootPosition(\r\n sourceAnimationGroup: AnimationGroup,\r\n animationGroup: AnimationGroup,\r\n sourceRootTransformNode: TransformNode,\r\n targetRootTransformNode: TransformNode,\r\n targetRootPositionAnimation: Animation,\r\n proportionRatio: number\r\n ) {\r\n const targetNodeInverseParentWorldMatrix = targetRootTransformNode.parent?.getWorldMatrix().invertToRef(TmpVectors.Matrix[0]) ?? Matrix.IdentityReadOnly;\r\n\r\n sourceRootTransformNode.computeWorldMatrix(true);\r\n targetRootTransformNode.computeWorldMatrix(true);\r\n\r\n const sourceWorldPosition = sourceRootTransformNode.absolutePosition.clone();\r\n const targetWorldPosition = targetRootTransformNode.absolutePosition.clone();\r\n\r\n sourceAnimationGroup.play(false);\r\n animationGroup.play(false);\r\n\r\n // Loop over the position animation of the root transform node\r\n for (const key of targetRootPositionAnimation.getKeys()) {\r\n const frame = key.frame;\r\n\r\n // Advance the source and retargeted animations to this frame\r\n sourceAnimationGroup.goToFrame(frame);\r\n sourceAnimationGroup.pause();\r\n\r\n animationGroup.goToFrame(frame);\r\n animationGroup.pause();\r\n\r\n sourceRootTransformNode.computeWorldMatrix(true);\r\n\r\n const offset = sourceRootTransformNode.absolutePosition.subtractToRef(sourceWorldPosition, TmpVectors.Vector3[0]);\r\n\r\n offset.scaleInPlace(proportionRatio);\r\n offset.addInPlace(targetWorldPosition);\r\n\r\n Vector3.TransformNormalToRef(offset, targetNodeInverseParentWorldMatrix, key.value);\r\n }\r\n\r\n sourceAnimationGroup.stop();\r\n animationGroup.stop();\r\n }\r\n\r\n private _fixGroundReference(\r\n sourceAnimationGroup: AnimationGroup,\r\n animationGroup: AnimationGroup,\r\n verticalAxis: number,\r\n targetRootTransformNode: TransformNode,\r\n targetRootPositionAnimation: Animation,\r\n sourceGroundReferenceTransformNode: TransformNode,\r\n targetGroundReferenceTransformNode: TransformNode\r\n ) {\r\n const targetNodeInverseParentWorldMatrix = targetRootTransformNode.parent?.getWorldMatrix().invertToRef(TmpVectors.Matrix[0]) ?? Matrix.IdentityReadOnly;\r\n\r\n sourceAnimationGroup.play(false);\r\n animationGroup.play(false);\r\n\r\n // Loop over the position animation of the root transform node\r\n for (const key of targetRootPositionAnimation.getKeys()) {\r\n const frame = key.frame;\r\n\r\n // Advance the source and retargeted animations to this frame\r\n sourceAnimationGroup.goToFrame(frame);\r\n sourceAnimationGroup.pause();\r\n\r\n animationGroup.goToFrame(frame);\r\n animationGroup.pause();\r\n\r\n sourceGroundReferenceTransformNode.computeWorldMatrix(true);\r\n targetGroundReferenceTransformNode.computeWorldMatrix(true);\r\n\r\n // Calculate the offset to apply to the root position in the target to have the ground reference at the same height in the source and target animations\r\n const diffGroundReferences = targetGroundReferenceTransformNode.absolutePosition.subtractToRef(\r\n sourceGroundReferenceTransformNode.absolutePosition,\r\n TmpVectors.Vector3[0]\r\n );\r\n\r\n const offset = verticalAxis === 0 ? diffGroundReferences.x : verticalAxis === 1 ? diffGroundReferences.y : diffGroundReferences.z;\r\n\r\n const localOffset = Vector3.TransformNormalToRef(\r\n new Vector3(verticalAxis === 0 ? offset : 0, verticalAxis === 1 ? offset : 0, verticalAxis === 2 ? offset : 0),\r\n targetNodeInverseParentWorldMatrix,\r\n TmpVectors.Vector3[1]\r\n );\r\n\r\n key.value.subtractInPlace(localOffset);\r\n }\r\n\r\n sourceAnimationGroup.stop();\r\n animationGroup.stop();\r\n }\r\n}\r\n"]}
|
package/Animations/index.d.ts
CHANGED
package/Animations/index.js
CHANGED
package/Animations/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC","sourcesContent":["export * from \"./animatable\";\r\nexport * from \"./animation\";\r\nexport * from \"./animationPropertiesOverride\";\r\nexport * from \"./easing\";\r\nexport * from \"./runtimeAnimation\";\r\nexport * from \"./animationEvent\";\r\nexport * from \"./animationGroup\";\r\nexport * from \"./animationKey\";\r\nexport * from \"./animationRange\";\r\nexport * from \"./animatable.interface\";\r\nexport * from \"./pathCursor\";\r\nexport * from \"./animationGroupMask\";\r\nexport * from \"./animation.optimizations\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Animations/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC","sourcesContent":["export * from \"./animatable\";\r\nexport * from \"./animation\";\r\nexport * from \"./animationPropertiesOverride\";\r\nexport * from \"./easing\";\r\nexport * from \"./runtimeAnimation\";\r\nexport * from \"./animationEvent\";\r\nexport * from \"./animationGroup\";\r\nexport * from \"./animationKey\";\r\nexport * from \"./animationRange\";\r\nexport * from \"./animatable.interface\";\r\nexport * from \"./pathCursor\";\r\nexport * from \"./animationGroupMask\";\r\nexport * from \"./animation.optimizations\";\r\nexport * from \"./animatorAvatar\";\r\n"]}
|
|
@@ -10,7 +10,7 @@ import type { IWebAudioInNode } from "./webAudioNode.js";
|
|
|
10
10
|
export declare class _WebAudioSoundSource extends AbstractSoundSource {
|
|
11
11
|
private _stereo;
|
|
12
12
|
protected _subGraph: _WebAudioBusAndSoundSubGraph;
|
|
13
|
-
protected _webAudioNode: AudioNode
|
|
13
|
+
protected _webAudioNode: Nullable<AudioNode>;
|
|
14
14
|
/** @internal */
|
|
15
15
|
_audioContext: AudioContext | OfflineAudioContext;
|
|
16
16
|
/** @internal */
|
|
@@ -20,7 +20,7 @@ export declare class _WebAudioSoundSource extends AbstractSoundSource {
|
|
|
20
20
|
/** @internal */
|
|
21
21
|
_initAsync(options: Partial<ISoundSourceOptions>): Promise<void>;
|
|
22
22
|
/** @internal */
|
|
23
|
-
get _inNode(): AudioNode
|
|
23
|
+
get _inNode(): Nullable<AudioNode>;
|
|
24
24
|
/** @internal */
|
|
25
25
|
get _outNode(): Nullable<AudioNode>;
|
|
26
26
|
/** @internal */
|
|
@@ -9,6 +9,7 @@ export class _WebAudioSoundSource extends AbstractSoundSource {
|
|
|
9
9
|
constructor(name, webAudioNode, engine, options) {
|
|
10
10
|
super(name, engine, options);
|
|
11
11
|
this._stereo = null;
|
|
12
|
+
this._webAudioNode = null;
|
|
12
13
|
this._audioContext = this.engine._audioContext;
|
|
13
14
|
this._webAudioNode = webAudioNode;
|
|
14
15
|
this._subGraph = new _WebAudioSoundSource._SubGraph(this);
|
|
@@ -43,6 +44,15 @@ export class _WebAudioSoundSource extends AbstractSoundSource {
|
|
|
43
44
|
/** @internal */
|
|
44
45
|
dispose() {
|
|
45
46
|
super.dispose();
|
|
47
|
+
if (this._webAudioNode) {
|
|
48
|
+
if (this._webAudioNode instanceof MediaStreamAudioSourceNode) {
|
|
49
|
+
for (const track of this._webAudioNode.mediaStream.getTracks()) {
|
|
50
|
+
track.stop();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
this._webAudioNode.disconnect();
|
|
54
|
+
this._webAudioNode = null;
|
|
55
|
+
}
|
|
46
56
|
this._stereo = null;
|
|
47
57
|
this._subGraph.dispose();
|
|
48
58
|
this.engine._removeNode(this);
|
|
@@ -85,9 +95,9 @@ _WebAudioSoundSource._SubGraph = class extends _WebAudioBusAndSoundSubGraph {
|
|
|
85
95
|
}
|
|
86
96
|
_onSubNodesChanged() {
|
|
87
97
|
super._onSubNodesChanged();
|
|
88
|
-
this._owner._inNode
|
|
98
|
+
this._owner._inNode?.disconnect();
|
|
89
99
|
if (this._owner._subGraph._inNode) {
|
|
90
|
-
this._owner._inNode
|
|
100
|
+
this._owner._inNode?.connect(this._owner._subGraph._inNode);
|
|
91
101
|
}
|
|
92
102
|
}
|
|
93
103
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webAudioSoundSource.js","sourceRoot":"","sources":["../../../../../dev/core/src/AudioV2/webAudio/webAudioSoundSource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,gBAAgB;AAChB,MAAM,OAAO,oBAAqB,SAAQ,mBAAmB;IAYzD,gBAAgB;IAChB,YAAmB,IAAY,EAAE,YAAuB,EAAE,MAAuB,EAAE,OAAqC;QACpH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAbzB,YAAO,GAA2B,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"webAudioSoundSource.js","sourceRoot":"","sources":["../../../../../dev/core/src/AudioV2/webAudio/webAudioSoundSource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE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C,WAAW,CAAC,IAAI,CAAC,CAAC;QAE7C,IAAI,CAAC,YAAY,EAAE,CAAC;YAChB,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAEkB,sBAAsB,CAAC,UAAmB,EAAE,aAAqB;QAChF,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IAC3E,CAAC;;AAEc,8BAAS,GAAG,KAAM,SAAQ,4BAA4B;IAGjE,IAAc,gBAAgB;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,IAAI,IAAI,CAAC;IAChD,CAAC;IAED,IAAc,cAAc;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC;IAC9C,CAAC;IAEkB,kBAAkB;QACjC,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAE3B,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;QAElC,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;YAChC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;CACJ,AApBuB,CAoBtB","sourcesContent":["import type { Nullable } from \"../../types\";\nimport type { AbstractAudioNode } from \"../abstractAudio/abstractAudioNode\";\nimport type { ISoundSourceOptions } from \"../abstractAudio/abstractSoundSource\";\nimport { AbstractSoundSource } from \"../abstractAudio/abstractSoundSource\";\nimport type { AbstractSpatialAudio } from \"../abstractAudio/subProperties/abstractSpatialAudio\";\nimport { _HasSpatialAudioOptions } from \"../abstractAudio/subProperties/abstractSpatialAudio\";\nimport { _StereoAudio } from \"../abstractAudio/subProperties/stereoAudio\";\nimport { _WebAudioBusAndSoundSubGraph } from \"./subNodes/webAudioBusAndSoundSubGraph\";\nimport { _SpatialWebAudio } from \"./subProperties/spatialWebAudio\";\nimport type { _WebAudioEngine } from \"./webAudioEngine\";\nimport type { IWebAudioInNode } from \"./webAudioNode\";\n\n/** @internal */\nexport class _WebAudioSoundSource extends AbstractSoundSource {\n private _stereo: Nullable<_StereoAudio> = null;\n\n protected _subGraph: _WebAudioBusAndSoundSubGraph;\n protected _webAudioNode: Nullable<AudioNode> = null;\n\n /** @internal */\n public _audioContext: AudioContext | OfflineAudioContext;\n\n /** @internal */\n public override readonly engine: _WebAudioEngine;\n\n /** @internal */\n public constructor(name: string, webAudioNode: AudioNode, engine: _WebAudioEngine, options: Partial<ISoundSourceOptions>) {\n super(name, engine, options);\n\n this._audioContext = this.engine._audioContext;\n this._webAudioNode = webAudioNode;\n\n this._subGraph = new _WebAudioSoundSource._SubGraph(this);\n }\n\n /** @internal */\n public async _initAsync(options: Partial<ISoundSourceOptions>): Promise<void> {\n if (options.outBus) {\n this.outBus = options.outBus;\n } else if (options.outBusAutoDefault !== false) {\n await this.engine.isReadyPromise;\n this.outBus = this.engine.defaultMainBus;\n }\n\n await this._subGraph.initAsync(options);\n\n if (_HasSpatialAudioOptions(options)) {\n this._initSpatialProperty();\n }\n\n this.engine._addNode(this);\n }\n\n /** @internal */\n public get _inNode() {\n return this._webAudioNode;\n }\n\n /** @internal */\n public get _outNode() {\n return this._subGraph._outNode;\n }\n\n /** @internal */\n public override get stereo(): _StereoAudio {\n return this._stereo ?? (this._stereo = new _StereoAudio(this._subGraph));\n }\n\n /** @internal */\n public override dispose(): void {\n super.dispose();\n\n if (this._webAudioNode) {\n if (this._webAudioNode instanceof MediaStreamAudioSourceNode) {\n for (const track of this._webAudioNode.mediaStream.getTracks()) {\n track.stop();\n }\n }\n\n this._webAudioNode.disconnect();\n this._webAudioNode = null;\n }\n\n this._stereo = null;\n\n this._subGraph.dispose();\n\n this.engine._removeNode(this);\n }\n\n /** @internal */\n public getClassName(): string {\n return \"_WebAudioSoundSource\";\n }\n\n protected override _connect(node: IWebAudioInNode): boolean {\n const connected = super._connect(node);\n\n if (!connected) {\n return false;\n }\n\n // If the wrapped node is not available now, it will be connected later by the subgraph.\n if (node._inNode) {\n this._outNode?.connect(node._inNode);\n }\n\n return true;\n }\n\n protected override _disconnect(node: IWebAudioInNode): boolean {\n const disconnected = super._disconnect(node);\n\n if (!disconnected) {\n return false;\n }\n\n if (node._inNode) {\n this._outNode?.disconnect(node._inNode);\n }\n\n return true;\n }\n\n protected override _createSpatialProperty(autoUpdate: boolean, minUpdateTime: number): AbstractSpatialAudio {\n return new _SpatialWebAudio(this._subGraph, autoUpdate, minUpdateTime);\n }\n\n private static _SubGraph = class extends _WebAudioBusAndSoundSubGraph {\n protected override _owner: _WebAudioSoundSource;\n\n protected get _downstreamNodes(): Nullable<Set<AbstractAudioNode>> {\n return this._owner._downstreamNodes ?? null;\n }\n\n protected get _upstreamNodes(): Nullable<Set<AbstractAudioNode>> {\n return this._owner._upstreamNodes ?? null;\n }\n\n protected override _onSubNodesChanged(): void {\n super._onSubNodesChanged();\n\n this._owner._inNode?.disconnect();\n\n if (this._owner._subGraph._inNode) {\n this._owner._inNode?.connect(this._owner._subGraph._inNode);\n }\n }\n };\n}\n"]}
|
package/Bones/index.d.ts
CHANGED
package/Bones/index.js
CHANGED
package/Bones/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Bones/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC","sourcesContent":["export * from \"./bone\";\r\nexport * from \"./boneIKController\";\r\nexport * from \"./boneLookController\";\r\nexport * from \"./skeleton\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Bones/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC","sourcesContent":["export * from \"./bone\";\r\nexport * from \"./boneIKController\";\r\nexport * from \"./boneLookController\";\r\nexport * from \"./skeleton\";\r\nexport * from \"./skeleton.functions\";\r\n"]}
|
package/Bones/skeleton.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { AnimationRange } from "../Animations/animationRange.js";
|
|
|
12
12
|
import type { IInspectable } from "../Misc/iInspectable.js";
|
|
13
13
|
import type { IAnimatable } from "../Animations/animatable.interface.js";
|
|
14
14
|
import type { IAssetContainer } from "../IAssetContainer.js";
|
|
15
|
+
import type { TransformNode } from "../Meshes/transformNode.js";
|
|
15
16
|
/**
|
|
16
17
|
* Class used to handle skinning animations
|
|
17
18
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
|
|
@@ -144,6 +145,18 @@ export declare class Skeleton implements IAnimatable {
|
|
|
144
145
|
* @returns the indice of the bone. Returns -1 if not found
|
|
145
146
|
*/
|
|
146
147
|
getBoneIndexByName(name: string): number;
|
|
148
|
+
/**
|
|
149
|
+
* Finds a bone in a skeleton that is linked to the given transform node.
|
|
150
|
+
* @param transformNode The transform node to find the bone for
|
|
151
|
+
* @returns The bone linked to the transform node, or null if not found
|
|
152
|
+
*/
|
|
153
|
+
findBoneFromLinkedTransformNode(transformNode: TransformNode): Bone | null;
|
|
154
|
+
/**
|
|
155
|
+
* Finds a bone in a skeleton by the name of its linked transform node.
|
|
156
|
+
* @param name The name of the linked transform node
|
|
157
|
+
* @returns The bone linked to the transform node with the given name, or null if not found
|
|
158
|
+
*/
|
|
159
|
+
findBoneFromLinkedTransformNodeName(name: string): Bone | null;
|
|
147
160
|
/**
|
|
148
161
|
* Create a new animation range
|
|
149
162
|
* @param name defines the name of the range
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Scene } from "../scene.js";
|
|
2
|
+
import type { TransformNode } from "../Meshes/transformNode.js";
|
|
3
|
+
import { Mesh } from "../Meshes/mesh.js";
|
|
4
|
+
import { Skeleton } from "./skeleton.js";
|
|
5
|
+
/**
|
|
6
|
+
* Creates a skeleton from a hierarchy of transform nodes by converting each node into a bone.
|
|
7
|
+
* Each transform node in the hierarchy will be linked to its corresponding bone, allowing the skeleton
|
|
8
|
+
* to be driven by the transform node transformations.
|
|
9
|
+
* @param rootNode The root transform node of the hierarchy to convert into a skeleton
|
|
10
|
+
* @param scene The scene in which to create the skeleton
|
|
11
|
+
* @param options Optional parameters for skeleton creation
|
|
12
|
+
* - name: The name for the created skeleton (defaults to rootNode.name + "_skeleton")
|
|
13
|
+
* - boneMeshSize: The diameter of the sphere mesh created for each bone (defaults to 1, only used if createMesh is true)
|
|
14
|
+
* - createMesh: If true, creates a mesh with spheres at each bone location for visualization purposes.
|
|
15
|
+
* The mesh will be parented to the rootNode's parent and returned through options.mesh
|
|
16
|
+
* - mesh: An existing mesh to attach the skeleton to. If provided, the skeleton will be assigned to this mesh
|
|
17
|
+
* @returns A new skeleton with bones corresponding to the transform node hierarchy
|
|
18
|
+
* @remarks
|
|
19
|
+
* - Only transform nodes with a rotationQuaternion property will be converted into bones
|
|
20
|
+
*/
|
|
21
|
+
export declare function CreateSkeletonFromTransformNodeHierarchy(rootNode: TransformNode, scene: Scene, options?: {
|
|
22
|
+
name?: string;
|
|
23
|
+
boneMeshSize?: number;
|
|
24
|
+
createMesh?: boolean;
|
|
25
|
+
mesh?: Mesh;
|
|
26
|
+
}): Skeleton;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Bone } from "./bone.js";
|
|
2
|
+
import { Matrix } from "../Maths/math.vector.js";
|
|
3
|
+
import { Mesh } from "../Meshes/mesh.js";
|
|
4
|
+
import { MeshBuilder } from "../Meshes/meshBuilder.js";
|
|
5
|
+
import { VertexBuffer } from "../Buffers/buffer.js";
|
|
6
|
+
import { Skeleton } from "./skeleton.js";
|
|
7
|
+
/**
|
|
8
|
+
* Creates a skeleton from a hierarchy of transform nodes by converting each node into a bone.
|
|
9
|
+
* Each transform node in the hierarchy will be linked to its corresponding bone, allowing the skeleton
|
|
10
|
+
* to be driven by the transform node transformations.
|
|
11
|
+
* @param rootNode The root transform node of the hierarchy to convert into a skeleton
|
|
12
|
+
* @param scene The scene in which to create the skeleton
|
|
13
|
+
* @param options Optional parameters for skeleton creation
|
|
14
|
+
* - name: The name for the created skeleton (defaults to rootNode.name + "_skeleton")
|
|
15
|
+
* - boneMeshSize: The diameter of the sphere mesh created for each bone (defaults to 1, only used if createMesh is true)
|
|
16
|
+
* - createMesh: If true, creates a mesh with spheres at each bone location for visualization purposes.
|
|
17
|
+
* The mesh will be parented to the rootNode's parent and returned through options.mesh
|
|
18
|
+
* - mesh: An existing mesh to attach the skeleton to. If provided, the skeleton will be assigned to this mesh
|
|
19
|
+
* @returns A new skeleton with bones corresponding to the transform node hierarchy
|
|
20
|
+
* @remarks
|
|
21
|
+
* - Only transform nodes with a rotationQuaternion property will be converted into bones
|
|
22
|
+
*/
|
|
23
|
+
export function CreateSkeletonFromTransformNodeHierarchy(rootNode, scene, options) {
|
|
24
|
+
const name = options?.name || rootNode.name + "_skeleton";
|
|
25
|
+
const skeleton = new Skeleton(name, name, scene);
|
|
26
|
+
const nodes = rootNode.getChildTransformNodes(false);
|
|
27
|
+
nodes.unshift(rootNode);
|
|
28
|
+
let mesh = options?.mesh || null;
|
|
29
|
+
if (options?.createMesh) {
|
|
30
|
+
mesh = new Mesh(`${name}_mesh`, scene);
|
|
31
|
+
mesh.parent = rootNode.parent;
|
|
32
|
+
mesh.skeleton = skeleton;
|
|
33
|
+
options.mesh = mesh;
|
|
34
|
+
}
|
|
35
|
+
else if (mesh) {
|
|
36
|
+
mesh.skeleton = skeleton;
|
|
37
|
+
}
|
|
38
|
+
const positions = [];
|
|
39
|
+
const indices = [];
|
|
40
|
+
const normals = [];
|
|
41
|
+
const boneIndices = [];
|
|
42
|
+
const boneWeights = [];
|
|
43
|
+
const boneMesh = options?.createMesh ? MeshBuilder.CreateSphere("dummy", { diameter: options?.boneMeshSize || 1, segments: 8 }, scene) : null;
|
|
44
|
+
const boneMeshNumVertices = boneMesh?.getTotalVertices() || 0;
|
|
45
|
+
const boneMeshPositions = boneMesh?.getVerticesData(VertexBuffer.PositionKind);
|
|
46
|
+
const boneMeshIndices = boneMesh?.getIndices();
|
|
47
|
+
const boneMeshNormals = boneMesh?.getVerticesData(VertexBuffer.NormalKind);
|
|
48
|
+
const mapNameToBone = {};
|
|
49
|
+
for (const node of nodes) {
|
|
50
|
+
if (!node.rotationQuaternion || node.getClassName() !== "TransformNode") {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const currentVertexIndex = positions.length / 3;
|
|
54
|
+
if (boneMeshPositions) {
|
|
55
|
+
for (let i = 0; i < boneMeshPositions.length; ++i) {
|
|
56
|
+
positions.push(boneMeshPositions[i]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (boneMeshNormals) {
|
|
60
|
+
for (let i = 0; i < boneMeshNormals.length; ++i) {
|
|
61
|
+
normals.push(boneMeshNormals[i]);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const boneIndex = skeleton.bones.length;
|
|
65
|
+
if (boneMesh) {
|
|
66
|
+
for (let i = 0; i < boneMeshNumVertices; ++i) {
|
|
67
|
+
boneIndices.push(boneIndex, -1, -1, -1);
|
|
68
|
+
boneWeights.push(1, 0, 0, 0);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (boneMeshIndices) {
|
|
72
|
+
for (let i = 0; i < boneMeshIndices.length; ++i) {
|
|
73
|
+
indices.push(currentVertexIndex + boneMeshIndices[i]);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const bone = new Bone(node.name, skeleton, node.parent ? mapNameToBone[node.parent.name] : null, Matrix.Compose(node.scaling, node.rotationQuaternion, node.position), // local matrix
|
|
77
|
+
undefined, Matrix.Identity() // bind matrix
|
|
78
|
+
);
|
|
79
|
+
bone.linkTransformNode(node);
|
|
80
|
+
mapNameToBone[node.name] = bone;
|
|
81
|
+
}
|
|
82
|
+
mesh?.setVerticesData(VertexBuffer.PositionKind, positions);
|
|
83
|
+
mesh?.setVerticesData(VertexBuffer.NormalKind, normals);
|
|
84
|
+
mesh?.setVerticesData(VertexBuffer.MatricesIndicesKind, boneIndices);
|
|
85
|
+
mesh?.setVerticesData(VertexBuffer.MatricesWeightsKind, boneWeights);
|
|
86
|
+
mesh?.setIndices(indices);
|
|
87
|
+
mesh?.refreshBoundingInfo(true, false);
|
|
88
|
+
boneMesh?.dispose();
|
|
89
|
+
return skeleton;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=skeleton.functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.functions.js","sourceRoot":"","sources":["../../../../dev/core/src/Bones/skeleton.functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,IAAI,EAAE,0BAAyB;AACxC,OAAO,EAAE,WAAW,EAAE,iCAAgC;AACtD,OAAO,EAAE,YAAY,EAAE,6BAA4B;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,wCAAwC,CACpD,QAAuB,EACvB,KAAY,EACZ,OAAqF;IAErF,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,QAAQ,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1D,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,IAAI,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AAG,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;gBAC9C,OAAO,CAAC,IAAI,CAAC,kBAAkB,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1D,CAAC;QACL,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,IAAI,CACjB,IAAI,CAAC,IAAI,EACT,QAAQ,EACR,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EACpD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,eAAe;QACrF,SAAS,EACT,MAAM,CAAC,QAAQ,EAAE,CAAC,cAAc;SACnC,CAAC;QAEF,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAE7B,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACpC,CAAC;IAED,IAAI,EAAE,eAAe,CAAC,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAC5D,IAAI,EAAE,eAAe,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACxD,IAAI,EAAE,eAAe,CAAC,YAAY,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IACrE,IAAI,EAAE,eAAe,CAAC,YAAY,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IACrE,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAE1B,IAAI,EAAE,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAEvC,QAAQ,EAAE,OAAO,EAAE,CAAC;IAEpB,OAAO,QAAQ,CAAC;AACpB,CAAC","sourcesContent":["import { Bone } from \"./bone\";\r\nimport { Matrix } from \"../Maths/math.vector\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { Mesh } from \"core/Meshes/mesh\";\r\nimport { MeshBuilder } from \"core/Meshes/meshBuilder\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport { Skeleton } from \"./skeleton\";\r\n\r\n/**\r\n * Creates a skeleton from a hierarchy of transform nodes by converting each node into a bone.\r\n * Each transform node in the hierarchy will be linked to its corresponding bone, allowing the skeleton\r\n * to be driven by the transform node transformations.\r\n * @param rootNode The root transform node of the hierarchy to convert into a skeleton\r\n * @param scene The scene in which to create the skeleton\r\n * @param options Optional parameters for skeleton creation\r\n * - name: The name for the created skeleton (defaults to rootNode.name + \"_skeleton\")\r\n * - boneMeshSize: The diameter of the sphere mesh created for each bone (defaults to 1, only used if createMesh is true)\r\n * - createMesh: If true, creates a mesh with spheres at each bone location for visualization purposes.\r\n * The mesh will be parented to the rootNode's parent and returned through options.mesh\r\n * - mesh: An existing mesh to attach the skeleton to. If provided, the skeleton will be assigned to this mesh\r\n * @returns A new skeleton with bones corresponding to the transform node hierarchy\r\n * @remarks\r\n * - Only transform nodes with a rotationQuaternion property will be converted into bones\r\n */\r\nexport function CreateSkeletonFromTransformNodeHierarchy(\r\n rootNode: TransformNode,\r\n scene: Scene,\r\n options?: { name?: string; boneMeshSize?: number; createMesh?: boolean; mesh?: Mesh }\r\n): Skeleton {\r\n const name = options?.name || rootNode.name + \"_skeleton\";\r\n const skeleton = new Skeleton(name, name, scene);\r\n\r\n const nodes = rootNode.getChildTransformNodes(false);\r\n\r\n nodes.unshift(rootNode);\r\n\r\n let mesh = options?.mesh || null;\r\n if (options?.createMesh) {\r\n mesh = new Mesh(`${name}_mesh`, scene);\r\n mesh.parent = rootNode.parent;\r\n mesh.skeleton = skeleton;\r\n\r\n options.mesh = mesh;\r\n } else if (mesh) {\r\n mesh.skeleton = skeleton;\r\n }\r\n\r\n const positions: number[] = [];\r\n const indices: number[] = [];\r\n const normals: number[] = [];\r\n const boneIndices: number[] = [];\r\n const boneWeights: number[] = [];\r\n\r\n const boneMesh = options?.createMesh ? MeshBuilder.CreateSphere(\"dummy\", { diameter: options?.boneMeshSize || 1, segments: 8 }, scene) : null;\r\n\r\n const boneMeshNumVertices = boneMesh?.getTotalVertices() || 0;\r\n const boneMeshPositions = boneMesh?.getVerticesData(VertexBuffer.PositionKind);\r\n const boneMeshIndices = boneMesh?.getIndices();\r\n const boneMeshNormals = boneMesh?.getVerticesData(VertexBuffer.NormalKind);\r\n\r\n const mapNameToBone: { [name: string]: Bone } = {};\r\n\r\n for (const node of nodes) {\r\n if (!node.rotationQuaternion || node.getClassName() !== \"TransformNode\") {\r\n continue;\r\n }\r\n\r\n const currentVertexIndex = positions.length / 3;\r\n\r\n if (boneMeshPositions) {\r\n for (let i = 0; i < boneMeshPositions.length; ++i) {\r\n positions.push(boneMeshPositions[i]);\r\n }\r\n }\r\n if (boneMeshNormals) {\r\n for (let i = 0; i < boneMeshNormals.length; ++i) {\r\n normals.push(boneMeshNormals[i]);\r\n }\r\n }\r\n\r\n const boneIndex = skeleton.bones.length;\r\n\r\n if (boneMesh) {\r\n for (let i = 0; i < boneMeshNumVertices; ++i) {\r\n boneIndices.push(boneIndex, -1, -1, -1);\r\n boneWeights.push(1, 0, 0, 0);\r\n }\r\n }\r\n\r\n if (boneMeshIndices) {\r\n for (let i = 0; i < boneMeshIndices.length; ++i) {\r\n indices.push(currentVertexIndex + boneMeshIndices[i]);\r\n }\r\n }\r\n\r\n const bone = new Bone(\r\n node.name,\r\n skeleton,\r\n node.parent ? mapNameToBone[node.parent.name] : null,\r\n Matrix.Compose(node.scaling, node.rotationQuaternion, node.position), // local matrix\r\n undefined,\r\n Matrix.Identity() // bind matrix\r\n );\r\n\r\n bone.linkTransformNode(node);\r\n\r\n mapNameToBone[node.name] = bone;\r\n }\r\n\r\n mesh?.setVerticesData(VertexBuffer.PositionKind, positions);\r\n mesh?.setVerticesData(VertexBuffer.NormalKind, normals);\r\n mesh?.setVerticesData(VertexBuffer.MatricesIndicesKind, boneIndices);\r\n mesh?.setVerticesData(VertexBuffer.MatricesWeightsKind, boneWeights);\r\n mesh?.setIndices(indices);\r\n\r\n mesh?.refreshBoundingInfo(true, false);\r\n\r\n boneMesh?.dispose();\r\n\r\n return skeleton;\r\n}\r\n"]}
|
package/Bones/skeleton.js
CHANGED
|
@@ -196,6 +196,32 @@ export class Skeleton {
|
|
|
196
196
|
}
|
|
197
197
|
return -1;
|
|
198
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Finds a bone in a skeleton that is linked to the given transform node.
|
|
201
|
+
* @param transformNode The transform node to find the bone for
|
|
202
|
+
* @returns The bone linked to the transform node, or null if not found
|
|
203
|
+
*/
|
|
204
|
+
findBoneFromLinkedTransformNode(transformNode) {
|
|
205
|
+
for (const bone of this.bones) {
|
|
206
|
+
if (bone._linkedTransformNode === transformNode) {
|
|
207
|
+
return bone;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return null;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Finds a bone in a skeleton by the name of its linked transform node.
|
|
214
|
+
* @param name The name of the linked transform node
|
|
215
|
+
* @returns The bone linked to the transform node with the given name, or null if not found
|
|
216
|
+
*/
|
|
217
|
+
findBoneFromLinkedTransformNodeName(name) {
|
|
218
|
+
for (const bone of this.bones) {
|
|
219
|
+
if (bone._linkedTransformNode && bone._linkedTransformNode.name === name) {
|
|
220
|
+
return bone;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
199
225
|
/**
|
|
200
226
|
* Create a new animation range
|
|
201
227
|
* @param name defines the name of the range
|