@babylonjs/core 5.22.1 → 5.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Actions/abstractActionManager.d.ts +6 -6
- package/Actions/abstractActionManager.js +1 -1
- package/Actions/abstractActionManager.js.map +1 -1
- package/Actions/actionManager.d.ts +5 -5
- package/Actions/actionManager.js +5 -5
- package/Actions/actionManager.js.map +1 -1
- package/Animations/animatable.js +2 -1
- package/Animations/animatable.js.map +1 -1
- package/Animations/animation.js +137 -139
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.d.ts +3 -3
- package/Animations/animationGroup.js +3 -3
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/runtimeAnimation.js +6 -7
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioSceneComponent.d.ts +1 -1
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.d.ts +2 -1
- package/Audio/sound.js +21 -9
- package/Audio/sound.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.d.ts +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Cameras/bouncingBehavior.d.ts +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
- package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
- package/Behaviors/Cameras/framingBehavior.js +1 -1
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Bones/bone.d.ts +1 -1
- package/Bones/bone.js +1 -1
- package/Bones/bone.js.map +1 -1
- package/Bones/skeleton.d.ts +2 -2
- package/Bones/skeleton.js +11 -5
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/Inputs/BaseCameraMouseWheelInput.js +3 -22
- package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js +3 -3
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +1 -11
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.js +3 -3
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/followCameraMouseWheelInput.js +1 -4
- package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +3 -3
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/arcRotateCamera.d.ts +1 -1
- package/Cameras/arcRotateCamera.js +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +2 -2
- package/Cameras/camera.js +2 -2
- package/Cameras/camera.js.map +1 -1
- package/Cameras/freeCamera.d.ts +1 -1
- package/Cameras/freeCamera.js +1 -1
- package/Cameras/freeCamera.js.map +1 -1
- package/Cameras/gamepadCamera.d.ts +1 -1
- package/Cameras/gamepadCamera.js +1 -1
- package/Cameras/gamepadCamera.js.map +1 -1
- package/Cameras/targetCamera.d.ts +1 -1
- package/Cameras/targetCamera.js +1 -1
- package/Cameras/targetCamera.js.map +1 -1
- package/Cameras/touchCamera.d.ts +1 -1
- package/Cameras/touchCamera.js +1 -1
- package/Cameras/touchCamera.js.map +1 -1
- package/Cameras/universalCamera.d.ts +1 -1
- package/Cameras/universalCamera.js +1 -1
- package/Cameras/universalCamera.js.map +1 -1
- package/Cameras/virtualJoysticksCamera.d.ts +1 -1
- package/Cameras/virtualJoysticksCamera.js +1 -1
- package/Cameras/virtualJoysticksCamera.js.map +1 -1
- package/Culling/boundingBox.d.ts +2 -2
- package/Culling/boundingBox.js +2 -2
- package/Culling/boundingBox.js.map +1 -1
- package/Culling/ray.d.ts +1 -1
- package/Culling/ray.js +1 -1
- package/Culling/ray.js.map +1 -1
- package/Debug/debugLayer.d.ts +1 -1
- package/Debug/debugLayer.js +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js +20 -2
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +8 -10
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.query.d.ts +2 -2
- package/Engines/Extensions/engine.query.js.map +1 -1
- package/Engines/ICanvas.d.ts +11 -0
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/WebGL/webGLPipelineContext.d.ts +29 -19
- package/Engines/WebGL/webGLPipelineContext.js +99 -311
- package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/engine.d.ts +2 -2
- package/Engines/engine.js +2 -2
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +2 -2
- package/Engines/nativeEngine.js +2 -2
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +1 -0
- package/Engines/renderTargetWrapper.js +5 -2
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +6 -5
- package/Engines/thinEngine.js +11 -7
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +4 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/clipboardEvents.d.ts +1 -1
- package/Events/clipboardEvents.js +1 -1
- package/Events/clipboardEvents.js.map +1 -1
- package/Events/deviceInputEvents.d.ts +11 -4
- package/Events/deviceInputEvents.js.map +1 -1
- package/Gamepads/Controllers/windowsMotionController.d.ts +1 -1
- package/Gamepads/Controllers/windowsMotionController.js +1 -1
- package/Gamepads/Controllers/windowsMotionController.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +4 -0
- package/Gizmos/boundingBoxGizmo.js +6 -0
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +4 -4
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.d.ts +3 -3
- package/Layers/effectLayer.js +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +3 -3
- package/Layers/glowLayer.js +2 -2
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +3 -3
- package/Layers/highlightLayer.js +2 -2
- package/Layers/highlightLayer.js.map +1 -1
- package/Lights/directionalLight.d.ts +2 -2
- package/Lights/directionalLight.js +2 -2
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/hemisphericLight.d.ts +3 -3
- package/Lights/hemisphericLight.js +3 -3
- package/Lights/hemisphericLight.js.map +1 -1
- package/Lights/light.d.ts +2 -2
- package/Lights/light.js +2 -2
- package/Lights/light.js.map +1 -1
- package/Lights/lightConstants.d.ts +1 -1
- package/Lights/lightConstants.js +1 -1
- package/Lights/lightConstants.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +3 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +4 -0
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +4 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +1 -1
- package/Materials/Node/nodeMaterial.js +5 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +4 -1
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.d.ts +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.js +9 -3
- package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.d.ts +9 -9
- package/Materials/Textures/Procedurals/proceduralTexture.js +9 -9
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/colorGradingTexture.d.ts +1 -1
- package/Materials/Textures/colorGradingTexture.js +1 -1
- package/Materials/Textures/colorGradingTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.d.ts +2 -2
- package/Materials/Textures/cubeTexture.js +2 -2
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.d.ts +1 -1
- package/Materials/Textures/rawCubeTexture.js +1 -1
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +3 -5
- package/Materials/Textures/renderTargetTexture.js +19 -19
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/colorCurves.d.ts +3 -3
- package/Materials/colorCurves.js +3 -3
- package/Materials/colorCurves.js.map +1 -1
- package/Materials/effect.d.ts +27 -27
- package/Materials/effect.js +22 -288
- package/Materials/effect.js.map +1 -1
- package/Materials/fresnelParameters.d.ts +1 -1
- package/Materials/fresnelParameters.js +1 -1
- package/Materials/fresnelParameters.js.map +1 -1
- package/Materials/imageProcessingConfiguration.d.ts +4 -4
- package/Materials/imageProcessingConfiguration.js +4 -4
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +25 -25
- package/Materials/shaderMaterial.js +25 -25
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.js +4 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Maths/math.functions.d.ts +2 -2
- package/Maths/math.functions.js +2 -2
- package/Maths/math.functions.js.map +1 -1
- package/Maths/math.polar.d.ts +77 -0
- package/Maths/math.polar.js +114 -0
- package/Maths/math.polar.js.map +1 -0
- package/Maths/math.scalar.d.ts +2 -2
- package/Maths/math.scalar.js +2 -2
- package/Maths/math.scalar.js.map +1 -1
- package/Maths/math.vector.d.ts +13 -12
- package/Maths/math.vector.js +13 -12
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +1 -1
- package/Meshes/abstractMesh.js +13 -2
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +3 -3
- package/Meshes/geometry.js +3 -3
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/groundMesh.d.ts +5 -4
- package/Meshes/groundMesh.js +5 -4
- package/Meshes/groundMesh.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +1 -1
- package/Meshes/instancedMesh.js +1 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +3 -3
- package/Meshes/mesh.js +7 -3
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/subMesh.d.ts +1 -1
- package/Meshes/subMesh.js +1 -1
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.d.ts +1 -1
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Meshes/transformNode.js +6 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.d.ts +2 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/HighDynamicRange/hdr.d.ts +3 -3
- package/Misc/HighDynamicRange/hdr.js +3 -3
- package/Misc/HighDynamicRange/hdr.js.map +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.d.ts +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
- package/Misc/arrayTools.d.ts +13 -12
- package/Misc/arrayTools.js +70 -39
- package/Misc/arrayTools.js.map +1 -1
- package/Misc/assetsManager.d.ts +3 -3
- package/Misc/assetsManager.js +3 -3
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/basis.js +17 -3
- package/Misc/basis.js.map +1 -1
- package/Misc/environmentTextureTools.d.ts +4 -4
- package/Misc/environmentTextureTools.js +5 -5
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/fileTools.d.ts +3 -3
- package/Misc/fileTools.js +19 -12
- package/Misc/fileTools.js.map +1 -1
- package/Misc/logger.js +1 -1
- package/Misc/logger.js.map +1 -1
- package/Misc/observable.d.ts +1 -1
- package/Misc/observable.js +1 -1
- package/Misc/observable.js.map +1 -1
- package/Misc/performanceMonitor.d.ts +3 -3
- package/Misc/performanceMonitor.js +3 -3
- package/Misc/performanceMonitor.js.map +1 -1
- package/Misc/rgbdTextureTools.d.ts +1 -1
- package/Misc/rgbdTextureTools.js +1 -1
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/Misc/sceneOptimizer.d.ts +7 -7
- package/Misc/sceneOptimizer.js +7 -7
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/stringDictionary.d.ts +6 -6
- package/Misc/stringDictionary.js +6 -6
- package/Misc/stringDictionary.js.map +1 -1
- package/Misc/textureTools.d.ts +4 -4
- package/Misc/textureTools.js +4 -4
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.d.ts +6 -6
- package/Misc/tools.js +6 -6
- package/Misc/tools.js.map +1 -1
- package/Misc/videoRecorder.d.ts +1 -1
- package/Misc/videoRecorder.js +1 -1
- package/Misc/videoRecorder.js.map +1 -1
- package/Offline/database.js +3 -3
- package/Offline/database.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +1 -1
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +1 -1
- package/Particles/gpuParticleSystem.js +1 -1
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +1 -1
- package/Particles/particleSystem.js +1 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +4 -0
- package/Particles/solidParticleSystem.js +25 -3
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Physics/Plugins/ammoJSPlugin.d.ts +1 -1
- package/Physics/Plugins/ammoJSPlugin.js +1 -1
- package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/Plugins/oimoJSPlugin.js +1 -1
- package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
- package/Physics/physicsEngineComponent.d.ts +1 -1
- package/Physics/physicsEngineComponent.js +1 -1
- package/Physics/physicsEngineComponent.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +3 -3
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +1 -2
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +3 -3
- package/PostProcesses/blurPostProcess.js +3 -3
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +3 -3
- package/PostProcesses/volumetricLightScatteringPostProcess.js +3 -3
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/depthPeelingRenderer.d.ts +1 -0
- package/Rendering/depthPeelingRenderer.js +32 -5
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.d.ts +2 -2
- package/Rendering/edgesRenderer.js +1 -1
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +4 -2
- package/Rendering/geometryBufferRenderer.js +5 -3
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/geometryBufferRendererSceneComponent.d.ts +2 -1
- package/Rendering/geometryBufferRendererSceneComponent.js +3 -2
- package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
- package/Rendering/prePassRenderer.d.ts +11 -3
- package/Rendering/prePassRenderer.js +18 -3
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.d.ts +2 -2
- package/Rendering/subSurfaceConfiguration.js +2 -2
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Sprites/spriteSceneComponent.js +4 -1
- package/Sprites/spriteSceneComponent.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +4 -0
- package/XR/features/WebXRControllerTeleportation.js +24 -19
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.d.ts +2 -2
- package/XR/motionController/webXRAbstractMotionController.js +2 -2
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/motionController/webXRControllerComponent.d.ts +1 -1
- package/XR/motionController/webXRControllerComponent.js +1 -1
- package/XR/motionController/webXRControllerComponent.js.map +1 -1
- package/XR/motionController/webXRMotionControllerManager.d.ts +3 -3
- package/XR/motionController/webXRMotionControllerManager.js +3 -3
- package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
- package/node.d.ts +4 -4
- package/node.js +3 -3
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +0 -4
- package/scene.d.ts +80 -63
- package/scene.js +92 -46
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +1 -1
- package/sceneComponent.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webXRControllerComponent.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/XR/motionController/webXRControllerComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAoDnD;;GAEG;AACH,MAAM,OAAO,wBAAwB;IA2CjC;;;;;;;;OAQG;IACH;IACI;;OAEG;IACI,EAAU;IACjB;;OAEG;IACI,IAAmC,EAClC,eAAuB,CAAC,CAAC,EACzB,eAAyB,EAAE;QAN5B,OAAE,GAAF,EAAE,CAAQ;QAIV,SAAI,GAAJ,IAAI,CAA+B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E;4BACN,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;4BACf,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;yBAClB;qBACJ,CAAC;iBACL;gBACD,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC3D,UAAU,GAAG,IAAI,CAAC;aACrB;SACJ;QAED,IAAI,aAAa,EAAE;YACf,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,8BAA8B,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;SAC7D;QACD,IAAI,UAAU,EAAE;YACZ,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,4BAA4B,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACjE;IACL,CAAC;;AA9MD;;GAEG;AACW,oCAAW,GAAkC,QAAQ,CAAC;AACpE;;GAEG;AACW,qCAAY,GAAkC,SAAS,CAAC;AACtE;;GAEG;AACW,wCAAe,GAAkC,YAAY,CAAC;AAC5E;;GAEG;AACW,sCAAa,GAAkC,UAAU,CAAC;AACxE;;GAEG;AACW,qCAAY,GAAkC,SAAS,CAAC","sourcesContent":["import type { IMinimalMotionControllerObject, MotionControllerComponentType } from \"./webXRAbstractMotionController\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { IDisposable } from \"../../scene\";\r\n\r\n/**\r\n * X-Y values for axes in WebXR\r\n */\r\nexport interface IWebXRMotionControllerAxesValue {\r\n /**\r\n * The value of the x axis\r\n */\r\n x: number;\r\n /**\r\n * The value of the y-axis\r\n */\r\n y: number;\r\n}\r\n\r\n/**\r\n * changed / previous values for the values of this component\r\n */\r\nexport interface IWebXRMotionControllerComponentChangesValues<T> {\r\n /**\r\n * current (this frame) value\r\n */\r\n current: T;\r\n /**\r\n * previous (last change) value\r\n */\r\n previous: T;\r\n}\r\n\r\n/**\r\n * Represents changes in the component between current frame and last values recorded\r\n */\r\nexport interface IWebXRMotionControllerComponentChanges {\r\n /**\r\n * will be populated with previous and current values if axes changed\r\n */\r\n axes?: IWebXRMotionControllerComponentChangesValues<IWebXRMotionControllerAxesValue>;\r\n /**\r\n * will be populated with previous and current values if pressed changed\r\n */\r\n pressed?: IWebXRMotionControllerComponentChangesValues<boolean>;\r\n /**\r\n * will be populated with previous and current values if touched changed\r\n */\r\n touched?: IWebXRMotionControllerComponentChangesValues<boolean>;\r\n /**\r\n * will be populated with previous and current values if value changed\r\n */\r\n value?: IWebXRMotionControllerComponentChangesValues<number>;\r\n}\r\n/**\r\n * This class represents a single component (for example button or thumbstick) of a motion controller\r\n */\r\nexport class WebXRControllerComponent implements IDisposable {\r\n private _axes: IWebXRMotionControllerAxesValue = {\r\n x: 0,\r\n y: 0,\r\n };\r\n private _changes: IWebXRMotionControllerComponentChanges = {};\r\n private _currentValue: number = 0;\r\n private _hasChanges: boolean = false;\r\n private _pressed: boolean = false;\r\n private _touched: boolean = false;\r\n\r\n /**\r\n * button component type\r\n */\r\n public static BUTTON_TYPE: MotionControllerComponentType = \"button\";\r\n /**\r\n * squeeze component type\r\n */\r\n public static SQUEEZE_TYPE: MotionControllerComponentType = \"squeeze\";\r\n /**\r\n * Thumbstick component type\r\n */\r\n public static THUMBSTICK_TYPE: MotionControllerComponentType = \"thumbstick\";\r\n /**\r\n * Touchpad component type\r\n */\r\n public static TOUCHPAD_TYPE: MotionControllerComponentType = \"touchpad\";\r\n /**\r\n * trigger component type\r\n */\r\n public static TRIGGER_TYPE: MotionControllerComponentType = \"trigger\";\r\n\r\n /**\r\n * If axes are available for this component (like a touchpad or thumbstick) the observers will be notified when\r\n * the axes data changes\r\n */\r\n public onAxisValueChangedObservable: Observable<{ x: number; y: number }> = new Observable();\r\n /**\r\n * Observers registered here will be triggered when the state of a button changes\r\n * State change is either pressed / touched / value\r\n */\r\n public onButtonStateChangedObservable: Observable<WebXRControllerComponent> = new Observable();\r\n\r\n /**\r\n * Creates a new component for a motion controller.\r\n * It is created by the motion controller itself\r\n *\r\n * @param id the id of this component\r\n * @param type the type of the component\r\n * @param _buttonIndex index in the buttons array of the gamepad\r\n * @param _axesIndices indices of the values in the axes array of the gamepad\r\n */\r\n constructor(\r\n /**\r\n * the id of this component\r\n */\r\n public id: string,\r\n /**\r\n * the type of the component\r\n */\r\n public type: MotionControllerComponentType,\r\n private _buttonIndex: number = -1,\r\n private _axesIndices: number[] = []\r\n ) {}\r\n\r\n /**\r\n * The current axes data. If this component has no axes it will still return an object { x: 0, y: 0 }\r\n */\r\n public get axes(): IWebXRMotionControllerAxesValue {\r\n return this._axes;\r\n }\r\n\r\n /**\r\n * Get the changes. Elements will be populated only if they changed with their previous and current value\r\n */\r\n public get changes(): IWebXRMotionControllerComponentChanges {\r\n return this._changes;\r\n }\r\n\r\n /**\r\n * Return whether or not the component changed the last frame\r\n */\r\n public get hasChanges(): boolean {\r\n return this._hasChanges;\r\n }\r\n\r\n /**\r\n * is the button currently pressed\r\n */\r\n public get pressed(): boolean {\r\n return this._pressed;\r\n }\r\n\r\n /**\r\n * is the button currently touched\r\n */\r\n public get touched(): boolean {\r\n return this._touched;\r\n }\r\n\r\n /**\r\n * Get the current value of this component\r\n */\r\n public get value(): number {\r\n return this._currentValue;\r\n }\r\n\r\n /**\r\n * Dispose this component\r\n */\r\n public dispose(): void {\r\n this.onAxisValueChangedObservable.clear();\r\n this.onButtonStateChangedObservable.clear();\r\n }\r\n\r\n /**\r\n * Are there axes correlating to this component\r\n * @return true is axes data is available\r\n */\r\n public isAxes(): boolean {\r\n return this._axesIndices.length !== 0;\r\n }\r\n\r\n /**\r\n * Is this component a button (hence - pressable)\r\n * @returns true if can be pressed\r\n */\r\n public isButton(): boolean {\r\n return this._buttonIndex !== -1;\r\n }\r\n\r\n /**\r\n * update this component using the gamepad object it is in. Called on every frame\r\n * @param nativeController the native gamepad controller object\r\n */\r\n public update(nativeController: IMinimalMotionControllerObject) {\r\n let buttonUpdated = false;\r\n let axesUpdate = false;\r\n this._hasChanges = false;\r\n this._changes = {};\r\n\r\n if (this.isButton()) {\r\n const button = nativeController.buttons[this._buttonIndex];\r\n // defensive, in case a profile was forced\r\n if (!button) {\r\n return;\r\n }\r\n if (this._currentValue !== button.value) {\r\n this.changes.value = {\r\n current: button.value,\r\n previous: this._currentValue,\r\n };\r\n buttonUpdated = true;\r\n this._currentValue = button.value;\r\n }\r\n if (this._touched !== button.touched) {\r\n this.changes.touched = {\r\n current: button.touched,\r\n previous: this._touched,\r\n };\r\n buttonUpdated = true;\r\n this._touched = button.touched;\r\n }\r\n if (this._pressed !== button.pressed) {\r\n this.changes.pressed = {\r\n current: button.pressed,\r\n previous: this._pressed,\r\n };\r\n buttonUpdated = true;\r\n this._pressed = button.pressed;\r\n }\r\n }\r\n\r\n if (this.isAxes()) {\r\n if (this._axes.x !== nativeController.axes[this._axesIndices[0]]) {\r\n this.changes.axes = {\r\n current: {\r\n x: nativeController.axes[this._axesIndices[0]],\r\n y: this._axes.y,\r\n },\r\n previous: {\r\n x: this._axes.x,\r\n y: this._axes.y,\r\n },\r\n };\r\n this._axes.x = nativeController.axes[this._axesIndices[0]];\r\n axesUpdate = true;\r\n }\r\n\r\n if (this._axes.y !== nativeController.axes[this._axesIndices[1]]) {\r\n if (this.changes.axes) {\r\n this.changes.axes.current.y = nativeController.axes[this._axesIndices[1]];\r\n } else {\r\n this.changes.axes = {\r\n current: {\r\n x: this._axes.x,\r\n y: nativeController.axes[this._axesIndices[1]],\r\n },\r\n previous: {\r\n x: this._axes.x,\r\n y: this._axes.y,\r\n },\r\n };\r\n }\r\n this._axes.y = nativeController.axes[this._axesIndices[1]];\r\n axesUpdate = true;\r\n }\r\n }\r\n\r\n if (buttonUpdated) {\r\n this._hasChanges = true;\r\n this.onButtonStateChangedObservable.notifyObservers(this);\r\n }\r\n if (axesUpdate) {\r\n this._hasChanges = true;\r\n this.onAxisValueChangedObservable.notifyObservers(this._axes);\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"webXRControllerComponent.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/XR/motionController/webXRControllerComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAoDnD;;GAEG;AACH,MAAM,OAAO,wBAAwB;IA2CjC;;;;;;;;OAQG;IACH;IACI;;OAEG;IACI,EAAU;IACjB;;OAEG;IACI,IAAmC,EAClC,eAAuB,CAAC,CAAC,EACzB,eAAyB,EAAE;QAN5B,OAAE,GAAF,EAAE,CAAQ;QAIV,SAAI,GAAJ,IAAI,CAA+B;QAClC,iBAAY,GAAZ,YAAY,CAAa;QACzB,iBAAY,GAAZ,YAAY,CAAe;QA7D/B,UAAK,GAAoC;YAC7C,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;SACP,CAAC;QACM,aAAQ,GAA2C,EAAE,CAAC;QACtD,kBAAa,GAAW,CAAC,CAAC;QAC1B,gBAAW,GAAY,KAAK,CAAC;QAC7B,aAAQ,GAAY,KAAK,CAAC;QAC1B,aAAQ,GAAY,KAAK,CAAC;QAuBlC;;;WAGG;QACI,iCAA4B,GAAyC,IAAI,UAAU,EAAE,CAAC;QAC7F;;;WAGG;QACI,mCAA8B,GAAyC,IAAI,UAAU,EAAE,CAAC;IAsB5F,CAAC;IAEJ;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,C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type { IMinimalMotionControllerObject, MotionControllerComponentType } from \"./webXRAbstractMotionController\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { IDisposable } from \"../../scene\";\r\n\r\n/**\r\n * X-Y values for axes in WebXR\r\n */\r\nexport interface IWebXRMotionControllerAxesValue {\r\n /**\r\n * The value of the x axis\r\n */\r\n x: number;\r\n /**\r\n * The value of the y-axis\r\n */\r\n y: number;\r\n}\r\n\r\n/**\r\n * changed / previous values for the values of this component\r\n */\r\nexport interface IWebXRMotionControllerComponentChangesValues<T> {\r\n /**\r\n * current (this frame) value\r\n */\r\n current: T;\r\n /**\r\n * previous (last change) value\r\n */\r\n previous: T;\r\n}\r\n\r\n/**\r\n * Represents changes in the component between current frame and last values recorded\r\n */\r\nexport interface IWebXRMotionControllerComponentChanges {\r\n /**\r\n * will be populated with previous and current values if axes changed\r\n */\r\n axes?: IWebXRMotionControllerComponentChangesValues<IWebXRMotionControllerAxesValue>;\r\n /**\r\n * will be populated with previous and current values if pressed changed\r\n */\r\n pressed?: IWebXRMotionControllerComponentChangesValues<boolean>;\r\n /**\r\n * will be populated with previous and current values if touched changed\r\n */\r\n touched?: IWebXRMotionControllerComponentChangesValues<boolean>;\r\n /**\r\n * will be populated with previous and current values if value changed\r\n */\r\n value?: IWebXRMotionControllerComponentChangesValues<number>;\r\n}\r\n/**\r\n * This class represents a single component (for example button or thumbstick) of a motion controller\r\n */\r\nexport class WebXRControllerComponent implements IDisposable {\r\n private _axes: IWebXRMotionControllerAxesValue = {\r\n x: 0,\r\n y: 0,\r\n };\r\n private _changes: IWebXRMotionControllerComponentChanges = {};\r\n private _currentValue: number = 0;\r\n private _hasChanges: boolean = false;\r\n private _pressed: boolean = false;\r\n private _touched: boolean = false;\r\n\r\n /**\r\n * button component type\r\n */\r\n public static BUTTON_TYPE: MotionControllerComponentType = \"button\";\r\n /**\r\n * squeeze component type\r\n */\r\n public static SQUEEZE_TYPE: MotionControllerComponentType = \"squeeze\";\r\n /**\r\n * Thumbstick component type\r\n */\r\n public static THUMBSTICK_TYPE: MotionControllerComponentType = \"thumbstick\";\r\n /**\r\n * Touchpad component type\r\n */\r\n public static TOUCHPAD_TYPE: MotionControllerComponentType = \"touchpad\";\r\n /**\r\n * trigger component type\r\n */\r\n public static TRIGGER_TYPE: MotionControllerComponentType = \"trigger\";\r\n\r\n /**\r\n * If axes are available for this component (like a touchpad or thumbstick) the observers will be notified when\r\n * the axes data changes\r\n */\r\n public onAxisValueChangedObservable: Observable<{ x: number; y: number }> = new Observable();\r\n /**\r\n * Observers registered here will be triggered when the state of a button changes\r\n * State change is either pressed / touched / value\r\n */\r\n public onButtonStateChangedObservable: Observable<WebXRControllerComponent> = new Observable();\r\n\r\n /**\r\n * Creates a new component for a motion controller.\r\n * It is created by the motion controller itself\r\n *\r\n * @param id the id of this component\r\n * @param type the type of the component\r\n * @param _buttonIndex index in the buttons array of the gamepad\r\n * @param _axesIndices indices of the values in the axes array of the gamepad\r\n */\r\n constructor(\r\n /**\r\n * the id of this component\r\n */\r\n public id: string,\r\n /**\r\n * the type of the component\r\n */\r\n public type: MotionControllerComponentType,\r\n private _buttonIndex: number = -1,\r\n private _axesIndices: number[] = []\r\n ) {}\r\n\r\n /**\r\n * The current axes data. If this component has no axes it will still return an object { x: 0, y: 0 }\r\n */\r\n public get axes(): IWebXRMotionControllerAxesValue {\r\n return this._axes;\r\n }\r\n\r\n /**\r\n * Get the changes. Elements will be populated only if they changed with their previous and current value\r\n */\r\n public get changes(): IWebXRMotionControllerComponentChanges {\r\n return this._changes;\r\n }\r\n\r\n /**\r\n * Return whether or not the component changed the last frame\r\n */\r\n public get hasChanges(): boolean {\r\n return this._hasChanges;\r\n }\r\n\r\n /**\r\n * is the button currently pressed\r\n */\r\n public get pressed(): boolean {\r\n return this._pressed;\r\n }\r\n\r\n /**\r\n * is the button currently touched\r\n */\r\n public get touched(): boolean {\r\n return this._touched;\r\n }\r\n\r\n /**\r\n * Get the current value of this component\r\n */\r\n public get value(): number {\r\n return this._currentValue;\r\n }\r\n\r\n /**\r\n * Dispose this component\r\n */\r\n public dispose(): void {\r\n this.onAxisValueChangedObservable.clear();\r\n this.onButtonStateChangedObservable.clear();\r\n }\r\n\r\n /**\r\n * Are there axes correlating to this component\r\n * @returns true is axes data is available\r\n */\r\n public isAxes(): boolean {\r\n return this._axesIndices.length !== 0;\r\n }\r\n\r\n /**\r\n * Is this component a button (hence - pressable)\r\n * @returns true if can be pressed\r\n */\r\n public isButton(): boolean {\r\n return this._buttonIndex !== -1;\r\n }\r\n\r\n /**\r\n * update this component using the gamepad object it is in. Called on every frame\r\n * @param nativeController the native gamepad controller object\r\n */\r\n public update(nativeController: IMinimalMotionControllerObject) {\r\n let buttonUpdated = false;\r\n let axesUpdate = false;\r\n this._hasChanges = false;\r\n this._changes = {};\r\n\r\n if (this.isButton()) {\r\n const button = nativeController.buttons[this._buttonIndex];\r\n // defensive, in case a profile was forced\r\n if (!button) {\r\n return;\r\n }\r\n if (this._currentValue !== button.value) {\r\n this.changes.value = {\r\n current: button.value,\r\n previous: this._currentValue,\r\n };\r\n buttonUpdated = true;\r\n this._currentValue = button.value;\r\n }\r\n if (this._touched !== button.touched) {\r\n this.changes.touched = {\r\n current: button.touched,\r\n previous: this._touched,\r\n };\r\n buttonUpdated = true;\r\n this._touched = button.touched;\r\n }\r\n if (this._pressed !== button.pressed) {\r\n this.changes.pressed = {\r\n current: button.pressed,\r\n previous: this._pressed,\r\n };\r\n buttonUpdated = true;\r\n this._pressed = button.pressed;\r\n }\r\n }\r\n\r\n if (this.isAxes()) {\r\n if (this._axes.x !== nativeController.axes[this._axesIndices[0]]) {\r\n this.changes.axes = {\r\n current: {\r\n x: nativeController.axes[this._axesIndices[0]],\r\n y: this._axes.y,\r\n },\r\n previous: {\r\n x: this._axes.x,\r\n y: this._axes.y,\r\n },\r\n };\r\n this._axes.x = nativeController.axes[this._axesIndices[0]];\r\n axesUpdate = true;\r\n }\r\n\r\n if (this._axes.y !== nativeController.axes[this._axesIndices[1]]) {\r\n if (this.changes.axes) {\r\n this.changes.axes.current.y = nativeController.axes[this._axesIndices[1]];\r\n } else {\r\n this.changes.axes = {\r\n current: {\r\n x: this._axes.x,\r\n y: nativeController.axes[this._axesIndices[1]],\r\n },\r\n previous: {\r\n x: this._axes.x,\r\n y: this._axes.y,\r\n },\r\n };\r\n }\r\n this._axes.y = nativeController.axes[this._axesIndices[1]];\r\n axesUpdate = true;\r\n }\r\n }\r\n\r\n if (buttonUpdated) {\r\n this._hasChanges = true;\r\n this.onButtonStateChangedObservable.notifyObservers(this);\r\n }\r\n if (axesUpdate) {\r\n this._hasChanges = true;\r\n this.onAxisValueChangedObservable.notifyObservers(this._axes);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -42,7 +42,7 @@ export declare class WebXRMotionControllerManager {
|
|
|
42
42
|
/**
|
|
43
43
|
* Find a fallback profile if the profile was not found. There are a few predefined generic profiles.
|
|
44
44
|
* @param profileId the profile to which a fallback needs to be found
|
|
45
|
-
* @
|
|
45
|
+
* @returns an array with corresponding fallback profiles
|
|
46
46
|
*/
|
|
47
47
|
static FindFallbackWithProfileId(profileId: string): string[];
|
|
48
48
|
/**
|
|
@@ -57,7 +57,7 @@ export declare class WebXRMotionControllerManager {
|
|
|
57
57
|
* @param xrInput the xrInput to which a new controller is initialized
|
|
58
58
|
* @param scene the scene to which the model will be added
|
|
59
59
|
* @param forceProfile force a certain profile for this controller
|
|
60
|
-
* @
|
|
60
|
+
* @returns A promise that fulfils with the motion controller class for this profile id or the generic standard class if none was found
|
|
61
61
|
*/
|
|
62
62
|
static GetMotionControllerWithXRInput(xrInput: XRInputSource, scene: Scene, forceProfile?: string): Promise<WebXRAbstractMotionController>;
|
|
63
63
|
/**
|
|
@@ -77,7 +77,7 @@ export declare class WebXRMotionControllerManager {
|
|
|
77
77
|
static RegisterFallbacksForProfileId(profileId: string, fallbacks: string[]): void;
|
|
78
78
|
/**
|
|
79
79
|
* Will update the list of profiles available in the repository
|
|
80
|
-
* @
|
|
80
|
+
* @returns a promise that resolves to a map of profiles available online
|
|
81
81
|
*/
|
|
82
82
|
static UpdateProfilesList(): Promise<{
|
|
83
83
|
[profile: string]: string;
|
|
@@ -44,7 +44,7 @@ export class WebXRMotionControllerManager {
|
|
|
44
44
|
/**
|
|
45
45
|
* Find a fallback profile if the profile was not found. There are a few predefined generic profiles.
|
|
46
46
|
* @param profileId the profile to which a fallback needs to be found
|
|
47
|
-
* @
|
|
47
|
+
* @returns an array with corresponding fallback profiles
|
|
48
48
|
*/
|
|
49
49
|
static FindFallbackWithProfileId(profileId) {
|
|
50
50
|
const returnArray = this._Fallbacks[profileId] || [];
|
|
@@ -63,7 +63,7 @@ export class WebXRMotionControllerManager {
|
|
|
63
63
|
* @param xrInput the xrInput to which a new controller is initialized
|
|
64
64
|
* @param scene the scene to which the model will be added
|
|
65
65
|
* @param forceProfile force a certain profile for this controller
|
|
66
|
-
* @
|
|
66
|
+
* @returns A promise that fulfils with the motion controller class for this profile id or the generic standard class if none was found
|
|
67
67
|
*/
|
|
68
68
|
static GetMotionControllerWithXRInput(xrInput, scene, forceProfile) {
|
|
69
69
|
const profileArray = [];
|
|
@@ -131,7 +131,7 @@ export class WebXRMotionControllerManager {
|
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
133
|
* Will update the list of profiles available in the repository
|
|
134
|
-
* @
|
|
134
|
+
* @returns a promise that resolves to a map of profiles available online
|
|
135
135
|
*/
|
|
136
136
|
static UpdateProfilesList() {
|
|
137
137
|
this._ProfilesList = Tools.LoadFileAsync(this.BaseRepositoryUrl + "/profiles/profilesList.json", false).then((data) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webXRMotionControllerManager.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/XR/motionController/webXRMotionControllerManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;AAErF,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CA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AC,CAAC,EAAE;gBAClB,SAAS;aACZ;YACD,MAAM,SAAS,GAAG,IAAI,CAAC,yBAAyB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;YAClE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;gBACvC,MAAM,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtE,IAAI,oBAAoB,EAAE;oBACtB,OAAO,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;iBAChE;aACJ;SACJ;QAED,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;IAC3F,CAAC;;AAnOc,kDAAqB,GAAoD,EAAE,CAAC;AAC5E,uCAAU,GAAsC,EAAE,CAAC;AAClE,oBAAoB;AACL,oDAAuB,GAAiE,EAAE,CAAC;AAG1G;;GAEG;AACW,8CAAiB,GAAG,2EAA2E,CAAC;AAC9G;;GAEG;AACW,uDAA0B,GAAY,IAAI,CAAC;AACzD;;GAEG;AACW,gDAAmB,GAAY,IAAI,CAAC;AAElD;;;GAGG;AACW,mDAAsB,GAAY,IAAI,CAAC;AA+MzD,qEAAqE;AACrE,4BAA4B,CAAC,kBAAkB,CAAC,mCAAmC,CAAC,SAAS,EAAE,CAAC,OAAsB,EAAE,KAAY,EAAE,EAAE;IACpI,OAAO,IAAI,mCAAmC,CAAC,KAAK,EAAO,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;AACpG,CAAC,CAAC,CAAC;AAEH,qBAAqB;AACrB,4BAA4B,CAAC,gBAAgB,EAAE,CAAC","sourcesContent":["import type { WebXRAbstractMotionController, IMotionControllerProfile } from \"./webXRAbstractMotionController\";\r\nimport { WebXRGenericTriggerMotionController } from \"./webXRGenericMotionController\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport { WebXRProfiledMotionController } from \"./webXRProfiledMotionController\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\n\r\n/**\r\n * A construction function type to create a new controller based on an xrInput object\r\n */\r\nexport type MotionControllerConstructor = (xrInput: XRInputSource, scene: Scene) => WebXRAbstractMotionController;\r\n\r\n/**\r\n * The MotionController Manager manages all registered motion controllers and loads the right one when needed.\r\n *\r\n * When this repository is complete: https://github.com/immersive-web/webxr-input-profiles/tree/master/packages/assets\r\n * it should be replaced with auto-loaded controllers.\r\n *\r\n * When using a model try to stay as generic as possible. Eventually there will be no need in any of the controller classes\r\n */\r\n\r\nconst controllerCache: Array<{\r\n filename: string;\r\n path: string;\r\n meshes: AbstractMesh[];\r\n}> = [];\r\n\r\n/**\r\n * Motion controller manager is managing the different webxr profiles and makes sure the right\r\n * controller is being loaded.\r\n */\r\nexport class WebXRMotionControllerManager {\r\n private static _AvailableControllers: { [type: string]: MotionControllerConstructor } = {};\r\n private static _Fallbacks: { [profileId: string]: string[] } = {};\r\n // cache for loading\r\n private static _ProfileLoadingPromises: { [profileName: string]: Promise<IMotionControllerProfile> } = {};\r\n private static _ProfilesList: Nullable<Promise<{ [profile: string]: string }>>;\r\n\r\n /**\r\n * The base URL of the online controller repository. Can be changed at any time.\r\n */\r\n public static BaseRepositoryUrl = \"https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist\";\r\n /**\r\n * Which repository gets priority - local or online\r\n */\r\n public static PrioritizeOnlineRepository: boolean = true;\r\n /**\r\n * Use the online repository, or use only locally-defined controllers\r\n */\r\n public static UseOnlineRepository: boolean = true;\r\n\r\n /**\r\n * Disable the controller cache and load the models each time a new WebXRProfileMotionController is loaded.\r\n * Defaults to true.\r\n */\r\n public static DisableControllerCache: boolean = true;\r\n\r\n /**\r\n * Clear the cache used for profile loading and reload when requested again\r\n */\r\n public static ClearProfilesCache() {\r\n this._ProfilesList = null;\r\n this._ProfileLoadingPromises = {};\r\n }\r\n\r\n /**\r\n * Register the default fallbacks.\r\n * This function is called automatically when this file is imported.\r\n */\r\n public static DefaultFallbacks() {\r\n this.RegisterFallbacksForProfileId(\"google-daydream\", [\"generic-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"htc-vive-focus\", [\"generic-trigger-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"htc-vive\", [\"generic-trigger-squeeze-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"magicleap-one\", [\"generic-trigger-squeeze-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"windows-mixed-reality\", [\"generic-trigger-squeeze-touchpad-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"microsoft-mixed-reality\", [\"windows-mixed-reality\", \"generic-trigger-squeeze-touchpad-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"oculus-go\", [\"generic-trigger-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"oculus-touch-v2\", [\"oculus-touch\", \"generic-trigger-squeeze-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"oculus-touch\", [\"generic-trigger-squeeze-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"samsung-gearvr\", [\"windows-mixed-reality\", \"generic-trigger-squeeze-touchpad-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"samsung-odyssey\", [\"generic-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"valve-index\", [\"generic-trigger-squeeze-touchpad-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"generic-hand-select\", [\"generic-trigger\"]);\r\n }\r\n\r\n /**\r\n * Find a fallback profile if the profile was not found. There are a few predefined generic profiles.\r\n * @param profileId the profile to which a fallback needs to be found\r\n * @return an array with corresponding fallback profiles\r\n */\r\n public static FindFallbackWithProfileId(profileId: string): string[] {\r\n const returnArray = this._Fallbacks[profileId] || [];\r\n\r\n returnArray.unshift(profileId);\r\n return returnArray;\r\n }\r\n\r\n /**\r\n * When acquiring a new xrInput object (usually by the WebXRInput class), match it with the correct profile.\r\n * The order of search:\r\n *\r\n * 1) Iterate the profiles array of the xr input and try finding a corresponding motion controller\r\n * 2) (If not found) search in the gamepad id and try using it (legacy versions only)\r\n * 3) search for registered fallbacks (should be redundant, nonetheless it makes sense to check)\r\n * 4) return the generic trigger controller if none were found\r\n *\r\n * @param xrInput the xrInput to which a new controller is initialized\r\n * @param scene the scene to which the model will be added\r\n * @param forceProfile force a certain profile for this controller\r\n * @return A promise that fulfils with the motion controller class for this profile id or the generic standard class if none was found\r\n */\r\n public static GetMotionControllerWithXRInput(xrInput: XRInputSource, scene: Scene, forceProfile?: string): Promise<WebXRAbstractMotionController> {\r\n const profileArray: string[] = [];\r\n if (forceProfile) {\r\n profileArray.push(forceProfile);\r\n }\r\n profileArray.push(...(xrInput.profiles || []));\r\n\r\n // emulator support\r\n if (profileArray.length && !profileArray[0]) {\r\n // remove the first \"undefined\" that the emulator is adding\r\n profileArray.pop();\r\n }\r\n\r\n // legacy support - try using the gamepad id\r\n if (xrInput.gamepad && xrInput.gamepad.id) {\r\n switch (xrInput.gamepad.id) {\r\n case xrInput.gamepad.id.match(/oculus touch/gi) ? xrInput.gamepad.id : undefined:\r\n // oculus in gamepad id\r\n profileArray.push(\"oculus-touch-v2\");\r\n break;\r\n }\r\n }\r\n\r\n // make sure microsoft/windows mixed reality works correctly\r\n const windowsMRIdx = profileArray.indexOf(\"windows-mixed-reality\");\r\n if (windowsMRIdx !== -1) {\r\n profileArray.splice(windowsMRIdx, 0, \"microsoft-mixed-reality\");\r\n }\r\n\r\n if (!profileArray.length) {\r\n profileArray.push(\"generic-trigger\");\r\n }\r\n\r\n if (this.UseOnlineRepository) {\r\n const firstFunction = this.PrioritizeOnlineRepository ? this._LoadProfileFromRepository : this._LoadProfilesFromAvailableControllers;\r\n const secondFunction = this.PrioritizeOnlineRepository ? this._LoadProfilesFromAvailableControllers : this._LoadProfileFromRepository;\r\n\r\n return firstFunction.call(this, profileArray, xrInput, scene).catch(() => {\r\n return secondFunction.call(this, profileArray, xrInput, scene);\r\n });\r\n } else {\r\n // use only available functions\r\n return this._LoadProfilesFromAvailableControllers(profileArray, xrInput, scene);\r\n }\r\n }\r\n\r\n /**\r\n * Register a new controller based on its profile. This function will be called by the controller classes themselves.\r\n *\r\n * If you are missing a profile, make sure it is imported in your source, otherwise it will not register.\r\n *\r\n * @param type the profile type to register\r\n * @param constructFunction the function to be called when loading this profile\r\n */\r\n public static RegisterController(type: string, constructFunction: MotionControllerConstructor) {\r\n this._AvailableControllers[type] = constructFunction;\r\n }\r\n\r\n /**\r\n * Register a fallback to a specific profile.\r\n * @param profileId the profileId that will receive the fallbacks\r\n * @param fallbacks A list of fallback profiles\r\n */\r\n public static RegisterFallbacksForProfileId(profileId: string, fallbacks: string[]): void {\r\n if (this._Fallbacks[profileId]) {\r\n this._Fallbacks[profileId].push(...fallbacks);\r\n } else {\r\n this._Fallbacks[profileId] = fallbacks;\r\n }\r\n }\r\n\r\n /**\r\n * Will update the list of profiles available in the repository\r\n * @return a promise that resolves to a map of profiles available online\r\n */\r\n public static UpdateProfilesList() {\r\n this._ProfilesList = Tools.LoadFileAsync(this.BaseRepositoryUrl + \"/profiles/profilesList.json\", false).then((data) => {\r\n return JSON.parse(data.toString());\r\n });\r\n return this._ProfilesList;\r\n }\r\n\r\n /**\r\n * Clear the controller's cache (usually happens at the end of a session)\r\n */\r\n public static ClearControllerCache() {\r\n controllerCache.forEach((cacheItem) => {\r\n cacheItem.meshes.forEach((mesh) => {\r\n mesh.dispose(false, true);\r\n });\r\n });\r\n controllerCache.length = 0;\r\n }\r\n\r\n private static _LoadProfileFromRepository(profileArray: string[], xrInput: XRInputSource, scene: Scene): Promise<WebXRAbstractMotionController> {\r\n return Promise.resolve()\r\n .then(() => {\r\n if (!this._ProfilesList) {\r\n return this.UpdateProfilesList();\r\n } else {\r\n return this._ProfilesList;\r\n }\r\n })\r\n .then((profilesList: { [profile: string]: string }) => {\r\n // load the right profile\r\n for (let i = 0; i < profileArray.length; ++i) {\r\n // defensive\r\n if (!profileArray[i]) {\r\n continue;\r\n }\r\n if (profilesList[profileArray[i]]) {\r\n return profileArray[i];\r\n }\r\n }\r\n\r\n throw new Error(`neither controller ${profileArray[0]} nor all fallbacks were found in the repository,`);\r\n })\r\n .then((profileToLoad: string) => {\r\n // load the profile\r\n if (!this._ProfileLoadingPromises[profileToLoad]) {\r\n this._ProfileLoadingPromises[profileToLoad] = Tools.LoadFileAsync(`${this.BaseRepositoryUrl}/profiles/${profileToLoad}/profile.json`, false).then(\r\n (data) => <IMotionControllerProfile>JSON.parse(data as string)\r\n );\r\n }\r\n return this._ProfileLoadingPromises[profileToLoad];\r\n })\r\n .then((profile: IMotionControllerProfile) => {\r\n return new WebXRProfiledMotionController(scene, xrInput, profile, this.BaseRepositoryUrl, this.DisableControllerCache ? undefined : controllerCache);\r\n });\r\n }\r\n\r\n private static _LoadProfilesFromAvailableControllers(profileArray: string[], xrInput: XRInputSource, scene: Scene) {\r\n // check fallbacks\r\n for (let i = 0; i < profileArray.length; ++i) {\r\n // defensive\r\n if (!profileArray[i]) {\r\n continue;\r\n }\r\n const fallbacks = this.FindFallbackWithProfileId(profileArray[i]);\r\n for (let j = 0; j < fallbacks.length; ++j) {\r\n const constructionFunction = this._AvailableControllers[fallbacks[j]];\r\n if (constructionFunction) {\r\n return Promise.resolve(constructionFunction(xrInput, scene));\r\n }\r\n }\r\n }\r\n\r\n throw new Error(`no controller requested was found in the available controllers list`);\r\n }\r\n}\r\n\r\n// register the generic profile(s) here so we will at least have them\r\nWebXRMotionControllerManager.RegisterController(WebXRGenericTriggerMotionController.ProfileId, (xrInput: XRInputSource, scene: Scene) => {\r\n return new WebXRGenericTriggerMotionController(scene, <any>xrInput.gamepad, xrInput.handedness);\r\n});\r\n\r\n// register fallbacks\r\nWebXRMotionControllerManager.DefaultFallbacks();\r\n"]}
|
|
1
|
+
{"version":3,"file":"webXRMotionControllerMan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B;AACrB,4BAA4B,CAAC,gBAAgB,EAAE,CAAC","sourcesContent":["import type { WebXRAbstractMotionController, IMotionControllerProfile } from \"./webXRAbstractMotionController\";\r\nimport { WebXRGenericTriggerMotionController } from \"./webXRGenericMotionController\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport { WebXRProfiledMotionController } from \"./webXRProfiledMotionController\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { AbstractMesh } from \"../../Meshes/abstractMesh\";\r\n\r\n/**\r\n * A construction function type to create a new controller based on an xrInput object\r\n */\r\nexport type MotionControllerConstructor = (xrInput: XRInputSource, scene: Scene) => WebXRAbstractMotionController;\r\n\r\n/**\r\n * The MotionController Manager manages all registered motion controllers and loads the right one when needed.\r\n *\r\n * When this repository is complete: https://github.com/immersive-web/webxr-input-profiles/tree/master/packages/assets\r\n * it should be replaced with auto-loaded controllers.\r\n *\r\n * When using a model try to stay as generic as possible. Eventually there will be no need in any of the controller classes\r\n */\r\n\r\nconst controllerCache: Array<{\r\n filename: string;\r\n path: string;\r\n meshes: AbstractMesh[];\r\n}> = [];\r\n\r\n/**\r\n * Motion controller manager is managing the different webxr profiles and makes sure the right\r\n * controller is being loaded.\r\n */\r\nexport class WebXRMotionControllerManager {\r\n private static _AvailableControllers: { [type: string]: MotionControllerConstructor } = {};\r\n private static _Fallbacks: { [profileId: string]: string[] } = {};\r\n // cache for loading\r\n private static _ProfileLoadingPromises: { [profileName: string]: Promise<IMotionControllerProfile> } = {};\r\n private static _ProfilesList: Nullable<Promise<{ [profile: string]: string }>>;\r\n\r\n /**\r\n * The base URL of the online controller repository. Can be changed at any time.\r\n */\r\n public static BaseRepositoryUrl = \"https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist\";\r\n /**\r\n * Which repository gets priority - local or online\r\n */\r\n public static PrioritizeOnlineRepository: boolean = true;\r\n /**\r\n * Use the online repository, or use only locally-defined controllers\r\n */\r\n public static UseOnlineRepository: boolean = true;\r\n\r\n /**\r\n * Disable the controller cache and load the models each time a new WebXRProfileMotionController is loaded.\r\n * Defaults to true.\r\n */\r\n public static DisableControllerCache: boolean = true;\r\n\r\n /**\r\n * Clear the cache used for profile loading and reload when requested again\r\n */\r\n public static ClearProfilesCache() {\r\n this._ProfilesList = null;\r\n this._ProfileLoadingPromises = {};\r\n }\r\n\r\n /**\r\n * Register the default fallbacks.\r\n * This function is called automatically when this file is imported.\r\n */\r\n public static DefaultFallbacks() {\r\n this.RegisterFallbacksForProfileId(\"google-daydream\", [\"generic-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"htc-vive-focus\", [\"generic-trigger-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"htc-vive\", [\"generic-trigger-squeeze-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"magicleap-one\", [\"generic-trigger-squeeze-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"windows-mixed-reality\", [\"generic-trigger-squeeze-touchpad-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"microsoft-mixed-reality\", [\"windows-mixed-reality\", \"generic-trigger-squeeze-touchpad-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"oculus-go\", [\"generic-trigger-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"oculus-touch-v2\", [\"oculus-touch\", \"generic-trigger-squeeze-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"oculus-touch\", [\"generic-trigger-squeeze-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"samsung-gearvr\", [\"windows-mixed-reality\", \"generic-trigger-squeeze-touchpad-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"samsung-odyssey\", [\"generic-touchpad\"]);\r\n this.RegisterFallbacksForProfileId(\"valve-index\", [\"generic-trigger-squeeze-touchpad-thumbstick\"]);\r\n this.RegisterFallbacksForProfileId(\"generic-hand-select\", [\"generic-trigger\"]);\r\n }\r\n\r\n /**\r\n * Find a fallback profile if the profile was not found. There are a few predefined generic profiles.\r\n * @param profileId the profile to which a fallback needs to be found\r\n * @returns an array with corresponding fallback profiles\r\n */\r\n public static FindFallbackWithProfileId(profileId: string): string[] {\r\n const returnArray = this._Fallbacks[profileId] || [];\r\n\r\n returnArray.unshift(profileId);\r\n return returnArray;\r\n }\r\n\r\n /**\r\n * When acquiring a new xrInput object (usually by the WebXRInput class), match it with the correct profile.\r\n * The order of search:\r\n *\r\n * 1) Iterate the profiles array of the xr input and try finding a corresponding motion controller\r\n * 2) (If not found) search in the gamepad id and try using it (legacy versions only)\r\n * 3) search for registered fallbacks (should be redundant, nonetheless it makes sense to check)\r\n * 4) return the generic trigger controller if none were found\r\n *\r\n * @param xrInput the xrInput to which a new controller is initialized\r\n * @param scene the scene to which the model will be added\r\n * @param forceProfile force a certain profile for this controller\r\n * @returns A promise that fulfils with the motion controller class for this profile id or the generic standard class if none was found\r\n */\r\n public static GetMotionControllerWithXRInput(xrInput: XRInputSource, scene: Scene, forceProfile?: string): Promise<WebXRAbstractMotionController> {\r\n const profileArray: string[] = [];\r\n if (forceProfile) {\r\n profileArray.push(forceProfile);\r\n }\r\n profileArray.push(...(xrInput.profiles || []));\r\n\r\n // emulator support\r\n if (profileArray.length && !profileArray[0]) {\r\n // remove the first \"undefined\" that the emulator is adding\r\n profileArray.pop();\r\n }\r\n\r\n // legacy support - try using the gamepad id\r\n if (xrInput.gamepad && xrInput.gamepad.id) {\r\n switch (xrInput.gamepad.id) {\r\n case xrInput.gamepad.id.match(/oculus touch/gi) ? xrInput.gamepad.id : undefined:\r\n // oculus in gamepad id\r\n profileArray.push(\"oculus-touch-v2\");\r\n break;\r\n }\r\n }\r\n\r\n // make sure microsoft/windows mixed reality works correctly\r\n const windowsMRIdx = profileArray.indexOf(\"windows-mixed-reality\");\r\n if (windowsMRIdx !== -1) {\r\n profileArray.splice(windowsMRIdx, 0, \"microsoft-mixed-reality\");\r\n }\r\n\r\n if (!profileArray.length) {\r\n profileArray.push(\"generic-trigger\");\r\n }\r\n\r\n if (this.UseOnlineRepository) {\r\n const firstFunction = this.PrioritizeOnlineRepository ? this._LoadProfileFromRepository : this._LoadProfilesFromAvailableControllers;\r\n const secondFunction = this.PrioritizeOnlineRepository ? this._LoadProfilesFromAvailableControllers : this._LoadProfileFromRepository;\r\n\r\n return firstFunction.call(this, profileArray, xrInput, scene).catch(() => {\r\n return secondFunction.call(this, profileArray, xrInput, scene);\r\n });\r\n } else {\r\n // use only available functions\r\n return this._LoadProfilesFromAvailableControllers(profileArray, xrInput, scene);\r\n }\r\n }\r\n\r\n /**\r\n * Register a new controller based on its profile. This function will be called by the controller classes themselves.\r\n *\r\n * If you are missing a profile, make sure it is imported in your source, otherwise it will not register.\r\n *\r\n * @param type the profile type to register\r\n * @param constructFunction the function to be called when loading this profile\r\n */\r\n public static RegisterController(type: string, constructFunction: MotionControllerConstructor) {\r\n this._AvailableControllers[type] = constructFunction;\r\n }\r\n\r\n /**\r\n * Register a fallback to a specific profile.\r\n * @param profileId the profileId that will receive the fallbacks\r\n * @param fallbacks A list of fallback profiles\r\n */\r\n public static RegisterFallbacksForProfileId(profileId: string, fallbacks: string[]): void {\r\n if (this._Fallbacks[profileId]) {\r\n this._Fallbacks[profileId].push(...fallbacks);\r\n } else {\r\n this._Fallbacks[profileId] = fallbacks;\r\n }\r\n }\r\n\r\n /**\r\n * Will update the list of profiles available in the repository\r\n * @returns a promise that resolves to a map of profiles available online\r\n */\r\n public static UpdateProfilesList() {\r\n this._ProfilesList = Tools.LoadFileAsync(this.BaseRepositoryUrl + \"/profiles/profilesList.json\", false).then((data) => {\r\n return JSON.parse(data.toString());\r\n });\r\n return this._ProfilesList;\r\n }\r\n\r\n /**\r\n * Clear the controller's cache (usually happens at the end of a session)\r\n */\r\n public static ClearControllerCache() {\r\n controllerCache.forEach((cacheItem) => {\r\n cacheItem.meshes.forEach((mesh) => {\r\n mesh.dispose(false, true);\r\n });\r\n });\r\n controllerCache.length = 0;\r\n }\r\n\r\n private static _LoadProfileFromRepository(profileArray: string[], xrInput: XRInputSource, scene: Scene): Promise<WebXRAbstractMotionController> {\r\n return Promise.resolve()\r\n .then(() => {\r\n if (!this._ProfilesList) {\r\n return this.UpdateProfilesList();\r\n } else {\r\n return this._ProfilesList;\r\n }\r\n })\r\n .then((profilesList: { [profile: string]: string }) => {\r\n // load the right profile\r\n for (let i = 0; i < profileArray.length; ++i) {\r\n // defensive\r\n if (!profileArray[i]) {\r\n continue;\r\n }\r\n if (profilesList[profileArray[i]]) {\r\n return profileArray[i];\r\n }\r\n }\r\n\r\n throw new Error(`neither controller ${profileArray[0]} nor all fallbacks were found in the repository,`);\r\n })\r\n .then((profileToLoad: string) => {\r\n // load the profile\r\n if (!this._ProfileLoadingPromises[profileToLoad]) {\r\n this._ProfileLoadingPromises[profileToLoad] = Tools.LoadFileAsync(`${this.BaseRepositoryUrl}/profiles/${profileToLoad}/profile.json`, false).then(\r\n (data) => <IMotionControllerProfile>JSON.parse(data as string)\r\n );\r\n }\r\n return this._ProfileLoadingPromises[profileToLoad];\r\n })\r\n .then((profile: IMotionControllerProfile) => {\r\n return new WebXRProfiledMotionController(scene, xrInput, profile, this.BaseRepositoryUrl, this.DisableControllerCache ? undefined : controllerCache);\r\n });\r\n }\r\n\r\n private static _LoadProfilesFromAvailableControllers(profileArray: string[], xrInput: XRInputSource, scene: Scene) {\r\n // check fallbacks\r\n for (let i = 0; i < profileArray.length; ++i) {\r\n // defensive\r\n if (!profileArray[i]) {\r\n continue;\r\n }\r\n const fallbacks = this.FindFallbackWithProfileId(profileArray[i]);\r\n for (let j = 0; j < fallbacks.length; ++j) {\r\n const constructionFunction = this._AvailableControllers[fallbacks[j]];\r\n if (constructionFunction) {\r\n return Promise.resolve(constructionFunction(xrInput, scene));\r\n }\r\n }\r\n }\r\n\r\n throw new Error(`no controller requested was found in the available controllers list`);\r\n }\r\n}\r\n\r\n// register the generic profile(s) here so we will at least have them\r\nWebXRMotionControllerManager.RegisterController(WebXRGenericTriggerMotionController.ProfileId, (xrInput: XRInputSource, scene: Scene) => {\r\n return new WebXRGenericTriggerMotionController(scene, <any>xrInput.gamepad, xrInput.handedness);\r\n});\r\n\r\n// register fallbacks\r\nWebXRMotionControllerManager.DefaultFallbacks();\r\n"]}
|
package/node.d.ts
CHANGED
|
@@ -251,7 +251,7 @@ export declare class Node implements IBehaviorAware<Node> {
|
|
|
251
251
|
/**
|
|
252
252
|
* Is this node ready to be used/rendered
|
|
253
253
|
* @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)
|
|
254
|
-
* @
|
|
254
|
+
* @returns true if the node is ready
|
|
255
255
|
*/
|
|
256
256
|
isReady(completeCheck?: boolean): boolean;
|
|
257
257
|
/**
|
|
@@ -264,7 +264,7 @@ export declare class Node implements IBehaviorAware<Node> {
|
|
|
264
264
|
* Is this node enabled?
|
|
265
265
|
* If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true
|
|
266
266
|
* @param checkAncestors indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors
|
|
267
|
-
* @
|
|
267
|
+
* @returns whether this node (and its parent) is enabled
|
|
268
268
|
*/
|
|
269
269
|
isEnabled(checkAncestors?: boolean): boolean;
|
|
270
270
|
/** @hidden */
|
|
@@ -292,14 +292,14 @@ export declare class Node implements IBehaviorAware<Node> {
|
|
|
292
292
|
* Will return all nodes that have this node as ascendant
|
|
293
293
|
* @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
|
|
294
294
|
* @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
|
|
295
|
-
* @
|
|
295
|
+
* @returns all children nodes of all types
|
|
296
296
|
*/
|
|
297
297
|
getDescendants<T extends Node>(directDescendantsOnly?: boolean, predicate?: (node: Node) => node is T): T[];
|
|
298
298
|
/**
|
|
299
299
|
* Will return all nodes that have this node as ascendant
|
|
300
300
|
* @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
|
|
301
301
|
* @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
|
|
302
|
-
* @
|
|
302
|
+
* @returns all children nodes of all types
|
|
303
303
|
*/
|
|
304
304
|
getDescendants(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): Node[];
|
|
305
305
|
/**
|
package/node.js
CHANGED
|
@@ -410,7 +410,7 @@ export class Node {
|
|
|
410
410
|
/**
|
|
411
411
|
* Is this node ready to be used/rendered
|
|
412
412
|
* @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)
|
|
413
|
-
* @
|
|
413
|
+
* @returns true if the node is ready
|
|
414
414
|
*/
|
|
415
415
|
isReady(completeCheck = false) {
|
|
416
416
|
return this._nodeDataStorage._isReady;
|
|
@@ -429,7 +429,7 @@ export class Node {
|
|
|
429
429
|
* Is this node enabled?
|
|
430
430
|
* If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true
|
|
431
431
|
* @param checkAncestors indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors
|
|
432
|
-
* @
|
|
432
|
+
* @returns whether this node (and its parent) is enabled
|
|
433
433
|
*/
|
|
434
434
|
isEnabled(checkAncestors = true) {
|
|
435
435
|
if (checkAncestors === false) {
|
|
@@ -500,7 +500,7 @@ export class Node {
|
|
|
500
500
|
* Will return all nodes that have this node as ascendant
|
|
501
501
|
* @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
|
|
502
502
|
* @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
|
|
503
|
-
* @
|
|
503
|
+
* @returns all children nodes of all types
|
|
504
504
|
*/
|
|
505
505
|
getDescendants(directDescendantsOnly, predicate) {
|
|
506
506
|
const results = new Array();
|
package/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../../lts/core/generated/node.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAgB9C,cAAc;AACd,MAAM,qBAAqB;IAA3B;QACW,oBAAe,GAAG,KAAK,CAAC;QACxB,gBAAW,GAAG,KAAK,CAAC;QACpB,yBAAoB,GAAG,CAAC,CAAC,CAAC;QAC1B,eAAU,GAAG,IAAI,CAAC;QAClB,qBAAgB,GAAG,IAAI,CAAC;QACxB,aAAQ,GAAG,IAAI,CAAC;QAChB,qCAAgC,GAAG,IAAI,UAAU,EAAW,CAAC;QAC7D,wBAAmB,GAAG,IAAI,UAAU,EAAQ,CAAC;IACxD,CAAC;CAAA;AAED;;GAEG;AACH,MAAM,OAAO,IAAI;IA+Rb;;;;OAIG;IACH,YAAY,IAAY,EAAE,QAAyB,IAAI;QAnS7C,aAAQ,GAAG,KAAK,CAAC;QA0CnB,qBAAgB,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAoBvD;;WAEG;QAEI,UAAK,GAAG,EAAE,CAAC;QAElB;;WAEG;QAEI,aAAQ,GAAQ,IAAI,CAAC;QAE5B;;WAEG;QACI,sBAAiB,GAAQ,IAAI,CAAC;QA2BrC,cAAc;QACP,qBAAgB,GAA4B,IAAI,CAAC;QAExD;;WAEG;QACI,eAAU,GAAG,IAAI,KAAK,EAAa,CAAC;QACjC,YAAO,GAAiD,EAAE,CAAC;QAErE;;WAEG;QACI,YAAO,GAAmC,IAAI,CAAC;QAEtD,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G,WAAW,CAAC,YAAY,CAAC;gBACxC,MAAM,MAAM,GAAG,WAAW,CAAC,YAAY,CAAC;gBAExC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;gBACvC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aAC1C;SACJ;QAED,OAAO;YACH,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;SACX,CAAC;IACN,CAAC;;AA96BD;;;;;GAKG;AACH,6DAA6D;AAC/C,2BAAsB,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,EAAU,EAAkB,EAAE;IAC9F,MAAM,WAAW,CAAC,gBAAgB,CAAC,CAAC;AACxC,CAAC,CAAC;AAEa,sBAAiB,GAA2B,EAAE,CAAC;AAmC9D;IADC,SAAS,EAAE;kCACQ;AAMpB;IADC,SAAS,EAAE;gCACM;AAMlB;IADC,SAAS,EAAE;sCACY;AAMxB;IADC,SAAS,EAAE;mCACM;AAMlB;IADC,SAAS,EAAE;sCACgB","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport type { Scene } from \"./scene\";\r\nimport type { Nullable } from \"./types\";\r\nimport { Matrix, Vector3 } from \"./Maths/math.vector\";\r\nimport type { Engine } from \"./Engines/engine\";\r\nimport type { IBehaviorAware, Behavior } from \"./Behaviors/behavior\";\r\nimport { serialize } from \"./Misc/decorators\";\r\nimport type { Observer } from \"./Misc/observable\";\r\nimport { Observable } from \"./Misc/observable\";\r\nimport { EngineStore } from \"./Engines/engineStore\";\r\nimport { _WarnImport } from \"./Misc/devTools\";\r\nimport type { AbstractActionManager } from \"./Actions/abstractActionManager\";\r\nimport type { IInspectable } from \"./Misc/iInspectable\";\r\nimport type { AbstractScene } from \"./abstractScene\";\r\n\r\ndeclare type Animatable = import(\"./Animations/animatable\").Animatable;\r\ndeclare type AnimationPropertiesOverride = import(\"./Animations/animationPropertiesOverride\").AnimationPropertiesOverride;\r\ndeclare type Animation = import(\"./Animations/animation\").Animation;\r\ndeclare type AnimationRange = import(\"./Animations/animationRange\").AnimationRange;\r\ndeclare type AbstractMesh = import(\"./Meshes/abstractMesh\").AbstractMesh;\r\n\r\n/**\r\n * Defines how a node can be built from a string name.\r\n */\r\nexport type NodeConstructor = (name: string, scene: Scene, options?: any) => () => Node;\r\n\r\n/** @hidden */\r\nclass _InternalNodeDataInfo {\r\n public _doNotSerialize = false;\r\n public _isDisposed = false;\r\n public _sceneRootNodesIndex = -1;\r\n public _isEnabled = true;\r\n public _isParentEnabled = true;\r\n public _isReady = true;\r\n public _onEnabledStateChangedObservable = new Observable<boolean>();\r\n public _onClonedObservable = new Observable<Node>();\r\n}\r\n\r\n/**\r\n * Node is the basic class for all scene objects (Mesh, Light, Camera.)\r\n */\r\nexport class Node implements IBehaviorAware<Node> {\r\n protected _isDirty = false;\r\n\r\n /**\r\n * @param name\r\n * @param from\r\n * @param to\r\n * @hidden\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static _AnimationRangeFactory = (name: string, from: number, to: number): AnimationRange => {\r\n throw _WarnImport(\"AnimationRange\");\r\n };\r\n\r\n private static _NodeConstructors: { [key: string]: any } = {};\r\n\r\n /**\r\n * Add a new node constructor\r\n * @param type defines the type name of the node to construct\r\n * @param constructorFunc defines the constructor function\r\n */\r\n public static AddNodeConstructor(type: string, constructorFunc: NodeConstructor) {\r\n this._NodeConstructors[type] = constructorFunc;\r\n }\r\n\r\n /**\r\n * Returns a node constructor based on type name\r\n * @param type defines the type name\r\n * @param name defines the new node name\r\n * @param scene defines the hosting scene\r\n * @param options defines optional options to transmit to constructors\r\n * @returns the new constructor or null\r\n */\r\n public static Construct(type: string, name: string, scene: Scene, options?: any): Nullable<() => Node> {\r\n const constructorFunc = this._NodeConstructors[type];\r\n\r\n if (!constructorFunc) {\r\n return null;\r\n }\r\n\r\n return constructorFunc(name, scene, options);\r\n }\r\n\r\n private _nodeDataStorage = new _InternalNodeDataInfo();\r\n\r\n /**\r\n * Gets or sets the name of the node\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * Gets or sets the id of the node\r\n */\r\n @serialize()\r\n public id: string;\r\n\r\n /**\r\n * Gets or sets the unique id of the node\r\n */\r\n @serialize()\r\n public uniqueId: number;\r\n\r\n /**\r\n * Gets or sets a string used to store user defined state for the node\r\n */\r\n @serialize()\r\n public state = \"\";\r\n\r\n /**\r\n * Gets or sets an object used to store user defined information for the node\r\n */\r\n @serialize()\r\n public metadata: any = null;\r\n\r\n /**\r\n * For internal use only. Please do not use.\r\n */\r\n public reservedDataStore: any = null;\r\n\r\n /**\r\n * List of inspectable custom properties (used by the Inspector)\r\n * @see https://doc.babylonjs.com/how_to/debug_layer#extensibility\r\n */\r\n public inspectableCustomProperties: IInspectable[];\r\n\r\n /**\r\n * Gets or sets a boolean used to define if the node must be serialized\r\n */\r\n public get doNotSerialize() {\r\n if (this._nodeDataStorage._doNotSerialize) {\r\n return true;\r\n }\r\n\r\n if (this._parentNode) {\r\n return this._parentNode.doNotSerialize;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public set doNotSerialize(value: boolean) {\r\n this._nodeDataStorage._doNotSerialize = value;\r\n }\r\n\r\n /** @hidden */\r\n public _parentContainer: Nullable<AbstractScene> = null;\r\n\r\n /**\r\n * Gets a list of Animations associated with the node\r\n */\r\n public animations = new Array<Animation>();\r\n protected _ranges: { [name: string]: Nullable<AnimationRange> } = {};\r\n\r\n /**\r\n * Callback raised when the node is ready to be used\r\n */\r\n public onReady: Nullable<(node: Node) => void> = null;\r\n\r\n /** @hidden */\r\n public _currentRenderId = -1;\r\n private _parentUpdateId = -1;\r\n /** @hidden */\r\n public _childUpdateId = -1;\r\n\r\n /** @hidden */\r\n public _waitingParentId: Nullable<string> = null;\r\n /** @hidden */\r\n public _waitingParentInstanceIndex: Nullable<string> = null;\r\n /** @hidden */\r\n public _waitingParsedUniqueId: Nullable<number> = null;\r\n /** @hidden */\r\n public _scene: Scene;\r\n /** @hidden */\r\n public _cache: any = {};\r\n\r\n protected _parentNode: Nullable<Node> = null;\r\n\r\n /** @hidden */\r\n protected _children: Nullable<Node[]> = null;\r\n\r\n /** @hidden */\r\n public _worldMatrix = Matrix.Identity();\r\n /** @hidden */\r\n public _worldMatrixDeterminant = 0;\r\n /** @hidden */\r\n public _worldMatrixDeterminantIsDirty = true;\r\n\r\n /**\r\n * Gets a boolean indicating if the node has been disposed\r\n * @returns true if the node was disposed\r\n */\r\n public isDisposed(): boolean {\r\n return this._nodeDataStorage._isDisposed;\r\n }\r\n\r\n /**\r\n * Gets or sets the parent of the node (without keeping the current position in the scene)\r\n * @see https://doc.babylonjs.com/how_to/parenting\r\n */\r\n public set parent(parent: Nullable<Node>) {\r\n if (this._parentNode === parent) {\r\n return;\r\n }\r\n\r\n const previousParentNode = this._parentNode;\r\n\r\n // Remove self from list of children of parent\r\n if (this._parentNode && this._parentNode._children !== undefined && this._parentNode._children !== null) {\r\n const index = this._parentNode._children.indexOf(this);\r\n if (index !== -1) {\r\n this._parentNode._children.splice(index, 1);\r\n }\r\n\r\n if (!parent && !this._nodeDataStorage._isDisposed) {\r\n this._addToSceneRootNodes();\r\n }\r\n }\r\n\r\n // Store new parent\r\n this._parentNode = parent;\r\n\r\n // Add as child to new parent\r\n if (this._parentNode) {\r\n if (this._parentNode._children === undefined || this._parentNode._children === null) {\r\n this._parentNode._children = new Array<Node>();\r\n }\r\n this._parentNode._children.push(this);\r\n\r\n if (!previousParentNode) {\r\n this._removeFromSceneRootNodes();\r\n }\r\n }\r\n\r\n // Enabled state\r\n this._syncParentEnabledState();\r\n }\r\n\r\n public get parent(): Nullable<Node> {\r\n return this._parentNode;\r\n }\r\n\r\n /**\r\n * @param serializationObject\r\n * @hidden\r\n */\r\n public _serializeAsParent(serializationObject: any): void {\r\n serializationObject.parentId = this.uniqueId;\r\n }\r\n\r\n /** @hidden */\r\n public _addToSceneRootNodes() {\r\n if (this._nodeDataStorage._sceneRootNodesIndex === -1) {\r\n this._nodeDataStorage._sceneRootNodesIndex = this._scene.rootNodes.length;\r\n this._scene.rootNodes.push(this);\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public _removeFromSceneRootNodes() {\r\n if (this._nodeDataStorage._sceneRootNodesIndex !== -1) {\r\n const rootNodes = this._scene.rootNodes;\r\n const lastIdx = rootNodes.length - 1;\r\n rootNodes[this._nodeDataStorage._sceneRootNodesIndex] = rootNodes[lastIdx];\r\n rootNodes[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex = this._nodeDataStorage._sceneRootNodesIndex;\r\n this._scene.rootNodes.pop();\r\n this._nodeDataStorage._sceneRootNodesIndex = -1;\r\n }\r\n }\r\n\r\n private _animationPropertiesOverride: Nullable<AnimationPropertiesOverride> = null;\r\n\r\n /**\r\n * Gets or sets the animation properties override\r\n */\r\n public get animationPropertiesOverride(): Nullable<AnimationPropertiesOverride> {\r\n if (!this._animationPropertiesOverride) {\r\n return this._scene.animationPropertiesOverride;\r\n }\r\n return this._animationPropertiesOverride;\r\n }\r\n\r\n public set animationPropertiesOverride(value: Nullable<AnimationPropertiesOverride>) {\r\n this._animationPropertiesOverride = value;\r\n }\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"Node\" string\r\n */\r\n public getClassName(): string {\r\n return \"Node\";\r\n }\r\n\r\n /** @hidden */\r\n public readonly _isNode = true;\r\n\r\n /**\r\n * An event triggered when the mesh is disposed\r\n */\r\n public onDisposeObservable = new Observable<Node>();\r\n\r\n private _onDisposeObserver: Nullable<Observer<Node>> = null;\r\n /**\r\n * Sets a callback that will be raised when the node will be disposed\r\n */\r\n public set onDispose(callback: () => void) {\r\n if (this._onDisposeObserver) {\r\n this.onDisposeObservable.remove(this._onDisposeObserver);\r\n }\r\n this._onDisposeObserver = this.onDisposeObservable.add(callback);\r\n }\r\n\r\n /**\r\n * An event triggered when the enabled state of the node changes\r\n */\r\n public get onEnabledStateChangedObservable(): Observable<boolean> {\r\n return this._nodeDataStorage._onEnabledStateChangedObservable;\r\n }\r\n\r\n /**\r\n * An event triggered when the node is cloned\r\n */\r\n public get onClonedObservable(): Observable<Node> {\r\n return this._nodeDataStorage._onClonedObservable;\r\n }\r\n\r\n /**\r\n * Creates a new Node\r\n * @param name the name and id to be given to this node\r\n * @param scene the scene this node will be added to\r\n */\r\n constructor(name: string, scene: Nullable<Scene> = null) {\r\n this.name = name;\r\n this.id = name;\r\n this._scene = <Scene>(scene || EngineStore.LastCreatedScene);\r\n this.uniqueId = this._scene.getUniqueId();\r\n this._initCache();\r\n }\r\n\r\n /**\r\n * Gets the scene of the node\r\n * @returns a scene\r\n */\r\n public getScene(): Scene {\r\n return this._scene;\r\n }\r\n\r\n /**\r\n * Gets the engine of the node\r\n * @returns a Engine\r\n */\r\n public getEngine(): Engine {\r\n return this._scene.getEngine();\r\n }\r\n\r\n // Behaviors\r\n private _behaviors = new Array<Behavior<Node>>();\r\n\r\n /**\r\n * Attach a behavior to the node\r\n * @see https://doc.babylonjs.com/features/behaviour\r\n * @param behavior defines the behavior to attach\r\n * @param attachImmediately defines that the behavior must be attached even if the scene is still loading\r\n * @returns the current Node\r\n */\r\n public addBehavior(behavior: Behavior<Node>, attachImmediately = false): Node {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index !== -1) {\r\n return this;\r\n }\r\n\r\n behavior.init();\r\n if (this._scene.isLoading && !attachImmediately) {\r\n // We defer the attach when the scene will be loaded\r\n this._scene.onDataLoadedObservable.addOnce(() => {\r\n behavior.attach(this);\r\n });\r\n } else {\r\n behavior.attach(this);\r\n }\r\n this._behaviors.push(behavior);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Remove an attached behavior\r\n * @see https://doc.babylonjs.com/features/behaviour\r\n * @param behavior defines the behavior to attach\r\n * @returns the current Node\r\n */\r\n public removeBehavior(behavior: Behavior<Node>): Node {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index === -1) {\r\n return this;\r\n }\r\n\r\n this._behaviors[index].detach();\r\n this._behaviors.splice(index, 1);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the list of attached behaviors\r\n * @see https://doc.babylonjs.com/features/behaviour\r\n */\r\n public get behaviors(): Behavior<Node>[] {\r\n return this._behaviors;\r\n }\r\n\r\n /**\r\n * Gets an attached behavior by name\r\n * @param name defines the name of the behavior to look for\r\n * @see https://doc.babylonjs.com/features/behaviour\r\n * @returns null if behavior was not found else the requested behavior\r\n */\r\n public getBehaviorByName(name: string): Nullable<Behavior<Node>> {\r\n for (const behavior of this._behaviors) {\r\n if (behavior.name === name) {\r\n return behavior;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Returns the latest update of the World matrix\r\n * @returns a Matrix\r\n */\r\n public getWorldMatrix(): Matrix {\r\n if (this._currentRenderId !== this._scene.getRenderId()) {\r\n this.computeWorldMatrix();\r\n }\r\n return this._worldMatrix;\r\n }\r\n\r\n /** @hidden */\r\n public _getWorldMatrixDeterminant(): number {\r\n if (this._worldMatrixDeterminantIsDirty) {\r\n this._worldMatrixDeterminantIsDirty = false;\r\n this._worldMatrixDeterminant = this._worldMatrix.determinant();\r\n }\r\n return this._worldMatrixDeterminant;\r\n }\r\n\r\n /**\r\n * Returns directly the latest state of the mesh World matrix.\r\n * A Matrix is returned.\r\n */\r\n public get worldMatrixFromCache(): Matrix {\r\n return this._worldMatrix;\r\n }\r\n\r\n // override it in derived class if you add new variables to the cache\r\n // and call the parent class method\r\n /** @hidden */\r\n public _initCache() {\r\n this._cache = {};\r\n this._cache.parent = undefined;\r\n }\r\n\r\n /**\r\n * @param force\r\n * @hidden\r\n */\r\n public updateCache(force?: boolean): void {\r\n if (!force && this.isSynchronized()) {\r\n return;\r\n }\r\n\r\n this._cache.parent = this.parent;\r\n\r\n this._updateCache();\r\n }\r\n\r\n /**\r\n * @param trigger\r\n * @param initialCall\r\n * @hidden\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public _getActionManagerForTrigger(trigger?: number, initialCall = true): Nullable<AbstractActionManager> {\r\n if (!this.parent) {\r\n return null;\r\n }\r\n\r\n return this.parent._getActionManagerForTrigger(trigger, false);\r\n }\r\n\r\n // override it in derived class if you add new variables to the cache\r\n // and call the parent class method if !ignoreParentClass\r\n /**\r\n * @param ignoreParentClass\r\n * @hidden\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public _updateCache(ignoreParentClass?: boolean): void {}\r\n\r\n // override it in derived class if you add new variables to the cache\r\n /** @hidden */\r\n public _isSynchronized(): boolean {\r\n return true;\r\n }\r\n\r\n /** @hidden */\r\n public _markSyncedWithParent() {\r\n if (this._parentNode) {\r\n this._parentUpdateId = this._parentNode._childUpdateId;\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public isSynchronizedWithParent(): boolean {\r\n if (!this._parentNode) {\r\n return true;\r\n }\r\n\r\n if (this._parentNode._isDirty || this._parentUpdateId !== this._parentNode._childUpdateId) {\r\n return false;\r\n }\r\n\r\n return this._parentNode.isSynchronized();\r\n }\r\n\r\n /** @hidden */\r\n public isSynchronized(): boolean {\r\n if (this._cache.parent !== this._parentNode) {\r\n this._cache.parent = this._parentNode;\r\n return false;\r\n }\r\n\r\n if (this._parentNode && !this.isSynchronizedWithParent()) {\r\n return false;\r\n }\r\n\r\n return this._isSynchronized();\r\n }\r\n\r\n /**\r\n * Is this node ready to be used/rendered\r\n * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)\r\n * @return true if the node is ready\r\n */\r\n public isReady(completeCheck = false): boolean {\r\n return this._nodeDataStorage._isReady;\r\n }\r\n\r\n /**\r\n * Flag the node as dirty (Forcing it to update everything)\r\n * @param property helps children apply precise \"dirtyfication\"\r\n * @returns this node\r\n */\r\n public markAsDirty(property?: string): Node {\r\n this._currentRenderId = Number.MAX_VALUE;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Is this node enabled?\r\n * If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true\r\n * @param checkAncestors indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors\r\n * @return whether this node (and its parent) is enabled\r\n */\r\n public isEnabled(checkAncestors: boolean = true): boolean {\r\n if (checkAncestors === false) {\r\n return this._nodeDataStorage._isEnabled;\r\n }\r\n\r\n if (!this._nodeDataStorage._isEnabled) {\r\n return false;\r\n }\r\n\r\n return this._nodeDataStorage._isParentEnabled;\r\n }\r\n\r\n /** @hidden */\r\n protected _syncParentEnabledState() {\r\n this._nodeDataStorage._isParentEnabled = this._parentNode ? this._parentNode.isEnabled() : true;\r\n\r\n if (this._children) {\r\n this._children.forEach((c) => {\r\n c._syncParentEnabledState(); // Force children to update accordingly\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Set the enabled state of this node\r\n * @param value defines the new enabled state\r\n */\r\n public setEnabled(value: boolean): void {\r\n if (this._nodeDataStorage._isEnabled === value) {\r\n return;\r\n }\r\n this._nodeDataStorage._isEnabled = value;\r\n\r\n this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(value);\r\n\r\n this._syncParentEnabledState();\r\n }\r\n\r\n /**\r\n * Is this node a descendant of the given node?\r\n * The function will iterate up the hierarchy until the ancestor was found or no more parents defined\r\n * @param ancestor defines the parent node to inspect\r\n * @returns a boolean indicating if this node is a descendant of the given node\r\n */\r\n public isDescendantOf(ancestor: Node): boolean {\r\n if (this.parent) {\r\n if (this.parent === ancestor) {\r\n return true;\r\n }\r\n\r\n return this.parent.isDescendantOf(ancestor);\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * @param results\r\n * @param directDescendantsOnly\r\n * @param predicate\r\n * @hidden\r\n */\r\n public _getDescendants(results: Node[], directDescendantsOnly: boolean = false, predicate?: (node: Node) => boolean): void {\r\n if (!this._children) {\r\n return;\r\n }\r\n\r\n for (let index = 0; index < this._children.length; index++) {\r\n const item = this._children[index];\r\n\r\n if (!predicate || predicate(item)) {\r\n results.push(item);\r\n }\r\n\r\n if (!directDescendantsOnly) {\r\n item._getDescendants(results, false, predicate);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Will return all nodes that have this node as ascendant\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @return all children nodes of all types\r\n */\r\n public getDescendants<T extends Node>(directDescendantsOnly?: boolean, predicate?: (node: Node) => node is T): T[];\r\n\r\n /**\r\n * Will return all nodes that have this node as ascendant\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @return all children nodes of all types\r\n */\r\n public getDescendants(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): Node[];\r\n\r\n /**\r\n * Will return all nodes that have this node as ascendant\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @return all children nodes of all types\r\n */\r\n public getDescendants(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): Node[] {\r\n const results = new Array<Node>();\r\n\r\n this._getDescendants(results, directDescendantsOnly, predicate);\r\n\r\n return results;\r\n }\r\n\r\n /**\r\n * Get all child-meshes of this node\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @returns an array of AbstractMesh\r\n */\r\n public getChildMeshes<T extends AbstractMesh>(directDescendantsOnly?: boolean, predicate?: (node: Node) => node is T): T[];\r\n\r\n /**\r\n * Get all child-meshes of this node\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @returns an array of AbstractMesh\r\n */\r\n public getChildMeshes(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): AbstractMesh[];\r\n\r\n /**\r\n * Get all child-meshes of this node\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @returns an array of AbstractMesh\r\n */\r\n public getChildMeshes(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): AbstractMesh[] {\r\n const results: Array<AbstractMesh> = [];\r\n this._getDescendants(results, directDescendantsOnly, (node: Node) => {\r\n return (!predicate || predicate(node)) && (<AbstractMesh>node).cullingStrategy !== undefined;\r\n });\r\n return results;\r\n }\r\n\r\n /**\r\n * Get all direct children of this node\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)\r\n * @returns an array of Node\r\n */\r\n public getChildren<T extends Node>(predicate?: (node: Node) => node is T, directDescendantsOnly?: boolean): T[];\r\n\r\n /**\r\n * Get all direct children of this node\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)\r\n * @returns an array of Node\r\n */\r\n public getChildren(predicate?: (node: Node) => boolean, directDescendantsOnly?: boolean): Node[];\r\n\r\n /**\r\n * Get all direct children of this node\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)\r\n * @returns an array of Node\r\n */\r\n public getChildren(predicate?: (node: Node) => boolean, directDescendantsOnly = true): Node[] {\r\n return this.getDescendants(directDescendantsOnly, predicate);\r\n }\r\n\r\n /**\r\n * @param state\r\n * @hidden\r\n */\r\n public _setReady(state: boolean): void {\r\n if (state === this._nodeDataStorage._isReady) {\r\n return;\r\n }\r\n\r\n if (!state) {\r\n this._nodeDataStorage._isReady = false;\r\n return;\r\n }\r\n\r\n if (this.onReady) {\r\n this.onReady(this);\r\n }\r\n this._nodeDataStorage._isReady = true;\r\n }\r\n\r\n /**\r\n * Get an animation by name\r\n * @param name defines the name of the animation to look for\r\n * @returns null if not found else the requested animation\r\n */\r\n public getAnimationByName(name: string): Nullable<Animation> {\r\n for (let i = 0; i < this.animations.length; i++) {\r\n const animation = this.animations[i];\r\n\r\n if (animation.name === name) {\r\n return animation;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates an animation range for this node\r\n * @param name defines the name of the range\r\n * @param from defines the starting key\r\n * @param to defines the end key\r\n */\r\n public createAnimationRange(name: string, from: number, to: number): void {\r\n // check name not already in use\r\n if (!this._ranges[name]) {\r\n this._ranges[name] = Node._AnimationRangeFactory(name, from, to);\r\n for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) {\r\n if (this.animations[i]) {\r\n this.animations[i].createRange(name, from, to);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Delete a specific animation range\r\n * @param name defines the name of the range to delete\r\n * @param deleteFrames defines if animation frames from the range must be deleted as well\r\n */\r\n public deleteAnimationRange(name: string, deleteFrames = true): void {\r\n for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) {\r\n if (this.animations[i]) {\r\n this.animations[i].deleteRange(name, deleteFrames);\r\n }\r\n }\r\n this._ranges[name] = null; // said much faster than 'delete this._range[name]'\r\n }\r\n\r\n /**\r\n * Get an animation range by name\r\n * @param name defines the name of the animation range to look for\r\n * @returns null if not found else the requested animation range\r\n */\r\n public getAnimationRange(name: string): Nullable<AnimationRange> {\r\n return this._ranges[name] || null;\r\n }\r\n\r\n /**\r\n * Gets the list of all animation ranges defined on this node\r\n * @returns an array\r\n */\r\n public getAnimationRanges(): Nullable<AnimationRange>[] {\r\n const animationRanges: Nullable<AnimationRange>[] = [];\r\n let name: string;\r\n for (name in this._ranges) {\r\n animationRanges.push(this._ranges[name]);\r\n }\r\n return animationRanges;\r\n }\r\n\r\n /**\r\n * Will start the animation sequence\r\n * @param name defines the range frames for animation sequence\r\n * @param loop defines if the animation should loop (false by default)\r\n * @param speedRatio defines the speed factor in which to run the animation (1 by default)\r\n * @param onAnimationEnd defines a function to be executed when the animation ended (undefined by default)\r\n * @returns the object created for this animation. If range does not exist, it will return null\r\n */\r\n public beginAnimation(name: string, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): Nullable<Animatable> {\r\n const range = this.getAnimationRange(name);\r\n\r\n if (!range) {\r\n return null;\r\n }\r\n\r\n return this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Serialize animation ranges into a JSON compatible object\r\n * @returns serialization object\r\n */\r\n public serializeAnimationRanges(): any {\r\n const serializationRanges = [];\r\n for (const name in this._ranges) {\r\n const localRange = this._ranges[name];\r\n if (!localRange) {\r\n continue;\r\n }\r\n const range: any = {};\r\n range.name = name;\r\n range.from = localRange.from;\r\n range.to = localRange.to;\r\n serializationRanges.push(range);\r\n }\r\n return serializationRanges;\r\n }\r\n\r\n /**\r\n * Computes the world matrix of the node\r\n * @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch\r\n * @returns the world matrix\r\n */\r\n public computeWorldMatrix(force?: boolean): Matrix {\r\n if (!this._worldMatrix) {\r\n this._worldMatrix = Matrix.Identity();\r\n }\r\n return this._worldMatrix;\r\n }\r\n\r\n /**\r\n * Releases resources associated with this node.\r\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\r\n * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)\r\n */\r\n public dispose(doNotRecurse?: boolean, disposeMaterialAndTextures = false): void {\r\n this._nodeDataStorage._isDisposed = true;\r\n\r\n if (!doNotRecurse) {\r\n const nodes = this.getDescendants(true);\r\n for (const node of nodes) {\r\n node.dispose(doNotRecurse, disposeMaterialAndTextures);\r\n }\r\n }\r\n\r\n if (!this.parent) {\r\n this._removeFromSceneRootNodes();\r\n } else {\r\n this.parent = null;\r\n }\r\n\r\n // Callback\r\n this.onDisposeObservable.notifyObservers(this);\r\n this.onDisposeObservable.clear();\r\n\r\n this.onEnabledStateChangedObservable.clear();\r\n this.onClonedObservable.clear();\r\n\r\n // Behaviors\r\n for (const behavior of this._behaviors) {\r\n behavior.detach();\r\n }\r\n\r\n this._behaviors.length = 0;\r\n\r\n this.metadata = null;\r\n }\r\n\r\n /**\r\n * Parse animation range data from a serialization object and store them into a given node\r\n * @param node defines where to store the animation ranges\r\n * @param parsedNode defines the serialization object to read data from\r\n * @param scene defines the hosting scene\r\n */\r\n public static ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void {\r\n if (parsedNode.ranges) {\r\n for (let index = 0; index < parsedNode.ranges.length; index++) {\r\n const data = parsedNode.ranges[index];\r\n node.createAnimationRange(data.name, data.from, data.to);\r\n }\r\n }\r\n }\r\n /**\r\n * Return the minimum and maximum world vectors of the entire hierarchy under current node\r\n * @param includeDescendants Include bounding info from descendants as well (true by default)\r\n * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors\r\n * @returns the new bounding vectors\r\n */\r\n public getHierarchyBoundingVectors(includeDescendants = true, predicate: Nullable<(abstractMesh: AbstractMesh) => boolean> = null): { min: Vector3; max: Vector3 } {\r\n // Ensures that all world matrix will be recomputed.\r\n this.getScene().incrementRenderId();\r\n\r\n this.computeWorldMatrix(true);\r\n\r\n let min: Vector3;\r\n let max: Vector3;\r\n\r\n const thisAbstractMesh = this as Node as AbstractMesh;\r\n if (thisAbstractMesh.getBoundingInfo && thisAbstractMesh.subMeshes) {\r\n // If this is an abstract mesh get its bounding info\r\n const boundingInfo = thisAbstractMesh.getBoundingInfo();\r\n min = boundingInfo.boundingBox.minimumWorld.clone();\r\n max = boundingInfo.boundingBox.maximumWorld.clone();\r\n } else {\r\n min = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n max = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\r\n }\r\n\r\n if (includeDescendants) {\r\n const descendants = this.getDescendants(false);\r\n\r\n for (const descendant of descendants) {\r\n const childMesh = <AbstractMesh>descendant;\r\n childMesh.computeWorldMatrix(true);\r\n\r\n // Filters meshes based on custom predicate function.\r\n if (predicate && !predicate(childMesh)) {\r\n continue;\r\n }\r\n\r\n //make sure we have the needed params to get mix and max\r\n if (!childMesh.getBoundingInfo || childMesh.getTotalVertices() === 0) {\r\n continue;\r\n }\r\n\r\n const childBoundingInfo = childMesh.getBoundingInfo();\r\n const boundingBox = childBoundingInfo.boundingBox;\r\n\r\n const minBox = boundingBox.minimumWorld;\r\n const maxBox = boundingBox.maximumWorld;\r\n\r\n Vector3.CheckExtends(minBox, min, max);\r\n Vector3.CheckExtends(maxBox, min, max);\r\n }\r\n }\r\n\r\n return {\r\n min: min,\r\n max: max,\r\n };\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../../lts/core/generated/node.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,O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OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aAC1C;SACJ;QAED,OAAO;YACH,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;SACX,CAAC;IACN,CAAC;;AA96BD;;;;;GAKG;AACH,6DAA6D;AAC/C,2BAAsB,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,EAAU,EAAkB,EAAE;IAC9F,MAAM,WAAW,CAAC,gBAAgB,CAAC,CAAC;AACxC,CAAC,CAAC;AAEa,sBAAiB,GAA2B,EAAE,CAAC;AAmC9D;IADC,SAAS,EAAE;kCACQ;AAMpB;IADC,SAAS,EAAE;gCACM;AAMlB;IADC,SAAS,EAAE;sCACY;AAMxB;IADC,SAAS,EAAE;mCACM;AAMlB;IADC,SAAS,EAAE;sCACgB","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport type { Scene } from \"./scene\";\r\nimport type { Nullable } from \"./types\";\r\nimport { Matrix, Vector3 } from \"./Maths/math.vector\";\r\nimport type { Engine } from \"./Engines/engine\";\r\nimport type { IBehaviorAware, Behavior } from \"./Behaviors/behavior\";\r\nimport { serialize } from \"./Misc/decorators\";\r\nimport type { Observer } from \"./Misc/observable\";\r\nimport { Observable } from \"./Misc/observable\";\r\nimport { EngineStore } from \"./Engines/engineStore\";\r\nimport { _WarnImport } from \"./Misc/devTools\";\r\nimport type { AbstractActionManager } from \"./Actions/abstractActionManager\";\r\nimport type { IInspectable } from \"./Misc/iInspectable\";\r\nimport type { AbstractScene } from \"./abstractScene\";\r\n\r\ndeclare type Animatable = import(\"./Animations/animatable\").Animatable;\r\ndeclare type AnimationPropertiesOverride = import(\"./Animations/animationPropertiesOverride\").AnimationPropertiesOverride;\r\ndeclare type Animation = import(\"./Animations/animation\").Animation;\r\ndeclare type AnimationRange = import(\"./Animations/animationRange\").AnimationRange;\r\ndeclare type AbstractMesh = import(\"./Meshes/abstractMesh\").AbstractMesh;\r\n\r\n/**\r\n * Defines how a node can be built from a string name.\r\n */\r\nexport type NodeConstructor = (name: string, scene: Scene, options?: any) => () => Node;\r\n\r\n/** @hidden */\r\nclass _InternalNodeDataInfo {\r\n public _doNotSerialize = false;\r\n public _isDisposed = false;\r\n public _sceneRootNodesIndex = -1;\r\n public _isEnabled = true;\r\n public _isParentEnabled = true;\r\n public _isReady = true;\r\n public _onEnabledStateChangedObservable = new Observable<boolean>();\r\n public _onClonedObservable = new Observable<Node>();\r\n}\r\n\r\n/**\r\n * Node is the basic class for all scene objects (Mesh, Light, Camera.)\r\n */\r\nexport class Node implements IBehaviorAware<Node> {\r\n protected _isDirty = false;\r\n\r\n /**\r\n * @param name\r\n * @param from\r\n * @param to\r\n * @hidden\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static _AnimationRangeFactory = (name: string, from: number, to: number): AnimationRange => {\r\n throw _WarnImport(\"AnimationRange\");\r\n };\r\n\r\n private static _NodeConstructors: { [key: string]: any } = {};\r\n\r\n /**\r\n * Add a new node constructor\r\n * @param type defines the type name of the node to construct\r\n * @param constructorFunc defines the constructor function\r\n */\r\n public static AddNodeConstructor(type: string, constructorFunc: NodeConstructor) {\r\n this._NodeConstructors[type] = constructorFunc;\r\n }\r\n\r\n /**\r\n * Returns a node constructor based on type name\r\n * @param type defines the type name\r\n * @param name defines the new node name\r\n * @param scene defines the hosting scene\r\n * @param options defines optional options to transmit to constructors\r\n * @returns the new constructor or null\r\n */\r\n public static Construct(type: string, name: string, scene: Scene, options?: any): Nullable<() => Node> {\r\n const constructorFunc = this._NodeConstructors[type];\r\n\r\n if (!constructorFunc) {\r\n return null;\r\n }\r\n\r\n return constructorFunc(name, scene, options);\r\n }\r\n\r\n private _nodeDataStorage = new _InternalNodeDataInfo();\r\n\r\n /**\r\n * Gets or sets the name of the node\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * Gets or sets the id of the node\r\n */\r\n @serialize()\r\n public id: string;\r\n\r\n /**\r\n * Gets or sets the unique id of the node\r\n */\r\n @serialize()\r\n public uniqueId: number;\r\n\r\n /**\r\n * Gets or sets a string used to store user defined state for the node\r\n */\r\n @serialize()\r\n public state = \"\";\r\n\r\n /**\r\n * Gets or sets an object used to store user defined information for the node\r\n */\r\n @serialize()\r\n public metadata: any = null;\r\n\r\n /**\r\n * For internal use only. Please do not use.\r\n */\r\n public reservedDataStore: any = null;\r\n\r\n /**\r\n * List of inspectable custom properties (used by the Inspector)\r\n * @see https://doc.babylonjs.com/how_to/debug_layer#extensibility\r\n */\r\n public inspectableCustomProperties: IInspectable[];\r\n\r\n /**\r\n * Gets or sets a boolean used to define if the node must be serialized\r\n */\r\n public get doNotSerialize() {\r\n if (this._nodeDataStorage._doNotSerialize) {\r\n return true;\r\n }\r\n\r\n if (this._parentNode) {\r\n return this._parentNode.doNotSerialize;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public set doNotSerialize(value: boolean) {\r\n this._nodeDataStorage._doNotSerialize = value;\r\n }\r\n\r\n /** @hidden */\r\n public _parentContainer: Nullable<AbstractScene> = null;\r\n\r\n /**\r\n * Gets a list of Animations associated with the node\r\n */\r\n public animations = new Array<Animation>();\r\n protected _ranges: { [name: string]: Nullable<AnimationRange> } = {};\r\n\r\n /**\r\n * Callback raised when the node is ready to be used\r\n */\r\n public onReady: Nullable<(node: Node) => void> = null;\r\n\r\n /** @hidden */\r\n public _currentRenderId = -1;\r\n private _parentUpdateId = -1;\r\n /** @hidden */\r\n public _childUpdateId = -1;\r\n\r\n /** @hidden */\r\n public _waitingParentId: Nullable<string> = null;\r\n /** @hidden */\r\n public _waitingParentInstanceIndex: Nullable<string> = null;\r\n /** @hidden */\r\n public _waitingParsedUniqueId: Nullable<number> = null;\r\n /** @hidden */\r\n public _scene: Scene;\r\n /** @hidden */\r\n public _cache: any = {};\r\n\r\n protected _parentNode: Nullable<Node> = null;\r\n\r\n /** @hidden */\r\n protected _children: Nullable<Node[]> = null;\r\n\r\n /** @hidden */\r\n public _worldMatrix = Matrix.Identity();\r\n /** @hidden */\r\n public _worldMatrixDeterminant = 0;\r\n /** @hidden */\r\n public _worldMatrixDeterminantIsDirty = true;\r\n\r\n /**\r\n * Gets a boolean indicating if the node has been disposed\r\n * @returns true if the node was disposed\r\n */\r\n public isDisposed(): boolean {\r\n return this._nodeDataStorage._isDisposed;\r\n }\r\n\r\n /**\r\n * Gets or sets the parent of the node (without keeping the current position in the scene)\r\n * @see https://doc.babylonjs.com/how_to/parenting\r\n */\r\n public set parent(parent: Nullable<Node>) {\r\n if (this._parentNode === parent) {\r\n return;\r\n }\r\n\r\n const previousParentNode = this._parentNode;\r\n\r\n // Remove self from list of children of parent\r\n if (this._parentNode && this._parentNode._children !== undefined && this._parentNode._children !== null) {\r\n const index = this._parentNode._children.indexOf(this);\r\n if (index !== -1) {\r\n this._parentNode._children.splice(index, 1);\r\n }\r\n\r\n if (!parent && !this._nodeDataStorage._isDisposed) {\r\n this._addToSceneRootNodes();\r\n }\r\n }\r\n\r\n // Store new parent\r\n this._parentNode = parent;\r\n\r\n // Add as child to new parent\r\n if (this._parentNode) {\r\n if (this._parentNode._children === undefined || this._parentNode._children === null) {\r\n this._parentNode._children = new Array<Node>();\r\n }\r\n this._parentNode._children.push(this);\r\n\r\n if (!previousParentNode) {\r\n this._removeFromSceneRootNodes();\r\n }\r\n }\r\n\r\n // Enabled state\r\n this._syncParentEnabledState();\r\n }\r\n\r\n public get parent(): Nullable<Node> {\r\n return this._parentNode;\r\n }\r\n\r\n /**\r\n * @param serializationObject\r\n * @hidden\r\n */\r\n public _serializeAsParent(serializationObject: any): void {\r\n serializationObject.parentId = this.uniqueId;\r\n }\r\n\r\n /** @hidden */\r\n public _addToSceneRootNodes() {\r\n if (this._nodeDataStorage._sceneRootNodesIndex === -1) {\r\n this._nodeDataStorage._sceneRootNodesIndex = this._scene.rootNodes.length;\r\n this._scene.rootNodes.push(this);\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public _removeFromSceneRootNodes() {\r\n if (this._nodeDataStorage._sceneRootNodesIndex !== -1) {\r\n const rootNodes = this._scene.rootNodes;\r\n const lastIdx = rootNodes.length - 1;\r\n rootNodes[this._nodeDataStorage._sceneRootNodesIndex] = rootNodes[lastIdx];\r\n rootNodes[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex = this._nodeDataStorage._sceneRootNodesIndex;\r\n this._scene.rootNodes.pop();\r\n this._nodeDataStorage._sceneRootNodesIndex = -1;\r\n }\r\n }\r\n\r\n private _animationPropertiesOverride: Nullable<AnimationPropertiesOverride> = null;\r\n\r\n /**\r\n * Gets or sets the animation properties override\r\n */\r\n public get animationPropertiesOverride(): Nullable<AnimationPropertiesOverride> {\r\n if (!this._animationPropertiesOverride) {\r\n return this._scene.animationPropertiesOverride;\r\n }\r\n return this._animationPropertiesOverride;\r\n }\r\n\r\n public set animationPropertiesOverride(value: Nullable<AnimationPropertiesOverride>) {\r\n this._animationPropertiesOverride = value;\r\n }\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"Node\" string\r\n */\r\n public getClassName(): string {\r\n return \"Node\";\r\n }\r\n\r\n /** @hidden */\r\n public readonly _isNode = true;\r\n\r\n /**\r\n * An event triggered when the mesh is disposed\r\n */\r\n public onDisposeObservable = new Observable<Node>();\r\n\r\n private _onDisposeObserver: Nullable<Observer<Node>> = null;\r\n /**\r\n * Sets a callback that will be raised when the node will be disposed\r\n */\r\n public set onDispose(callback: () => void) {\r\n if (this._onDisposeObserver) {\r\n this.onDisposeObservable.remove(this._onDisposeObserver);\r\n }\r\n this._onDisposeObserver = this.onDisposeObservable.add(callback);\r\n }\r\n\r\n /**\r\n * An event triggered when the enabled state of the node changes\r\n */\r\n public get onEnabledStateChangedObservable(): Observable<boolean> {\r\n return this._nodeDataStorage._onEnabledStateChangedObservable;\r\n }\r\n\r\n /**\r\n * An event triggered when the node is cloned\r\n */\r\n public get onClonedObservable(): Observable<Node> {\r\n return this._nodeDataStorage._onClonedObservable;\r\n }\r\n\r\n /**\r\n * Creates a new Node\r\n * @param name the name and id to be given to this node\r\n * @param scene the scene this node will be added to\r\n */\r\n constructor(name: string, scene: Nullable<Scene> = null) {\r\n this.name = name;\r\n this.id = name;\r\n this._scene = <Scene>(scene || EngineStore.LastCreatedScene);\r\n this.uniqueId = this._scene.getUniqueId();\r\n this._initCache();\r\n }\r\n\r\n /**\r\n * Gets the scene of the node\r\n * @returns a scene\r\n */\r\n public getScene(): Scene {\r\n return this._scene;\r\n }\r\n\r\n /**\r\n * Gets the engine of the node\r\n * @returns a Engine\r\n */\r\n public getEngine(): Engine {\r\n return this._scene.getEngine();\r\n }\r\n\r\n // Behaviors\r\n private _behaviors = new Array<Behavior<Node>>();\r\n\r\n /**\r\n * Attach a behavior to the node\r\n * @see https://doc.babylonjs.com/features/behaviour\r\n * @param behavior defines the behavior to attach\r\n * @param attachImmediately defines that the behavior must be attached even if the scene is still loading\r\n * @returns the current Node\r\n */\r\n public addBehavior(behavior: Behavior<Node>, attachImmediately = false): Node {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index !== -1) {\r\n return this;\r\n }\r\n\r\n behavior.init();\r\n if (this._scene.isLoading && !attachImmediately) {\r\n // We defer the attach when the scene will be loaded\r\n this._scene.onDataLoadedObservable.addOnce(() => {\r\n behavior.attach(this);\r\n });\r\n } else {\r\n behavior.attach(this);\r\n }\r\n this._behaviors.push(behavior);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Remove an attached behavior\r\n * @see https://doc.babylonjs.com/features/behaviour\r\n * @param behavior defines the behavior to attach\r\n * @returns the current Node\r\n */\r\n public removeBehavior(behavior: Behavior<Node>): Node {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index === -1) {\r\n return this;\r\n }\r\n\r\n this._behaviors[index].detach();\r\n this._behaviors.splice(index, 1);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the list of attached behaviors\r\n * @see https://doc.babylonjs.com/features/behaviour\r\n */\r\n public get behaviors(): Behavior<Node>[] {\r\n return this._behaviors;\r\n }\r\n\r\n /**\r\n * Gets an attached behavior by name\r\n * @param name defines the name of the behavior to look for\r\n * @see https://doc.babylonjs.com/features/behaviour\r\n * @returns null if behavior was not found else the requested behavior\r\n */\r\n public getBehaviorByName(name: string): Nullable<Behavior<Node>> {\r\n for (const behavior of this._behaviors) {\r\n if (behavior.name === name) {\r\n return behavior;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Returns the latest update of the World matrix\r\n * @returns a Matrix\r\n */\r\n public getWorldMatrix(): Matrix {\r\n if (this._currentRenderId !== this._scene.getRenderId()) {\r\n this.computeWorldMatrix();\r\n }\r\n return this._worldMatrix;\r\n }\r\n\r\n /** @hidden */\r\n public _getWorldMatrixDeterminant(): number {\r\n if (this._worldMatrixDeterminantIsDirty) {\r\n this._worldMatrixDeterminantIsDirty = false;\r\n this._worldMatrixDeterminant = this._worldMatrix.determinant();\r\n }\r\n return this._worldMatrixDeterminant;\r\n }\r\n\r\n /**\r\n * Returns directly the latest state of the mesh World matrix.\r\n * A Matrix is returned.\r\n */\r\n public get worldMatrixFromCache(): Matrix {\r\n return this._worldMatrix;\r\n }\r\n\r\n // override it in derived class if you add new variables to the cache\r\n // and call the parent class method\r\n /** @hidden */\r\n public _initCache() {\r\n this._cache = {};\r\n this._cache.parent = undefined;\r\n }\r\n\r\n /**\r\n * @param force\r\n * @hidden\r\n */\r\n public updateCache(force?: boolean): void {\r\n if (!force && this.isSynchronized()) {\r\n return;\r\n }\r\n\r\n this._cache.parent = this.parent;\r\n\r\n this._updateCache();\r\n }\r\n\r\n /**\r\n * @param trigger\r\n * @param initialCall\r\n * @hidden\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public _getActionManagerForTrigger(trigger?: number, initialCall = true): Nullable<AbstractActionManager> {\r\n if (!this.parent) {\r\n return null;\r\n }\r\n\r\n return this.parent._getActionManagerForTrigger(trigger, false);\r\n }\r\n\r\n // override it in derived class if you add new variables to the cache\r\n // and call the parent class method if !ignoreParentClass\r\n /**\r\n * @param ignoreParentClass\r\n * @hidden\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public _updateCache(ignoreParentClass?: boolean): void {}\r\n\r\n // override it in derived class if you add new variables to the cache\r\n /** @hidden */\r\n public _isSynchronized(): boolean {\r\n return true;\r\n }\r\n\r\n /** @hidden */\r\n public _markSyncedWithParent() {\r\n if (this._parentNode) {\r\n this._parentUpdateId = this._parentNode._childUpdateId;\r\n }\r\n }\r\n\r\n /** @hidden */\r\n public isSynchronizedWithParent(): boolean {\r\n if (!this._parentNode) {\r\n return true;\r\n }\r\n\r\n if (this._parentNode._isDirty || this._parentUpdateId !== this._parentNode._childUpdateId) {\r\n return false;\r\n }\r\n\r\n return this._parentNode.isSynchronized();\r\n }\r\n\r\n /** @hidden */\r\n public isSynchronized(): boolean {\r\n if (this._cache.parent !== this._parentNode) {\r\n this._cache.parent = this._parentNode;\r\n return false;\r\n }\r\n\r\n if (this._parentNode && !this.isSynchronizedWithParent()) {\r\n return false;\r\n }\r\n\r\n return this._isSynchronized();\r\n }\r\n\r\n /**\r\n * Is this node ready to be used/rendered\r\n * @param completeCheck defines if a complete check (including materials and lights) has to be done (false by default)\r\n * @returns true if the node is ready\r\n */\r\n public isReady(completeCheck = false): boolean {\r\n return this._nodeDataStorage._isReady;\r\n }\r\n\r\n /**\r\n * Flag the node as dirty (Forcing it to update everything)\r\n * @param property helps children apply precise \"dirtyfication\"\r\n * @returns this node\r\n */\r\n public markAsDirty(property?: string): Node {\r\n this._currentRenderId = Number.MAX_VALUE;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Is this node enabled?\r\n * If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true\r\n * @param checkAncestors indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors\r\n * @returns whether this node (and its parent) is enabled\r\n */\r\n public isEnabled(checkAncestors: boolean = true): boolean {\r\n if (checkAncestors === false) {\r\n return this._nodeDataStorage._isEnabled;\r\n }\r\n\r\n if (!this._nodeDataStorage._isEnabled) {\r\n return false;\r\n }\r\n\r\n return this._nodeDataStorage._isParentEnabled;\r\n }\r\n\r\n /** @hidden */\r\n protected _syncParentEnabledState() {\r\n this._nodeDataStorage._isParentEnabled = this._parentNode ? this._parentNode.isEnabled() : true;\r\n\r\n if (this._children) {\r\n this._children.forEach((c) => {\r\n c._syncParentEnabledState(); // Force children to update accordingly\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Set the enabled state of this node\r\n * @param value defines the new enabled state\r\n */\r\n public setEnabled(value: boolean): void {\r\n if (this._nodeDataStorage._isEnabled === value) {\r\n return;\r\n }\r\n this._nodeDataStorage._isEnabled = value;\r\n\r\n this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(value);\r\n\r\n this._syncParentEnabledState();\r\n }\r\n\r\n /**\r\n * Is this node a descendant of the given node?\r\n * The function will iterate up the hierarchy until the ancestor was found or no more parents defined\r\n * @param ancestor defines the parent node to inspect\r\n * @returns a boolean indicating if this node is a descendant of the given node\r\n */\r\n public isDescendantOf(ancestor: Node): boolean {\r\n if (this.parent) {\r\n if (this.parent === ancestor) {\r\n return true;\r\n }\r\n\r\n return this.parent.isDescendantOf(ancestor);\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * @param results\r\n * @param directDescendantsOnly\r\n * @param predicate\r\n * @hidden\r\n */\r\n public _getDescendants(results: Node[], directDescendantsOnly: boolean = false, predicate?: (node: Node) => boolean): void {\r\n if (!this._children) {\r\n return;\r\n }\r\n\r\n for (let index = 0; index < this._children.length; index++) {\r\n const item = this._children[index];\r\n\r\n if (!predicate || predicate(item)) {\r\n results.push(item);\r\n }\r\n\r\n if (!directDescendantsOnly) {\r\n item._getDescendants(results, false, predicate);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Will return all nodes that have this node as ascendant\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @returns all children nodes of all types\r\n */\r\n public getDescendants<T extends Node>(directDescendantsOnly?: boolean, predicate?: (node: Node) => node is T): T[];\r\n\r\n /**\r\n * Will return all nodes that have this node as ascendant\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @returns all children nodes of all types\r\n */\r\n public getDescendants(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): Node[];\r\n\r\n /**\r\n * Will return all nodes that have this node as ascendant\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @returns all children nodes of all types\r\n */\r\n public getDescendants(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): Node[] {\r\n const results = new Array<Node>();\r\n\r\n this._getDescendants(results, directDescendantsOnly, predicate);\r\n\r\n return results;\r\n }\r\n\r\n /**\r\n * Get all child-meshes of this node\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @returns an array of AbstractMesh\r\n */\r\n public getChildMeshes<T extends AbstractMesh>(directDescendantsOnly?: boolean, predicate?: (node: Node) => node is T): T[];\r\n\r\n /**\r\n * Get all child-meshes of this node\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @returns an array of AbstractMesh\r\n */\r\n public getChildMeshes(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): AbstractMesh[];\r\n\r\n /**\r\n * Get all child-meshes of this node\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @returns an array of AbstractMesh\r\n */\r\n public getChildMeshes(directDescendantsOnly?: boolean, predicate?: (node: Node) => boolean): AbstractMesh[] {\r\n const results: Array<AbstractMesh> = [];\r\n this._getDescendants(results, directDescendantsOnly, (node: Node) => {\r\n return (!predicate || predicate(node)) && (<AbstractMesh>node).cullingStrategy !== undefined;\r\n });\r\n return results;\r\n }\r\n\r\n /**\r\n * Get all direct children of this node\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)\r\n * @returns an array of Node\r\n */\r\n public getChildren<T extends Node>(predicate?: (node: Node) => node is T, directDescendantsOnly?: boolean): T[];\r\n\r\n /**\r\n * Get all direct children of this node\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)\r\n * @returns an array of Node\r\n */\r\n public getChildren(predicate?: (node: Node) => boolean, directDescendantsOnly?: boolean): Node[];\r\n\r\n /**\r\n * Get all direct children of this node\r\n * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored\r\n * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)\r\n * @returns an array of Node\r\n */\r\n public getChildren(predicate?: (node: Node) => boolean, directDescendantsOnly = true): Node[] {\r\n return this.getDescendants(directDescendantsOnly, predicate);\r\n }\r\n\r\n /**\r\n * @param state\r\n * @hidden\r\n */\r\n public _setReady(state: boolean): void {\r\n if (state === this._nodeDataStorage._isReady) {\r\n return;\r\n }\r\n\r\n if (!state) {\r\n this._nodeDataStorage._isReady = false;\r\n return;\r\n }\r\n\r\n if (this.onReady) {\r\n this.onReady(this);\r\n }\r\n this._nodeDataStorage._isReady = true;\r\n }\r\n\r\n /**\r\n * Get an animation by name\r\n * @param name defines the name of the animation to look for\r\n * @returns null if not found else the requested animation\r\n */\r\n public getAnimationByName(name: string): Nullable<Animation> {\r\n for (let i = 0; i < this.animations.length; i++) {\r\n const animation = this.animations[i];\r\n\r\n if (animation.name === name) {\r\n return animation;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Creates an animation range for this node\r\n * @param name defines the name of the range\r\n * @param from defines the starting key\r\n * @param to defines the end key\r\n */\r\n public createAnimationRange(name: string, from: number, to: number): void {\r\n // check name not already in use\r\n if (!this._ranges[name]) {\r\n this._ranges[name] = Node._AnimationRangeFactory(name, from, to);\r\n for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) {\r\n if (this.animations[i]) {\r\n this.animations[i].createRange(name, from, to);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Delete a specific animation range\r\n * @param name defines the name of the range to delete\r\n * @param deleteFrames defines if animation frames from the range must be deleted as well\r\n */\r\n public deleteAnimationRange(name: string, deleteFrames = true): void {\r\n for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) {\r\n if (this.animations[i]) {\r\n this.animations[i].deleteRange(name, deleteFrames);\r\n }\r\n }\r\n this._ranges[name] = null; // said much faster than 'delete this._range[name]'\r\n }\r\n\r\n /**\r\n * Get an animation range by name\r\n * @param name defines the name of the animation range to look for\r\n * @returns null if not found else the requested animation range\r\n */\r\n public getAnimationRange(name: string): Nullable<AnimationRange> {\r\n return this._ranges[name] || null;\r\n }\r\n\r\n /**\r\n * Gets the list of all animation ranges defined on this node\r\n * @returns an array\r\n */\r\n public getAnimationRanges(): Nullable<AnimationRange>[] {\r\n const animationRanges: Nullable<AnimationRange>[] = [];\r\n let name: string;\r\n for (name in this._ranges) {\r\n animationRanges.push(this._ranges[name]);\r\n }\r\n return animationRanges;\r\n }\r\n\r\n /**\r\n * Will start the animation sequence\r\n * @param name defines the range frames for animation sequence\r\n * @param loop defines if the animation should loop (false by default)\r\n * @param speedRatio defines the speed factor in which to run the animation (1 by default)\r\n * @param onAnimationEnd defines a function to be executed when the animation ended (undefined by default)\r\n * @returns the object created for this animation. If range does not exist, it will return null\r\n */\r\n public beginAnimation(name: string, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void): Nullable<Animatable> {\r\n const range = this.getAnimationRange(name);\r\n\r\n if (!range) {\r\n return null;\r\n }\r\n\r\n return this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd);\r\n }\r\n\r\n /**\r\n * Serialize animation ranges into a JSON compatible object\r\n * @returns serialization object\r\n */\r\n public serializeAnimationRanges(): any {\r\n const serializationRanges = [];\r\n for (const name in this._ranges) {\r\n const localRange = this._ranges[name];\r\n if (!localRange) {\r\n continue;\r\n }\r\n const range: any = {};\r\n range.name = name;\r\n range.from = localRange.from;\r\n range.to = localRange.to;\r\n serializationRanges.push(range);\r\n }\r\n return serializationRanges;\r\n }\r\n\r\n /**\r\n * Computes the world matrix of the node\r\n * @param force defines if the cache version should be invalidated forcing the world matrix to be created from scratch\r\n * @returns the world matrix\r\n */\r\n public computeWorldMatrix(force?: boolean): Matrix {\r\n if (!this._worldMatrix) {\r\n this._worldMatrix = Matrix.Identity();\r\n }\r\n return this._worldMatrix;\r\n }\r\n\r\n /**\r\n * Releases resources associated with this node.\r\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\r\n * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)\r\n */\r\n public dispose(doNotRecurse?: boolean, disposeMaterialAndTextures = false): void {\r\n this._nodeDataStorage._isDisposed = true;\r\n\r\n if (!doNotRecurse) {\r\n const nodes = this.getDescendants(true);\r\n for (const node of nodes) {\r\n node.dispose(doNotRecurse, disposeMaterialAndTextures);\r\n }\r\n }\r\n\r\n if (!this.parent) {\r\n this._removeFromSceneRootNodes();\r\n } else {\r\n this.parent = null;\r\n }\r\n\r\n // Callback\r\n this.onDisposeObservable.notifyObservers(this);\r\n this.onDisposeObservable.clear();\r\n\r\n this.onEnabledStateChangedObservable.clear();\r\n this.onClonedObservable.clear();\r\n\r\n // Behaviors\r\n for (const behavior of this._behaviors) {\r\n behavior.detach();\r\n }\r\n\r\n this._behaviors.length = 0;\r\n\r\n this.metadata = null;\r\n }\r\n\r\n /**\r\n * Parse animation range data from a serialization object and store them into a given node\r\n * @param node defines where to store the animation ranges\r\n * @param parsedNode defines the serialization object to read data from\r\n * @param scene defines the hosting scene\r\n */\r\n public static ParseAnimationRanges(node: Node, parsedNode: any, scene: Scene): void {\r\n if (parsedNode.ranges) {\r\n for (let index = 0; index < parsedNode.ranges.length; index++) {\r\n const data = parsedNode.ranges[index];\r\n node.createAnimationRange(data.name, data.from, data.to);\r\n }\r\n }\r\n }\r\n /**\r\n * Return the minimum and maximum world vectors of the entire hierarchy under current node\r\n * @param includeDescendants Include bounding info from descendants as well (true by default)\r\n * @param predicate defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors\r\n * @returns the new bounding vectors\r\n */\r\n public getHierarchyBoundingVectors(includeDescendants = true, predicate: Nullable<(abstractMesh: AbstractMesh) => boolean> = null): { min: Vector3; max: Vector3 } {\r\n // Ensures that all world matrix will be recomputed.\r\n this.getScene().incrementRenderId();\r\n\r\n this.computeWorldMatrix(true);\r\n\r\n let min: Vector3;\r\n let max: Vector3;\r\n\r\n const thisAbstractMesh = this as Node as AbstractMesh;\r\n if (thisAbstractMesh.getBoundingInfo && thisAbstractMesh.subMeshes) {\r\n // If this is an abstract mesh get its bounding info\r\n const boundingInfo = thisAbstractMesh.getBoundingInfo();\r\n min = boundingInfo.boundingBox.minimumWorld.clone();\r\n max = boundingInfo.boundingBox.maximumWorld.clone();\r\n } else {\r\n min = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n max = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\r\n }\r\n\r\n if (includeDescendants) {\r\n const descendants = this.getDescendants(false);\r\n\r\n for (const descendant of descendants) {\r\n const childMesh = <AbstractMesh>descendant;\r\n childMesh.computeWorldMatrix(true);\r\n\r\n // Filters meshes based on custom predicate function.\r\n if (predicate && !predicate(childMesh)) {\r\n continue;\r\n }\r\n\r\n //make sure we have the needed params to get mix and max\r\n if (!childMesh.getBoundingInfo || childMesh.getTotalVertices() === 0) {\r\n continue;\r\n }\r\n\r\n const childBoundingInfo = childMesh.getBoundingInfo();\r\n const boundingBox = childBoundingInfo.boundingBox;\r\n\r\n const minBox = boundingBox.minimumWorld;\r\n const maxBox = boundingBox.maximumWorld;\r\n\r\n Vector3.CheckExtends(minBox, min, max);\r\n Vector3.CheckExtends(maxBox, min, max);\r\n }\r\n }\r\n\r\n return {\r\n min: min,\r\n max: max,\r\n };\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -118,7 +118,3 @@ Please see the [Contributing Guidelines](./contributing.md)
|
|
|
118
118
|
## Features
|
|
119
119
|
|
|
120
120
|
To get a complete list of supported features, please visit our [website](https://www.babylonjs.com/#specifications).
|
|
121
|
-
|
|
122
|
-
## Build
|
|
123
|
-
|
|
124
|
-
Babylon.js is automatically built using [Gulp](https://gulpjs.com/). For further instructions see the readme at [/Tools/Gulp](https://github.com/BabylonJS/Babylon.js/tree/master/Tools/Gulp).
|