@babylonjs/core 5.28.0 → 5.30.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/actionManager.js +2 -0
- package/Actions/actionManager.js.map +1 -1
- package/Cameras/camera.js +4 -4
- package/Cameras/camera.js.map +1 -1
- package/Collisions/pickingInfo.d.ts +1 -2
- package/Collisions/pickingInfo.js +7 -4
- package/Collisions/pickingInfo.js.map +1 -1
- package/Culling/ray.d.ts +1 -1
- package/Culling/ray.js +5 -6
- package/Culling/ray.js.map +1 -1
- package/Debug/debugLayer.d.ts +5 -0
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +5 -1
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.videoTexture.js +6 -3
- package/Engines/Extensions/engine.videoTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +4 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +2 -0
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js +3 -7
- package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +2 -0
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTintWASM.d.ts +1 -0
- package/Engines/WebGPU/webgpuTintWASM.js +7 -1
- package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
- package/Engines/constants.d.ts +4 -0
- package/Engines/constants.js +4 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +45 -12
- package/Engines/renderTargetWrapper.d.ts +2 -1
- package/Engines/renderTargetWrapper.js +1 -0
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +6 -3
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +0 -2
- package/Engines/webgpuEngine.js +15 -14
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/pointerEvents.d.ts +11 -6
- package/Events/pointerEvents.js +24 -6
- package/Events/pointerEvents.js.map +1 -1
- package/IAccessibilityTag.d.ts +29 -0
- package/IAccessibilityTag.js +2 -0
- package/IAccessibilityTag.js.map +1 -0
- package/Inputs/scene.inputManager.d.ts +9 -1
- package/Inputs/scene.inputManager.js +83 -37
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.js +2 -6
- package/Layers/effectLayer.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.d.ts +24 -3
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +92 -21
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.d.ts +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.d.ts +5 -0
- package/Materials/Textures/htmlElementTexture.js +4 -1
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +1 -1
- package/Materials/Textures/renderTargetTexture.js +2 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/videoTexture.d.ts +6 -1
- package/Materials/Textures/videoTexture.js +7 -2
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Maths/math.vector.d.ts +460 -337
- package/Maths/math.vector.js +370 -184
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/decalBuilder.d.ts +8 -0
- package/Meshes/Builders/decalBuilder.js +270 -51
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/mesh.d.ts +1 -1
- package/Meshes/mesh.js +42 -1
- package/Meshes/mesh.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.d.ts +17 -4
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +49 -9
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
- package/Misc/iInspectable.d.ts +5 -1
- package/Misc/iInspectable.js +4 -0
- package/Misc/iInspectable.js.map +1 -1
- package/Misc/index.d.ts +1 -1
- package/Misc/index.js +1 -1
- package/Misc/index.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +41 -46
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/observable.js +4 -4
- package/Misc/observable.js.map +1 -1
- package/Misc/pressureObserverWrapper.d.ts +36 -0
- package/Misc/pressureObserverWrapper.js +68 -0
- package/Misc/pressureObserverWrapper.js.map +1 -0
- package/Misc/screenshotTools.js +0 -1
- package/Misc/screenshotTools.js.map +1 -1
- package/Particles/particleSystem.d.ts +4 -0
- package/Particles/particleSystem.js +12 -4
- package/Particles/particleSystem.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.d.ts +14 -8
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +16 -6
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +2 -1
- package/PostProcesses/blurPostProcess.js +3 -2
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.js +2 -1
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.js +3 -5
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.js +9 -4
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/postProcess.js +4 -4
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +2 -6
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js +4 -0
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/depthRenderer.js +2 -6
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +2 -6
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/renderingGroup.d.ts +4 -0
- package/Rendering/renderingGroup.js +7 -1
- package/Rendering/renderingGroup.js.map +1 -1
- package/Rendering/renderingManager.d.ts +8 -0
- package/Rendering/renderingManager.js +18 -0
- package/Rendering/renderingManager.js.map +1 -1
- package/Shaders/ShadersInclude/shadowsFragmentFunctions.js +18 -13
- package/Shaders/ShadersInclude/shadowsFragmentFunctions.js.map +1 -1
- package/Shaders/circleOfConfusion.fragment.js +1 -1
- package/Shaders/circleOfConfusion.fragment.js.map +1 -1
- package/Shaders/depthOfFieldMerge.fragment.js +1 -1
- package/Shaders/depthOfFieldMerge.fragment.js.map +1 -1
- package/Shaders/fxaa.fragment.js +10 -5
- package/Shaders/fxaa.fragment.js.map +1 -1
- package/Shaders/kernelBlur.fragment.js +2 -2
- package/Shaders/kernelBlur.fragment.js.map +1 -1
- package/Shaders/particles.vertex.js +4 -1
- package/Shaders/particles.vertex.js.map +1 -1
- package/Shaders/spriteMap.fragment.js +7 -2
- package/Shaders/spriteMap.fragment.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js +1 -0
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/webXRRenderTargetTextureProvider.js +1 -0
- package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
- package/node.d.ts +8 -0
- package/node.js +13 -1
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +6 -8
- package/scene.js +11 -30
- package/scene.js.map +1 -1
- package/Misc/computePressure.d.ts +0 -57
- package/Misc/computePressure.js +0 -48
- package/Misc/computePressure.js.map +0 -1
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,gBAAgB;AAChB,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;IA0Rb;;;;OAIG;IACH,YAAY,IAAY,EAAE,QAAyB,IAAI;QA9R7C,aAAQ,GAAG,KAAK,CAAC;QAsCnB,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,gBAAgB;QACT,qBAAgB,GAA4B,IAAI,CAAC;QAExD;;WAEG;QACI,eAAU,GAAG,IAAI,KAAK,EAAa,CAAC;QACjC,YAAO,GAAiD,EAAE,CAAC;QAErE;;WAEG;QACI,YAAO,GAAm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CAAC;gBAElD,MAAM,MAAM,GAAG,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;;AA/5BD;;GAEG;AACW,2BAAsB,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,GAAW,EAAkB,EAAE;IACjG,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/** @internal */\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 * @internal\r\n */\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 /** @internal */\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 /** @internal */\r\n public _currentRenderId = -1;\r\n private _parentUpdateId = -1;\r\n /** @internal */\r\n public _childUpdateId = -1;\r\n\r\n /** @internal */\r\n public _waitingParentId: Nullable<string> = null;\r\n /** @internal */\r\n public _waitingParentInstanceIndex: Nullable<string> = null;\r\n /** @internal */\r\n public _waitingParsedUniqueId: Nullable<number> = null;\r\n /** @internal */\r\n public _scene: Scene;\r\n /** @internal */\r\n public _cache: any = {};\r\n\r\n protected _parentNode: Nullable<Node> = null;\r\n\r\n /** @internal */\r\n protected _children: Nullable<Node[]> = null;\r\n\r\n /** @internal */\r\n public _worldMatrix = Matrix.Identity();\r\n /** @internal */\r\n public _worldMatrixDeterminant = 0;\r\n /** @internal */\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 * @internal\r\n */\r\n public _serializeAsParent(serializationObject: any): void {\r\n serializationObject.parentId = this.uniqueId;\r\n }\r\n\r\n /** @internal */\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 /** @internal */\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 /** @internal */\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 /** @internal */\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 /** @internal */\r\n public _initCache() {\r\n this._cache = {};\r\n this._cache.parent = undefined;\r\n }\r\n\r\n /**\r\n * @internal\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 * @internal\r\n */\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 * @internal\r\n */\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 /** @internal */\r\n public _isSynchronized(): boolean {\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n public _markSyncedWithParent() {\r\n if (this._parentNode) {\r\n this._parentUpdateId = this._parentNode._childUpdateId;\r\n }\r\n }\r\n\r\n /** @internal */\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 /** @internal */\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 /** @internal */\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 * @internal\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 * @internal\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,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;AAiB9C,gBAAgB;AAChB,MAA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,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;;AA76BD;;GAEG;AACW,2BAAsB,GAAG,CAAC,KAAa,EAAE,KAAa,EAAE,GAAW,EAAkB,EAAE;IACjG,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\nimport type { IAccessibilityTag } from \"./IAccessibilityTag\";\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/** @internal */\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 * @internal\r\n */\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 the accessibility tag to describe the node for accessibility purpose.\r\n */\r\n public set accessibilityTag(value: Nullable<IAccessibilityTag>) {\r\n this._accessibilityTag = value;\r\n this.onAccessibilityTagChangedObservable.notifyObservers(value);\r\n }\r\n\r\n public get accessibilityTag() {\r\n return this._accessibilityTag;\r\n }\r\n\r\n protected _accessibilityTag: Nullable<IAccessibilityTag> = null;\r\n\r\n public onAccessibilityTagChangedObservable = new Observable<Nullable<IAccessibilityTag>>();\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 /** @internal */\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 /** @internal */\r\n public _currentRenderId = -1;\r\n private _parentUpdateId = -1;\r\n /** @internal */\r\n public _childUpdateId = -1;\r\n\r\n /** @internal */\r\n public _waitingParentId: Nullable<string> = null;\r\n /** @internal */\r\n public _waitingParentInstanceIndex: Nullable<string> = null;\r\n /** @internal */\r\n public _waitingParsedUniqueId: Nullable<number> = null;\r\n /** @internal */\r\n public _scene: Scene;\r\n /** @internal */\r\n public _cache: any = {};\r\n\r\n protected _parentNode: Nullable<Node> = null;\r\n\r\n /** @internal */\r\n protected _children: Nullable<Node[]> = null;\r\n\r\n /** @internal */\r\n public _worldMatrix = Matrix.Identity();\r\n /** @internal */\r\n public _worldMatrixDeterminant = 0;\r\n /** @internal */\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 * @internal\r\n */\r\n public _serializeAsParent(serializationObject: any): void {\r\n serializationObject.parentId = this.uniqueId;\r\n }\r\n\r\n /** @internal */\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 /** @internal */\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 /** @internal */\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 /** @internal */\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 /** @internal */\r\n public _initCache() {\r\n this._cache = {};\r\n this._cache.parent = undefined;\r\n }\r\n\r\n /**\r\n * @internal\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 * @internal\r\n */\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 * @internal\r\n */\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 /** @internal */\r\n public _isSynchronized(): boolean {\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n public _markSyncedWithParent() {\r\n if (this._parentNode) {\r\n this._parentUpdateId = this._parentNode._childUpdateId;\r\n }\r\n }\r\n\r\n /** @internal */\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 /** @internal */\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 /** @internal */\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 this._syncParentEnabledState();\r\n this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(value);\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 * @internal\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 * @internal\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/scene.d.ts
CHANGED
|
@@ -30,7 +30,6 @@ import type { Plane } from "./Maths/math.plane";
|
|
|
30
30
|
import type { LoadFileError, RequestFileError, ReadFileError } from "./Misc/fileTools";
|
|
31
31
|
import type { IClipPlanesHolder } from "./Misc/interfaces/iClipPlanesHolder";
|
|
32
32
|
import type { IPointerEvent } from "./Events/deviceInputEvents";
|
|
33
|
-
import type { IComputePressureData } from "./Misc/computePressure";
|
|
34
33
|
declare type Ray = import("./Culling/ray").Ray;
|
|
35
34
|
declare type TrianglePickingPredicate = import("./Culling/ray").TrianglePickingPredicate;
|
|
36
35
|
declare type Animation = import("./Animations/animation").Animation;
|
|
@@ -1833,6 +1832,7 @@ export declare class Scene extends AbstractScene implements IAnimatable, IClipPl
|
|
|
1833
1832
|
getCollidingSubMeshCandidates: (mesh: AbstractMesh, collider: Collider) => ISmartArrayLike<SubMesh>;
|
|
1834
1833
|
/** @internal */
|
|
1835
1834
|
_activeMeshesFrozen: boolean;
|
|
1835
|
+
/** @internal */
|
|
1836
1836
|
_activeMeshesFrozenButKeepClipping: boolean;
|
|
1837
1837
|
private _skipEvaluateActiveMeshesCompletely;
|
|
1838
1838
|
/**
|
|
@@ -1971,6 +1971,10 @@ export declare class Scene extends AbstractScene implements IAnimatable, IClipPl
|
|
|
1971
1971
|
* @returns the current scene
|
|
1972
1972
|
*/
|
|
1973
1973
|
createPickingRayInCameraSpaceToRef(x: number, y: number, result: Ray, camera?: Camera): Scene;
|
|
1974
|
+
/** @internal */
|
|
1975
|
+
get _pickingAvailable(): boolean;
|
|
1976
|
+
/** @internal */
|
|
1977
|
+
_registeredActions: number;
|
|
1974
1978
|
/** Launch a ray to try to pick a mesh in the scene
|
|
1975
1979
|
* @param x position on screen
|
|
1976
1980
|
* @param y position on screen
|
|
@@ -1980,7 +1984,7 @@ export declare class Scene extends AbstractScene implements IAnimatable, IClipPl
|
|
|
1980
1984
|
* @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected
|
|
1981
1985
|
* @returns a PickingInfo
|
|
1982
1986
|
*/
|
|
1983
|
-
pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Nullable<Camera>, trianglePredicate?: TrianglePickingPredicate):
|
|
1987
|
+
pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Nullable<Camera>, trianglePredicate?: TrianglePickingPredicate): PickingInfo;
|
|
1984
1988
|
/** Launch a ray to try to pick a mesh in the scene using only bounding information of the main mesh (not using submeshes)
|
|
1985
1989
|
* @param x position on screen
|
|
1986
1990
|
* @param y position on screen
|
|
@@ -2138,12 +2142,6 @@ export declare class Scene extends AbstractScene implements IAnimatable, IClipPl
|
|
|
2138
2142
|
* @returns the perf collector belonging to the scene.
|
|
2139
2143
|
*/
|
|
2140
2144
|
getPerfCollector(): PerformanceViewerCollector;
|
|
2141
|
-
private _computePressureObserver;
|
|
2142
|
-
/**
|
|
2143
|
-
* An event triggered when the cpu usage/speed meets certain thresholds.
|
|
2144
|
-
* Note: Compute pressure is an experimental API.
|
|
2145
|
-
*/
|
|
2146
|
-
onComputePressureChanged: Observable<IComputePressureData>;
|
|
2147
2145
|
}
|
|
2148
2146
|
declare module "./scene" {
|
|
2149
2147
|
interface Scene {
|
package/scene.js
CHANGED
|
@@ -24,7 +24,6 @@ import { Frustum } from "./Maths/math.frustum.js";
|
|
|
24
24
|
import { UniqueIdGenerator } from "./Misc/uniqueIdGenerator.js";
|
|
25
25
|
import { ReadFile, RequestFile, LoadFile } from "./Misc/fileTools.js";
|
|
26
26
|
import { LightConstants } from "./Lights/lightConstants.js";
|
|
27
|
-
import { ComputePressureObserverWrapper } from "./Misc/computePressure.js";
|
|
28
27
|
import { _ObserveArray } from "./Misc/arrayTools.js";
|
|
29
28
|
/**
|
|
30
29
|
* Define how the scene should favor performance over ease of use
|
|
@@ -668,6 +667,7 @@ export class Scene extends AbstractScene {
|
|
|
668
667
|
this._preventFreeActiveMeshesAndRenderingGroups = false;
|
|
669
668
|
/** @internal */
|
|
670
669
|
this._activeMeshesFrozen = false;
|
|
670
|
+
/** @internal */
|
|
671
671
|
this._activeMeshesFrozenButKeepClipping = false;
|
|
672
672
|
this._skipEvaluateActiveMeshesCompletely = false;
|
|
673
673
|
/** @internal */
|
|
@@ -678,17 +678,14 @@ export class Scene extends AbstractScene {
|
|
|
678
678
|
this.getDeterministicFrameTime = () => {
|
|
679
679
|
return this._engine.getTimeStep();
|
|
680
680
|
};
|
|
681
|
+
/** @internal */
|
|
682
|
+
this._registeredActions = 0;
|
|
681
683
|
this._blockMaterialDirtyMechanism = false;
|
|
682
684
|
/**
|
|
683
685
|
* Internal perfCollector instance used for sharing between inspector and playground.
|
|
684
686
|
* Marked as protected to allow sharing between prototype extensions, but disallow access at toplevel.
|
|
685
687
|
*/
|
|
686
688
|
this._perfCollector = null;
|
|
687
|
-
/**
|
|
688
|
-
* An event triggered when the cpu usage/speed meets certain thresholds.
|
|
689
|
-
* Note: Compute pressure is an experimental API.
|
|
690
|
-
*/
|
|
691
|
-
this.onComputePressureChanged = new Observable();
|
|
692
689
|
this.activeCameras = new Array();
|
|
693
690
|
const fullOptions = {
|
|
694
691
|
useGeometryUniqueIdsMap: true,
|
|
@@ -728,16 +725,6 @@ export class Scene extends AbstractScene {
|
|
|
728
725
|
if (!options || !options.virtual) {
|
|
729
726
|
this._engine.onNewSceneAddedObservable.notifyObservers(this);
|
|
730
727
|
}
|
|
731
|
-
if (ComputePressureObserverWrapper.IsAvailable) {
|
|
732
|
-
this._computePressureObserver = new ComputePressureObserverWrapper((update) => {
|
|
733
|
-
this.onComputePressureChanged.notifyObservers(update);
|
|
734
|
-
}, {
|
|
735
|
-
// Thresholds divide the interval [0.0 .. 1.0] into ranges.
|
|
736
|
-
cpuUtilizationThresholds: [0.25, 0.5, 0.75, 0.9],
|
|
737
|
-
cpuSpeedThresholds: [0.5]
|
|
738
|
-
});
|
|
739
|
-
this._computePressureObserver.observe("cpu");
|
|
740
|
-
}
|
|
741
728
|
}
|
|
742
729
|
/**
|
|
743
730
|
* Factory used to create the default material.
|
|
@@ -1664,7 +1651,7 @@ export class Scene extends AbstractScene {
|
|
|
1664
1651
|
* @param checkRenderTargets true to also check that the meshes rendered as part of a render target are ready (default: false)
|
|
1665
1652
|
*/
|
|
1666
1653
|
executeWhenReady(func, checkRenderTargets = false) {
|
|
1667
|
-
this.onReadyObservable.
|
|
1654
|
+
this.onReadyObservable.addOnce(func);
|
|
1668
1655
|
if (this._executeWhenReadyTimeoutId !== null) {
|
|
1669
1656
|
return;
|
|
1670
1657
|
}
|
|
@@ -3135,6 +3122,7 @@ export class Scene extends AbstractScene {
|
|
|
3135
3122
|
this._activeParticleSystems.data[i].animate();
|
|
3136
3123
|
}
|
|
3137
3124
|
}
|
|
3125
|
+
this._renderingManager.resetSprites();
|
|
3138
3126
|
return;
|
|
3139
3127
|
}
|
|
3140
3128
|
if (!this.activeCamera) {
|
|
@@ -3681,8 +3669,6 @@ export class Scene extends AbstractScene {
|
|
|
3681
3669
|
step.action(this._renderTargets);
|
|
3682
3670
|
}
|
|
3683
3671
|
// Multi-cameras?
|
|
3684
|
-
// save current active camera, following calls will change it, discarding user settings
|
|
3685
|
-
const activeCamera = this._activeCamera;
|
|
3686
3672
|
if (this.activeCameras && this.activeCameras.length > 0) {
|
|
3687
3673
|
for (let cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) {
|
|
3688
3674
|
this._processSubCameras(this.activeCameras[cameraIndex], cameraIndex > 0);
|
|
@@ -3694,7 +3680,6 @@ export class Scene extends AbstractScene {
|
|
|
3694
3680
|
}
|
|
3695
3681
|
this._processSubCameras(this.activeCamera, !!this.activeCamera.outputRenderTarget);
|
|
3696
3682
|
}
|
|
3697
|
-
this._activeCamera = activeCamera;
|
|
3698
3683
|
// Intersection checks
|
|
3699
3684
|
this._checkIntersections();
|
|
3700
3685
|
// Executes the after render stage actions.
|
|
@@ -3746,7 +3731,6 @@ export class Scene extends AbstractScene {
|
|
|
3746
3731
|
* Releases all held resources
|
|
3747
3732
|
*/
|
|
3748
3733
|
dispose() {
|
|
3749
|
-
var _a;
|
|
3750
3734
|
if (this.isDisposed) {
|
|
3751
3735
|
return;
|
|
3752
3736
|
}
|
|
@@ -3852,9 +3836,6 @@ export class Scene extends AbstractScene {
|
|
|
3852
3836
|
this.onPreKeyboardObservable.clear();
|
|
3853
3837
|
this.onKeyboardObservable.clear();
|
|
3854
3838
|
this.onActiveCameraChanged.clear();
|
|
3855
|
-
this.onComputePressureChanged.clear();
|
|
3856
|
-
(_a = this._computePressureObserver) === null || _a === void 0 ? void 0 : _a.unobserve("cpu");
|
|
3857
|
-
this._computePressureObserver = undefined;
|
|
3858
3839
|
this.detachControl();
|
|
3859
3840
|
// Detach cameras
|
|
3860
3841
|
const canvas = this._engine.getInputElement();
|
|
@@ -4029,6 +4010,10 @@ export class Scene extends AbstractScene {
|
|
|
4029
4010
|
createPickingRayInCameraSpaceToRef(x, y, result, camera) {
|
|
4030
4011
|
throw _WarnImport("Ray");
|
|
4031
4012
|
}
|
|
4013
|
+
/** @internal */
|
|
4014
|
+
get _pickingAvailable() {
|
|
4015
|
+
return false;
|
|
4016
|
+
}
|
|
4032
4017
|
/** Launch a ray to try to pick a mesh in the scene
|
|
4033
4018
|
* @param x position on screen
|
|
4034
4019
|
* @param y position on screen
|
|
@@ -4040,9 +4025,7 @@ export class Scene extends AbstractScene {
|
|
|
4040
4025
|
*/
|
|
4041
4026
|
pick(x, y, predicate, fastCheck, camera, trianglePredicate) {
|
|
4042
4027
|
// Dummy info if picking as not been imported
|
|
4043
|
-
|
|
4044
|
-
pi._pickingUnavailable = true;
|
|
4045
|
-
return pi;
|
|
4028
|
+
return new PickingInfo();
|
|
4046
4029
|
}
|
|
4047
4030
|
/** Launch a ray to try to pick a mesh in the scene using only bounding information of the main mesh (not using submeshes)
|
|
4048
4031
|
* @param x position on screen
|
|
@@ -4054,9 +4037,7 @@ export class Scene extends AbstractScene {
|
|
|
4054
4037
|
*/
|
|
4055
4038
|
pickWithBoundingInfo(x, y, predicate, fastCheck, camera) {
|
|
4056
4039
|
// Dummy info if picking as not been imported
|
|
4057
|
-
|
|
4058
|
-
pi._pickingUnavailable = true;
|
|
4059
|
-
return pi;
|
|
4040
|
+
return new PickingInfo();
|
|
4060
4041
|
}
|
|
4061
4042
|
/** Use the given ray to pick a mesh in the scene
|
|
4062
4043
|
* @param ray The ray to use to pick meshes
|