{"ast":null,"code":"import { __decorate } from \"./tslib.es6.js\";\nimport { Matrix, Vector3 } from \"./Maths/math.vector.js\";\nimport { serialize } from \"./Misc/decorators.js\";\nimport { Observable } from \"./Misc/observable.js\";\nimport { EngineStore } from \"./Engines/engineStore.js\";\nimport { _WarnImport } from \"./Misc/devTools.js\";\nimport { SerializationHelper } from \"./Misc/decorators.serialization.js\";\n/** @internal */\nclass _InternalNodeDataInfo {\n constructor() {\n this._doNotSerialize = false;\n this._isDisposed = false;\n this._sceneRootNodesIndex = -1;\n this._isEnabled = true;\n this._isParentEnabled = true;\n this._isReady = true;\n this._onEnabledStateChangedObservable = new Observable();\n this._onClonedObservable = new Observable();\n }\n}\n/**\n * Node is the basic class for all scene objects (Mesh, Light, Camera.)\n */\nexport class Node {\n /**\n * Add a new node constructor\n * @param type defines the type name of the node to construct\n * @param constructorFunc defines the constructor function\n */\n static AddNodeConstructor(type, constructorFunc) {\n this._NodeConstructors[type] = constructorFunc;\n }\n /**\n * Returns a node constructor based on type name\n * @param type defines the type name\n * @param name defines the new node name\n * @param scene defines the hosting scene\n * @param options defines optional options to transmit to constructors\n * @returns the new constructor or null\n */\n static Construct(type, name, scene, options) {\n const constructorFunc = this._NodeConstructors[type];\n if (!constructorFunc) {\n return null;\n }\n return constructorFunc(name, scene, options);\n }\n /**\n * Gets or sets the accessibility tag to describe the node for accessibility purpose.\n */\n set accessibilityTag(value) {\n this._accessibilityTag = value;\n this.onAccessibilityTagChangedObservable.notifyObservers(value);\n }\n get accessibilityTag() {\n return this._accessibilityTag;\n }\n /**\n * Gets or sets a boolean used to define if the node must be serialized\n */\n get doNotSerialize() {\n if (this._nodeDataStorage._doNotSerialize) {\n return true;\n }\n if (this._parentNode) {\n return this._parentNode.doNotSerialize;\n }\n return false;\n }\n set doNotSerialize(value) {\n this._nodeDataStorage._doNotSerialize = value;\n }\n /**\n * Gets a boolean indicating if the node has been disposed\n * @returns true if the node was disposed\n */\n isDisposed() {\n return this._nodeDataStorage._isDisposed;\n }\n /**\n * Gets or sets the parent of the node (without keeping the current position in the scene)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/parent\n */\n set parent(parent) {\n if (this._parentNode === parent) {\n return;\n }\n const previousParentNode = this._parentNode;\n // Remove self from list of children of parent\n if (this._parentNode && this._parentNode._children !== undefined && this._parentNode._children !== null) {\n const index = this._parentNode._children.indexOf(this);\n if (index !== -1) {\n this._parentNode._children.splice(index, 1);\n }\n if (!parent && !this._nodeDataStorage._isDisposed) {\n this._addToSceneRootNodes();\n }\n }\n // Store new parent\n this._parentNode = parent;\n this._isDirty = true;\n // Add as child to new parent\n if (this._parentNode) {\n if (this._parentNode._children === undefined || this._parentNode._children === null) {\n this._parentNode._children = new Array();\n }\n this._parentNode._children.push(this);\n if (!previousParentNode) {\n this._removeFromSceneRootNodes();\n }\n }\n // Enabled state\n this._syncParentEnabledState();\n }\n get parent() {\n return this._parentNode;\n }\n /**\n * @internal\n */\n _serializeAsParent(serializationObject) {\n serializationObject.parentId = this.uniqueId;\n }\n /** @internal */\n _addToSceneRootNodes() {\n if (this._nodeDataStorage._sceneRootNodesIndex === -1) {\n this._nodeDataStorage._sceneRootNodesIndex = this._scene.rootNodes.length;\n this._scene.rootNodes.push(this);\n }\n }\n /** @internal */\n _removeFromSceneRootNodes() {\n if (this._nodeDataStorage._sceneRootNodesIndex !== -1) {\n const rootNodes = this._scene.rootNodes;\n const lastIdx = rootNodes.length - 1;\n rootNodes[this._nodeDataStorage._sceneRootNodesIndex] = rootNodes[lastIdx];\n rootNodes[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex = this._nodeDataStorage._sceneRootNodesIndex;\n this._scene.rootNodes.pop();\n this._nodeDataStorage._sceneRootNodesIndex = -1;\n }\n }\n /**\n * Gets or sets the animation properties override\n */\n get animationPropertiesOverride() {\n if (!this._animationPropertiesOverride) {\n return this._scene.animationPropertiesOverride;\n }\n return this._animationPropertiesOverride;\n }\n set animationPropertiesOverride(value) {\n this._animationPropertiesOverride = value;\n }\n /**\n * Gets a string identifying the name of the class\n * @returns \"Node\" string\n */\n getClassName() {\n return \"Node\";\n }\n /**\n * Sets a callback that will be raised when the node will be disposed\n */\n set onDispose(callback) {\n if (this._onDisposeObserver) {\n this.onDisposeObservable.remove(this._onDisposeObserver);\n }\n this._onDisposeObserver = this.onDisposeObservable.add(callback);\n }\n /**\n * An event triggered when the enabled state of the node changes\n */\n get onEnabledStateChangedObservable() {\n return this._nodeDataStorage._onEnabledStateChangedObservable;\n }\n /**\n * An event triggered when the node is cloned\n */\n get onClonedObservable() {\n return this._nodeDataStorage._onClonedObservable;\n }\n /**\n * Creates a new Node\n * @param name the name and id to be given to this node\n * @param scene the scene this node will be added to\n * @param isPure indicates this Node is just a Node, and not a derived class like Mesh or Camera\n */\n constructor(name, scene = null, isPure = true) {\n this._isDirty = false;\n this._nodeDataStorage = new _InternalNodeDataInfo();\n /**\n * Gets or sets a string used to store user defined state for the node\n */\n this.state = \"\";\n /**\n * Gets or sets an object used to store user defined information for the node\n */\n this.metadata = null;\n /**\n * For internal use only. Please do not use.\n */\n this.reservedDataStore = null;\n this._accessibilityTag = null;\n /**\n * Observable fired when an accessibility tag is changed\n */\n this.onAccessibilityTagChangedObservable = new Observable();\n /** @internal */\n this._parentContainer = null;\n /**\n * Gets a list of Animations associated with the node\n */\n this.animations = [];\n this._ranges = {};\n /**\n * Callback raised when the node is ready to be used\n */\n this.onReady = null;\n /** @internal */\n this._currentRenderId = -1;\n this._parentUpdateId = -1;\n /** @internal */\n this._childUpdateId = -1;\n /** @internal */\n this._waitingParentId = null;\n /** @internal */\n this._waitingParentInstanceIndex = null;\n /** @internal */\n this._waitingParsedUniqueId = null;\n /** @internal */\n this._cache = {};\n this._parentNode = null;\n /** @internal */\n this._children = null;\n /** @internal */\n this._worldMatrix = Matrix.Identity();\n /** @internal */\n this._worldMatrixDeterminant = 0;\n /** @internal */\n this._worldMatrixDeterminantIsDirty = true;\n this._animationPropertiesOverride = null;\n /** @internal */\n this._isNode = true;\n /**\n * An event triggered when the mesh is disposed\n */\n this.onDisposeObservable = new Observable();\n this._onDisposeObserver = null;\n // Behaviors\n this._behaviors = new Array();\n this.name = name;\n this.id = name;\n this._scene = scene || EngineStore.LastCreatedScene;\n this.uniqueId = this._scene.getUniqueId();\n this._initCache();\n if (isPure) {\n this._addToSceneRootNodes();\n }\n }\n /**\n * Gets the scene of the node\n * @returns a scene\n */\n getScene() {\n return this._scene;\n }\n /**\n * Gets the engine of the node\n * @returns a Engine\n */\n getEngine() {\n return this._scene.getEngine();\n }\n /**\n * Attach a behavior to the node\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\n * @param behavior defines the behavior to attach\n * @param attachImmediately defines that the behavior must be attached even if the scene is still loading\n * @returns the current Node\n */\n addBehavior(behavior, attachImmediately = false) {\n const index = this._behaviors.indexOf(behavior);\n if (index !== -1) {\n return this;\n }\n behavior.init();\n if (this._scene.isLoading && !attachImmediately) {\n // We defer the attach when the scene will be loaded\n this._scene.onDataLoadedObservable.addOnce(() => {\n behavior.attach(this);\n });\n } else {\n behavior.attach(this);\n }\n this._behaviors.push(behavior);\n return this;\n }\n /**\n * Remove an attached behavior\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\n * @param behavior defines the behavior to attach\n * @returns the current Node\n */\n removeBehavior(behavior) {\n const index = this._behaviors.indexOf(behavior);\n if (index === -1) {\n return this;\n }\n this._behaviors[index].detach();\n this._behaviors.splice(index, 1);\n return this;\n }\n /**\n * Gets the list of attached behaviors\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\n */\n get behaviors() {\n return this._behaviors;\n }\n /**\n * Gets an attached behavior by name\n * @param name defines the name of the behavior to look for\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\n * @returns null if behavior was not found else the requested behavior\n */\n getBehaviorByName(name) {\n for (const behavior of this._behaviors) {\n if (behavior.name === name) {\n return behavior;\n }\n }\n return null;\n }\n /**\n * Returns the latest update of the World matrix\n * @returns a Matrix\n */\n getWorldMatrix() {\n if (this._currentRenderId !== this._scene.getRenderId()) {\n this.computeWorldMatrix();\n }\n return this._worldMatrix;\n }\n /** @internal */\n _getWorldMatrixDeterminant() {\n if (this._worldMatrixDeterminantIsDirty) {\n this._worldMatrixDeterminantIsDirty = false;\n this._worldMatrixDeterminant = this._worldMatrix.determinant();\n }\n return this._worldMatrixDeterminant;\n }\n /**\n * Returns directly the latest state of the mesh World matrix.\n * A Matrix is returned.\n */\n get worldMatrixFromCache() {\n return this._worldMatrix;\n }\n // override it in derived class if you add new variables to the cache\n // and call the parent class method\n /** @internal */\n _initCache() {\n this._cache = {};\n }\n /**\n * @internal\n */\n updateCache(force) {\n if (!force && this.isSynchronized()) {\n return;\n }\n this._updateCache();\n }\n /**\n * @internal\n */\n _getActionManagerForTrigger(trigger, _initialCall = true) {\n if (!this.parent) {\n return null;\n }\n return this.parent._getActionManagerForTrigger(trigger, false);\n }\n // override it in derived class if you add new variables to the cache\n // and call the parent class method if !ignoreParentClass\n /**\n * @internal\n */\n _updateCache(_ignoreParentClass) {}\n // override it in derived class if you add new variables to the cache\n /** @internal */\n _isSynchronized() {\n return true;\n }\n /** @internal */\n _markSyncedWithParent() {\n if (this._parentNode) {\n this._parentUpdateId = this._parentNode._childUpdateId;\n }\n }\n /** @internal */\n isSynchronizedWithParent() {\n if (!this._parentNode) {\n return true;\n }\n if (this._parentNode._isDirty || this._parentUpdateId !== this._parentNode._childUpdateId) {\n return false;\n }\n return this._parentNode.isSynchronized();\n }\n /** @internal */\n isSynchronized() {\n if (this._parentNode && !this.isSynchronizedWithParent()) {\n return false;\n }\n return this._isSynchronized();\n }\n /**\n * Is this node ready to be used/rendered\n * @param _completeCheck defines if a complete check (including materials and lights) has to be done (false by default)\n * @returns true if the node is ready\n */\n isReady(_completeCheck = false) {\n return this._nodeDataStorage._isReady;\n }\n /**\n * Flag the node as dirty (Forcing it to update everything)\n * @param _property helps children apply precise \"dirtyfication\"\n * @returns this node\n */\n markAsDirty(_property) {\n this._currentRenderId = Number.MAX_VALUE;\n this._isDirty = true;\n return this;\n }\n /**\n * Is this node enabled?\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\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\n * @returns whether this node (and its parent) is enabled\n */\n isEnabled(checkAncestors = true) {\n if (checkAncestors === false) {\n return this._nodeDataStorage._isEnabled;\n }\n if (!this._nodeDataStorage._isEnabled) {\n return false;\n }\n return this._nodeDataStorage._isParentEnabled;\n }\n /** @internal */\n _syncParentEnabledState() {\n this._nodeDataStorage._isParentEnabled = this._parentNode ? this._parentNode.isEnabled() : true;\n if (this._children) {\n this._children.forEach(c => {\n c._syncParentEnabledState(); // Force children to update accordingly\n });\n }\n }\n /**\n * Set the enabled state of this node\n * @param value defines the new enabled state\n */\n setEnabled(value) {\n if (this._nodeDataStorage._isEnabled === value) {\n return;\n }\n this._nodeDataStorage._isEnabled = value;\n this._syncParentEnabledState();\n this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(value);\n }\n /**\n * Is this node a descendant of the given node?\n * The function will iterate up the hierarchy until the ancestor was found or no more parents defined\n * @param ancestor defines the parent node to inspect\n * @returns a boolean indicating if this node is a descendant of the given node\n */\n isDescendantOf(ancestor) {\n if (this.parent) {\n if (this.parent === ancestor) {\n return true;\n }\n return this.parent.isDescendantOf(ancestor);\n }\n return false;\n }\n /**\n * @internal\n */\n _getDescendants(results, directDescendantsOnly = false, predicate) {\n if (!this._children) {\n return;\n }\n for (let index = 0; index < this._children.length; index++) {\n const item = this._children[index];\n if (!predicate || predicate(item)) {\n results.push(item);\n }\n if (!directDescendantsOnly) {\n item._getDescendants(results, false, predicate);\n }\n }\n }\n /**\n * Will return all nodes that have this node as ascendant\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\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\n * @returns all children nodes of all types\n */\n getDescendants(directDescendantsOnly, predicate) {\n const results = [];\n this._getDescendants(results, directDescendantsOnly, predicate);\n return results;\n }\n /**\n * Get all child-meshes of this node\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)\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\n * @returns an array of AbstractMesh\n */\n getChildMeshes(directDescendantsOnly, predicate) {\n const results = [];\n this._getDescendants(results, directDescendantsOnly, node => {\n return (!predicate || predicate(node)) && node.cullingStrategy !== undefined;\n });\n return results;\n }\n /**\n * Get all direct children of this node\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\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)\n * @returns an array of Node\n */\n getChildren(predicate, directDescendantsOnly = true) {\n return this.getDescendants(directDescendantsOnly, predicate);\n }\n /**\n * @internal\n */\n _setReady(state) {\n if (state === this._nodeDataStorage._isReady) {\n return;\n }\n if (!state) {\n this._nodeDataStorage._isReady = false;\n return;\n }\n if (this.onReady) {\n this.onReady(this);\n }\n this._nodeDataStorage._isReady = true;\n }\n /**\n * Get an animation by name\n * @param name defines the name of the animation to look for\n * @returns null if not found else the requested animation\n */\n getAnimationByName(name) {\n for (let i = 0; i < this.animations.length; i++) {\n const animation = this.animations[i];\n if (animation.name === name) {\n return animation;\n }\n }\n return null;\n }\n /**\n * Creates an animation range for this node\n * @param name defines the name of the range\n * @param from defines the starting key\n * @param to defines the end key\n */\n createAnimationRange(name, from, to) {\n // check name not already in use\n if (!this._ranges[name]) {\n this._ranges[name] = Node._AnimationRangeFactory(name, from, to);\n for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) {\n if (this.animations[i]) {\n this.animations[i].createRange(name, from, to);\n }\n }\n }\n }\n /**\n * Delete a specific animation range\n * @param name defines the name of the range to delete\n * @param deleteFrames defines if animation frames from the range must be deleted as well\n */\n deleteAnimationRange(name, deleteFrames = true) {\n for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) {\n if (this.animations[i]) {\n this.animations[i].deleteRange(name, deleteFrames);\n }\n }\n this._ranges[name] = null; // said much faster than 'delete this._range[name]'\n }\n /**\n * Get an animation range by name\n * @param name defines the name of the animation range to look for\n * @returns null if not found else the requested animation range\n */\n getAnimationRange(name) {\n return this._ranges[name] || null;\n }\n /**\n * Clone the current node\n * @param name Name of the new clone\n * @param newParent New parent for the clone\n * @param doNotCloneChildren Do not clone children hierarchy\n * @returns the new transform node\n */\n clone(name, newParent, doNotCloneChildren) {\n const result = SerializationHelper.Clone(() => new Node(name, this.getScene()), this);\n if (newParent) {\n result.parent = newParent;\n }\n if (!doNotCloneChildren) {\n // Children\n const directDescendants = this.getDescendants(true);\n for (let index = 0; index < directDescendants.length; index++) {\n const child = directDescendants[index];\n child.clone(name + \".\" + child.name, result);\n }\n }\n return result;\n }\n /**\n * Gets the list of all animation ranges defined on this node\n * @returns an array\n */\n getAnimationRanges() {\n const animationRanges = [];\n let name;\n for (name in this._ranges) {\n animationRanges.push(this._ranges[name]);\n }\n return animationRanges;\n }\n /**\n * Will start the animation sequence\n * @param name defines the range frames for animation sequence\n * @param loop defines if the animation should loop (false by default)\n * @param speedRatio defines the speed factor in which to run the animation (1 by default)\n * @param onAnimationEnd defines a function to be executed when the animation ended (undefined by default)\n * @returns the object created for this animation. If range does not exist, it will return null\n */\n beginAnimation(name, loop, speedRatio, onAnimationEnd) {\n const range = this.getAnimationRange(name);\n if (!range) {\n return null;\n }\n return this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd);\n }\n /**\n * Serialize animation ranges into a JSON compatible object\n * @returns serialization object\n */\n serializeAnimationRanges() {\n const serializationRanges = [];\n for (const name in this._ranges) {\n const localRange = this._ranges[name];\n if (!localRange) {\n continue;\n }\n const range = {};\n range.name = name;\n range.from = localRange.from;\n range.to = localRange.to;\n serializationRanges.push(range);\n }\n return serializationRanges;\n }\n /**\n * Computes the world matrix of the node\n * @param _force defines if the cache version should be invalidated forcing the world matrix to be created from scratch\n * @returns the world matrix\n */\n computeWorldMatrix(_force) {\n if (!this._worldMatrix) {\n this._worldMatrix = Matrix.Identity();\n }\n return this._worldMatrix;\n }\n /**\n * Releases resources associated with this node.\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\n * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)\n */\n dispose(doNotRecurse, disposeMaterialAndTextures = false) {\n this._nodeDataStorage._isDisposed = true;\n if (!doNotRecurse) {\n const nodes = this.getDescendants(true);\n for (const node of nodes) {\n node.dispose(doNotRecurse, disposeMaterialAndTextures);\n }\n }\n if (!this.parent) {\n this._removeFromSceneRootNodes();\n } else {\n this.parent = null;\n }\n // Callback\n this.onDisposeObservable.notifyObservers(this);\n this.onDisposeObservable.clear();\n this.onEnabledStateChangedObservable.clear();\n this.onClonedObservable.clear();\n // Behaviors\n for (const behavior of this._behaviors) {\n behavior.detach();\n }\n this._behaviors.length = 0;\n this.metadata = null;\n }\n /**\n * Parse animation range data from a serialization object and store them into a given node\n * @param node defines where to store the animation ranges\n * @param parsedNode defines the serialization object to read data from\n * @param _scene defines the hosting scene\n */\n static ParseAnimationRanges(node, parsedNode, _scene) {\n if (parsedNode.ranges) {\n for (let index = 0; index < parsedNode.ranges.length; index++) {\n const data = parsedNode.ranges[index];\n node.createAnimationRange(data.name, data.from, data.to);\n }\n }\n }\n /**\n * Return the minimum and maximum world vectors of the entire hierarchy under current node\n * @param includeDescendants Include bounding info from descendants as well (true by default)\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\n * @returns the new bounding vectors\n */\n getHierarchyBoundingVectors(includeDescendants = true, predicate = null) {\n // Ensures that all world matrix will be recomputed.\n this.getScene().incrementRenderId();\n this.computeWorldMatrix(true);\n let min;\n let max;\n const thisAbstractMesh = this;\n if (thisAbstractMesh.getBoundingInfo && thisAbstractMesh.subMeshes) {\n // If this is an abstract mesh get its bounding info\n const boundingInfo = thisAbstractMesh.getBoundingInfo();\n min = boundingInfo.boundingBox.minimumWorld.clone();\n max = boundingInfo.boundingBox.maximumWorld.clone();\n } else {\n min = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n max = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n }\n if (includeDescendants) {\n const descendants = this.getDescendants(false);\n for (const descendant of descendants) {\n const childMesh = descendant;\n childMesh.computeWorldMatrix(true);\n // Filters meshes based on custom predicate function.\n if (predicate && !predicate(childMesh)) {\n continue;\n }\n //make sure we have the needed params to get mix and max\n if (!childMesh.getBoundingInfo || childMesh.getTotalVertices() === 0) {\n continue;\n }\n const childBoundingInfo = childMesh.getBoundingInfo();\n const boundingBox = childBoundingInfo.boundingBox;\n const minBox = boundingBox.minimumWorld;\n const maxBox = boundingBox.maximumWorld;\n Vector3.CheckExtends(minBox, min, max);\n Vector3.CheckExtends(maxBox, min, max);\n }\n }\n return {\n min: min,\n max: max\n };\n }\n}\n/**\n * @internal\n */\nNode._AnimationRangeFactory = (_name, _from, _to) => {\n throw _WarnImport(\"AnimationRange\");\n};\nNode._NodeConstructors = {};\n__decorate([serialize()], Node.prototype, \"name\", void 0);\n__decorate([serialize()], Node.prototype, \"id\", void 0);\n__decorate([serialize()], Node.prototype, \"uniqueId\", void 0);\n__decorate([serialize()], Node.prototype, \"state\", void 0);\n__decorate([serialize()], Node.prototype, \"metadata\", void 0);","map":{"version":3,"names":["__decorate","Matrix","Vector3","serialize","Observable","EngineStore","_WarnImport","SerializationHelper","_InternalNodeDataInfo","constructor","_doNotSerialize","_isDisposed","_sceneRootNodesIndex","_isEnabled","_isParentEnabled","_isReady","_onEnabledStateChangedObservable","_onClonedObservable","Node","AddNodeConstructor","type","constructorFunc","_NodeConstructors","Construct","name","scene","options","accessibilityTag","value","_accessibilityTag","onAccessibilityTagChangedObservable","notifyObservers","doNotSerialize","_nodeDataStorage","_parentNode","isDisposed","parent","previousParentNode","_children","undefined","index","indexOf","splice","_addToSceneRootNodes","_isDirty","Array","push","_removeFromSceneRootNodes","_syncParentEnabledState","_serializeAsParent","serializationObject","parentId","uniqueId","_scene","rootNodes","length","lastIdx","pop","animationPropertiesOverride","_animationPropertiesOverride","getClassName","onDispose","callback","_onDisposeObserver","onDisposeObservable","remove","add","onEnabledStateChangedObservable","onClonedObservable","isPure","state","metadata","reservedDataStore","_parentContainer","animations","_ranges","onReady","_currentRenderId","_parentUpdateId","_childUpdateId","_waitingParentId","_waitingParentInstanceIndex","_waitingParsedUniqueId","_cache","_worldMatrix","Identity","_worldMatrixDeterminant","_worldMatrixDeterminantIsDirty","_isNode","_behaviors","id","LastCreatedScene","getUniqueId","_initCache","getScene","getEngine","addBehavior","behavior","attachImmediately","init","isLoading","onDataLoadedObservable","addOnce","attach","removeBehavior","detach","behaviors","getBehaviorByName","getWorldMatrix","getRenderId","computeWorldMatrix","_getWorldMatrixDeterminant","determinant","worldMatrixFromCache","updateCache","force","isSynchronized","_updateCache","_getActionManagerForTrigger","trigger","_initialCall","_ignoreParentClass","_isSynchronized","_markSyncedWithParent","isSynchronizedWithParent","isReady","_completeCheck","markAsDirty","_property","Number","MAX_VALUE","isEnabled","checkAncestors","forEach","c","setEnabled","isDescendantOf","ancestor","_getDescendants","results","directDescendantsOnly","predicate","item","getDescendants","getChildMeshes","node","cullingStrategy","getChildren","_setReady","getAnimationByName","i","animation","createAnimationRange","from","to","_AnimationRangeFactory","nAnimations","createRange","deleteAnimationRange","deleteFrames","deleteRange","getAnimationRange","clone","newParent","doNotCloneChildren","result","Clone","directDescendants","child","getAnimationRanges","animationRanges","beginAnimation","loop","speedRatio","onAnimationEnd","range","serializeAnimationRanges","serializationRanges","localRange","_force","dispose","doNotRecurse","disposeMaterialAndTextures","nodes","clear","ParseAnimationRanges","parsedNode","ranges","data","getHierarchyBoundingVectors","includeDescendants","incrementRenderId","min","max","thisAbstractMesh","getBoundingInfo","subMeshes","boundingInfo","boundingBox","minimumWorld","maximumWorld","descendants","descendant","childMesh","getTotalVertices","childBoundingInfo","minBox","maxBox","CheckExtends","_name","_from","_to","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/node.js"],"sourcesContent":["import { __decorate } from \"./tslib.es6.js\";\nimport { Matrix, Vector3 } from \"./Maths/math.vector.js\";\nimport { serialize } from \"./Misc/decorators.js\";\nimport { Observable } from \"./Misc/observable.js\";\nimport { EngineStore } from \"./Engines/engineStore.js\";\nimport { _WarnImport } from \"./Misc/devTools.js\";\nimport { SerializationHelper } from \"./Misc/decorators.serialization.js\";\n/** @internal */\nclass _InternalNodeDataInfo {\n constructor() {\n this._doNotSerialize = false;\n this._isDisposed = false;\n this._sceneRootNodesIndex = -1;\n this._isEnabled = true;\n this._isParentEnabled = true;\n this._isReady = true;\n this._onEnabledStateChangedObservable = new Observable();\n this._onClonedObservable = new Observable();\n }\n}\n/**\n * Node is the basic class for all scene objects (Mesh, Light, Camera.)\n */\nexport class Node {\n /**\n * Add a new node constructor\n * @param type defines the type name of the node to construct\n * @param constructorFunc defines the constructor function\n */\n static AddNodeConstructor(type, constructorFunc) {\n this._NodeConstructors[type] = constructorFunc;\n }\n /**\n * Returns a node constructor based on type name\n * @param type defines the type name\n * @param name defines the new node name\n * @param scene defines the hosting scene\n * @param options defines optional options to transmit to constructors\n * @returns the new constructor or null\n */\n static Construct(type, name, scene, options) {\n const constructorFunc = this._NodeConstructors[type];\n if (!constructorFunc) {\n return null;\n }\n return constructorFunc(name, scene, options);\n }\n /**\n * Gets or sets the accessibility tag to describe the node for accessibility purpose.\n */\n set accessibilityTag(value) {\n this._accessibilityTag = value;\n this.onAccessibilityTagChangedObservable.notifyObservers(value);\n }\n get accessibilityTag() {\n return this._accessibilityTag;\n }\n /**\n * Gets or sets a boolean used to define if the node must be serialized\n */\n get doNotSerialize() {\n if (this._nodeDataStorage._doNotSerialize) {\n return true;\n }\n if (this._parentNode) {\n return this._parentNode.doNotSerialize;\n }\n return false;\n }\n set doNotSerialize(value) {\n this._nodeDataStorage._doNotSerialize = value;\n }\n /**\n * Gets a boolean indicating if the node has been disposed\n * @returns true if the node was disposed\n */\n isDisposed() {\n return this._nodeDataStorage._isDisposed;\n }\n /**\n * Gets or sets the parent of the node (without keeping the current position in the scene)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/parent\n */\n set parent(parent) {\n if (this._parentNode === parent) {\n return;\n }\n const previousParentNode = this._parentNode;\n // Remove self from list of children of parent\n if (this._parentNode && this._parentNode._children !== undefined && this._parentNode._children !== null) {\n const index = this._parentNode._children.indexOf(this);\n if (index !== -1) {\n this._parentNode._children.splice(index, 1);\n }\n if (!parent && !this._nodeDataStorage._isDisposed) {\n this._addToSceneRootNodes();\n }\n }\n // Store new parent\n this._parentNode = parent;\n this._isDirty = true;\n // Add as child to new parent\n if (this._parentNode) {\n if (this._parentNode._children === undefined || this._parentNode._children === null) {\n this._parentNode._children = new Array();\n }\n this._parentNode._children.push(this);\n if (!previousParentNode) {\n this._removeFromSceneRootNodes();\n }\n }\n // Enabled state\n this._syncParentEnabledState();\n }\n get parent() {\n return this._parentNode;\n }\n /**\n * @internal\n */\n _serializeAsParent(serializationObject) {\n serializationObject.parentId = this.uniqueId;\n }\n /** @internal */\n _addToSceneRootNodes() {\n if (this._nodeDataStorage._sceneRootNodesIndex === -1) {\n this._nodeDataStorage._sceneRootNodesIndex = this._scene.rootNodes.length;\n this._scene.rootNodes.push(this);\n }\n }\n /** @internal */\n _removeFromSceneRootNodes() {\n if (this._nodeDataStorage._sceneRootNodesIndex !== -1) {\n const rootNodes = this._scene.rootNodes;\n const lastIdx = rootNodes.length - 1;\n rootNodes[this._nodeDataStorage._sceneRootNodesIndex] = rootNodes[lastIdx];\n rootNodes[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex = this._nodeDataStorage._sceneRootNodesIndex;\n this._scene.rootNodes.pop();\n this._nodeDataStorage._sceneRootNodesIndex = -1;\n }\n }\n /**\n * Gets or sets the animation properties override\n */\n get animationPropertiesOverride() {\n if (!this._animationPropertiesOverride) {\n return this._scene.animationPropertiesOverride;\n }\n return this._animationPropertiesOverride;\n }\n set animationPropertiesOverride(value) {\n this._animationPropertiesOverride = value;\n }\n /**\n * Gets a string identifying the name of the class\n * @returns \"Node\" string\n */\n getClassName() {\n return \"Node\";\n }\n /**\n * Sets a callback that will be raised when the node will be disposed\n */\n set onDispose(callback) {\n if (this._onDisposeObserver) {\n this.onDisposeObservable.remove(this._onDisposeObserver);\n }\n this._onDisposeObserver = this.onDisposeObservable.add(callback);\n }\n /**\n * An event triggered when the enabled state of the node changes\n */\n get onEnabledStateChangedObservable() {\n return this._nodeDataStorage._onEnabledStateChangedObservable;\n }\n /**\n * An event triggered when the node is cloned\n */\n get onClonedObservable() {\n return this._nodeDataStorage._onClonedObservable;\n }\n /**\n * Creates a new Node\n * @param name the name and id to be given to this node\n * @param scene the scene this node will be added to\n * @param isPure indicates this Node is just a Node, and not a derived class like Mesh or Camera\n */\n constructor(name, scene = null, isPure = true) {\n this._isDirty = false;\n this._nodeDataStorage = new _InternalNodeDataInfo();\n /**\n * Gets or sets a string used to store user defined state for the node\n */\n this.state = \"\";\n /**\n * Gets or sets an object used to store user defined information for the node\n */\n this.metadata = null;\n /**\n * For internal use only. Please do not use.\n */\n this.reservedDataStore = null;\n this._accessibilityTag = null;\n /**\n * Observable fired when an accessibility tag is changed\n */\n this.onAccessibilityTagChangedObservable = new Observable();\n /** @internal */\n this._parentContainer = null;\n /**\n * Gets a list of Animations associated with the node\n */\n this.animations = [];\n this._ranges = {};\n /**\n * Callback raised when the node is ready to be used\n */\n this.onReady = null;\n /** @internal */\n this._currentRenderId = -1;\n this._parentUpdateId = -1;\n /** @internal */\n this._childUpdateId = -1;\n /** @internal */\n this._waitingParentId = null;\n /** @internal */\n this._waitingParentInstanceIndex = null;\n /** @internal */\n this._waitingParsedUniqueId = null;\n /** @internal */\n this._cache = {};\n this._parentNode = null;\n /** @internal */\n this._children = null;\n /** @internal */\n this._worldMatrix = Matrix.Identity();\n /** @internal */\n this._worldMatrixDeterminant = 0;\n /** @internal */\n this._worldMatrixDeterminantIsDirty = true;\n this._animationPropertiesOverride = null;\n /** @internal */\n this._isNode = true;\n /**\n * An event triggered when the mesh is disposed\n */\n this.onDisposeObservable = new Observable();\n this._onDisposeObserver = null;\n // Behaviors\n this._behaviors = new Array();\n this.name = name;\n this.id = name;\n this._scene = (scene || EngineStore.LastCreatedScene);\n this.uniqueId = this._scene.getUniqueId();\n this._initCache();\n if (isPure) {\n this._addToSceneRootNodes();\n }\n }\n /**\n * Gets the scene of the node\n * @returns a scene\n */\n getScene() {\n return this._scene;\n }\n /**\n * Gets the engine of the node\n * @returns a Engine\n */\n getEngine() {\n return this._scene.getEngine();\n }\n /**\n * Attach a behavior to the node\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\n * @param behavior defines the behavior to attach\n * @param attachImmediately defines that the behavior must be attached even if the scene is still loading\n * @returns the current Node\n */\n addBehavior(behavior, attachImmediately = false) {\n const index = this._behaviors.indexOf(behavior);\n if (index !== -1) {\n return this;\n }\n behavior.init();\n if (this._scene.isLoading && !attachImmediately) {\n // We defer the attach when the scene will be loaded\n this._scene.onDataLoadedObservable.addOnce(() => {\n behavior.attach(this);\n });\n }\n else {\n behavior.attach(this);\n }\n this._behaviors.push(behavior);\n return this;\n }\n /**\n * Remove an attached behavior\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\n * @param behavior defines the behavior to attach\n * @returns the current Node\n */\n removeBehavior(behavior) {\n const index = this._behaviors.indexOf(behavior);\n if (index === -1) {\n return this;\n }\n this._behaviors[index].detach();\n this._behaviors.splice(index, 1);\n return this;\n }\n /**\n * Gets the list of attached behaviors\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\n */\n get behaviors() {\n return this._behaviors;\n }\n /**\n * Gets an attached behavior by name\n * @param name defines the name of the behavior to look for\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\n * @returns null if behavior was not found else the requested behavior\n */\n getBehaviorByName(name) {\n for (const behavior of this._behaviors) {\n if (behavior.name === name) {\n return behavior;\n }\n }\n return null;\n }\n /**\n * Returns the latest update of the World matrix\n * @returns a Matrix\n */\n getWorldMatrix() {\n if (this._currentRenderId !== this._scene.getRenderId()) {\n this.computeWorldMatrix();\n }\n return this._worldMatrix;\n }\n /** @internal */\n _getWorldMatrixDeterminant() {\n if (this._worldMatrixDeterminantIsDirty) {\n this._worldMatrixDeterminantIsDirty = false;\n this._worldMatrixDeterminant = this._worldMatrix.determinant();\n }\n return this._worldMatrixDeterminant;\n }\n /**\n * Returns directly the latest state of the mesh World matrix.\n * A Matrix is returned.\n */\n get worldMatrixFromCache() {\n return this._worldMatrix;\n }\n // override it in derived class if you add new variables to the cache\n // and call the parent class method\n /** @internal */\n _initCache() {\n this._cache = {};\n }\n /**\n * @internal\n */\n updateCache(force) {\n if (!force && this.isSynchronized()) {\n return;\n }\n this._updateCache();\n }\n /**\n * @internal\n */\n _getActionManagerForTrigger(trigger, _initialCall = true) {\n if (!this.parent) {\n return null;\n }\n return this.parent._getActionManagerForTrigger(trigger, false);\n }\n // override it in derived class if you add new variables to the cache\n // and call the parent class method if !ignoreParentClass\n /**\n * @internal\n */\n _updateCache(_ignoreParentClass) { }\n // override it in derived class if you add new variables to the cache\n /** @internal */\n _isSynchronized() {\n return true;\n }\n /** @internal */\n _markSyncedWithParent() {\n if (this._parentNode) {\n this._parentUpdateId = this._parentNode._childUpdateId;\n }\n }\n /** @internal */\n isSynchronizedWithParent() {\n if (!this._parentNode) {\n return true;\n }\n if (this._parentNode._isDirty || this._parentUpdateId !== this._parentNode._childUpdateId) {\n return false;\n }\n return this._parentNode.isSynchronized();\n }\n /** @internal */\n isSynchronized() {\n if (this._parentNode && !this.isSynchronizedWithParent()) {\n return false;\n }\n return this._isSynchronized();\n }\n /**\n * Is this node ready to be used/rendered\n * @param _completeCheck defines if a complete check (including materials and lights) has to be done (false by default)\n * @returns true if the node is ready\n */\n isReady(_completeCheck = false) {\n return this._nodeDataStorage._isReady;\n }\n /**\n * Flag the node as dirty (Forcing it to update everything)\n * @param _property helps children apply precise \"dirtyfication\"\n * @returns this node\n */\n markAsDirty(_property) {\n this._currentRenderId = Number.MAX_VALUE;\n this._isDirty = true;\n return this;\n }\n /**\n * Is this node enabled?\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\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\n * @returns whether this node (and its parent) is enabled\n */\n isEnabled(checkAncestors = true) {\n if (checkAncestors === false) {\n return this._nodeDataStorage._isEnabled;\n }\n if (!this._nodeDataStorage._isEnabled) {\n return false;\n }\n return this._nodeDataStorage._isParentEnabled;\n }\n /** @internal */\n _syncParentEnabledState() {\n this._nodeDataStorage._isParentEnabled = this._parentNode ? this._parentNode.isEnabled() : true;\n if (this._children) {\n this._children.forEach((c) => {\n c._syncParentEnabledState(); // Force children to update accordingly\n });\n }\n }\n /**\n * Set the enabled state of this node\n * @param value defines the new enabled state\n */\n setEnabled(value) {\n if (this._nodeDataStorage._isEnabled === value) {\n return;\n }\n this._nodeDataStorage._isEnabled = value;\n this._syncParentEnabledState();\n this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(value);\n }\n /**\n * Is this node a descendant of the given node?\n * The function will iterate up the hierarchy until the ancestor was found or no more parents defined\n * @param ancestor defines the parent node to inspect\n * @returns a boolean indicating if this node is a descendant of the given node\n */\n isDescendantOf(ancestor) {\n if (this.parent) {\n if (this.parent === ancestor) {\n return true;\n }\n return this.parent.isDescendantOf(ancestor);\n }\n return false;\n }\n /**\n * @internal\n */\n _getDescendants(results, directDescendantsOnly = false, predicate) {\n if (!this._children) {\n return;\n }\n for (let index = 0; index < this._children.length; index++) {\n const item = this._children[index];\n if (!predicate || predicate(item)) {\n results.push(item);\n }\n if (!directDescendantsOnly) {\n item._getDescendants(results, false, predicate);\n }\n }\n }\n /**\n * Will return all nodes that have this node as ascendant\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\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\n * @returns all children nodes of all types\n */\n getDescendants(directDescendantsOnly, predicate) {\n const results = [];\n this._getDescendants(results, directDescendantsOnly, predicate);\n return results;\n }\n /**\n * Get all child-meshes of this node\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)\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\n * @returns an array of AbstractMesh\n */\n getChildMeshes(directDescendantsOnly, predicate) {\n const results = [];\n this._getDescendants(results, directDescendantsOnly, (node) => {\n return (!predicate || predicate(node)) && node.cullingStrategy !== undefined;\n });\n return results;\n }\n /**\n * Get all direct children of this node\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\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)\n * @returns an array of Node\n */\n getChildren(predicate, directDescendantsOnly = true) {\n return this.getDescendants(directDescendantsOnly, predicate);\n }\n /**\n * @internal\n */\n _setReady(state) {\n if (state === this._nodeDataStorage._isReady) {\n return;\n }\n if (!state) {\n this._nodeDataStorage._isReady = false;\n return;\n }\n if (this.onReady) {\n this.onReady(this);\n }\n this._nodeDataStorage._isReady = true;\n }\n /**\n * Get an animation by name\n * @param name defines the name of the animation to look for\n * @returns null if not found else the requested animation\n */\n getAnimationByName(name) {\n for (let i = 0; i < this.animations.length; i++) {\n const animation = this.animations[i];\n if (animation.name === name) {\n return animation;\n }\n }\n return null;\n }\n /**\n * Creates an animation range for this node\n * @param name defines the name of the range\n * @param from defines the starting key\n * @param to defines the end key\n */\n createAnimationRange(name, from, to) {\n // check name not already in use\n if (!this._ranges[name]) {\n this._ranges[name] = Node._AnimationRangeFactory(name, from, to);\n for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) {\n if (this.animations[i]) {\n this.animations[i].createRange(name, from, to);\n }\n }\n }\n }\n /**\n * Delete a specific animation range\n * @param name defines the name of the range to delete\n * @param deleteFrames defines if animation frames from the range must be deleted as well\n */\n deleteAnimationRange(name, deleteFrames = true) {\n for (let i = 0, nAnimations = this.animations.length; i < nAnimations; i++) {\n if (this.animations[i]) {\n this.animations[i].deleteRange(name, deleteFrames);\n }\n }\n this._ranges[name] = null; // said much faster than 'delete this._range[name]'\n }\n /**\n * Get an animation range by name\n * @param name defines the name of the animation range to look for\n * @returns null if not found else the requested animation range\n */\n getAnimationRange(name) {\n return this._ranges[name] || null;\n }\n /**\n * Clone the current node\n * @param name Name of the new clone\n * @param newParent New parent for the clone\n * @param doNotCloneChildren Do not clone children hierarchy\n * @returns the new transform node\n */\n clone(name, newParent, doNotCloneChildren) {\n const result = SerializationHelper.Clone(() => new Node(name, this.getScene()), this);\n if (newParent) {\n result.parent = newParent;\n }\n if (!doNotCloneChildren) {\n // Children\n const directDescendants = this.getDescendants(true);\n for (let index = 0; index < directDescendants.length; index++) {\n const child = directDescendants[index];\n child.clone(name + \".\" + child.name, result);\n }\n }\n return result;\n }\n /**\n * Gets the list of all animation ranges defined on this node\n * @returns an array\n */\n getAnimationRanges() {\n const animationRanges = [];\n let name;\n for (name in this._ranges) {\n animationRanges.push(this._ranges[name]);\n }\n return animationRanges;\n }\n /**\n * Will start the animation sequence\n * @param name defines the range frames for animation sequence\n * @param loop defines if the animation should loop (false by default)\n * @param speedRatio defines the speed factor in which to run the animation (1 by default)\n * @param onAnimationEnd defines a function to be executed when the animation ended (undefined by default)\n * @returns the object created for this animation. If range does not exist, it will return null\n */\n beginAnimation(name, loop, speedRatio, onAnimationEnd) {\n const range = this.getAnimationRange(name);\n if (!range) {\n return null;\n }\n return this._scene.beginAnimation(this, range.from, range.to, loop, speedRatio, onAnimationEnd);\n }\n /**\n * Serialize animation ranges into a JSON compatible object\n * @returns serialization object\n */\n serializeAnimationRanges() {\n const serializationRanges = [];\n for (const name in this._ranges) {\n const localRange = this._ranges[name];\n if (!localRange) {\n continue;\n }\n const range = {};\n range.name = name;\n range.from = localRange.from;\n range.to = localRange.to;\n serializationRanges.push(range);\n }\n return serializationRanges;\n }\n /**\n * Computes the world matrix of the node\n * @param _force defines if the cache version should be invalidated forcing the world matrix to be created from scratch\n * @returns the world matrix\n */\n computeWorldMatrix(_force) {\n if (!this._worldMatrix) {\n this._worldMatrix = Matrix.Identity();\n }\n return this._worldMatrix;\n }\n /**\n * Releases resources associated with this node.\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\n * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)\n */\n dispose(doNotRecurse, disposeMaterialAndTextures = false) {\n this._nodeDataStorage._isDisposed = true;\n if (!doNotRecurse) {\n const nodes = this.getDescendants(true);\n for (const node of nodes) {\n node.dispose(doNotRecurse, disposeMaterialAndTextures);\n }\n }\n if (!this.parent) {\n this._removeFromSceneRootNodes();\n }\n else {\n this.parent = null;\n }\n // Callback\n this.onDisposeObservable.notifyObservers(this);\n this.onDisposeObservable.clear();\n this.onEnabledStateChangedObservable.clear();\n this.onClonedObservable.clear();\n // Behaviors\n for (const behavior of this._behaviors) {\n behavior.detach();\n }\n this._behaviors.length = 0;\n this.metadata = null;\n }\n /**\n * Parse animation range data from a serialization object and store them into a given node\n * @param node defines where to store the animation ranges\n * @param parsedNode defines the serialization object to read data from\n * @param _scene defines the hosting scene\n */\n static ParseAnimationRanges(node, parsedNode, _scene) {\n if (parsedNode.ranges) {\n for (let index = 0; index < parsedNode.ranges.length; index++) {\n const data = parsedNode.ranges[index];\n node.createAnimationRange(data.name, data.from, data.to);\n }\n }\n }\n /**\n * Return the minimum and maximum world vectors of the entire hierarchy under current node\n * @param includeDescendants Include bounding info from descendants as well (true by default)\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\n * @returns the new bounding vectors\n */\n getHierarchyBoundingVectors(includeDescendants = true, predicate = null) {\n // Ensures that all world matrix will be recomputed.\n this.getScene().incrementRenderId();\n this.computeWorldMatrix(true);\n let min;\n let max;\n const thisAbstractMesh = this;\n if (thisAbstractMesh.getBoundingInfo && thisAbstractMesh.subMeshes) {\n // If this is an abstract mesh get its bounding info\n const boundingInfo = thisAbstractMesh.getBoundingInfo();\n min = boundingInfo.boundingBox.minimumWorld.clone();\n max = boundingInfo.boundingBox.maximumWorld.clone();\n }\n else {\n min = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n max = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n }\n if (includeDescendants) {\n const descendants = this.getDescendants(false);\n for (const descendant of descendants) {\n const childMesh = descendant;\n childMesh.computeWorldMatrix(true);\n // Filters meshes based on custom predicate function.\n if (predicate && !predicate(childMesh)) {\n continue;\n }\n //make sure we have the needed params to get mix and max\n if (!childMesh.getBoundingInfo || childMesh.getTotalVertices() === 0) {\n continue;\n }\n const childBoundingInfo = childMesh.getBoundingInfo();\n const boundingBox = childBoundingInfo.boundingBox;\n const minBox = boundingBox.minimumWorld;\n const maxBox = boundingBox.maximumWorld;\n Vector3.CheckExtends(minBox, min, max);\n Vector3.CheckExtends(maxBox, min, max);\n }\n }\n return {\n min: min,\n max: max,\n };\n }\n}\n/**\n * @internal\n */\nNode._AnimationRangeFactory = (_name, _from, _to) => {\n throw _WarnImport(\"AnimationRange\");\n};\nNode._NodeConstructors = {};\n__decorate([\n serialize()\n], Node.prototype, \"name\", void 0);\n__decorate([\n serialize()\n], Node.prototype, \"id\", void 0);\n__decorate([\n serialize()\n], Node.prototype, \"uniqueId\", void 0);\n__decorate([\n serialize()\n], Node.prototype, \"state\", void 0);\n__decorate([\n serialize()\n], Node.prototype, \"metadata\", void 0);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,MAAM,EAAEC,OAAO,QAAQ,wBAAwB;AACxD,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,mBAAmB,QAAQ,oCAAoC;AACxE;AACA,MAAMC,qBAAqB,CAAC;EACxBC,WAAWA,CAAA,EAAG;IACV,IAAI,CAACC,eAAe,GAAG,KAAK;IAC5B,IAAI,CAACC,WAAW,GAAG,KAAK;IACxB,IAAI,CAACC,oBAAoB,GAAG,CAAC,CAAC;IAC9B,IAAI,CAACC,UAAU,GAAG,IAAI;IACtB,IAAI,CAACC,gBAAgB,GAAG,IAAI;IAC5B,IAAI,CAACC,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACC,gCAAgC,GAAG,IAAIZ,UAAU,CAAC,CAAC;IACxD,IAAI,CAACa,mBAAmB,GAAG,IAAIb,UAAU,CAAC,CAAC;EAC/C;AACJ;AACA;AACA;AACA;AACA,OAAO,MAAMc,IAAI,CAAC;EACd;AACJ;AACA;AACA;AACA;EACI,OAAOC,kBAAkBA,CAACC,IAAI,EAAEC,eAAe,EAAE;IAC7C,IAAI,CAACC,iBAAiB,CAACF,IAAI,CAAC,GAAGC,eAAe;EAClD;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACI,OAAOE,SAASA,CAACH,IAAI,EAAEI,IAAI,EAAEC,KAAK,EAAEC,OAAO,E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