@babylonjs/core 7.27.1 → 7.27.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animatable.core.d.ts +198 -0
- package/Animations/animatable.core.js +893 -0
- package/Animations/animatable.core.js.map +1 -0
- package/Animations/animatable.d.ts +4 -213
- package/Animations/animatable.js +5 -886
- package/Animations/animatable.js.map +1 -1
- package/Animations/animationGroup.d.ts +1 -1
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/runtimeAnimation.d.ts +1 -0
- package/Animations/runtimeAnimation.js +25 -1
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioSceneComponent.d.ts +0 -4
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Bones/skeleton.d.ts +1 -1
- package/Bones/skeleton.js.map +1 -1
- package/Culling/ray.core.d.ts +328 -0
- package/Culling/ray.core.js +934 -0
- package/Culling/ray.core.js.map +1 -0
- package/Culling/ray.d.ts +1 -220
- package/Culling/ray.js +12 -791
- package/Culling/ray.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/Inputs/scene.inputManager.js +1 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayerSceneComponent.d.ts +0 -6
- package/Layers/effectLayerSceneComponent.js +0 -1
- package/Layers/effectLayerSceneComponent.js.map +1 -1
- package/Layers/layerSceneComponent.d.ts +0 -9
- package/Layers/layerSceneComponent.js +0 -1
- package/Layers/layerSceneComponent.js.map +1 -1
- package/LensFlares/lensFlareSystemSceneComponent.d.ts +0 -5
- package/LensFlares/lensFlareSystemSceneComponent.js +0 -1
- package/LensFlares/lensFlareSystemSceneComponent.js.map +1 -1
- package/Lights/light.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.d.ts +0 -10
- package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js +0 -1
- package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js.map +1 -1
- package/Materials/effectRenderer.d.ts +1 -0
- package/Materials/effectRenderer.js +2 -0
- package/Materials/effectRenderer.js.map +1 -1
- package/Meshes/mesh.d.ts +7 -0
- package/Meshes/mesh.js +15 -0
- package/Meshes/mesh.js.map +1 -1
- package/Misc/assetsManager.d.ts +1 -1
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/tools.js +1 -13
- package/Misc/tools.js.map +1 -1
- package/Sprites/spriteSceneComponent.d.ts +1 -1
- package/Sprites/spriteSceneComponent.js +4 -4
- package/Sprites/spriteSceneComponent.js.map +1 -1
- package/assetContainer.d.ts +1 -1
- package/assetContainer.js.map +1 -1
- package/node.d.ts +1 -1
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +45 -4
- package/scene.js +81 -54
- package/scene.js.map +1 -1
package/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../dev/core/src/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,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AE;mCACM;AAMX;IADN,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 { AbstractEngine } from \"./Engines/abstractEngine\";\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 { IAccessibilityTag } from \"./IAccessibilityTag\";\r\nimport type { AnimationRange } from \"./Animations/animationRange\";\r\nimport type { AnimationPropertiesOverride } from \"./Animations/animationPropertiesOverride\";\r\nimport type { AbstractMesh } from \"./Meshes/abstractMesh\";\r\nimport type { Animation } from \"./Animations/animation\";\r\nimport type { Animatable } from \"./Animations/animatable\";\r\nimport { SerializationHelper } from \"./Misc/decorators.serialization\";\r\nimport type { IAssetContainer } from \"./IAssetContainer\";\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 /** @internal */\r\n public _internalMetadata: any;\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/toolsAndResources/inspector#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 /**\r\n * Observable fired when an accessibility tag is changed\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<IAssetContainer> = null;\r\n\r\n /**\r\n * Gets a list of Animations associated with the node\r\n */\r\n public animations: 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/features/featuresDeepDive/mesh/transforms/parent_pivot/parent\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 this._isDirty = true;\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 * @param isPure indicates this Node is just a Node, and not a derived class like Mesh or Camera\r\n */\r\n public constructor(name: string, scene: Nullable<Scene> = null, isPure = true) {\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 if (isPure) {\r\n this._addToSceneRootNodes();\r\n }\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(): AbstractEngine {\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/featuresDeepDive/behaviors\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/featuresDeepDive/behaviors\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/featuresDeepDive/behaviors\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/featuresDeepDive/behaviors\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 }\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._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._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: 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 * Clone the current node\r\n * @param name Name of the new clone\r\n * @param newParent New parent for the clone\r\n * @param doNotCloneChildren Do not clone children hierarchy\r\n * @returns the new transform node\r\n */\r\n public clone(name: string, newParent: Nullable<Node>, doNotCloneChildren?: boolean): Nullable<Node> {\r\n const result = SerializationHelper.Clone(() => new Node(name, this.getScene()), this);\r\n\r\n if (newParent) {\r\n result.parent = newParent;\r\n }\r\n\r\n if (!doNotCloneChildren) {\r\n // Children\r\n const directDescendants = this.getDescendants(true);\r\n for (let index = 0; index < directDescendants.length; index++) {\r\n const child = directDescendants[index];\r\n\r\n child.clone(name + \".\" + child.name, result);\r\n }\r\n }\r\n\r\n return result;\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":["../../../dev/core/src/node.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,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C,CAElC;AAEa,sBAAiB,GAA2B,EAAE,AAA7B,CAA8B;AAmCvD;IADN,SAAS,EAAE;kCACQ;AAMb;IADN,SAAS,EAAE;gCACM;AAMX;IADN,SAAS,EAAE;sCACY;AAMjB;IADN,SAAS,EAAE;mCACM;AAMX;IADN,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 { AbstractEngine } from \"./Engines/abstractEngine\";\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 { IAccessibilityTag } from \"./IAccessibilityTag\";\r\nimport type { AnimationRange } from \"./Animations/animationRange\";\r\nimport type { AnimationPropertiesOverride } from \"./Animations/animationPropertiesOverride\";\r\nimport type { AbstractMesh } from \"./Meshes/abstractMesh\";\r\nimport type { Animation } from \"./Animations/animation\";\r\nimport type { Animatable } from \"./Animations/animatable.core\";\r\nimport { SerializationHelper } from \"./Misc/decorators.serialization\";\r\nimport type { IAssetContainer } from \"./IAssetContainer\";\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 /** @internal */\r\n public _internalMetadata: any;\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/toolsAndResources/inspector#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 /**\r\n * Observable fired when an accessibility tag is changed\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<IAssetContainer> = null;\r\n\r\n /**\r\n * Gets a list of Animations associated with the node\r\n */\r\n public animations: 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/features/featuresDeepDive/mesh/transforms/parent_pivot/parent\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 this._isDirty = true;\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 * @param isPure indicates this Node is just a Node, and not a derived class like Mesh or Camera\r\n */\r\n public constructor(name: string, scene: Nullable<Scene> = null, isPure = true) {\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 if (isPure) {\r\n this._addToSceneRootNodes();\r\n }\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(): AbstractEngine {\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/featuresDeepDive/behaviors\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/featuresDeepDive/behaviors\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/featuresDeepDive/behaviors\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/featuresDeepDive/behaviors\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 }\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._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._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: 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 * Clone the current node\r\n * @param name Name of the new clone\r\n * @param newParent New parent for the clone\r\n * @param doNotCloneChildren Do not clone children hierarchy\r\n * @returns the new transform node\r\n */\r\n public clone(name: string, newParent: Nullable<Node>, doNotCloneChildren?: boolean): Nullable<Node> {\r\n const result = SerializationHelper.Clone(() => new Node(name, this.getScene()), this);\r\n\r\n if (newParent) {\r\n result.parent = newParent;\r\n }\r\n\r\n if (!doNotCloneChildren) {\r\n // Children\r\n const directDescendants = this.getDescendants(true);\r\n for (let index = 0; index < directDescendants.length; index++) {\r\n const child = directDescendants[index];\r\n\r\n child.clone(name + \".\" + child.name, result);\r\n }\r\n }\r\n\r\n return result;\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
|
@@ -34,7 +34,7 @@ import type { Skeleton } from "./Bones/skeleton";
|
|
|
34
34
|
import type { Bone } from "./Bones/bone";
|
|
35
35
|
import type { Camera } from "./Cameras/camera";
|
|
36
36
|
import type { Collider } from "./Collisions/collider";
|
|
37
|
-
import type { Ray, MeshPredicate, TrianglePickingPredicate } from "./Culling/ray";
|
|
37
|
+
import type { Ray, MeshPredicate, TrianglePickingPredicate } from "./Culling/ray.core";
|
|
38
38
|
import type { Light } from "./Lights/light";
|
|
39
39
|
import type { PerformanceViewerCollector } from "./Misc/PerformanceViewer/performanceViewerCollector";
|
|
40
40
|
import type { MorphTarget } from "./Morph/morphTarget";
|
|
@@ -51,9 +51,14 @@ import type { RenderTargetTexture } from "./Materials/Textures/renderTargetTextu
|
|
|
51
51
|
import type { SubMesh } from "./Meshes/subMesh";
|
|
52
52
|
import type { Node } from "./node";
|
|
53
53
|
import type { Animation } from "./Animations/animation";
|
|
54
|
-
import type { Animatable } from "./Animations/animatable";
|
|
54
|
+
import type { Animatable } from "./Animations/animatable.core";
|
|
55
55
|
import type { AbstractEngine } from "./Engines/abstractEngine";
|
|
56
56
|
import type { IAssetContainer } from "./IAssetContainer";
|
|
57
|
+
import type { EffectLayer } from "./Layers/effectLayer";
|
|
58
|
+
import type { Sound } from "./Audio/sound";
|
|
59
|
+
import type { Layer } from "./Layers/layer";
|
|
60
|
+
import type { LensFlareSystem } from "./LensFlares/lensFlareSystem";
|
|
61
|
+
import type { ProceduralTexture } from "./Materials/Textures/Procedurals/proceduralTexture";
|
|
57
62
|
/**
|
|
58
63
|
* Define an interface for all classes that will hold resources
|
|
59
64
|
*/
|
|
@@ -129,6 +134,12 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
|
|
|
129
134
|
*/
|
|
130
135
|
static CollisionCoordinatorFactory(): ICollisionCoordinator;
|
|
131
136
|
/** @internal */
|
|
137
|
+
_tempPickingRay: Nullable<Ray>;
|
|
138
|
+
/** @internal */
|
|
139
|
+
_cachedRayForTransform: Ray;
|
|
140
|
+
/** @internal */
|
|
141
|
+
_pickWithRayInverseMatrix: Matrix;
|
|
142
|
+
/** @internal */
|
|
132
143
|
_inputManager: InputManager;
|
|
133
144
|
/** Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position */
|
|
134
145
|
cameraToUseForPointers: Nullable<Camera>;
|
|
@@ -258,6 +269,10 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
|
|
|
258
269
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro
|
|
259
270
|
*/
|
|
260
271
|
particleSystems: IParticleSystem[];
|
|
272
|
+
/**
|
|
273
|
+
* Gets the current delta time used by animation engine
|
|
274
|
+
*/
|
|
275
|
+
deltaTime: number;
|
|
261
276
|
/**
|
|
262
277
|
* Gets a list of Animations associated with the scene
|
|
263
278
|
*/
|
|
@@ -324,6 +339,30 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
|
|
|
324
339
|
* The list of postprocesses added to the scene
|
|
325
340
|
*/
|
|
326
341
|
postProcesses: PostProcess[];
|
|
342
|
+
/**
|
|
343
|
+
* The list of effect layers (highlights/glow) added to the scene
|
|
344
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/highlightLayer
|
|
345
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/glowLayer
|
|
346
|
+
*/
|
|
347
|
+
effectLayers: Array<EffectLayer>;
|
|
348
|
+
/**
|
|
349
|
+
* The list of sounds used in the scene.
|
|
350
|
+
*/
|
|
351
|
+
sounds: Nullable<Array<Sound>>;
|
|
352
|
+
/**
|
|
353
|
+
* The list of layers (background and foreground) of the scene
|
|
354
|
+
*/
|
|
355
|
+
layers: Array<Layer>;
|
|
356
|
+
/**
|
|
357
|
+
* The list of lens flare system added to the scene
|
|
358
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
|
|
359
|
+
*/
|
|
360
|
+
lensFlareSystems: Array<LensFlareSystem>;
|
|
361
|
+
/**
|
|
362
|
+
* The list of procedural textures added to the scene
|
|
363
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/proceduralTextures
|
|
364
|
+
*/
|
|
365
|
+
proceduralTextures: Array<ProceduralTexture>;
|
|
327
366
|
/**
|
|
328
367
|
* @returns all meshes, lights, cameras, transformNodes and bones
|
|
329
368
|
*/
|
|
@@ -2016,6 +2055,10 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
|
|
|
2016
2055
|
* @param passId If provided, releases only the draw wrapper corresponding to this render pass id
|
|
2017
2056
|
*/
|
|
2018
2057
|
resetDrawCache(passId?: number): void;
|
|
2058
|
+
/**
|
|
2059
|
+
* If this function is defined it will take precedence over the standard render() function.
|
|
2060
|
+
*/
|
|
2061
|
+
customRenderFunction?: () => void;
|
|
2019
2062
|
/**
|
|
2020
2063
|
* Render the scene
|
|
2021
2064
|
* @param updateCameras defines a boolean indicating if cameras must update according to their inputs (true by default)
|
|
@@ -2102,8 +2145,6 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
|
|
|
2102
2145
|
*/
|
|
2103
2146
|
createPickingRayInCameraSpaceToRef(x: number, y: number, result: Ray, camera?: Camera): Scene;
|
|
2104
2147
|
/** @internal */
|
|
2105
|
-
get _pickingAvailable(): boolean;
|
|
2106
|
-
/** @internal */
|
|
2107
2148
|
_registeredActions: number;
|
|
2108
2149
|
/** Launch a ray to try to pick a mesh in the scene
|
|
2109
2150
|
* @param x position on screen
|
package/scene.js
CHANGED
|
@@ -611,7 +611,6 @@ export class Scene {
|
|
|
611
611
|
* @param options defines the scene options
|
|
612
612
|
*/
|
|
613
613
|
constructor(engine, options) {
|
|
614
|
-
// Members
|
|
615
614
|
/** @internal */
|
|
616
615
|
this._inputManager = new InputManager(this);
|
|
617
616
|
/** Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position */
|
|
@@ -732,6 +731,30 @@ export class Scene {
|
|
|
732
731
|
* The list of postprocesses added to the scene
|
|
733
732
|
*/
|
|
734
733
|
this.postProcesses = [];
|
|
734
|
+
/**
|
|
735
|
+
* The list of effect layers (highlights/glow) added to the scene
|
|
736
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/highlightLayer
|
|
737
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/glowLayer
|
|
738
|
+
*/
|
|
739
|
+
this.effectLayers = [];
|
|
740
|
+
/**
|
|
741
|
+
* The list of sounds used in the scene.
|
|
742
|
+
*/
|
|
743
|
+
this.sounds = null;
|
|
744
|
+
/**
|
|
745
|
+
* The list of layers (background and foreground) of the scene
|
|
746
|
+
*/
|
|
747
|
+
this.layers = [];
|
|
748
|
+
/**
|
|
749
|
+
* The list of lens flare system added to the scene
|
|
750
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare
|
|
751
|
+
*/
|
|
752
|
+
this.lensFlareSystems = [];
|
|
753
|
+
/**
|
|
754
|
+
* The list of procedural textures added to the scene
|
|
755
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/proceduralTextures
|
|
756
|
+
*/
|
|
757
|
+
this.proceduralTextures = [];
|
|
735
758
|
/**
|
|
736
759
|
* Gets or sets a boolean indicating if animations are enabled
|
|
737
760
|
*/
|
|
@@ -3825,59 +3848,67 @@ export class Scene {
|
|
|
3825
3848
|
}
|
|
3826
3849
|
// Before render
|
|
3827
3850
|
this.onBeforeRenderObservable.notifyObservers(this);
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3851
|
+
// Custom render function?
|
|
3852
|
+
if (this.customRenderFunction) {
|
|
3853
|
+
this._renderId++;
|
|
3854
|
+
this._engine.currentRenderPassId = 0;
|
|
3855
|
+
this.customRenderFunction();
|
|
3856
|
+
}
|
|
3857
|
+
else {
|
|
3858
|
+
const engine = this.getEngine();
|
|
3859
|
+
// Customs render targets
|
|
3860
|
+
this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);
|
|
3861
|
+
const currentActiveCamera = this.activeCameras?.length ? this.activeCameras[0] : this.activeCamera;
|
|
3862
|
+
if (this.renderTargetsEnabled) {
|
|
3863
|
+
Tools.StartPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0);
|
|
3864
|
+
this._intermediateRendering = true;
|
|
3865
|
+
for (let customIndex = 0; customIndex < this.customRenderTargets.length; customIndex++) {
|
|
3866
|
+
const renderTarget = this.customRenderTargets[customIndex];
|
|
3867
|
+
if (renderTarget._shouldRender()) {
|
|
3868
|
+
this._renderId++;
|
|
3869
|
+
this.activeCamera = renderTarget.activeCamera || this.activeCamera;
|
|
3870
|
+
if (!this.activeCamera) {
|
|
3871
|
+
throw new Error("Active camera not set");
|
|
3872
|
+
}
|
|
3873
|
+
// Viewport
|
|
3874
|
+
engine.setViewport(this.activeCamera.viewport);
|
|
3875
|
+
// Camera
|
|
3876
|
+
this.updateTransformMatrix();
|
|
3877
|
+
renderTarget.render(currentActiveCamera !== this.activeCamera, this.dumpNextRenderTargets);
|
|
3842
3878
|
}
|
|
3843
|
-
// Viewport
|
|
3844
|
-
engine.setViewport(this.activeCamera.viewport);
|
|
3845
|
-
// Camera
|
|
3846
|
-
this.updateTransformMatrix();
|
|
3847
|
-
renderTarget.render(currentActiveCamera !== this.activeCamera, this.dumpNextRenderTargets);
|
|
3848
3879
|
}
|
|
3880
|
+
Tools.EndPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0);
|
|
3881
|
+
this._intermediateRendering = false;
|
|
3882
|
+
this._renderId++;
|
|
3849
3883
|
}
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
this.
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
// Restore back buffer
|
|
3856
|
-
this.activeCamera = currentActiveCamera;
|
|
3857
|
-
if (this._activeCamera && this._activeCamera.cameraRigMode !== 22 && !this.prePass) {
|
|
3858
|
-
this._bindFrameBuffer(this._activeCamera, false);
|
|
3859
|
-
}
|
|
3860
|
-
this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
|
|
3861
|
-
for (const step of this._beforeClearStage) {
|
|
3862
|
-
step.action();
|
|
3863
|
-
}
|
|
3864
|
-
// Clear
|
|
3865
|
-
this._clearFrameBuffer(this.activeCamera);
|
|
3866
|
-
// Collects render targets from external components.
|
|
3867
|
-
for (const step of this._gatherRenderTargetsStage) {
|
|
3868
|
-
step.action(this._renderTargets);
|
|
3869
|
-
}
|
|
3870
|
-
// Multi-cameras?
|
|
3871
|
-
if (this.activeCameras && this.activeCameras.length > 0) {
|
|
3872
|
-
for (let cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) {
|
|
3873
|
-
this._processSubCameras(this.activeCameras[cameraIndex], cameraIndex > 0);
|
|
3884
|
+
this._engine.currentRenderPassId = currentActiveCamera?.renderPassId ?? 0;
|
|
3885
|
+
// Restore back buffer
|
|
3886
|
+
this.activeCamera = currentActiveCamera;
|
|
3887
|
+
if (this._activeCamera && this._activeCamera.cameraRigMode !== 22 && !this.prePass) {
|
|
3888
|
+
this._bindFrameBuffer(this._activeCamera, false);
|
|
3874
3889
|
}
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3890
|
+
this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
|
|
3891
|
+
for (const step of this._beforeClearStage) {
|
|
3892
|
+
step.action();
|
|
3893
|
+
}
|
|
3894
|
+
// Clear
|
|
3895
|
+
this._clearFrameBuffer(this.activeCamera);
|
|
3896
|
+
// Collects render targets from external components.
|
|
3897
|
+
for (const step of this._gatherRenderTargetsStage) {
|
|
3898
|
+
step.action(this._renderTargets);
|
|
3899
|
+
}
|
|
3900
|
+
// Multi-cameras?
|
|
3901
|
+
if (this.activeCameras && this.activeCameras.length > 0) {
|
|
3902
|
+
for (let cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) {
|
|
3903
|
+
this._processSubCameras(this.activeCameras[cameraIndex], cameraIndex > 0);
|
|
3904
|
+
}
|
|
3905
|
+
}
|
|
3906
|
+
else {
|
|
3907
|
+
if (!this.activeCamera) {
|
|
3908
|
+
throw new Error("No camera defined");
|
|
3909
|
+
}
|
|
3910
|
+
this._processSubCameras(this.activeCamera, !!this.activeCamera.outputRenderTarget);
|
|
3879
3911
|
}
|
|
3880
|
-
this._processSubCameras(this.activeCamera, !!this.activeCamera.outputRenderTarget);
|
|
3881
3912
|
}
|
|
3882
3913
|
// Intersection checks
|
|
3883
3914
|
this._checkIntersections();
|
|
@@ -3962,7 +3993,7 @@ export class Scene {
|
|
|
3962
3993
|
this._pointerDownStage.clear();
|
|
3963
3994
|
this._pointerUpStage.clear();
|
|
3964
3995
|
this.importedMeshesFiles = [];
|
|
3965
|
-
if (this.stopAllAnimations) {
|
|
3996
|
+
if (this._activeAnimatables && this.stopAllAnimations) {
|
|
3966
3997
|
// Ensures that no animatable notifies a callback that could start a new animation group, constantly adding new animatables to the active list...
|
|
3967
3998
|
this._activeAnimatables.forEach((animatable) => {
|
|
3968
3999
|
animatable.onAnimationEndObservable.clear();
|
|
@@ -4226,10 +4257,6 @@ export class Scene {
|
|
|
4226
4257
|
createPickingRayInCameraSpaceToRef(x, y, result, camera) {
|
|
4227
4258
|
throw _WarnImport("Ray");
|
|
4228
4259
|
}
|
|
4229
|
-
/** @internal */
|
|
4230
|
-
get _pickingAvailable() {
|
|
4231
|
-
return false;
|
|
4232
|
-
}
|
|
4233
4260
|
/** Launch a ray to try to pick a mesh in the scene
|
|
4234
4261
|
* @param x position on screen
|
|
4235
4262
|
* @param y position on screen
|