554a0f99b886dd5d708ea364bdd615f6b28e109ddea1a203f918868f155471b4.json 268 KB

1
  1. {"ast":null,"code":"import { __decorate } from \"../tslib.es6.js\";\nimport { Observable } from \"../Misc/observable.js\";\nimport { Quaternion, Matrix, Vector3, TmpVectors } from \"../Maths/math.vector.js\";\nimport { VertexBuffer } from \"../Buffers/buffer.js\";\nimport { VertexData } from \"../Meshes/mesh.vertexData.js\";\nimport { TransformNode } from \"../Meshes/transformNode.js\";\nimport { PickingInfo } from \"../Collisions/pickingInfo.js\";\nimport { BoundingInfo } from \"../Culling/boundingInfo.js\";\nimport { UniformBuffer } from \"../Materials/uniformBuffer.js\";\nimport { _MeshCollisionData } from \"../Collisions/meshCollisionData.js\";\nimport { _WarnImport } from \"../Misc/devTools.js\";\nimport { extractMinAndMax } from \"../Maths/math.functions.js\";\nimport { Color3, Color4 } from \"../Maths/math.color.js\";\nimport { Epsilon } from \"../Maths/math.constants.js\";\nimport { Axis } from \"../Maths/math.axis.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { nativeOverride } from \"../Misc/decorators.js\";\nimport { AbstractEngine } from \"../Engines/abstractEngine.js\";\nfunction applyMorph(data, kind, morphTargetManager) {\n let getTargetData = null;\n switch (kind) {\n case VertexBuffer.PositionKind:\n getTargetData = target => target.getPositions();\n break;\n case VertexBuffer.NormalKind:\n getTargetData = target => target.getNormals();\n break;\n case VertexBuffer.TangentKind:\n getTargetData = target => target.getTangents();\n break;\n case VertexBuffer.UVKind:\n getTargetData = target => target.getUVs();\n break;\n default:\n return;\n }\n for (let index = 0; index < data.length; index++) {\n let value = data[index];\n for (let targetCount = 0; targetCount < morphTargetManager.numTargets; targetCount++) {\n const target = morphTargetManager.getTarget(targetCount);\n const influence = target.influence;\n if (influence !== 0) {\n const targetData = getTargetData(target);\n if (targetData) {\n value += (targetData[index] - data[index]) * influence;\n }\n }\n }\n data[index] = value;\n }\n}\nfunction applySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData) {\n const tempVector = TmpVectors.Vector3[0];\n const finalMatrix = TmpVectors.Matrix[0];\n const tempMatrix = TmpVectors.Matrix[1];\n const transformFromFloatsToRef = kind === VertexBuffer.NormalKind ? Vector3.TransformNormalFromFloatsToRef : Vector3.TransformCoordinatesFromFloatsToRef;\n for (let index = 0, matWeightIdx = 0; index < data.length; index += 3, matWeightIdx += 4) {\n finalMatrix.reset();\n let inf;\n let weight;\n for (inf = 0; inf < 4; inf++) {\n weight = matricesWeightsData[matWeightIdx + inf];\n if (weight > 0) {\n Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix);\n finalMatrix.addToSelf(tempMatrix);\n }\n }\n if (matricesIndicesExtraData && matricesWeightsExtraData) {\n for (inf = 0; inf < 4; inf++) {\n weight = matricesWeightsExtraData[matWeightIdx + inf];\n if (weight > 0) {\n Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix);\n finalMatrix.addToSelf(tempMatrix);\n }\n }\n }\n transformFromFloatsToRef(data[index], data[index + 1], data[index + 2], finalMatrix, tempVector);\n tempVector.toArray(data, index);\n }\n}\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nclass _FacetDataStorage {\n constructor() {\n this.facetNb = 0; // facet number\n this.partitioningSubdivisions = 10; // number of subdivisions per axis in the partitioning space\n this.partitioningBBoxRatio = 1.01; // the partitioning array space is by default 1% bigger than the bounding box\n this.facetDataEnabled = false; // is the facet data feature enabled on this mesh ?\n this.facetParameters = {}; // keep a reference to the object parameters to avoid memory re-allocation\n this.bbSize = Vector3.Zero(); // bbox size approximated for facet data\n this.subDiv = {\n // actual number of subdivisions per axis for ComputeNormals()\n max: 1,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n X: 1,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Y: 1,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Z: 1\n };\n this.facetDepthSort = false; // is the facet depth sort to be computed\n this.facetDepthSortEnabled = false; // is the facet depth sort initialized\n }\n}\n/**\n * @internal\n **/\n// eslint-disable-next-line @typescript-eslint/naming-convention\nclass _InternalAbstractMeshDataInfo {\n constructor() {\n this._hasVertexAlpha = false;\n this._useVertexColors = true;\n this._numBoneInfluencers = 4;\n this._applyFog = true;\n this._receiveShadows = false;\n this._facetData = new _FacetDataStorage();\n this._visibility = 1.0;\n this._skeleton = null;\n this._layerMask = 0x0fffffff;\n this._computeBonesUsingShaders = true;\n this._isActive = false;\n this._onlyForInstances = false;\n this._isActiveIntermediate = false;\n this._onlyForInstancesIntermediate = false;\n this._actAsRegularMesh = false;\n this._currentLOD = null;\n this._currentLODIsUpToDate = false;\n this._collisionRetryCount = 3;\n this._morphTargetManager = null;\n this._renderingGroupId = 0;\n this._bakedVertexAnimationManager = null;\n this._material = null;\n this._positions = null;\n this._pointerOverDisableMeshTesting = false;\n // Collisions\n this._meshCollisionData = new _MeshCollisionData();\n this._enableDistantPicking = false;\n /** @internal\n * Bounding info that is unnafected by the addition of thin instances\n */\n this._rawBoundingInfo = null;\n /** @internal\n * This value will indicate us that at some point, the mesh was specifically used with the opposite winding order\n * We use that as a clue to force the material to sideOrientation = null\n */\n this._sideOrientationHint = false;\n /**\n * @internal\n * if this is set to true, the mesh will be visible only if its parent(s) are also visible\n */\n this._inheritVisibility = false;\n }\n}\n/**\n * Class used to store all common mesh properties\n */\nexport class AbstractMesh extends TransformNode {\n /**\n * No billboard\n */\n static get BILLBOARDMODE_NONE() {\n return TransformNode.BILLBOARDMODE_NONE;\n }\n /** Billboard on X axis */\n static get BILLBOARDMODE_X() {\n return TransformNode.BILLBOARDMODE_X;\n }\n /** Billboard on Y axis */\n static get BILLBOARDMODE_Y() {\n return TransformNode.BILLBOARDMODE_Y;\n }\n /** Billboard on Z axis */\n static get BILLBOARDMODE_Z() {\n return TransformNode.BILLBOARDMODE_Z;\n }\n /** Billboard on all axes */\n static get BILLBOARDMODE_ALL() {\n return TransformNode.BILLBOARDMODE_ALL;\n }\n /** Billboard on using position instead of orientation */\n static get BILLBOARDMODE_USE_POSITION() {\n return TransformNode.BILLBOARDMODE_USE_POSITION;\n }\n /**\n * Gets the number of facets in the mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#what-is-a-mesh-facet\n */\n get facetNb() {\n return this._internalAbstractMeshDataInfo._facetData.facetNb;\n }\n /**\n * Gets or set the number (integer) of subdivisions per axis in the partitioning space\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning\n */\n get partitioningSubdivisions() {\n return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions;\n }\n set partitioningSubdivisions(nb) {\n this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions = nb;\n }\n /**\n * The ratio (float) to apply to the bounding box size to set to the partitioning space.\n * Ex : 1.01 (default) the partitioning space is 1% bigger than the bounding box\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning\n */\n get partitioningBBoxRatio() {\n return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio;\n }\n set partitioningBBoxRatio(ratio) {\n this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio = ratio;\n }\n /**\n * Gets or sets a boolean indicating that the facets must be depth sorted on next call to `updateFacetData()`.\n * Works only for updatable meshes.\n * Doesn't work with multi-materials\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort\n */\n get mustDepthSortFacets() {\n return this._internalAbstractMeshDataInfo._facetData.facetDepthSort;\n }\n set mustDepthSortFacets(sort) {\n this._internalAbstractMeshDataInfo._facetData.facetDepthSort = sort;\n }\n /**\n * The location (Vector3) where the facet depth sort must be computed from.\n * By default, the active camera position.\n * Used only when facet depth sort is enabled\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort\n */\n get facetDepthSortFrom() {\n return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom;\n }\n set facetDepthSortFrom(location) {\n this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom = location;\n }\n /** number of collision detection tries. Change this value if not all collisions are detected and handled properly */\n get collisionRetryCount() {\n return this._internalAbstractMeshDataInfo._collisionRetryCount;\n }\n set collisionRetryCount(retryCount) {\n this._internalAbstractMeshDataInfo._collisionRetryCount = retryCount;\n }\n /**\n * gets a boolean indicating if facetData is enabled\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#what-is-a-mesh-facet\n */\n get isFacetDataEnabled() {\n return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled;\n }\n /**\n * Gets or sets the morph target manager\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/morphTargets\n */\n get morphTargetManager() {\n return this._internalAbstractMeshDataInfo._morphTargetManager;\n }\n set morphTargetManager(value) {\n if (this._internalAbstractMeshDataInfo._morphTargetManager === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._morphTargetManager = value;\n this._syncGeometryWithMorphTargetManager();\n }\n /**\n * Gets or sets the baked vertex animation manager\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/baked_texture_animations\n */\n get bakedVertexAnimationManager() {\n return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager;\n }\n set bakedVertexAnimationManager(value) {\n if (this._internalAbstractMeshDataInfo._bakedVertexAnimationManager === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._bakedVertexAnimationManager = value;\n this._markSubMeshesAsAttributesDirty();\n }\n /** @internal */\n _syncGeometryWithMorphTargetManager() {}\n /**\n * @internal\n */\n _updateNonUniformScalingState(value) {\n if (!super._updateNonUniformScalingState(value)) {\n return false;\n }\n this._markSubMeshesAsMiscDirty();\n return true;\n }\n /** @internal */\n get rawBoundingInfo() {\n return this._internalAbstractMeshDataInfo._rawBoundingInfo;\n }\n set rawBoundingInfo(boundingInfo) {\n this._internalAbstractMeshDataInfo._rawBoundingInfo = boundingInfo;\n }\n /** Set a function to call when this mesh collides with another one */\n set onCollide(callback) {\n if (this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver) {\n this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver);\n }\n this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver = this.onCollideObservable.add(callback);\n }\n /** Set a function to call when the collision's position changes */\n set onCollisionPositionChange(callback) {\n if (this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver) {\n this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver);\n }\n this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(callback);\n }\n /**\n * Gets or sets mesh visibility between 0 and 1 (default is 1)\n */\n get visibility() {\n return this._internalAbstractMeshDataInfo._visibility;\n }\n /**\n * Gets or sets mesh visibility between 0 and 1 (default is 1)\n */\n set visibility(value) {\n if (this._internalAbstractMeshDataInfo._visibility === value) {\n return;\n }\n const oldValue = this._internalAbstractMeshDataInfo._visibility;\n this._internalAbstractMeshDataInfo._visibility = value;\n if (oldValue === 1 && value !== 1 || oldValue !== 1 && value === 1) {\n this._markSubMeshesAsDirty(defines => {\n defines.markAsMiscDirty();\n defines.markAsPrePassDirty();\n });\n }\n }\n /**\n * If set to true, a mesh will only be visible only if its parent(s) are also visible (default is false)\n */\n get inheritVisibility() {\n return this._internalAbstractMeshDataInfo._inheritVisibility;\n }\n set inheritVisibility(value) {\n this._internalAbstractMeshDataInfo._inheritVisibility = value;\n }\n /**\n * Gets or sets a boolean indicating if the mesh is visible (renderable). Default is true\n */\n get isVisible() {\n if (!this._isVisible || !this.inheritVisibility || !this._parentNode) {\n return this._isVisible;\n }\n if (this._isVisible) {\n let parent = this._parentNode;\n while (parent) {\n const parentVisible = parent.isVisible;\n if (typeof parentVisible !== \"undefined\") {\n return parentVisible;\n }\n parent = parent.parent;\n }\n }\n return this._isVisible;\n }\n set isVisible(value) {\n this._isVisible = value;\n }\n /**\n * Gets or sets the property which disables the test that is checking that the mesh under the pointer is the same than the previous time we tested for it (default: false).\n * Set this property to true if you want thin instances picking to be reported accurately when moving over the mesh.\n * Note that setting this property to true will incur some performance penalties when dealing with pointer events for this mesh so use it sparingly.\n */\n get pointerOverDisableMeshTesting() {\n return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting;\n }\n set pointerOverDisableMeshTesting(disable) {\n this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting = disable;\n }\n /**\n * Specifies the rendering group id for this mesh (0 by default)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering#rendering-groups\n */\n get renderingGroupId() {\n return this._internalAbstractMeshDataInfo._renderingGroupId;\n }\n set renderingGroupId(value) {\n this._internalAbstractMeshDataInfo._renderingGroupId = value;\n }\n /** Gets or sets current material */\n get material() {\n return this._internalAbstractMeshDataInfo._material;\n }\n set material(value) {\n this._setMaterial(value);\n }\n /** @internal */\n _setMaterial(value) {\n if (this._internalAbstractMeshDataInfo._material === value) {\n return;\n }\n // remove from material mesh map id needed\n if (this._internalAbstractMeshDataInfo._material && this._internalAbstractMeshDataInfo._material.meshMap) {\n this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId] = undefined;\n }\n this._internalAbstractMeshDataInfo._material = value;\n if (value && value.meshMap) {\n value.meshMap[this.uniqueId] = this;\n }\n if (this.onMaterialChangedObservable.hasObservers()) {\n this.onMaterialChangedObservable.notifyObservers(this);\n }\n if (!this.subMeshes) {\n return;\n }\n this.resetDrawCache(undefined, value == null);\n this._unBindEffect();\n }\n /**\n * Gets the material used to render the mesh in a specific render pass\n * @param renderPassId render pass id\n * @returns material used for the render pass. If no specific material is used for this render pass, undefined is returned (meaning mesh.material is used for this pass)\n */\n getMaterialForRenderPass(renderPassId) {\n var _this$_internalAbstra;\n return (_this$_internalAbstra = this._internalAbstractMeshDataInfo._materialForRenderPass) === null || _this$_internalAbstra === void 0 ? void 0 : _this$_internalAbstra[renderPassId];\n }\n /**\n * Sets the material to be used to render the mesh in a specific render pass\n * @param renderPassId render pass id\n * @param material material to use for this render pass. If undefined is passed, no specific material will be used for this render pass but the regular material will be used instead (mesh.material)\n */\n setMaterialForRenderPass(renderPassId, material) {\n this.resetDrawCache(renderPassId);\n if (!this._internalAbstractMeshDataInfo._materialForRenderPass) {\n this._internalAbstractMeshDataInfo._materialForRenderPass = [];\n }\n this._internalAbstractMeshDataInfo._materialForRenderPass[renderPassId] = material;\n }\n /**\n * Gets or sets a boolean indicating that this mesh can receive realtime shadows\n * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows\n */\n get receiveShadows() {\n return this._internalAbstractMeshDataInfo._receiveShadows;\n }\n set receiveShadows(value) {\n if (this._internalAbstractMeshDataInfo._receiveShadows === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._receiveShadows = value;\n this._markSubMeshesAsLightDirty();\n }\n /**\n * Gets or sets a boolean indicating that this mesh needs to use vertex alpha data to render.\n * This property is misnamed and should be `useVertexAlpha`. Note that the mesh will be rendered\n * with alpha blending when this flag is set even if vertex alpha data is missing from the geometry.\n */\n get hasVertexAlpha() {\n return this._internalAbstractMeshDataInfo._hasVertexAlpha;\n }\n set hasVertexAlpha(value) {\n if (this._internalAbstractMeshDataInfo._hasVertexAlpha === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._hasVertexAlpha = value;\n this._markSubMeshesAsAttributesDirty();\n this._markSubMeshesAsMiscDirty();\n }\n /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */\n get useVertexColors() {\n return this._internalAbstractMeshDataInfo._useVertexColors;\n }\n set useVertexColors(value) {\n if (this._internalAbstractMeshDataInfo._useVertexColors === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._useVertexColors = value;\n this._markSubMeshesAsAttributesDirty();\n }\n /**\n * Gets or sets a boolean indicating that bone animations must be computed by the GPU (true by default)\n */\n get computeBonesUsingShaders() {\n return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;\n }\n set computeBonesUsingShaders(value) {\n if (this._internalAbstractMeshDataInfo._computeBonesUsingShaders === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._computeBonesUsingShaders = value;\n this._markSubMeshesAsAttributesDirty();\n }\n /** Gets or sets the number of allowed bone influences per vertex (4 by default) */\n get numBoneInfluencers() {\n return this._internalAbstractMeshDataInfo._numBoneInfluencers;\n }\n set numBoneInfluencers(value) {\n if (this._internalAbstractMeshDataInfo._numBoneInfluencers === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._numBoneInfluencers = value;\n this._markSubMeshesAsAttributesDirty();\n }\n /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */\n get applyFog() {\n return this._internalAbstractMeshDataInfo._applyFog;\n }\n set applyFog(value) {\n if (this._internalAbstractMeshDataInfo._applyFog === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._applyFog = value;\n this._markSubMeshesAsMiscDirty();\n }\n /** When enabled, decompose picking matrices for better precision with large values for mesh position and scling */\n get enableDistantPicking() {\n return this._internalAbstractMeshDataInfo._enableDistantPicking;\n }\n set enableDistantPicking(value) {\n this._internalAbstractMeshDataInfo._enableDistantPicking = value;\n }\n /**\n * Gets or sets the current layer mask (default is 0x0FFFFFFF)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/layerMasksAndMultiCam\n */\n get layerMask() {\n return this._internalAbstractMeshDataInfo._layerMask;\n }\n set layerMask(value) {\n if (value === this._internalAbstractMeshDataInfo._layerMask) {\n return;\n }\n this._internalAbstractMeshDataInfo._layerMask = value;\n this._resyncLightSources();\n }\n /**\n * Gets or sets a collision mask used to mask collisions (default is -1).\n * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0\n */\n get collisionMask() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask;\n }\n set collisionMask(mask) {\n this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask = !isNaN(mask) ? mask : -1;\n }\n /**\n * Gets or sets a collision response flag (default is true).\n * when collisionResponse is false, events are still triggered but colliding entity has no response\n * This helps creating trigger volume when user wants collision feedback events but not position/velocity\n * to respond to the collision.\n */\n get collisionResponse() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse;\n }\n set collisionResponse(response) {\n this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse = response;\n }\n /**\n * Gets or sets the current collision group mask (-1 by default).\n * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0\n */\n get collisionGroup() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup;\n }\n set collisionGroup(mask) {\n this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup = !isNaN(mask) ? mask : -1;\n }\n /**\n * Gets or sets current surrounding meshes (null by default).\n *\n * By default collision detection is tested against every mesh in the scene.\n * It is possible to set surroundingMeshes to a defined list of meshes and then only these specified\n * meshes will be tested for the collision.\n *\n * Note: if set to an empty array no collision will happen when this mesh is moved.\n */\n get surroundingMeshes() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes;\n }\n set surroundingMeshes(meshes) {\n this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes = meshes;\n }\n /** Gets the list of lights affecting that mesh */\n get lightSources() {\n return this._lightSources;\n }\n /**\n * Gets or sets a skeleton to apply skinning transformations\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons\n */\n set skeleton(value) {\n const skeleton = this._internalAbstractMeshDataInfo._skeleton;\n if (skeleton && skeleton.needInitialSkinMatrix) {\n skeleton._unregisterMeshWithPoseMatrix(this);\n }\n if (value && value.needInitialSkinMatrix) {\n value._registerMeshWithPoseMatrix(this);\n }\n this._internalAbstractMeshDataInfo._skeleton = value;\n if (!this._internalAbstractMeshDataInfo._skeleton) {\n this._bonesTransformMatrices = null;\n }\n this._markSubMeshesAsAttributesDirty();\n }\n get skeleton() {\n return this._internalAbstractMeshDataInfo._skeleton;\n }\n // Constructor\n /**\n * Creates a new AbstractMesh\n * @param name defines the name of the mesh\n * @param scene defines the hosting scene\n */\n constructor(name, scene = null) {\n super(name, scene, false);\n // Internal data\n /** @internal */\n this._internalAbstractMeshDataInfo = new _InternalAbstractMeshDataInfo();\n /** @internal */\n this._waitingMaterialId = null;\n /** @internal */\n this._waitingMorphTargetManagerId = null;\n /**\n * The culling strategy to use to check whether the mesh must be rendered or not.\n * This value can be changed at any time and will be used on the next render mesh selection.\n * The possible values are :\n * - AbstractMesh.CULLINGSTRATEGY_STANDARD\n * - AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY\n * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION\n * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY\n * Please read each static variable documentation to get details about the culling process.\n * */\n this.cullingStrategy = AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY;\n // Events\n /**\n * An event triggered when this mesh collides with another one\n */\n this.onCollideObservable = new Observable();\n /**\n * An event triggered when the collision's position changes\n */\n this.onCollisionPositionChangeObservable = new Observable();\n /**\n * An event triggered when material is changed\n */\n this.onMaterialChangedObservable = new Observable();\n // Properties\n /**\n * Gets or sets the orientation for POV movement & rotation\n */\n this.definedFacingForward = true;\n /** @internal */\n this._occlusionQuery = null;\n /** @internal */\n this._renderingGroup = null;\n /** Gets or sets the alpha index used to sort transparent meshes\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering#alpha-index\n */\n this.alphaIndex = Number.MAX_VALUE;\n this._isVisible = true;\n /**\n * Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true\n */\n this.isPickable = true;\n /**\n * Gets or sets a boolean indicating if the mesh can be near picked (touched by the XR controller or hands). Default is false\n */\n this.isNearPickable = false;\n /**\n * Gets or sets a boolean indicating if the mesh can be grabbed. Default is false.\n * Setting this to true, while using the XR near interaction feature, will trigger a pointer event when the mesh is grabbed.\n * Grabbing means that the controller is using the squeeze or main trigger button to grab the mesh.\n * This is different from nearPickable which only triggers the event when the mesh is touched by the controller\n */\n this.isNearGrabbable = false;\n /** Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default) */\n this.showSubMeshesBoundingBox = false;\n /** Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n */\n this.isBlocker = false;\n /**\n * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)\n */\n this.enablePointerMoveEvents = false;\n /** Defines color to use when rendering outline */\n this.outlineColor = Color3.Red();\n /** Define width to use when rendering outline */\n this.outlineWidth = 0.02;\n /** Defines color to use when rendering overlay */\n this.overlayColor = Color3.Red();\n /** Defines alpha to use when rendering overlay */\n this.overlayAlpha = 0.5;\n /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default) */\n this.useOctreeForRenderingSelection = true;\n /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes picking (true by default) */\n this.useOctreeForPicking = true;\n /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default) */\n this.useOctreeForCollisions = true;\n /**\n * True if the mesh must be rendered in any case (this will shortcut the frustum clipping phase)\n */\n this.alwaysSelectAsActiveMesh = false;\n /**\n * Gets or sets a boolean indicating that the bounding info does not need to be kept in sync (for performance reason)\n */\n this.doNotSyncBoundingInfo = false;\n /**\n * Gets or sets the current action manager\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\n this.actionManager = null;\n /**\n * Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions\n */\n this.ellipsoid = new Vector3(0.5, 1, 0.5);\n /**\n * Gets or sets the ellipsoid offset used to impersonate this mesh when using collision engine (default is (0, 0, 0))\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions\n */\n this.ellipsoidOffset = new Vector3(0, 0, 0);\n // Edges\n /**\n * Defines edge width used when edgesRenderer is enabled\n * @see https://www.babylonjs-playground.com/#10OJSG#13\n */\n this.edgesWidth = 1;\n /**\n * Defines edge color used when edgesRenderer is enabled\n * @see https://www.babylonjs-playground.com/#10OJSG#13\n */\n this.edgesColor = new Color4(1, 0, 0, 1);\n /** @internal */\n this._edgesRenderer = null;\n /** @internal */\n this._masterMesh = null;\n this._boundingInfo = null;\n this._boundingInfoIsDirty = true;\n /** @internal */\n this._renderId = 0;\n /** @internal */\n this._intersectionsInProgress = new Array();\n /** @internal */\n this._unIndexed = false;\n /** @internal */\n this._lightSources = new Array();\n // Loading properties\n /** @internal */\n this._waitingData = {\n lods: null,\n actions: null,\n freezeWorldMatrix: null\n };\n /** @internal */\n this._bonesTransformMatrices = null;\n /** @internal */\n this._transformMatrixTexture = null;\n /**\n * An event triggered when the mesh is rebuilt.\n */\n this.onRebuildObservable = new Observable();\n this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {\n newPosition.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions, this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions);\n if (this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length() > AbstractEngine.CollisionsEpsilon) {\n this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions);\n }\n if (collidedMesh) {\n this.onCollideObservable.notifyObservers(collidedMesh);\n }\n this.onCollisionPositionChangeObservable.notifyObservers(this.position);\n };\n scene = this.getScene();\n scene.addMesh(this);\n this._resyncLightSources();\n // Mesh Uniform Buffer.\n this._uniformBuffer = new UniformBuffer(this.getScene().getEngine(), undefined, undefined, name, !this.getScene().getEngine().isWebGPU);\n this._buildUniformLayout();\n switch (scene.performancePriority) {\n case 2 /* ScenePerformancePriority.Aggressive */:\n this.doNotSyncBoundingInfo = true;\n // eslint-disable-next-line no-fallthrough\n case 1 /* ScenePerformancePriority.Intermediate */:\n this.alwaysSelectAsActiveMesh = true;\n this.isPickable = false;\n break;\n }\n }\n _buildUniformLayout() {\n this._uniformBuffer.addUniform(\"world\", 16);\n this._uniformBuffer.addUniform(\"visibility\", 1);\n this._uniformBuffer.create();\n }\n /**\n * Transfer the mesh values to its UBO.\n * @param world The world matrix associated with the mesh\n */\n transferToEffect(world) {\n const ubo = this._uniformBuffer;\n ubo.updateMatrix(\"world\", world);\n ubo.updateFloat(\"visibility\", this._internalAbstractMeshDataInfo._visibility);\n ubo.update();\n }\n /**\n * Gets the mesh uniform buffer.\n * @returns the uniform buffer of the mesh.\n */\n getMeshUniformBuffer() {\n return this._uniformBuffer;\n }\n /**\n * Returns the string \"AbstractMesh\"\n * @returns \"AbstractMesh\"\n */\n getClassName() {\n return \"AbstractMesh\";\n }\n /**\n * Gets a string representation of the current mesh\n * @param fullDetails defines a boolean indicating if full details must be included\n * @returns a string representation of the current mesh\n */\n toString(fullDetails) {\n let ret = \"Name: \" + this.name + \", isInstance: \" + (this.getClassName() !== \"InstancedMesh\" ? \"YES\" : \"NO\");\n ret += \", # of submeshes: \" + (this.subMeshes ? this.subMeshes.length : 0);\n const skeleton = this._internalAbstractMeshDataInfo._skeleton;\n if (skeleton) {\n ret += \", skeleton: \" + skeleton.name;\n }\n if (fullDetails) {\n ret += \", billboard mode: \" + [\"NONE\", \"X\", \"Y\", null, \"Z\", null, null, \"ALL\"][this.billboardMode];\n ret += \", freeze wrld mat: \" + (this._isWorldMatrixFrozen || this._waitingData.freezeWorldMatrix ? \"YES\" : \"NO\");\n }\n return ret;\n }\n /**\n * @internal\n */\n _getEffectiveParent() {\n if (this._masterMesh && this.billboardMode !== TransformNode.BILLBOARDMODE_NONE) {\n return this._masterMesh;\n }\n return super._getEffectiveParent();\n }\n /**\n * @internal\n */\n _getActionManagerForTrigger(trigger, initialCall = true) {\n if (this.actionManager && (initialCall || this.actionManager.isRecursive)) {\n if (trigger) {\n if (this.actionManager.hasSpecificTrigger(trigger)) {\n return this.actionManager;\n }\n } else {\n return this.actionManager;\n }\n }\n if (!this.parent) {\n return null;\n }\n return this.parent._getActionManagerForTrigger(trigger, false);\n }\n /**\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _rebuild(dispose = false) {\n this.onRebuildObservable.notifyObservers(this);\n if (this._occlusionQuery !== null) {\n this._occlusionQuery = null;\n }\n if (!this.subMeshes) {\n return;\n }\n for (const subMesh of this.subMeshes) {\n subMesh._rebuild();\n }\n this.resetDrawCache();\n }\n /** @internal */\n _resyncLightSources() {\n this._lightSources.length = 0;\n for (const light of this.getScene().lights) {\n if (!light.isEnabled()) {\n continue;\n }\n if (light.canAffectMesh(this)) {\n this._lightSources.push(light);\n }\n }\n this._markSubMeshesAsLightDirty();\n }\n /**\n * @internal\n */\n _resyncLightSource(light) {\n const isIn = light.isEnabled() && light.canAffectMesh(this);\n const index = this._lightSources.indexOf(light);\n let removed = false;\n if (index === -1) {\n if (!isIn) {\n return;\n }\n this._lightSources.push(light);\n } else {\n if (isIn) {\n return;\n }\n removed = true;\n this._lightSources.splice(index, 1);\n }\n this._markSubMeshesAsLightDirty(removed);\n }\n /** @internal */\n _unBindEffect() {\n for (const subMesh of this.subMeshes) {\n subMesh.setEffect(null);\n }\n }\n /**\n * @internal\n */\n _removeLightSource(light, dispose) {\n const index = this._lightSources.indexOf(light);\n if (index === -1) {\n return;\n }\n this._lightSources.splice(index, 1);\n this._markSubMeshesAsLightDirty(dispose);\n }\n _markSubMeshesAsDirty(func) {\n if (!this.subMeshes) {\n return;\n }\n for (const subMesh of this.subMeshes) {\n for (let i = 0; i < subMesh._drawWrappers.length; ++i) {\n const drawWrapper = subMesh._drawWrappers[i];\n if (!drawWrapper || !drawWrapper.defines || !drawWrapper.defines.markAllAsDirty) {\n continue;\n }\n func(drawWrapper.defines);\n }\n }\n }\n /**\n * @internal\n */\n _markSubMeshesAsLightDirty(dispose = false) {\n this._markSubMeshesAsDirty(defines => defines.markAsLightDirty(dispose));\n }\n /** @internal */\n _markSubMeshesAsAttributesDirty() {\n this._markSubMeshesAsDirty(defines => defines.markAsAttributesDirty());\n }\n /** @internal */\n _markSubMeshesAsMiscDirty() {\n this._markSubMeshesAsDirty(defines => defines.markAsMiscDirty());\n }\n /**\n * Flag the AbstractMesh as dirty (Forcing it to update everything)\n * @param property if set to \"rotation\" the objects rotationQuaternion will be set to null\n * @returns this AbstractMesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n markAsDirty(property) {\n this._currentRenderId = Number.MAX_VALUE;\n super.markAsDirty(property);\n this._isDirty = true;\n return this;\n }\n /**\n * Resets the draw wrappers cache for all submeshes of this abstract mesh\n * @param passId If provided, releases only the draw wrapper corresponding to this render pass id\n * @param immediate If true, the effect will be released immediately, otherwise it will be released at the next frame\n */\n resetDrawCache(passId, immediate = false) {\n if (!this.subMeshes) {\n return;\n }\n for (const subMesh of this.subMeshes) {\n subMesh.resetDrawCache(passId, immediate);\n }\n }\n // Methods\n /**\n * Returns true if the mesh is blocked. Implemented by child classes\n */\n get isBlocked() {\n return false;\n }\n /**\n * Returns the mesh itself by default. Implemented by child classes\n * @param camera defines the camera to use to pick the right LOD level\n * @returns the currentAbstractMesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getLOD(camera) {\n return this;\n }\n /**\n * Returns 0 by default. Implemented by child classes\n * @returns an integer\n */\n getTotalVertices() {\n return 0;\n }\n /**\n * Returns a positive integer : the total number of indices in this mesh geometry.\n * @returns the number of indices or zero if the mesh has no geometry.\n */\n getTotalIndices() {\n return 0;\n }\n /**\n * Returns null by default. Implemented by child classes\n * @returns null\n */\n getIndices() {\n return null;\n }\n /**\n * Returns the array of the requested vertex data kind. Implemented by child classes\n * @param kind defines the vertex data kind to use\n * @returns null\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getVerticesData(kind) {\n return null;\n }\n /**\n * Sets the vertex data of the mesh geometry for the requested `kind`.\n * If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data.\n * Note that a new underlying VertexBuffer object is created each call.\n * If the `kind` is the `PositionKind`, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.\n * @param kind defines vertex data kind:\n * * VertexBuffer.PositionKind\n * * VertexBuffer.UVKind\n * * VertexBuffer.UV2Kind\n * * VertexBuffer.UV3Kind\n * * VertexBuffer.UV4Kind\n * * VertexBuffer.UV5Kind\n * * VertexBuffer.UV6Kind\n * * VertexBuffer.ColorKind\n * * VertexBuffer.MatricesIndicesKind\n * * VertexBuffer.MatricesIndicesExtraKind\n * * VertexBuffer.MatricesWeightsKind\n * * VertexBuffer.MatricesWeightsExtraKind\n * @param data defines the data source\n * @param updatable defines if the data must be flagged as updatable (or static)\n * @param stride defines the vertex stride (size of an entire vertex). Can be null and in this case will be deduced from vertex data kind\n * @returns the current mesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setVerticesData(kind, data, updatable, stride) {\n return this;\n }\n /**\n * Updates the existing vertex data of the mesh geometry for the requested `kind`.\n * If the mesh has no geometry, it is simply returned as it is.\n * @param kind defines vertex data kind:\n * * VertexBuffer.PositionKind\n * * VertexBuffer.UVKind\n * * VertexBuffer.UV2Kind\n * * VertexBuffer.UV3Kind\n * * VertexBuffer.UV4Kind\n * * VertexBuffer.UV5Kind\n * * VertexBuffer.UV6Kind\n * * VertexBuffer.ColorKind\n * * VertexBuffer.MatricesIndicesKind\n * * VertexBuffer.MatricesIndicesExtraKind\n * * VertexBuffer.MatricesWeightsKind\n * * VertexBuffer.MatricesWeightsExtraKind\n * @param data defines the data source\n * @param updateExtends If `kind` is `PositionKind` and if `updateExtends` is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed\n * @param makeItUnique If true, a new global geometry is created from this data and is set to the mesh\n * @returns the current mesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n updateVerticesData(kind, data, updateExtends, makeItUnique) {\n return this;\n }\n /**\n * Sets the mesh indices,\n * If the mesh has no geometry, a new Geometry object is created and set to the mesh.\n * @param indices Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array)\n * @param totalVertices Defines the total number of vertices\n * @returns the current mesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setIndices(indices, totalVertices) {\n return this;\n }\n /**\n * Gets a boolean indicating if specific vertex data is present\n * @param kind defines the vertex data kind to use\n * @returns true is data kind is present\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isVerticesDataPresent(kind) {\n return false;\n }\n /**\n * Returns the mesh BoundingInfo object or creates a new one and returns if it was undefined.\n * Note that it returns a shallow bounding of the mesh (i.e. it does not include children).\n * However, if the mesh contains thin instances, it will be expanded to include them. If you want the \"raw\" bounding data instead, then use `getRawBoundingInfo()`.\n * To get the full bounding of all children, call `getHierarchyBoundingVectors` instead.\n * @returns a BoundingInfo\n */\n getBoundingInfo() {\n if (this._masterMesh) {\n return this._masterMesh.getBoundingInfo();\n }\n if (this._boundingInfoIsDirty) {\n this._boundingInfoIsDirty = false;\n // this._boundingInfo is being created if undefined\n this._updateBoundingInfo();\n }\n // cannot be null.\n return this._boundingInfo;\n }\n /**\n * Returns the bounding info unnafected by instance data.\n * @returns the bounding info of the mesh unaffected by instance data.\n */\n getRawBoundingInfo() {\n var _this$rawBoundingInfo;\n return (_this$rawBoundingInfo = this.rawBoundingInfo) !== null && _this$rawBoundingInfo !== void 0 ? _this$rawBoundingInfo : this.getBoundingInfo();\n }\n /**\n * Overwrite the current bounding info\n * @param boundingInfo defines the new bounding info\n * @returns the current mesh\n */\n setBoundingInfo(boundingInfo) {\n this._boundingInfo = boundingInfo;\n return this;\n }\n /**\n * Returns true if there is already a bounding info\n */\n get hasBoundingInfo() {\n return this._boundingInfo !== null;\n }\n /**\n * Creates a new bounding info for the mesh\n * @param minimum min vector of the bounding box/sphere\n * @param maximum max vector of the bounding box/sphere\n * @param worldMatrix defines the new world matrix\n * @returns the new bounding info\n */\n buildBoundingInfo(minimum, maximum, worldMatrix) {\n this._boundingInfo = new BoundingInfo(minimum, maximum, worldMatrix);\n return this._boundingInfo;\n }\n /**\n * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)\n * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false\n * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false\n * @param predicate predicate that is passed in to getHierarchyBoundingVectors when selecting which object should be included when scaling\n * @returns the current mesh\n */\n normalizeToUnitCube(includeDescendants = true, ignoreRotation = false, predicate) {\n return super.normalizeToUnitCube(includeDescendants, ignoreRotation, predicate);\n }\n /** Gets a boolean indicating if this mesh has skinning data and an attached skeleton */\n get useBones() {\n return this.skeleton && this.getScene().skeletonsEnabled && this.isVerticesDataPresent(VertexBuffer.MatricesIndicesKind) && this.isVerticesDataPresent(VertexBuffer.MatricesWeightsKind);\n }\n /** @internal */\n _preActivate() {}\n /**\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _preActivateForIntermediateRendering(renderId) {}\n /**\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _activate(renderId, intermediateRendering) {\n this._renderId = renderId;\n return true;\n }\n /** @internal */\n _postActivate() {\n // Do nothing\n }\n /** @internal */\n _freeze() {\n // Do nothing\n }\n /** @internal */\n _unFreeze() {\n // Do nothing\n }\n /**\n * Gets the current world matrix\n * @returns a Matrix\n */\n getWorldMatrix() {\n if (this._masterMesh && this.billboardMode === TransformNode.BILLBOARDMODE_NONE) {\n return this._masterMesh.getWorldMatrix();\n }\n return super.getWorldMatrix();\n }\n /** @internal */\n _getWorldMatrixDeterminant() {\n if (this._masterMesh) {\n return this._masterMesh._getWorldMatrixDeterminant();\n }\n return super._getWorldMatrixDeterminant();\n }\n /**\n * Gets a boolean indicating if this mesh is an instance or a regular mesh\n */\n get isAnInstance() {\n return false;\n }\n /**\n * Gets a boolean indicating if this mesh has instances\n */\n get hasInstances() {\n return false;\n }\n /**\n * Gets a boolean indicating if this mesh has thin instances\n */\n get hasThinInstances() {\n return false;\n }\n // ================================== Point of View Movement =================================\n /**\n * Perform relative position change from the point of view of behind the front of the mesh.\n * This is performed taking into account the meshes current rotation, so you do not have to care.\n * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.\n * @param amountRight defines the distance on the right axis\n * @param amountUp defines the distance on the up axis\n * @param amountForward defines the distance on the forward axis\n * @returns the current mesh\n */\n movePOV(amountRight, amountUp, amountForward) {\n this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward));\n return this;\n }\n /**\n * Calculate relative position change from the point of view of behind the front of the mesh.\n * This is performed taking into account the meshes current rotation, so you do not have to care.\n * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.\n * @param amountRight defines the distance on the right axis\n * @param amountUp defines the distance on the up axis\n * @param amountForward defines the distance on the forward axis\n * @returns the new displacement vector\n */\n calcMovePOV(amountRight, amountUp, amountForward) {\n const rotMatrix = new Matrix();\n const rotQuaternion = this.rotationQuaternion ? this.rotationQuaternion : Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);\n rotQuaternion.toRotationMatrix(rotMatrix);\n const translationDelta = Vector3.Zero();\n const defForwardMult = this.definedFacingForward ? -1 : 1;\n Vector3.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta);\n return translationDelta;\n }\n // ================================== Point of View Rotation =================================\n /**\n * Perform relative rotation change from the point of view of behind the front of the mesh.\n * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.\n * @param flipBack defines the flip\n * @param twirlClockwise defines the twirl\n * @param tiltRight defines the tilt\n * @returns the current mesh\n */\n rotatePOV(flipBack, twirlClockwise, tiltRight) {\n this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight));\n return this;\n }\n /**\n * Calculate relative rotation change from the point of view of behind the front of the mesh.\n * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.\n * @param flipBack defines the flip\n * @param twirlClockwise defines the twirl\n * @param tiltRight defines the tilt\n * @returns the new rotation vector\n */\n calcRotatePOV(flipBack, twirlClockwise, tiltRight) {\n const defForwardMult = this.definedFacingForward ? 1 : -1;\n return new Vector3(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult);\n }\n /**\n * @internal\n */\n _refreshBoundingInfo(data, bias) {\n if (data) {\n const extend = extractMinAndMax(data, 0, this.getTotalVertices(), bias);\n if (this._boundingInfo) {\n this._boundingInfo.reConstruct(extend.minimum, extend.maximum);\n } else {\n this._boundingInfo = new BoundingInfo(extend.minimum, extend.maximum);\n }\n }\n if (this.subMeshes) {\n for (let index = 0; index < this.subMeshes.length; index++) {\n this.subMeshes[index].refreshBoundingInfo(data);\n }\n }\n this._updateBoundingInfo();\n }\n /**\n * @internal\n */\n _refreshBoundingInfoDirect(extend) {\n if (this._boundingInfo) {\n this._boundingInfo.reConstruct(extend.minimum, extend.maximum);\n } else {\n this._boundingInfo = new BoundingInfo(extend.minimum, extend.maximum);\n }\n if (this.subMeshes) {\n for (let index = 0; index < this.subMeshes.length; index++) {\n this.subMeshes[index].refreshBoundingInfo(null);\n }\n }\n this._updateBoundingInfo();\n }\n // This function is only here so we can apply the nativeOverride decorator.\n static _ApplySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData) {\n applySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData);\n }\n /** @internal */\n _getData(options, data, kind = VertexBuffer.PositionKind) {\n const cache = options.cache;\n const getVertexData = kind => {\n if (cache) {\n const vertexData = cache._vertexData || (cache._vertexData = {});\n if (!vertexData[kind]) {\n this.copyVerticesData(kind, vertexData);\n }\n return vertexData[kind];\n }\n return this.getVerticesData(kind);\n };\n data || (data = getVertexData(kind));\n if (!data) {\n return null;\n }\n if (cache) {\n if (cache._outputData) {\n cache._outputData.set(data);\n } else {\n cache._outputData = new Float32Array(data);\n }\n data = cache._outputData;\n } else if (options.applyMorph && this.morphTargetManager || options.applySkeleton && this.skeleton) {\n data = data.slice();\n }\n if (options.applyMorph && this.morphTargetManager) {\n applyMorph(data, kind, this.morphTargetManager);\n }\n if (options.applySkeleton && this.skeleton) {\n const matricesIndicesData = getVertexData(VertexBuffer.MatricesIndicesKind);\n const matricesWeightsData = getVertexData(VertexBuffer.MatricesWeightsKind);\n if (matricesWeightsData && matricesIndicesData) {\n const needExtras = this.numBoneInfluencers > 4;\n const matricesIndicesExtraData = needExtras ? getVertexData(VertexBuffer.MatricesIndicesExtraKind) : null;\n const matricesWeightsExtraData = needExtras ? getVertexData(VertexBuffer.MatricesWeightsExtraKind) : null;\n const skeletonMatrices = this.skeleton.getTransformMatrices(this);\n AbstractMesh._ApplySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData);\n }\n }\n if (options.updatePositionsArray !== false && kind === VertexBuffer.PositionKind) {\n const positions = this._internalAbstractMeshDataInfo._positions || [];\n const previousLength = positions.length;\n positions.length = data.length / 3;\n if (previousLength < positions.length) {\n for (let positionIndex = previousLength; positionIndex < positions.length; positionIndex++) {\n positions[positionIndex] = new Vector3();\n }\n }\n for (let positionIndex = 0, dataIndex = 0; positionIndex < positions.length; positionIndex++, dataIndex += 3) {\n positions[positionIndex].copyFromFloats(data[dataIndex], data[dataIndex + 1], data[dataIndex + 2]);\n }\n this._internalAbstractMeshDataInfo._positions = positions;\n }\n return data;\n }\n /**\n * Get the normals vertex data and optionally apply skeleton and morphing.\n * @param applySkeleton defines whether to apply the skeleton\n * @param applyMorph defines whether to apply the morph target\n * @returns the normals data\n */\n getNormalsData(applySkeleton = false, applyMorph = false) {\n return this._getData({\n applySkeleton,\n applyMorph,\n updatePositionsArray: false\n }, null, VertexBuffer.NormalKind);\n }\n /**\n * Get the position vertex data and optionally apply skeleton and morphing.\n * @param applySkeleton defines whether to apply the skeleton\n * @param applyMorph defines whether to apply the morph target\n * @param data defines the position data to apply the skeleton and morph to\n * @returns the position data\n */\n getPositionData(applySkeleton = false, applyMorph = false, data = null) {\n return this._getData({\n applySkeleton,\n applyMorph,\n updatePositionsArray: false\n }, data, VertexBuffer.PositionKind);\n }\n /** @internal */\n _updateBoundingInfo() {\n if (this._boundingInfo) {\n this._boundingInfo.update(this.worldMatrixFromCache);\n } else {\n this._boundingInfo = new BoundingInfo(Vector3.Zero(), Vector3.Zero(), this.worldMatrixFromCache);\n }\n this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache);\n return this;\n }\n /**\n * @internal\n */\n _updateSubMeshesBoundingInfo(matrix) {\n if (!this.subMeshes) {\n return this;\n }\n const count = this.subMeshes.length;\n for (let subIndex = 0; subIndex < count; subIndex++) {\n const subMesh = this.subMeshes[subIndex];\n if (count > 1 || !subMesh.IsGlobal) {\n subMesh.updateBoundingInfo(matrix);\n }\n }\n return this;\n }\n /** @internal */\n _afterComputeWorldMatrix() {\n if (this.doNotSyncBoundingInfo) {\n return;\n }\n // Bounding info\n this._boundingInfoIsDirty = true;\n }\n /**\n * Returns `true` if the mesh is within the frustum defined by the passed array of planes.\n * A mesh is in the frustum if its bounding box intersects the frustum\n * @param frustumPlanes defines the frustum to test\n * @returns true if the mesh is in the frustum planes\n */\n isInFrustum(frustumPlanes) {\n return this.getBoundingInfo().isInFrustum(frustumPlanes, this.cullingStrategy);\n }\n /**\n * Returns `true` if the mesh is completely in the frustum defined be the passed array of planes.\n * A mesh is completely in the frustum if its bounding box it completely inside the frustum.\n * @param frustumPlanes defines the frustum to test\n * @returns true if the mesh is completely in the frustum planes\n */\n isCompletelyInFrustum(frustumPlanes) {\n return this.getBoundingInfo().isCompletelyInFrustum(frustumPlanes);\n }\n /**\n * True if the mesh intersects another mesh or a SolidParticle object\n * @param mesh defines a target mesh or SolidParticle to test\n * @param precise Unless the parameter `precise` is set to `true` the intersection is computed according to Axis Aligned Bounding Boxes (AABB), else according to OBB (Oriented BBoxes)\n * @param includeDescendants Can be set to true to test if the mesh defined in parameters intersects with the current mesh or any child meshes\n * @returns true if there is an intersection\n */\n intersectsMesh(mesh, precise = false, includeDescendants) {\n const boundingInfo = this.getBoundingInfo();\n const otherBoundingInfo = mesh.getBoundingInfo();\n if (boundingInfo.intersects(otherBoundingInfo, precise)) {\n return true;\n }\n if (includeDescendants) {\n for (const child of this.getChildMeshes()) {\n if (child.intersectsMesh(mesh, precise, true)) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Returns true if the passed point (Vector3) is inside the mesh bounding box\n * @param point defines the point to test\n * @returns true if there is an intersection\n */\n intersectsPoint(point) {\n return this.getBoundingInfo().intersectsPoint(point);\n }\n // Collisions\n /**\n * Gets or sets a boolean indicating that this mesh can be used in the collision engine\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions\n */\n get checkCollisions() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions;\n }\n set checkCollisions(collisionEnabled) {\n this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions = collisionEnabled;\n }\n /**\n * Gets Collider object used to compute collisions (not physics)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions\n */\n get collider() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._collider;\n }\n /**\n * Move the mesh using collision engine\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions\n * @param displacement defines the requested displacement vector\n * @returns the current mesh\n */\n moveWithCollisions(displacement) {\n const globalPosition = this.getAbsolutePosition();\n globalPosition.addToRef(this.ellipsoidOffset, this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);\n const coordinator = this.getScene().collisionCoordinator;\n if (!this._internalAbstractMeshDataInfo._meshCollisionData._collider) {\n this._internalAbstractMeshDataInfo._meshCollisionData._collider = coordinator.createCollider();\n }\n this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius = this.ellipsoid;\n coordinator.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions, displacement, this._internalAbstractMeshDataInfo._meshCollisionData._collider, this.collisionRetryCount, this, this._onCollisionPositionChange, this.uniqueId);\n return this;\n }\n // Collisions\n /**\n * @internal\n */\n _collideForSubMesh(subMesh, transformMatrix, collider) {\n var _subMesh$getMaterial;\n this._generatePointsArray();\n if (!this._positions) {\n return this;\n }\n // Transformation\n if (!subMesh._lastColliderWorldVertices || !subMesh._lastColliderTransformMatrix.equals(transformMatrix)) {\n subMesh._lastColliderTransformMatrix = transformMatrix.clone();\n subMesh._lastColliderWorldVertices = [];\n subMesh._trianglePlanes = [];\n const start = subMesh.verticesStart;\n const end = subMesh.verticesStart + subMesh.verticesCount;\n for (let i = start; i < end; i++) {\n subMesh._lastColliderWorldVertices.push(Vector3.TransformCoordinates(this._positions[i], transformMatrix));\n }\n }\n // Collide\n collider._collide(subMesh._trianglePlanes, subMesh._lastColliderWorldVertices, this.getIndices(), subMesh.indexStart, subMesh.indexStart + subMesh.indexCount, subMesh.verticesStart, !!subMesh.getMaterial(), this, this._shouldConvertRHS(), ((_subMesh$getMaterial = subMesh.getMaterial()) === null || _subMesh$getMaterial === void 0 ? void 0 : _subMesh$getMaterial.fillMode) === 7);\n return this;\n }\n /**\n * @internal\n */\n _processCollisionsForSubMeshes(collider, transformMatrix) {\n const subMeshes = this._scene.getCollidingSubMeshCandidates(this, collider);\n const len = subMeshes.length;\n for (let index = 0; index < len; index++) {\n const subMesh = subMeshes.data[index];\n // Bounding test\n if (len > 1 && !subMesh._checkCollision(collider)) {\n continue;\n }\n this._collideForSubMesh(subMesh, transformMatrix, collider);\n }\n return this;\n }\n /** @internal */\n _shouldConvertRHS() {\n return false;\n }\n /**\n * @internal\n */\n _checkCollision(collider) {\n // Bounding box test\n if (!this.getBoundingInfo()._checkCollision(collider)) {\n return this;\n }\n // Transformation matrix\n const collisionsScalingMatrix = TmpVectors.Matrix[0];\n const collisionsTransformMatrix = TmpVectors.Matrix[1];\n Matrix.ScalingToRef(1.0 / collider._radius.x, 1.0 / collider._radius.y, 1.0 / collider._radius.z, collisionsScalingMatrix);\n this.worldMatrixFromCache.multiplyToRef(collisionsScalingMatrix, collisionsTransformMatrix);\n this._processCollisionsForSubMeshes(collider, collisionsTransformMatrix);\n return this;\n }\n // Picking\n /** @internal */\n _generatePointsArray() {\n return false;\n }\n /**\n * Checks if the passed Ray intersects with the mesh. A mesh triangle can be picked both from its front and back sides,\n * irrespective of orientation.\n * @param ray defines the ray to use. It should be in the mesh's LOCAL coordinate space.\n * @param fastCheck defines if fast mode (but less precise) must be used (false by default)\n * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected\n * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)\n * @param worldToUse defines the world matrix to use to get the world coordinate of the intersection point\n * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check\n * @returns the picking info\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/mesh_intersect\n */\n intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo = false, worldToUse, skipBoundingInfo = false) {\n const pickingInfo = new PickingInfo();\n const className = this.getClassName();\n const intersectionThreshold = className === \"InstancedLinesMesh\" || className === \"LinesMesh\" || className === \"GreasedLineMesh\" ? this.intersectionThreshold : 0;\n const boundingInfo = this.getBoundingInfo();\n if (!this.subMeshes) {\n return pickingInfo;\n }\n if (!skipBoundingInfo && (!ray.intersectsSphere(boundingInfo.boundingSphere, intersectionThreshold) || !ray.intersectsBox(boundingInfo.boundingBox, intersectionThreshold))) {\n return pickingInfo;\n }\n if (onlyBoundingInfo) {\n pickingInfo.hit = skipBoundingInfo ? false : true;\n pickingInfo.pickedMesh = skipBoundingInfo ? null : this;\n pickingInfo.distance = skipBoundingInfo ? 0 : Vector3.Distance(ray.origin, boundingInfo.boundingSphere.center);\n pickingInfo.subMeshId = 0;\n return pickingInfo;\n }\n if (!this._generatePointsArray()) {\n return pickingInfo;\n }\n let intersectInfo = null;\n const subMeshes = this._scene.getIntersectingSubMeshCandidates(this, ray);\n const len = subMeshes.length;\n // Check if all submeshes are using a material that don't allow picking (point/lines rendering)\n // if no submesh can be picked that way, then fallback to BBox picking\n let anySubmeshSupportIntersect = false;\n for (let index = 0; index < len; index++) {\n const subMesh = subMeshes.data[index];\n const material = subMesh.getMaterial();\n if (!material) {\n continue;\n }\n if (material.fillMode == 7 || material.fillMode == 0 || material.fillMode == 1 || material.fillMode == 2 || material.fillMode == 4) {\n anySubmeshSupportIntersect = true;\n break;\n }\n }\n // no sub mesh support intersection, fallback to BBox that has already be done\n if (!anySubmeshSupportIntersect) {\n pickingInfo.hit = true;\n pickingInfo.pickedMesh = this;\n pickingInfo.distance = Vector3.Distance(ray.origin, boundingInfo.boundingSphere.center);\n pickingInfo.subMeshId = -1;\n return pickingInfo;\n }\n // at least 1 submesh supports intersection, keep going\n for (let index = 0; index < len; index++) {\n const subMesh = subMeshes.data[index];\n // Bounding test\n if (len > 1 && !skipBoundingInfo && !subMesh.canIntersects(ray)) {\n continue;\n }\n const currentIntersectInfo = subMesh.intersects(ray, this._positions, this.getIndices(), fastCheck, trianglePredicate);\n if (currentIntersectInfo) {\n if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) {\n intersectInfo = currentIntersectInfo;\n intersectInfo.subMeshId = index;\n if (fastCheck) {\n break;\n }\n }\n }\n }\n if (intersectInfo) {\n // Get picked point\n const world = worldToUse !== null && worldToUse !== void 0 ? worldToUse : this.getWorldMatrix();\n const worldOrigin = TmpVectors.Vector3[0];\n const direction = TmpVectors.Vector3[1];\n Vector3.TransformCoordinatesToRef(ray.origin, world, worldOrigin);\n ray.direction.scaleToRef(intersectInfo.distance, direction);\n const worldDirection = Vector3.TransformNormal(direction, world);\n const pickedPoint = worldDirection.addInPlace(worldOrigin);\n // Return result\n pickingInfo.hit = true;\n pickingInfo.distance = Vector3.Distance(worldOrigin, pickedPoint);\n pickingInfo.pickedPoint = pickedPoint;\n pickingInfo.pickedMesh = this;\n pickingInfo.bu = intersectInfo.bu || 0;\n pickingInfo.bv = intersectInfo.bv || 0;\n pickingInfo.subMeshFaceId = intersectInfo.faceId;\n pickingInfo.faceId = intersectInfo.faceId + subMeshes.data[intersectInfo.subMeshId].indexStart / (this.getClassName().indexOf(\"LinesMesh\") !== -1 ? 2 : 3);\n pickingInfo.subMeshId = intersectInfo.subMeshId;\n return pickingInfo;\n }\n return pickingInfo;\n }\n /**\n * Clones the current mesh\n * @param name defines the mesh name\n * @param newParent defines the new mesh parent\n * @param doNotCloneChildren defines a boolean indicating that children must not be cloned (false by default)\n * @returns the new mesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n clone(name, newParent, doNotCloneChildren) {\n return null;\n }\n /**\n * Disposes all the submeshes of the current mesh\n * @param immediate should dispose the effects immediately or not\n * @returns the current mesh\n */\n releaseSubMeshes(immediate = false) {\n if (this.subMeshes) {\n while (this.subMeshes.length) {\n this.subMeshes[0].dispose(immediate);\n }\n } else {\n this.subMeshes = [];\n }\n return this;\n }\n /**\n * Releases resources associated with this abstract mesh.\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 let index;\n const scene = this.getScene();\n // mesh map release.\n if (this._scene.useMaterialMeshMap) {\n // remove from material mesh map id needed\n if (this._internalAbstractMeshDataInfo._material && this._internalAbstractMeshDataInfo._material.meshMap) {\n this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId] = undefined;\n }\n }\n // Smart Array Retainers.\n scene.freeActiveMeshes();\n scene.freeRenderingGroups();\n if (scene.renderingManager.maintainStateBetweenFrames) {\n scene.renderingManager.restoreDispachedFlags();\n }\n // Action manager\n if (this.actionManager !== undefined && this.actionManager !== null) {\n // If we are the only mesh using the action manager, dispose of the action manager too unless it has opted out from that behavior\n if (this.actionManager.disposeWhenUnowned && !this._scene.meshes.some(m => m !== this && m.actionManager === this.actionManager)) {\n this.actionManager.dispose();\n }\n this.actionManager = null;\n }\n // Skeleton\n this._internalAbstractMeshDataInfo._skeleton = null;\n if (this._transformMatrixTexture) {\n this._transformMatrixTexture.dispose();\n this._transformMatrixTexture = null;\n }\n // Intersections in progress\n for (index = 0; index < this._intersectionsInProgress.length; index++) {\n const other = this._intersectionsInProgress[index];\n const pos = other._intersectionsInProgress.indexOf(this);\n other._intersectionsInProgress.splice(pos, 1);\n }\n this._intersectionsInProgress.length = 0;\n // Lights\n const lights = scene.lights;\n lights.forEach(light => {\n let meshIndex = light.includedOnlyMeshes.indexOf(this);\n if (meshIndex !== -1) {\n light.includedOnlyMeshes.splice(meshIndex, 1);\n }\n meshIndex = light.excludedMeshes.indexOf(this);\n if (meshIndex !== -1) {\n light.excludedMeshes.splice(meshIndex, 1);\n }\n // Shadow generators\n const generators = light.getShadowGenerators();\n if (generators) {\n const iterator = generators.values();\n for (let key = iterator.next(); key.done !== true; key = iterator.next()) {\n const generator = key.value;\n const shadowMap = generator.getShadowMap();\n if (shadowMap && shadowMap.renderList) {\n meshIndex = shadowMap.renderList.indexOf(this);\n if (meshIndex !== -1) {\n shadowMap.renderList.splice(meshIndex, 1);\n }\n }\n }\n }\n });\n // SubMeshes\n if (this.getClassName() !== \"InstancedMesh\" || this.getClassName() !== \"InstancedLinesMesh\") {\n this.releaseSubMeshes(true);\n }\n // Query\n const engine = scene.getEngine();\n if (this._occlusionQuery !== null) {\n this.isOcclusionQueryInProgress = false;\n engine.deleteQuery(this._occlusionQuery);\n this._occlusionQuery = null;\n }\n // Engine\n engine.wipeCaches();\n // Remove from scene\n scene.removeMesh(this);\n if (this._parentContainer) {\n const index = this._parentContainer.meshes.indexOf(this);\n if (index > -1) {\n this._parentContainer.meshes.splice(index, 1);\n }\n this._parentContainer = null;\n }\n if (disposeMaterialAndTextures) {\n if (this.material) {\n if (this.material.getClassName() === \"MultiMaterial\") {\n this.material.dispose(false, true, true);\n } else {\n this.material.dispose(false, true);\n }\n }\n }\n if (!doNotRecurse) {\n // Particles\n for (index = 0; index < scene.particleSystems.length; index++) {\n if (scene.particleSystems[index].emitter === this) {\n scene.particleSystems[index].dispose();\n index--;\n }\n }\n }\n // facet data\n if (this._internalAbstractMeshDataInfo._facetData.facetDataEnabled) {\n this.disableFacetData();\n }\n this._uniformBuffer.dispose();\n this.onAfterWorldMatrixUpdateObservable.clear();\n this.onCollideObservable.clear();\n this.onCollisionPositionChangeObservable.clear();\n this.onRebuildObservable.clear();\n super.dispose(doNotRecurse, disposeMaterialAndTextures);\n }\n // Facet data\n /** @internal */\n _initFacetData() {\n const data = this._internalAbstractMeshDataInfo._facetData;\n if (!data.facetNormals) {\n data.facetNormals = [];\n }\n if (!data.facetPositions) {\n data.facetPositions = [];\n }\n if (!data.facetPartitioning) {\n data.facetPartitioning = new Array();\n }\n data.facetNb = this.getIndices().length / 3 | 0;\n data.partitioningSubdivisions = data.partitioningSubdivisions ? data.partitioningSubdivisions : 10; // default nb of partitioning subdivisions = 10\n data.partitioningBBoxRatio = data.partitioningBBoxRatio ? data.partitioningBBoxRatio : 1.01; // default ratio 1.01 = the partitioning is 1% bigger than the bounding box\n for (let f = 0; f < data.facetNb; f++) {\n data.facetNormals[f] = Vector3.Zero();\n data.facetPositions[f] = Vector3.Zero();\n }\n data.facetDataEnabled = true;\n return this;\n }\n /**\n * Updates the mesh facetData arrays and the internal partitioning when the mesh is morphed or updated.\n * This method can be called within the render loop.\n * You don't need to call this method by yourself in the render loop when you update/morph a mesh with the methods CreateXXX() as they automatically manage this computation\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n updateFacetData() {\n const data = this._internalAbstractMeshDataInfo._facetData;\n if (!data.facetDataEnabled) {\n this._initFacetData();\n }\n const positions = this.getVerticesData(VertexBuffer.PositionKind);\n const indices = this.getIndices();\n const normals = this.getVerticesData(VertexBuffer.NormalKind);\n const bInfo = this.getBoundingInfo();\n if (data.facetDepthSort && !data.facetDepthSortEnabled) {\n // init arrays, matrix and sort function on first call\n data.facetDepthSortEnabled = true;\n if (indices instanceof Uint16Array) {\n data.depthSortedIndices = new Uint16Array(indices);\n } else if (indices instanceof Uint32Array) {\n data.depthSortedIndices = new Uint32Array(indices);\n } else {\n let needs32bits = false;\n for (let i = 0; i < indices.length; i++) {\n if (indices[i] > 65535) {\n needs32bits = true;\n break;\n }\n }\n if (needs32bits) {\n data.depthSortedIndices = new Uint32Array(indices);\n } else {\n data.depthSortedIndices = new Uint16Array(indices);\n }\n }\n data.facetDepthSortFunction = function (f1, f2) {\n return f2.sqDistance - f1.sqDistance;\n };\n if (!data.facetDepthSortFrom) {\n const camera = this.getScene().activeCamera;\n data.facetDepthSortFrom = camera ? camera.position : Vector3.Zero();\n }\n data.depthSortedFacets = [];\n for (let f = 0; f < data.facetNb; f++) {\n const depthSortedFacet = {\n ind: f * 3,\n sqDistance: 0.0\n };\n data.depthSortedFacets.push(depthSortedFacet);\n }\n data.invertedMatrix = Matrix.Identity();\n data.facetDepthSortOrigin = Vector3.Zero();\n }\n data.bbSize.x = bInfo.maximum.x - bInfo.minimum.x > Epsilon ? bInfo.maximum.x - bInfo.minimum.x : Epsilon;\n data.bbSize.y = bInfo.maximum.y - bInfo.minimum.y > Epsilon ? bInfo.maximum.y - bInfo.minimum.y : Epsilon;\n data.bbSize.z = bInfo.maximum.z - bInfo.minimum.z > Epsilon ? bInfo.maximum.z - bInfo.minimum.z : Epsilon;\n let bbSizeMax = data.bbSize.x > data.bbSize.y ? data.bbSize.x : data.bbSize.y;\n bbSizeMax = bbSizeMax > data.bbSize.z ? bbSizeMax : data.bbSize.z;\n data.subDiv.max = data.partitioningSubdivisions;\n data.subDiv.X = Math.floor(data.subDiv.max * data.bbSize.x / bbSizeMax); // adjust the number of subdivisions per axis\n data.subDiv.Y = Math.floor(data.subDiv.max * data.bbSize.y / bbSizeMax); // according to each bbox size per axis\n data.subDiv.Z = Math.floor(data.subDiv.max * data.bbSize.z / bbSizeMax);\n data.subDiv.X = data.subDiv.X < 1 ? 1 : data.subDiv.X; // at least one subdivision\n data.subDiv.Y = data.subDiv.Y < 1 ? 1 : data.subDiv.Y;\n data.subDiv.Z = data.subDiv.Z < 1 ? 1 : data.subDiv.Z;\n // set the parameters for ComputeNormals()\n data.facetParameters.facetNormals = this.getFacetLocalNormals();\n data.facetParameters.facetPositions = this.getFacetLocalPositions();\n data.facetParameters.facetPartitioning = this.getFacetLocalPartitioning();\n data.facetParameters.bInfo = bInfo;\n data.facetParameters.bbSize = data.bbSize;\n data.facetParameters.subDiv = data.subDiv;\n data.facetParameters.ratio = this.partitioningBBoxRatio;\n data.facetParameters.depthSort = data.facetDepthSort;\n if (data.facetDepthSort && data.facetDepthSortEnabled) {\n this.computeWorldMatrix(true);\n this._worldMatrix.invertToRef(data.invertedMatrix);\n Vector3.TransformCoordinatesToRef(data.facetDepthSortFrom, data.invertedMatrix, data.facetDepthSortOrigin);\n data.facetParameters.distanceTo = data.facetDepthSortOrigin;\n }\n data.facetParameters.depthSortedFacets = data.depthSortedFacets;\n if (normals) {\n VertexData.ComputeNormals(positions, indices, normals, data.facetParameters);\n }\n if (data.facetDepthSort && data.facetDepthSortEnabled) {\n data.depthSortedFacets.sort(data.facetDepthSortFunction);\n const l = data.depthSortedIndices.length / 3 | 0;\n for (let f = 0; f < l; f++) {\n const sind = data.depthSortedFacets[f].ind;\n data.depthSortedIndices[f * 3] = indices[sind];\n data.depthSortedIndices[f * 3 + 1] = indices[sind + 1];\n data.depthSortedIndices[f * 3 + 2] = indices[sind + 2];\n }\n this.updateIndices(data.depthSortedIndices, undefined, true);\n }\n return this;\n }\n /**\n * Returns the facetLocalNormals array.\n * The normals are expressed in the mesh local spac\n * @returns an array of Vector3\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetLocalNormals() {\n const facetData = this._internalAbstractMeshDataInfo._facetData;\n if (!facetData.facetNormals) {\n this.updateFacetData();\n }\n return facetData.facetNormals;\n }\n /**\n * Returns the facetLocalPositions array.\n * The facet positions are expressed in the mesh local space\n * @returns an array of Vector3\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetLocalPositions() {\n const facetData = this._internalAbstractMeshDataInfo._facetData;\n if (!facetData.facetPositions) {\n this.updateFacetData();\n }\n return facetData.facetPositions;\n }\n /**\n * Returns the facetLocalPartitioning array\n * @returns an array of array of numbers\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetLocalPartitioning() {\n const facetData = this._internalAbstractMeshDataInfo._facetData;\n if (!facetData.facetPartitioning) {\n this.updateFacetData();\n }\n return facetData.facetPartitioning;\n }\n /**\n * Returns the i-th facet position in the world system.\n * This method allocates a new Vector3 per call\n * @param i defines the facet index\n * @returns a new Vector3\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetPosition(i) {\n const pos = Vector3.Zero();\n this.getFacetPositionToRef(i, pos);\n return pos;\n }\n /**\n * Sets the reference Vector3 with the i-th facet position in the world system\n * @param i defines the facet index\n * @param ref defines the target vector\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetPositionToRef(i, ref) {\n const localPos = this.getFacetLocalPositions()[i];\n const world = this.getWorldMatrix();\n Vector3.TransformCoordinatesToRef(localPos, world, ref);\n return this;\n }\n /**\n * Returns the i-th facet normal in the world system.\n * This method allocates a new Vector3 per call\n * @param i defines the facet index\n * @returns a new Vector3\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetNormal(i) {\n const norm = Vector3.Zero();\n this.getFacetNormalToRef(i, norm);\n return norm;\n }\n /**\n * Sets the reference Vector3 with the i-th facet normal in the world system\n * @param i defines the facet index\n * @param ref defines the target vector\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetNormalToRef(i, ref) {\n const localNorm = this.getFacetLocalNormals()[i];\n Vector3.TransformNormalToRef(localNorm, this.getWorldMatrix(), ref);\n return this;\n }\n /**\n * Returns the facets (in an array) in the same partitioning block than the one the passed coordinates are located (expressed in the mesh local system)\n * @param x defines x coordinate\n * @param y defines y coordinate\n * @param z defines z coordinate\n * @returns the array of facet indexes\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetsAtLocalCoordinates(x, y, z) {\n const bInfo = this.getBoundingInfo();\n const data = this._internalAbstractMeshDataInfo._facetData;\n const ox = Math.floor((x - bInfo.minimum.x * data.partitioningBBoxRatio) * data.subDiv.X * data.partitioningBBoxRatio / data.bbSize.x);\n const oy = Math.floor((y - bInfo.minimum.y * data.partitioningBBoxRatio) * data.subDiv.Y * data.partitioningBBoxRatio / data.bbSize.y);\n const oz = Math.floor((z - bInfo.minimum.z * data.partitioningBBoxRatio) * data.subDiv.Z * data.partitioningBBoxRatio / data.bbSize.z);\n if (ox < 0 || ox > data.subDiv.max || oy < 0 || oy > data.subDiv.max || oz < 0 || oz > data.subDiv.max) {\n return null;\n }\n return data.facetPartitioning[ox + data.subDiv.max * oy + data.subDiv.max * data.subDiv.max * oz];\n }\n /**\n * Returns the closest mesh facet index at (x,y,z) World coordinates, null if not found\n * @param x defines x coordinate\n * @param y defines y coordinate\n * @param z defines z coordinate\n * @param projected sets as the (x,y,z) world projection on the facet\n * @param checkFace if true (default false), only the facet \"facing\" to (x,y,z) or only the ones \"turning their backs\", according to the parameter \"facing\" are returned\n * @param facing if facing and checkFace are true, only the facet \"facing\" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet \"turning their backs\" to (x, y, z) are returned : negative dot (x, y, z) * facet position\n * @returns the face index if found (or null instead)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getClosestFacetAtCoordinates(x, y, z, projected, checkFace = false, facing = true) {\n const world = this.getWorldMatrix();\n const invMat = TmpVectors.Matrix[5];\n world.invertToRef(invMat);\n const invVect = TmpVectors.Vector3[8];\n Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, invMat, invVect); // transform (x,y,z) to coordinates in the mesh local space\n const closest = this.getClosestFacetAtLocalCoordinates(invVect.x, invVect.y, invVect.z, projected, checkFace, facing);\n if (projected) {\n // transform the local computed projected vector to world coordinates\n Vector3.TransformCoordinatesFromFloatsToRef(projected.x, projected.y, projected.z, world, projected);\n }\n return closest;\n }\n /**\n * Returns the closest mesh facet index at (x,y,z) local coordinates, null if not found\n * @param x defines x coordinate\n * @param y defines y coordinate\n * @param z defines z coordinate\n * @param projected sets as the (x,y,z) local projection on the facet\n * @param checkFace if true (default false), only the facet \"facing\" to (x,y,z) or only the ones \"turning their backs\", according to the parameter \"facing\" are returned\n * @param facing if facing and checkFace are true, only the facet \"facing\" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet \"turning their backs\" to (x, y, z) are returned : negative dot (x, y, z) * facet position\n * @returns the face index if found (or null instead)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getClosestFacetAtLocalCoordinates(x, y, z, projected, checkFace = false, facing = true) {\n let closest = null;\n let tmpx = 0.0;\n let tmpy = 0.0;\n let tmpz = 0.0;\n let d = 0.0; // tmp dot facet normal * facet position\n let t0 = 0.0;\n let projx = 0.0;\n let projy = 0.0;\n let projz = 0.0;\n // Get all the facets in the same partitioning block than (x, y, z)\n const facetPositions = this.getFacetLocalPositions();\n const facetNormals = this.getFacetLocalNormals();\n const facetsInBlock = this.getFacetsAtLocalCoordinates(x, y, z);\n if (!facetsInBlock) {\n return null;\n }\n // Get the closest facet to (x, y, z)\n let shortest = Number.MAX_VALUE; // init distance vars\n let tmpDistance = shortest;\n let fib; // current facet in the block\n let norm; // current facet normal\n let p0; // current facet barycenter position\n // loop on all the facets in the current partitioning block\n for (let idx = 0; idx < facetsInBlock.length; idx++) {\n fib = facetsInBlock[idx];\n norm = facetNormals[fib];\n p0 = facetPositions[fib];\n d = (x - p0.x) * norm.x + (y - p0.y) * norm.y + (z - p0.z) * norm.z;\n if (!checkFace || checkFace && facing && d >= 0.0 || checkFace && !facing && d <= 0.0) {\n // compute (x,y,z) projection on the facet = (projx, projy, projz)\n d = norm.x * p0.x + norm.y * p0.y + norm.z * p0.z;\n t0 = -(norm.x * x + norm.y * y + norm.z * z - d) / (norm.x * norm.x + norm.y * norm.y + norm.z * norm.z);\n projx = x + norm.x * t0;\n projy = y + norm.y * t0;\n projz = z + norm.z * t0;\n tmpx = projx - x;\n tmpy = projy - y;\n tmpz = projz - z;\n tmpDistance = tmpx * tmpx + tmpy * tmpy + tmpz * tmpz; // compute length between (x, y, z) and its projection on the facet\n if (tmpDistance < shortest) {\n // just keep the closest facet to (x, y, z)\n shortest = tmpDistance;\n closest = fib;\n if (projected) {\n projected.x = projx;\n projected.y = projy;\n projected.z = projz;\n }\n }\n }\n }\n return closest;\n }\n /**\n * Returns the object \"parameter\" set with all the expected parameters for facetData computation by ComputeNormals()\n * @returns the parameters\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetDataParameters() {\n return this._internalAbstractMeshDataInfo._facetData.facetParameters;\n }\n /**\n * Disables the feature FacetData and frees the related memory\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n disableFacetData() {\n const facetData = this._internalAbstractMeshDataInfo._facetData;\n if (facetData.facetDataEnabled) {\n facetData.facetDataEnabled = false;\n facetData.facetPositions = [];\n facetData.facetNormals = [];\n facetData.facetPartitioning = new Array();\n facetData.facetParameters = {};\n facetData.depthSortedIndices = new Uint32Array(0);\n }\n return this;\n }\n /**\n * Updates the AbstractMesh indices array\n * @param indices defines the data source\n * @param offset defines the offset in the index buffer where to store the new data (can be null)\n * @param gpuMemoryOnly defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)\n * @returns the current mesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n updateIndices(indices, offset, gpuMemoryOnly = false) {\n return this;\n }\n /**\n * Creates new normals data for the mesh\n * @param updatable defines if the normal vertex buffer must be flagged as updatable\n * @returns the current mesh\n */\n createNormals(updatable) {\n const positions = this.getVerticesData(VertexBuffer.PositionKind);\n const indices = this.getIndices();\n let normals;\n if (this.isVerticesDataPresent(VertexBuffer.NormalKind)) {\n normals = this.getVerticesData(VertexBuffer.NormalKind);\n } else {\n normals = [];\n }\n VertexData.ComputeNormals(positions, indices, normals, {\n useRightHandedSystem: this.getScene().useRightHandedSystem\n });\n this.setVerticesData(VertexBuffer.NormalKind, normals, updatable);\n return this;\n }\n /**\n * Align the mesh with a normal\n * @param normal defines the normal to use\n * @param upDirection can be used to redefined the up vector to use (will use the (0, 1, 0) by default)\n * @returns the current mesh\n */\n alignWithNormal(normal, upDirection) {\n if (!upDirection) {\n upDirection = Axis.Y;\n }\n const axisX = TmpVectors.Vector3[0];\n const axisZ = TmpVectors.Vector3[1];\n Vector3.CrossToRef(upDirection, normal, axisZ);\n Vector3.CrossToRef(normal, axisZ, axisX);\n if (this.rotationQuaternion) {\n Quaternion.RotationQuaternionFromAxisToRef(axisX, normal, axisZ, this.rotationQuaternion);\n } else {\n Vector3.RotationFromAxisToRef(axisX, normal, axisZ, this.rotation);\n }\n return this;\n }\n /** @internal */\n _checkOcclusionQuery() {\n // Will be replaced by correct code if Occlusion queries are referenced\n return false;\n }\n // eslint-disable-next-line jsdoc/require-returns-check\n /**\n * Disables the mesh edge rendering mode\n * @returns the currentAbstractMesh\n */\n disableEdgesRendering() {\n throw _WarnImport(\"EdgesRenderer\");\n }\n // eslint-disable-next-line jsdoc/require-returns-check\n /**\n * Enables the edge rendering mode on the mesh.\n * This mode makes the mesh edges visible\n * @param epsilon defines the maximal distance between two angles to detect a face\n * @param checkVerticesInsteadOfIndices indicates that we should check vertex list directly instead of faces\n * @param options options to the edge renderer\n * @returns the currentAbstractMesh\n * @see https://www.babylonjs-playground.com/#19O9TU#0\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n enableEdgesRendering(epsilon, checkVerticesInsteadOfIndices, options) {\n throw _WarnImport(\"EdgesRenderer\");\n }\n /**\n * This function returns all of the particle systems in the scene that use the mesh as an emitter.\n * @returns an array of particle systems in the scene that use the mesh as an emitter\n */\n getConnectedParticleSystems() {\n return this._scene.particleSystems.filter(particleSystem => particleSystem.emitter === this);\n }\n}\n/** No occlusion */\nAbstractMesh.OCCLUSION_TYPE_NONE = 0;\n/** Occlusion set to optimistic */\nAbstractMesh.OCCLUSION_TYPE_OPTIMISTIC = 1;\n/** Occlusion set to strict */\nAbstractMesh.OCCLUSION_TYPE_STRICT = 2;\n/** Use an accurate occlusion algorithm */\nAbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE = 0;\n/** Use a conservative occlusion algorithm */\nAbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE = 1;\n/** Default culling strategy : this is an exclusion test and it's the more accurate.\n * Test order :\n * Is the bounding sphere outside the frustum ?\n * If not, are the bounding box vertices outside the frustum ?\n * It not, then the cullable object is in the frustum.\n */\nAbstractMesh.CULLINGSTRATEGY_STANDARD = 0;\n/** Culling strategy : Bounding Sphere Only.\n * This is an exclusion test. It's faster than the standard strategy because the bounding box is not tested.\n * It's also less accurate than the standard because some not visible objects can still be selected.\n * Test : is the bounding sphere outside the frustum ?\n * If not, then the cullable object is in the frustum.\n */\nAbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1;\n/** Culling strategy : Optimistic Inclusion.\n * This in an inclusion test first, then the standard exclusion test.\n * This can be faster when a cullable object is expected to be almost always in the camera frustum.\n * This could also be a little slower than the standard test when the tested object center is not the frustum but one of its bounding box vertex is still inside.\n * Anyway, it's as accurate as the standard strategy.\n * Test :\n * Is the cullable object bounding sphere center in the frustum ?\n * If not, apply the default culling strategy.\n */\nAbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2;\n/** Culling strategy : Optimistic Inclusion then Bounding Sphere Only.\n * This in an inclusion test first, then the bounding sphere only exclusion test.\n * This can be the fastest test when a cullable object is expected to be almost always in the camera frustum.\n * This could also be a little slower than the BoundingSphereOnly strategy when the tested object center is not in the frustum but its bounding sphere still intersects it.\n * It's less accurate than the standard strategy and as accurate as the BoundingSphereOnly strategy.\n * Test :\n * Is the cullable object bounding sphere center in the frustum ?\n * If not, apply the Bounding Sphere Only strategy. No Bounding Box is tested here.\n */\nAbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3;\n__decorate([nativeOverride.filter((...[data, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData]) => !Array.isArray(data) && !Array.isArray(matricesIndicesData) && !Array.isArray(matricesWeightsData) && !Array.isArray(matricesIndicesExtraData) && !Array.isArray(matricesWeightsExtraData))], AbstractMesh, \"_ApplySkeleton\", null);\nRegisterClass(\"BABYLON.AbstractMesh\", AbstractMesh);","map":{"version":3,"names":["__decorate","Observable","Quaternion","Matrix","Vector3","TmpVectors","VertexBuffer","VertexData","TransformNode","PickingInfo","BoundingInfo","UniformBuffer","_MeshCollisionData","_WarnImport","extractMinAndMax","Color3","Color4","Epsilon","Axis","RegisterClass","nativeOverride","AbstractEngine","applyMorph","data","kind","morphTargetManager","getTargetData","PositionKind","target","getPositions","NormalKind","getNormals","TangentKind","getTangents","UVKind","getUVs","index","length","value","targetCount","numTargets","getTarget","influence","targetData","applySkeleton","skeletonMatrices","matricesIndicesData","matricesWeightsData","matricesIndicesExtraData","matricesWeightsExtraData","tempVector","finalMatrix","tempMatrix","transformFromFloatsToRef","TransformNormalFromFloatsToRef","TransformCoordinatesFromFloatsToRef","matWeightIdx","reset","inf","weight","FromFloat32ArrayToRefScaled","Math","floor","addToSelf","toArray","_FacetDataStorage","constructor","facetNb","partitioningSubdivisions","partitioningBBoxRatio","facetDataEnabled","facetParameters","bbSize","Zero","subDiv","max","X","Y","Z","facetDepthSort","facetDepthSortEnabled","_InternalAbstractMeshDataInfo","_hasVertexAlpha","_useVertexColors","_numBoneInfluencers","_applyFog","_receiveShadows","_facetData","_visibility","_skeleton","_layerMask","_computeBonesUsingShaders","_isActive","_onlyForInstances","_isActiveIntermediate","_onlyForInstancesIntermediate","_actAsRegularMesh","_currentLOD","_currentLODIsUpToDate","_collisionRetryCount","_morphTargetManager","_renderingGroupId","_bakedVertexAnimationManager","_material","_positions","_pointerOverDisableMeshTesting","_meshCollisionData","_enableDistantPicking","_rawBoundingInfo","_sideOrientationHint","_inheritVisibility","AbstractMesh","BILLBOARDMODE_NONE","BILLBOARDMODE_X","BILLBOARDMODE_Y","BILLBOARDMODE_Z","BILLBOARDMODE_ALL","BILLBOARDMODE_USE_POSITION","_internalAbstractMeshDataInfo","nb","ratio","mustDepthSortFacets","sort","facetDepthSortFrom","location","collisionRetryCount","retryCount","isFacetDataEnabled","_syncGeometryWithMorphTargetManager","bakedVertexAnimationManager","_markSubMeshesAsAttributesDirty","_updateNonUniformScalingState","_markSubMeshesAsMiscDirty","rawBoundingInfo","boundingInfo","onCollide","callback","_onCollideObserver","onCollideObservable","remove","add","onCollisionPositionChange","_onCollisionPositionChangeObserver","onCollisionPositionChangeObservable","visibility","oldValue","_markSubMeshesAsDirty","defines","markAsMiscDirty","markAsPrePassDirty","inheritVisibility","isVisible","_isVisible","_parentNode","parent","parentVisible","pointerOverDisableMeshTesting","disable","renderingGroupId","material","_setMaterial","meshMap","uniqueId","undefined","onMaterialChangedObservable","hasObservers","notifyObservers","subMeshes","resetDrawCache","_unBindEffect","getMaterialForRenderPass","renderPassId","_this$_internalAbstra","_materialForRenderPass","setMaterialForRenderPass","receiveShadows","_markSubMeshesAsLightDirty","hasVertexAlpha","useVertexColors","computeBonesUsingShaders","numBoneInfluencers","applyFog","enableDistantPicking","layerMask","_resyncLightSources","collisionMask","_collisionMask","mask","isNaN","collisionResponse","_collisionResponse","response","collisionGroup","_collisionGroup","surroundingMeshes","_surroundingMeshes","meshes","lightSources","_lightSources","skeleton","needInitialSkinMatrix","_unregisterMeshWithPoseMatrix","_registerMeshWithPoseMatrix","_bonesTransformMatrices","name","scene","_waitingMaterialId","_waitingMorphTargetManagerId","cullingStrategy","CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY","definedFacingForward","_occlusionQuery","_renderingGroup","alphaIndex","Number","MAX_VALUE","isPickable","isNearPickable","isNearGrabbable","showSubMeshesBoundingBox","isBlocker","enablePointerMoveEvents","outlineColor","Red","outlineWidth","overlayColor","overlayAlpha","useOctreeForRenderingSelection","useOctreeForPicking","useOctreeForCollisions","alwaysSelectAsActiveMesh","doNotSyncBoundingInfo","actionManager","ellipsoid","ellipsoidOffset","edgesWidth","edgesColor","_edgesRenderer","_masterMesh","_boundingInfo","_boundingInfoIsDirty","_renderId","_intersectionsInProgress","Array","_unIndexed","_waitingData","lods","actions","freezeWorldMatrix","_transformMatrixTexture","onRebuildObservable","_onCollisionPositionChange","collisionId","newPosition","collidedMesh","subtractToRef","_oldPositionForCollisions","_diffPositionForCollisions","CollisionsEpsilon","position","addInPlace","getScene","addMesh","_uniformBuffer","getEngine","isWebGPU","_buildUniformLayout","performancePriority","addUniform","create","transferToEffect","world","ubo","updateMatrix","updateFloat","update","getMeshUniformBuffer","getClassName","toString","fullDetails","ret","billboardMode","_isWorldMatrixFrozen","_getEffectiveParent","_getActionManagerForTrigger","trigger","initialCall","isRecursive","hasSpecificTrigger","_rebuild","dispose","subMesh","light","lights","isEnabled","canAffectMesh","push","_resyncLightSource","isIn","indexOf","removed","splice","setEffect","_removeLightSource","func","i","_drawWrappers","drawWrapper","markAllAsDirty","markAsLightDirty","markAsAttributesDirty","markAsDirty","property","_currentRenderId","_isDirty","passId","immediate","isBlocked","getLOD","camera","getTotalVertices","getTotalIndices","getIndices","getVerticesData","setVerticesData","updatable","stride","updateVerticesData","updateExtends","makeItUnique","setIndices","indices","totalVertices","isVerticesDataPresent","getBoundingInfo","_updateBoundingInfo","getRawBoundingInfo","_this$rawBoundingInfo","setBoundingInfo","hasBoundingInfo","buildBoundingInfo","minimum","maximum","worldMatrix","normalizeToUnitCube","includeDescendants","ignoreRotation","predicate","useBones","skeletonsEnabled","MatricesIndicesKind","MatricesWeightsKind","_preActivate","_preActivateForIntermediateRendering","renderId","_activate","intermediateRendering","_postActivate","_freeze","_unFreeze","getWorldMatrix","_getWorldMatrixDeterminant","isAnInstance","hasInstances","hasThinInstances","movePOV","amountRight","amountUp","amountForward","calcMovePOV","rotMatrix","rotQuaternion","rotationQuaternion","RotationYawPitchRoll","rotation","y","x","z","toRotationMatrix","translationDelta","defForwardMult","rotatePOV","flipBack","twirlClockwise","tiltRight","calcRotatePOV","_refreshBoundingInfo","bias","extend","reConstruct","refreshBoundingInfo","_refreshBoundingInfoDirect","_ApplySkeleton","_getData","options","cache","getVertexData","vertexData","_vertexData","copyVerticesData","_outputData","set","Float32Array","slice","needExtras","MatricesIndicesExtraKind","MatricesWeightsExtraKind","getTransformMatrices","updatePositionsArray","positions","previousLength","positionIndex","dataIndex","copyFromFloats","getNormalsData","getPositionData","worldMatrixFromCache","_updateSubMeshesBoundingInfo","matrix","count","subIndex","IsGlobal","updateBoundingInfo","_afterComputeWorldMatrix","isInFrustum","frustumPlanes","isCompletelyInFrustum","intersectsMesh","mesh","precise","otherBoundingInfo","intersects","child","getChildMeshes","intersectsPoint","point","checkCollisions","_checkCollisions","collisionEnabled","collider","_collider","moveWithCollisions","displacement","globalPosition","getAbsolutePosition","addToRef","coordinator","collisionCoordinator","createCollider","_radius","getNewPosition","_collideForSubMesh","transformMatrix","_subMesh$getMaterial","_generatePointsArray","_lastColliderWorldVertices","_lastColliderTransformMatrix","equals","clone","_trianglePlanes","start","verticesStart","end","verticesCount","TransformCoordinates","_collide","indexStart","indexCount","getMaterial","_shouldConvertRHS","fillMode","_processCollisionsForSubMeshes","_scene","getCollidingSubMeshCandidates","len","_checkCollision","collisionsScalingMatrix","collisionsTransformMatrix","ScalingToRef","multiplyToRef","ray","fastCheck","trianglePredicate","onlyBoundingInfo","worldToUse","skipBoundingInfo","pickingInfo","className","intersectionThreshold","intersectsSphere","boundingSphere","intersectsBox","boundingBox","hit","pickedMesh","distance","Distance","origin","center","subMeshId","intersectInfo","getIntersectingSubMeshCandidates","anySubmeshSupportIntersect","canIntersects","currentIntersectInfo","worldOrigin","direction","TransformCoordinatesToRef","scaleToRef","worldDirection","TransformNormal","pickedPoint","bu","bv","subMeshFaceId","faceId","newParent","doNotCloneChildren","releaseSubMeshes","doNotRecurse","disposeMaterialAndTextures","useMaterialMeshMap","freeActiveMeshes","freeRenderingGroups","renderingManager","maintainStateBetweenFrames","restoreDispachedFlags","disposeWhenUnowned","some","m","other","pos","forEach","meshIndex","includedOnlyMeshes","excludedMeshes","generators","getShadowGenerators","iterator","values","key","next","done","generator","shadowMap","getShadowMap","renderList","engine","isOcclusionQueryInProgress","deleteQuery","wipeCaches","removeMesh","_parentContainer","particleSystems","emitter","disableFacetData","onAfterWorldMatrixUpdateObservable","clear","_initFacetData","facetNormals","facetPositions","facetPartitioning","f","updateFacetData","normals","bInfo","Uint16Array","depthSortedIndices","Uint32Array","needs32bits","facetDepthSortFunction","f1","f2","sqDistance","activeCamera","depthSortedFacets","depthSortedFacet","ind","invertedMatrix","Identity","facetDepthSortOrigin","bbSizeMax","getFacetLocalNormals","getFacetLocalPositions","getFacetLocalPartitioning","depthSort","computeWorldMatrix","_worldMatrix","invertToRef","distanceTo","ComputeNormals","l","sind","updateIndices","facetData","getFacetPosition","getFacetPositionToRef","ref","localPos","getFacetNormal","norm","getFacetNormalToRef","localNorm","TransformNormalToRef","getFacetsAtLocalCoordinates","ox","oy","oz","getClosestFacetAtCoordinates","projected","checkFace","facing","invMat","invVect","closest","getClosestFacetAtLocalCoordinates","tmpx","tmpy","tmpz","d","t0","projx","projy","projz","facetsInBlock","shortest","tmpDistance","fib","p0","idx","getFacetDataParameters","offset","gpuMemoryOnly","createNormals","useRightHandedSystem","alignWithNormal","normal","upDirection","axisX","axisZ","CrossToRef","RotationQuaternionFromAxisToRef","RotationFromAxisToRef","_checkOcclusionQuery","disableEdgesRendering","enableEdgesRendering","epsilon","checkVerticesInsteadOfIndices","getConnectedParticleSystems","filter","particleSystem","OCCLUSION_TYPE_NONE","OCCLUSION_TYPE_OPTIMISTIC","OCCLUSION_TYPE_STRICT","OCCLUSION_ALGORITHM_TYPE_ACCURATE","OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE","CULLINGSTRATEGY_STANDARD","CULLINGSTRATEGY_OPTIMISTIC_INCLUSION","CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY","isArray"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/abstractMesh.js"],"sourcesContent":["import { __decorate } from \"../tslib.es6.js\";\nimport { Observable } from \"../Misc/observable.js\";\nimport { Quaternion, Matrix, Vector3, TmpVectors } from \"../Maths/math.vector.js\";\nimport { VertexBuffer } from \"../Buffers/buffer.js\";\nimport { VertexData } from \"../Meshes/mesh.vertexData.js\";\nimport { TransformNode } from \"../Meshes/transformNode.js\";\nimport { PickingInfo } from \"../Collisions/pickingInfo.js\";\nimport { BoundingInfo } from \"../Culling/boundingInfo.js\";\n\nimport { UniformBuffer } from \"../Materials/uniformBuffer.js\";\nimport { _MeshCollisionData } from \"../Collisions/meshCollisionData.js\";\nimport { _WarnImport } from \"../Misc/devTools.js\";\nimport { extractMinAndMax } from \"../Maths/math.functions.js\";\nimport { Color3, Color4 } from \"../Maths/math.color.js\";\nimport { Epsilon } from \"../Maths/math.constants.js\";\nimport { Axis } from \"../Maths/math.axis.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { nativeOverride } from \"../Misc/decorators.js\";\nimport { AbstractEngine } from \"../Engines/abstractEngine.js\";\nfunction applyMorph(data, kind, morphTargetManager) {\n let getTargetData = null;\n switch (kind) {\n case VertexBuffer.PositionKind:\n getTargetData = (target) => target.getPositions();\n break;\n case VertexBuffer.NormalKind:\n getTargetData = (target) => target.getNormals();\n break;\n case VertexBuffer.TangentKind:\n getTargetData = (target) => target.getTangents();\n break;\n case VertexBuffer.UVKind:\n getTargetData = (target) => target.getUVs();\n break;\n default:\n return;\n }\n for (let index = 0; index < data.length; index++) {\n let value = data[index];\n for (let targetCount = 0; targetCount < morphTargetManager.numTargets; targetCount++) {\n const target = morphTargetManager.getTarget(targetCount);\n const influence = target.influence;\n if (influence !== 0) {\n const targetData = getTargetData(target);\n if (targetData) {\n value += (targetData[index] - data[index]) * influence;\n }\n }\n }\n data[index] = value;\n }\n}\nfunction applySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData) {\n const tempVector = TmpVectors.Vector3[0];\n const finalMatrix = TmpVectors.Matrix[0];\n const tempMatrix = TmpVectors.Matrix[1];\n const transformFromFloatsToRef = kind === VertexBuffer.NormalKind ? Vector3.TransformNormalFromFloatsToRef : Vector3.TransformCoordinatesFromFloatsToRef;\n for (let index = 0, matWeightIdx = 0; index < data.length; index += 3, matWeightIdx += 4) {\n finalMatrix.reset();\n let inf;\n let weight;\n for (inf = 0; inf < 4; inf++) {\n weight = matricesWeightsData[matWeightIdx + inf];\n if (weight > 0) {\n Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix);\n finalMatrix.addToSelf(tempMatrix);\n }\n }\n if (matricesIndicesExtraData && matricesWeightsExtraData) {\n for (inf = 0; inf < 4; inf++) {\n weight = matricesWeightsExtraData[matWeightIdx + inf];\n if (weight > 0) {\n Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix);\n finalMatrix.addToSelf(tempMatrix);\n }\n }\n }\n transformFromFloatsToRef(data[index], data[index + 1], data[index + 2], finalMatrix, tempVector);\n tempVector.toArray(data, index);\n }\n}\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nclass _FacetDataStorage {\n constructor() {\n this.facetNb = 0; // facet number\n this.partitioningSubdivisions = 10; // number of subdivisions per axis in the partitioning space\n this.partitioningBBoxRatio = 1.01; // the partitioning array space is by default 1% bigger than the bounding box\n this.facetDataEnabled = false; // is the facet data feature enabled on this mesh ?\n this.facetParameters = {}; // keep a reference to the object parameters to avoid memory re-allocation\n this.bbSize = Vector3.Zero(); // bbox size approximated for facet data\n this.subDiv = {\n // actual number of subdivisions per axis for ComputeNormals()\n max: 1,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n X: 1,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Y: 1,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Z: 1,\n };\n this.facetDepthSort = false; // is the facet depth sort to be computed\n this.facetDepthSortEnabled = false; // is the facet depth sort initialized\n }\n}\n/**\n * @internal\n **/\n// eslint-disable-next-line @typescript-eslint/naming-convention\nclass _InternalAbstractMeshDataInfo {\n constructor() {\n this._hasVertexAlpha = false;\n this._useVertexColors = true;\n this._numBoneInfluencers = 4;\n this._applyFog = true;\n this._receiveShadows = false;\n this._facetData = new _FacetDataStorage();\n this._visibility = 1.0;\n this._skeleton = null;\n this._layerMask = 0x0fffffff;\n this._computeBonesUsingShaders = true;\n this._isActive = false;\n this._onlyForInstances = false;\n this._isActiveIntermediate = false;\n this._onlyForInstancesIntermediate = false;\n this._actAsRegularMesh = false;\n this._currentLOD = null;\n this._currentLODIsUpToDate = false;\n this._collisionRetryCount = 3;\n this._morphTargetManager = null;\n this._renderingGroupId = 0;\n this._bakedVertexAnimationManager = null;\n this._material = null;\n this._positions = null;\n this._pointerOverDisableMeshTesting = false;\n // Collisions\n this._meshCollisionData = new _MeshCollisionData();\n this._enableDistantPicking = false;\n /** @internal\n * Bounding info that is unnafected by the addition of thin instances\n */\n this._rawBoundingInfo = null;\n /** @internal\n * This value will indicate us that at some point, the mesh was specifically used with the opposite winding order\n * We use that as a clue to force the material to sideOrientation = null\n */\n this._sideOrientationHint = false;\n /**\n * @internal\n * if this is set to true, the mesh will be visible only if its parent(s) are also visible\n */\n this._inheritVisibility = false;\n }\n}\n/**\n * Class used to store all common mesh properties\n */\nexport class AbstractMesh extends TransformNode {\n /**\n * No billboard\n */\n static get BILLBOARDMODE_NONE() {\n return TransformNode.BILLBOARDMODE_NONE;\n }\n /** Billboard on X axis */\n static get BILLBOARDMODE_X() {\n return TransformNode.BILLBOARDMODE_X;\n }\n /** Billboard on Y axis */\n static get BILLBOARDMODE_Y() {\n return TransformNode.BILLBOARDMODE_Y;\n }\n /** Billboard on Z axis */\n static get BILLBOARDMODE_Z() {\n return TransformNode.BILLBOARDMODE_Z;\n }\n /** Billboard on all axes */\n static get BILLBOARDMODE_ALL() {\n return TransformNode.BILLBOARDMODE_ALL;\n }\n /** Billboard on using position instead of orientation */\n static get BILLBOARDMODE_USE_POSITION() {\n return TransformNode.BILLBOARDMODE_USE_POSITION;\n }\n /**\n * Gets the number of facets in the mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#what-is-a-mesh-facet\n */\n get facetNb() {\n return this._internalAbstractMeshDataInfo._facetData.facetNb;\n }\n /**\n * Gets or set the number (integer) of subdivisions per axis in the partitioning space\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning\n */\n get partitioningSubdivisions() {\n return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions;\n }\n set partitioningSubdivisions(nb) {\n this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions = nb;\n }\n /**\n * The ratio (float) to apply to the bounding box size to set to the partitioning space.\n * Ex : 1.01 (default) the partitioning space is 1% bigger than the bounding box\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#tweaking-the-partitioning\n */\n get partitioningBBoxRatio() {\n return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio;\n }\n set partitioningBBoxRatio(ratio) {\n this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio = ratio;\n }\n /**\n * Gets or sets a boolean indicating that the facets must be depth sorted on next call to `updateFacetData()`.\n * Works only for updatable meshes.\n * Doesn't work with multi-materials\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort\n */\n get mustDepthSortFacets() {\n return this._internalAbstractMeshDataInfo._facetData.facetDepthSort;\n }\n set mustDepthSortFacets(sort) {\n this._internalAbstractMeshDataInfo._facetData.facetDepthSort = sort;\n }\n /**\n * The location (Vector3) where the facet depth sort must be computed from.\n * By default, the active camera position.\n * Used only when facet depth sort is enabled\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#facet-depth-sort\n */\n get facetDepthSortFrom() {\n return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom;\n }\n set facetDepthSortFrom(location) {\n this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom = location;\n }\n /** number of collision detection tries. Change this value if not all collisions are detected and handled properly */\n get collisionRetryCount() {\n return this._internalAbstractMeshDataInfo._collisionRetryCount;\n }\n set collisionRetryCount(retryCount) {\n this._internalAbstractMeshDataInfo._collisionRetryCount = retryCount;\n }\n /**\n * gets a boolean indicating if facetData is enabled\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData#what-is-a-mesh-facet\n */\n get isFacetDataEnabled() {\n return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled;\n }\n /**\n * Gets or sets the morph target manager\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/morphTargets\n */\n get morphTargetManager() {\n return this._internalAbstractMeshDataInfo._morphTargetManager;\n }\n set morphTargetManager(value) {\n if (this._internalAbstractMeshDataInfo._morphTargetManager === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._morphTargetManager = value;\n this._syncGeometryWithMorphTargetManager();\n }\n /**\n * Gets or sets the baked vertex animation manager\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/baked_texture_animations\n */\n get bakedVertexAnimationManager() {\n return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager;\n }\n set bakedVertexAnimationManager(value) {\n if (this._internalAbstractMeshDataInfo._bakedVertexAnimationManager === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._bakedVertexAnimationManager = value;\n this._markSubMeshesAsAttributesDirty();\n }\n /** @internal */\n _syncGeometryWithMorphTargetManager() { }\n /**\n * @internal\n */\n _updateNonUniformScalingState(value) {\n if (!super._updateNonUniformScalingState(value)) {\n return false;\n }\n this._markSubMeshesAsMiscDirty();\n return true;\n }\n /** @internal */\n get rawBoundingInfo() {\n return this._internalAbstractMeshDataInfo._rawBoundingInfo;\n }\n set rawBoundingInfo(boundingInfo) {\n this._internalAbstractMeshDataInfo._rawBoundingInfo = boundingInfo;\n }\n /** Set a function to call when this mesh collides with another one */\n set onCollide(callback) {\n if (this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver) {\n this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver);\n }\n this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver = this.onCollideObservable.add(callback);\n }\n /** Set a function to call when the collision's position changes */\n set onCollisionPositionChange(callback) {\n if (this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver) {\n this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver);\n }\n this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(callback);\n }\n /**\n * Gets or sets mesh visibility between 0 and 1 (default is 1)\n */\n get visibility() {\n return this._internalAbstractMeshDataInfo._visibility;\n }\n /**\n * Gets or sets mesh visibility between 0 and 1 (default is 1)\n */\n set visibility(value) {\n if (this._internalAbstractMeshDataInfo._visibility === value) {\n return;\n }\n const oldValue = this._internalAbstractMeshDataInfo._visibility;\n this._internalAbstractMeshDataInfo._visibility = value;\n if ((oldValue === 1 && value !== 1) || (oldValue !== 1 && value === 1)) {\n this._markSubMeshesAsDirty((defines) => {\n defines.markAsMiscDirty();\n defines.markAsPrePassDirty();\n });\n }\n }\n /**\n * If set to true, a mesh will only be visible only if its parent(s) are also visible (default is false)\n */\n get inheritVisibility() {\n return this._internalAbstractMeshDataInfo._inheritVisibility;\n }\n set inheritVisibility(value) {\n this._internalAbstractMeshDataInfo._inheritVisibility = value;\n }\n /**\n * Gets or sets a boolean indicating if the mesh is visible (renderable). Default is true\n */\n get isVisible() {\n if (!this._isVisible || !this.inheritVisibility || !this._parentNode) {\n return this._isVisible;\n }\n if (this._isVisible) {\n let parent = this._parentNode;\n while (parent) {\n const parentVisible = parent.isVisible;\n if (typeof parentVisible !== \"undefined\") {\n return parentVisible;\n }\n parent = parent.parent;\n }\n }\n return this._isVisible;\n }\n set isVisible(value) {\n this._isVisible = value;\n }\n /**\n * Gets or sets the property which disables the test that is checking that the mesh under the pointer is the same than the previous time we tested for it (default: false).\n * Set this property to true if you want thin instances picking to be reported accurately when moving over the mesh.\n * Note that setting this property to true will incur some performance penalties when dealing with pointer events for this mesh so use it sparingly.\n */\n get pointerOverDisableMeshTesting() {\n return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting;\n }\n set pointerOverDisableMeshTesting(disable) {\n this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting = disable;\n }\n /**\n * Specifies the rendering group id for this mesh (0 by default)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering#rendering-groups\n */\n get renderingGroupId() {\n return this._internalAbstractMeshDataInfo._renderingGroupId;\n }\n set renderingGroupId(value) {\n this._internalAbstractMeshDataInfo._renderingGroupId = value;\n }\n /** Gets or sets current material */\n get material() {\n return this._internalAbstractMeshDataInfo._material;\n }\n set material(value) {\n this._setMaterial(value);\n }\n /** @internal */\n _setMaterial(value) {\n if (this._internalAbstractMeshDataInfo._material === value) {\n return;\n }\n // remove from material mesh map id needed\n if (this._internalAbstractMeshDataInfo._material && this._internalAbstractMeshDataInfo._material.meshMap) {\n this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId] = undefined;\n }\n this._internalAbstractMeshDataInfo._material = value;\n if (value && value.meshMap) {\n value.meshMap[this.uniqueId] = this;\n }\n if (this.onMaterialChangedObservable.hasObservers()) {\n this.onMaterialChangedObservable.notifyObservers(this);\n }\n if (!this.subMeshes) {\n return;\n }\n this.resetDrawCache(undefined, value == null);\n this._unBindEffect();\n }\n /**\n * Gets the material used to render the mesh in a specific render pass\n * @param renderPassId render pass id\n * @returns material used for the render pass. If no specific material is used for this render pass, undefined is returned (meaning mesh.material is used for this pass)\n */\n getMaterialForRenderPass(renderPassId) {\n return this._internalAbstractMeshDataInfo._materialForRenderPass?.[renderPassId];\n }\n /**\n * Sets the material to be used to render the mesh in a specific render pass\n * @param renderPassId render pass id\n * @param material material to use for this render pass. If undefined is passed, no specific material will be used for this render pass but the regular material will be used instead (mesh.material)\n */\n setMaterialForRenderPass(renderPassId, material) {\n this.resetDrawCache(renderPassId);\n if (!this._internalAbstractMeshDataInfo._materialForRenderPass) {\n this._internalAbstractMeshDataInfo._materialForRenderPass = [];\n }\n this._internalAbstractMeshDataInfo._materialForRenderPass[renderPassId] = material;\n }\n /**\n * Gets or sets a boolean indicating that this mesh can receive realtime shadows\n * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows\n */\n get receiveShadows() {\n return this._internalAbstractMeshDataInfo._receiveShadows;\n }\n set receiveShadows(value) {\n if (this._internalAbstractMeshDataInfo._receiveShadows === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._receiveShadows = value;\n this._markSubMeshesAsLightDirty();\n }\n /**\n * Gets or sets a boolean indicating that this mesh needs to use vertex alpha data to render.\n * This property is misnamed and should be `useVertexAlpha`. Note that the mesh will be rendered\n * with alpha blending when this flag is set even if vertex alpha data is missing from the geometry.\n */\n get hasVertexAlpha() {\n return this._internalAbstractMeshDataInfo._hasVertexAlpha;\n }\n set hasVertexAlpha(value) {\n if (this._internalAbstractMeshDataInfo._hasVertexAlpha === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._hasVertexAlpha = value;\n this._markSubMeshesAsAttributesDirty();\n this._markSubMeshesAsMiscDirty();\n }\n /** Gets or sets a boolean indicating that this mesh needs to use vertex color data to render (if this kind of vertex data is available in the geometry) */\n get useVertexColors() {\n return this._internalAbstractMeshDataInfo._useVertexColors;\n }\n set useVertexColors(value) {\n if (this._internalAbstractMeshDataInfo._useVertexColors === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._useVertexColors = value;\n this._markSubMeshesAsAttributesDirty();\n }\n /**\n * Gets or sets a boolean indicating that bone animations must be computed by the GPU (true by default)\n */\n get computeBonesUsingShaders() {\n return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;\n }\n set computeBonesUsingShaders(value) {\n if (this._internalAbstractMeshDataInfo._computeBonesUsingShaders === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._computeBonesUsingShaders = value;\n this._markSubMeshesAsAttributesDirty();\n }\n /** Gets or sets the number of allowed bone influences per vertex (4 by default) */\n get numBoneInfluencers() {\n return this._internalAbstractMeshDataInfo._numBoneInfluencers;\n }\n set numBoneInfluencers(value) {\n if (this._internalAbstractMeshDataInfo._numBoneInfluencers === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._numBoneInfluencers = value;\n this._markSubMeshesAsAttributesDirty();\n }\n /** Gets or sets a boolean indicating that this mesh will allow fog to be rendered on it (true by default) */\n get applyFog() {\n return this._internalAbstractMeshDataInfo._applyFog;\n }\n set applyFog(value) {\n if (this._internalAbstractMeshDataInfo._applyFog === value) {\n return;\n }\n this._internalAbstractMeshDataInfo._applyFog = value;\n this._markSubMeshesAsMiscDirty();\n }\n /** When enabled, decompose picking matrices for better precision with large values for mesh position and scling */\n get enableDistantPicking() {\n return this._internalAbstractMeshDataInfo._enableDistantPicking;\n }\n set enableDistantPicking(value) {\n this._internalAbstractMeshDataInfo._enableDistantPicking = value;\n }\n /**\n * Gets or sets the current layer mask (default is 0x0FFFFFFF)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/layerMasksAndMultiCam\n */\n get layerMask() {\n return this._internalAbstractMeshDataInfo._layerMask;\n }\n set layerMask(value) {\n if (value === this._internalAbstractMeshDataInfo._layerMask) {\n return;\n }\n this._internalAbstractMeshDataInfo._layerMask = value;\n this._resyncLightSources();\n }\n /**\n * Gets or sets a collision mask used to mask collisions (default is -1).\n * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0\n */\n get collisionMask() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask;\n }\n set collisionMask(mask) {\n this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask = !isNaN(mask) ? mask : -1;\n }\n /**\n * Gets or sets a collision response flag (default is true).\n * when collisionResponse is false, events are still triggered but colliding entity has no response\n * This helps creating trigger volume when user wants collision feedback events but not position/velocity\n * to respond to the collision.\n */\n get collisionResponse() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse;\n }\n set collisionResponse(response) {\n this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse = response;\n }\n /**\n * Gets or sets the current collision group mask (-1 by default).\n * A collision between A and B will happen if A.collisionGroup & b.collisionMask !== 0\n */\n get collisionGroup() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup;\n }\n set collisionGroup(mask) {\n this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup = !isNaN(mask) ? mask : -1;\n }\n /**\n * Gets or sets current surrounding meshes (null by default).\n *\n * By default collision detection is tested against every mesh in the scene.\n * It is possible to set surroundingMeshes to a defined list of meshes and then only these specified\n * meshes will be tested for the collision.\n *\n * Note: if set to an empty array no collision will happen when this mesh is moved.\n */\n get surroundingMeshes() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes;\n }\n set surroundingMeshes(meshes) {\n this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes = meshes;\n }\n /** Gets the list of lights affecting that mesh */\n get lightSources() {\n return this._lightSources;\n }\n /**\n * Gets or sets a skeleton to apply skinning transformations\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons\n */\n set skeleton(value) {\n const skeleton = this._internalAbstractMeshDataInfo._skeleton;\n if (skeleton && skeleton.needInitialSkinMatrix) {\n skeleton._unregisterMeshWithPoseMatrix(this);\n }\n if (value && value.needInitialSkinMatrix) {\n value._registerMeshWithPoseMatrix(this);\n }\n this._internalAbstractMeshDataInfo._skeleton = value;\n if (!this._internalAbstractMeshDataInfo._skeleton) {\n this._bonesTransformMatrices = null;\n }\n this._markSubMeshesAsAttributesDirty();\n }\n get skeleton() {\n return this._internalAbstractMeshDataInfo._skeleton;\n }\n // Constructor\n /**\n * Creates a new AbstractMesh\n * @param name defines the name of the mesh\n * @param scene defines the hosting scene\n */\n constructor(name, scene = null) {\n super(name, scene, false);\n // Internal data\n /** @internal */\n this._internalAbstractMeshDataInfo = new _InternalAbstractMeshDataInfo();\n /** @internal */\n this._waitingMaterialId = null;\n /** @internal */\n this._waitingMorphTargetManagerId = null;\n /**\n * The culling strategy to use to check whether the mesh must be rendered or not.\n * This value can be changed at any time and will be used on the next render mesh selection.\n * The possible values are :\n * - AbstractMesh.CULLINGSTRATEGY_STANDARD\n * - AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY\n * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION\n * - AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY\n * Please read each static variable documentation to get details about the culling process.\n * */\n this.cullingStrategy = AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY;\n // Events\n /**\n * An event triggered when this mesh collides with another one\n */\n this.onCollideObservable = new Observable();\n /**\n * An event triggered when the collision's position changes\n */\n this.onCollisionPositionChangeObservable = new Observable();\n /**\n * An event triggered when material is changed\n */\n this.onMaterialChangedObservable = new Observable();\n // Properties\n /**\n * Gets or sets the orientation for POV movement & rotation\n */\n this.definedFacingForward = true;\n /** @internal */\n this._occlusionQuery = null;\n /** @internal */\n this._renderingGroup = null;\n /** Gets or sets the alpha index used to sort transparent meshes\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering#alpha-index\n */\n this.alphaIndex = Number.MAX_VALUE;\n this._isVisible = true;\n /**\n * Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true\n */\n this.isPickable = true;\n /**\n * Gets or sets a boolean indicating if the mesh can be near picked (touched by the XR controller or hands). Default is false\n */\n this.isNearPickable = false;\n /**\n * Gets or sets a boolean indicating if the mesh can be grabbed. Default is false.\n * Setting this to true, while using the XR near interaction feature, will trigger a pointer event when the mesh is grabbed.\n * Grabbing means that the controller is using the squeeze or main trigger button to grab the mesh.\n * This is different from nearPickable which only triggers the event when the mesh is touched by the controller\n */\n this.isNearGrabbable = false;\n /** Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default) */\n this.showSubMeshesBoundingBox = false;\n /** Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/environment/lenseFlare\n */\n this.isBlocker = false;\n /**\n * Gets or sets a boolean indicating that pointer move events must be supported on this mesh (false by default)\n */\n this.enablePointerMoveEvents = false;\n /** Defines color to use when rendering outline */\n this.outlineColor = Color3.Red();\n /** Define width to use when rendering outline */\n this.outlineWidth = 0.02;\n /** Defines color to use when rendering overlay */\n this.overlayColor = Color3.Red();\n /** Defines alpha to use when rendering overlay */\n this.overlayAlpha = 0.5;\n /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes selection (true by default) */\n this.useOctreeForRenderingSelection = true;\n /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes picking (true by default) */\n this.useOctreeForPicking = true;\n /** Gets or sets a boolean indicating that internal octree (if available) can be used to boost submeshes collision (true by default) */\n this.useOctreeForCollisions = true;\n /**\n * True if the mesh must be rendered in any case (this will shortcut the frustum clipping phase)\n */\n this.alwaysSelectAsActiveMesh = false;\n /**\n * Gets or sets a boolean indicating that the bounding info does not need to be kept in sync (for performance reason)\n */\n this.doNotSyncBoundingInfo = false;\n /**\n * Gets or sets the current action manager\n * @see https://doc.babylonjs.com/features/featuresDeepDive/events/actions\n */\n this.actionManager = null;\n /**\n * Gets or sets the ellipsoid used to impersonate this mesh when using collision engine (default is (0.5, 1, 0.5))\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions\n */\n this.ellipsoid = new Vector3(0.5, 1, 0.5);\n /**\n * Gets or sets the ellipsoid offset used to impersonate this mesh when using collision engine (default is (0, 0, 0))\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions\n */\n this.ellipsoidOffset = new Vector3(0, 0, 0);\n // Edges\n /**\n * Defines edge width used when edgesRenderer is enabled\n * @see https://www.babylonjs-playground.com/#10OJSG#13\n */\n this.edgesWidth = 1;\n /**\n * Defines edge color used when edgesRenderer is enabled\n * @see https://www.babylonjs-playground.com/#10OJSG#13\n */\n this.edgesColor = new Color4(1, 0, 0, 1);\n /** @internal */\n this._edgesRenderer = null;\n /** @internal */\n this._masterMesh = null;\n this._boundingInfo = null;\n this._boundingInfoIsDirty = true;\n /** @internal */\n this._renderId = 0;\n /** @internal */\n this._intersectionsInProgress = new Array();\n /** @internal */\n this._unIndexed = false;\n /** @internal */\n this._lightSources = new Array();\n // Loading properties\n /** @internal */\n this._waitingData = {\n lods: null,\n actions: null,\n freezeWorldMatrix: null,\n };\n /** @internal */\n this._bonesTransformMatrices = null;\n /** @internal */\n this._transformMatrixTexture = null;\n /**\n * An event triggered when the mesh is rebuilt.\n */\n this.onRebuildObservable = new Observable();\n this._onCollisionPositionChange = (collisionId, newPosition, collidedMesh = null) => {\n newPosition.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions, this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions);\n if (this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length() > AbstractEngine.CollisionsEpsilon) {\n this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions);\n }\n if (collidedMesh) {\n this.onCollideObservable.notifyObservers(collidedMesh);\n }\n this.onCollisionPositionChangeObservable.notifyObservers(this.position);\n };\n scene = this.getScene();\n scene.addMesh(this);\n this._resyncLightSources();\n // Mesh Uniform Buffer.\n this._uniformBuffer = new UniformBuffer(this.getScene().getEngine(), undefined, undefined, name, !this.getScene().getEngine().isWebGPU);\n this._buildUniformLayout();\n switch (scene.performancePriority) {\n case 2 /* ScenePerformancePriority.Aggressive */:\n this.doNotSyncBoundingInfo = true;\n // eslint-disable-next-line no-fallthrough\n case 1 /* ScenePerformancePriority.Intermediate */:\n this.alwaysSelectAsActiveMesh = true;\n this.isPickable = false;\n break;\n }\n }\n _buildUniformLayout() {\n this._uniformBuffer.addUniform(\"world\", 16);\n this._uniformBuffer.addUniform(\"visibility\", 1);\n this._uniformBuffer.create();\n }\n /**\n * Transfer the mesh values to its UBO.\n * @param world The world matrix associated with the mesh\n */\n transferToEffect(world) {\n const ubo = this._uniformBuffer;\n ubo.updateMatrix(\"world\", world);\n ubo.updateFloat(\"visibility\", this._internalAbstractMeshDataInfo._visibility);\n ubo.update();\n }\n /**\n * Gets the mesh uniform buffer.\n * @returns the uniform buffer of the mesh.\n */\n getMeshUniformBuffer() {\n return this._uniformBuffer;\n }\n /**\n * Returns the string \"AbstractMesh\"\n * @returns \"AbstractMesh\"\n */\n getClassName() {\n return \"AbstractMesh\";\n }\n /**\n * Gets a string representation of the current mesh\n * @param fullDetails defines a boolean indicating if full details must be included\n * @returns a string representation of the current mesh\n */\n toString(fullDetails) {\n let ret = \"Name: \" + this.name + \", isInstance: \" + (this.getClassName() !== \"InstancedMesh\" ? \"YES\" : \"NO\");\n ret += \", # of submeshes: \" + (this.subMeshes ? this.subMeshes.length : 0);\n const skeleton = this._internalAbstractMeshDataInfo._skeleton;\n if (skeleton) {\n ret += \", skeleton: \" + skeleton.name;\n }\n if (fullDetails) {\n ret += \", billboard mode: \" + [\"NONE\", \"X\", \"Y\", null, \"Z\", null, null, \"ALL\"][this.billboardMode];\n ret += \", freeze wrld mat: \" + (this._isWorldMatrixFrozen || this._waitingData.freezeWorldMatrix ? \"YES\" : \"NO\");\n }\n return ret;\n }\n /**\n * @internal\n */\n _getEffectiveParent() {\n if (this._masterMesh && this.billboardMode !== TransformNode.BILLBOARDMODE_NONE) {\n return this._masterMesh;\n }\n return super._getEffectiveParent();\n }\n /**\n * @internal\n */\n _getActionManagerForTrigger(trigger, initialCall = true) {\n if (this.actionManager && (initialCall || this.actionManager.isRecursive)) {\n if (trigger) {\n if (this.actionManager.hasSpecificTrigger(trigger)) {\n return this.actionManager;\n }\n }\n else {\n return this.actionManager;\n }\n }\n if (!this.parent) {\n return null;\n }\n return this.parent._getActionManagerForTrigger(trigger, false);\n }\n /**\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _rebuild(dispose = false) {\n this.onRebuildObservable.notifyObservers(this);\n if (this._occlusionQuery !== null) {\n this._occlusionQuery = null;\n }\n if (!this.subMeshes) {\n return;\n }\n for (const subMesh of this.subMeshes) {\n subMesh._rebuild();\n }\n this.resetDrawCache();\n }\n /** @internal */\n _resyncLightSources() {\n this._lightSources.length = 0;\n for (const light of this.getScene().lights) {\n if (!light.isEnabled()) {\n continue;\n }\n if (light.canAffectMesh(this)) {\n this._lightSources.push(light);\n }\n }\n this._markSubMeshesAsLightDirty();\n }\n /**\n * @internal\n */\n _resyncLightSource(light) {\n const isIn = light.isEnabled() && light.canAffectMesh(this);\n const index = this._lightSources.indexOf(light);\n let removed = false;\n if (index === -1) {\n if (!isIn) {\n return;\n }\n this._lightSources.push(light);\n }\n else {\n if (isIn) {\n return;\n }\n removed = true;\n this._lightSources.splice(index, 1);\n }\n this._markSubMeshesAsLightDirty(removed);\n }\n /** @internal */\n _unBindEffect() {\n for (const subMesh of this.subMeshes) {\n subMesh.setEffect(null);\n }\n }\n /**\n * @internal\n */\n _removeLightSource(light, dispose) {\n const index = this._lightSources.indexOf(light);\n if (index === -1) {\n return;\n }\n this._lightSources.splice(index, 1);\n this._markSubMeshesAsLightDirty(dispose);\n }\n _markSubMeshesAsDirty(func) {\n if (!this.subMeshes) {\n return;\n }\n for (const subMesh of this.subMeshes) {\n for (let i = 0; i < subMesh._drawWrappers.length; ++i) {\n const drawWrapper = subMesh._drawWrappers[i];\n if (!drawWrapper || !drawWrapper.defines || !drawWrapper.defines.markAllAsDirty) {\n continue;\n }\n func(drawWrapper.defines);\n }\n }\n }\n /**\n * @internal\n */\n _markSubMeshesAsLightDirty(dispose = false) {\n this._markSubMeshesAsDirty((defines) => defines.markAsLightDirty(dispose));\n }\n /** @internal */\n _markSubMeshesAsAttributesDirty() {\n this._markSubMeshesAsDirty((defines) => defines.markAsAttributesDirty());\n }\n /** @internal */\n _markSubMeshesAsMiscDirty() {\n this._markSubMeshesAsDirty((defines) => defines.markAsMiscDirty());\n }\n /**\n * Flag the AbstractMesh as dirty (Forcing it to update everything)\n * @param property if set to \"rotation\" the objects rotationQuaternion will be set to null\n * @returns this AbstractMesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n markAsDirty(property) {\n this._currentRenderId = Number.MAX_VALUE;\n super.markAsDirty(property);\n this._isDirty = true;\n return this;\n }\n /**\n * Resets the draw wrappers cache for all submeshes of this abstract mesh\n * @param passId If provided, releases only the draw wrapper corresponding to this render pass id\n * @param immediate If true, the effect will be released immediately, otherwise it will be released at the next frame\n */\n resetDrawCache(passId, immediate = false) {\n if (!this.subMeshes) {\n return;\n }\n for (const subMesh of this.subMeshes) {\n subMesh.resetDrawCache(passId, immediate);\n }\n }\n // Methods\n /**\n * Returns true if the mesh is blocked. Implemented by child classes\n */\n get isBlocked() {\n return false;\n }\n /**\n * Returns the mesh itself by default. Implemented by child classes\n * @param camera defines the camera to use to pick the right LOD level\n * @returns the currentAbstractMesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getLOD(camera) {\n return this;\n }\n /**\n * Returns 0 by default. Implemented by child classes\n * @returns an integer\n */\n getTotalVertices() {\n return 0;\n }\n /**\n * Returns a positive integer : the total number of indices in this mesh geometry.\n * @returns the number of indices or zero if the mesh has no geometry.\n */\n getTotalIndices() {\n return 0;\n }\n /**\n * Returns null by default. Implemented by child classes\n * @returns null\n */\n getIndices() {\n return null;\n }\n /**\n * Returns the array of the requested vertex data kind. Implemented by child classes\n * @param kind defines the vertex data kind to use\n * @returns null\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getVerticesData(kind) {\n return null;\n }\n /**\n * Sets the vertex data of the mesh geometry for the requested `kind`.\n * If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data.\n * Note that a new underlying VertexBuffer object is created each call.\n * If the `kind` is the `PositionKind`, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.\n * @param kind defines vertex data kind:\n * * VertexBuffer.PositionKind\n * * VertexBuffer.UVKind\n * * VertexBuffer.UV2Kind\n * * VertexBuffer.UV3Kind\n * * VertexBuffer.UV4Kind\n * * VertexBuffer.UV5Kind\n * * VertexBuffer.UV6Kind\n * * VertexBuffer.ColorKind\n * * VertexBuffer.MatricesIndicesKind\n * * VertexBuffer.MatricesIndicesExtraKind\n * * VertexBuffer.MatricesWeightsKind\n * * VertexBuffer.MatricesWeightsExtraKind\n * @param data defines the data source\n * @param updatable defines if the data must be flagged as updatable (or static)\n * @param stride defines the vertex stride (size of an entire vertex). Can be null and in this case will be deduced from vertex data kind\n * @returns the current mesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setVerticesData(kind, data, updatable, stride) {\n return this;\n }\n /**\n * Updates the existing vertex data of the mesh geometry for the requested `kind`.\n * If the mesh has no geometry, it is simply returned as it is.\n * @param kind defines vertex data kind:\n * * VertexBuffer.PositionKind\n * * VertexBuffer.UVKind\n * * VertexBuffer.UV2Kind\n * * VertexBuffer.UV3Kind\n * * VertexBuffer.UV4Kind\n * * VertexBuffer.UV5Kind\n * * VertexBuffer.UV6Kind\n * * VertexBuffer.ColorKind\n * * VertexBuffer.MatricesIndicesKind\n * * VertexBuffer.MatricesIndicesExtraKind\n * * VertexBuffer.MatricesWeightsKind\n * * VertexBuffer.MatricesWeightsExtraKind\n * @param data defines the data source\n * @param updateExtends If `kind` is `PositionKind` and if `updateExtends` is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed\n * @param makeItUnique If true, a new global geometry is created from this data and is set to the mesh\n * @returns the current mesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n updateVerticesData(kind, data, updateExtends, makeItUnique) {\n return this;\n }\n /**\n * Sets the mesh indices,\n * If the mesh has no geometry, a new Geometry object is created and set to the mesh.\n * @param indices Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array)\n * @param totalVertices Defines the total number of vertices\n * @returns the current mesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setIndices(indices, totalVertices) {\n return this;\n }\n /**\n * Gets a boolean indicating if specific vertex data is present\n * @param kind defines the vertex data kind to use\n * @returns true is data kind is present\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isVerticesDataPresent(kind) {\n return false;\n }\n /**\n * Returns the mesh BoundingInfo object or creates a new one and returns if it was undefined.\n * Note that it returns a shallow bounding of the mesh (i.e. it does not include children).\n * However, if the mesh contains thin instances, it will be expanded to include them. If you want the \"raw\" bounding data instead, then use `getRawBoundingInfo()`.\n * To get the full bounding of all children, call `getHierarchyBoundingVectors` instead.\n * @returns a BoundingInfo\n */\n getBoundingInfo() {\n if (this._masterMesh) {\n return this._masterMesh.getBoundingInfo();\n }\n if (this._boundingInfoIsDirty) {\n this._boundingInfoIsDirty = false;\n // this._boundingInfo is being created if undefined\n this._updateBoundingInfo();\n }\n // cannot be null.\n return this._boundingInfo;\n }\n /**\n * Returns the bounding info unnafected by instance data.\n * @returns the bounding info of the mesh unaffected by instance data.\n */\n getRawBoundingInfo() {\n return this.rawBoundingInfo ?? this.getBoundingInfo();\n }\n /**\n * Overwrite the current bounding info\n * @param boundingInfo defines the new bounding info\n * @returns the current mesh\n */\n setBoundingInfo(boundingInfo) {\n this._boundingInfo = boundingInfo;\n return this;\n }\n /**\n * Returns true if there is already a bounding info\n */\n get hasBoundingInfo() {\n return this._boundingInfo !== null;\n }\n /**\n * Creates a new bounding info for the mesh\n * @param minimum min vector of the bounding box/sphere\n * @param maximum max vector of the bounding box/sphere\n * @param worldMatrix defines the new world matrix\n * @returns the new bounding info\n */\n buildBoundingInfo(minimum, maximum, worldMatrix) {\n this._boundingInfo = new BoundingInfo(minimum, maximum, worldMatrix);\n return this._boundingInfo;\n }\n /**\n * Uniformly scales the mesh to fit inside of a unit cube (1 X 1 X 1 units)\n * @param includeDescendants Use the hierarchy's bounding box instead of the mesh's bounding box. Default is false\n * @param ignoreRotation ignore rotation when computing the scale (ie. object will be axis aligned). Default is false\n * @param predicate predicate that is passed in to getHierarchyBoundingVectors when selecting which object should be included when scaling\n * @returns the current mesh\n */\n normalizeToUnitCube(includeDescendants = true, ignoreRotation = false, predicate) {\n return super.normalizeToUnitCube(includeDescendants, ignoreRotation, predicate);\n }\n /** Gets a boolean indicating if this mesh has skinning data and an attached skeleton */\n get useBones() {\n return ((this.skeleton &&\n this.getScene().skeletonsEnabled &&\n this.isVerticesDataPresent(VertexBuffer.MatricesIndicesKind) &&\n this.isVerticesDataPresent(VertexBuffer.MatricesWeightsKind)));\n }\n /** @internal */\n _preActivate() { }\n /**\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _preActivateForIntermediateRendering(renderId) { }\n /**\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _activate(renderId, intermediateRendering) {\n this._renderId = renderId;\n return true;\n }\n /** @internal */\n _postActivate() {\n // Do nothing\n }\n /** @internal */\n _freeze() {\n // Do nothing\n }\n /** @internal */\n _unFreeze() {\n // Do nothing\n }\n /**\n * Gets the current world matrix\n * @returns a Matrix\n */\n getWorldMatrix() {\n if (this._masterMesh && this.billboardMode === TransformNode.BILLBOARDMODE_NONE) {\n return this._masterMesh.getWorldMatrix();\n }\n return super.getWorldMatrix();\n }\n /** @internal */\n _getWorldMatrixDeterminant() {\n if (this._masterMesh) {\n return this._masterMesh._getWorldMatrixDeterminant();\n }\n return super._getWorldMatrixDeterminant();\n }\n /**\n * Gets a boolean indicating if this mesh is an instance or a regular mesh\n */\n get isAnInstance() {\n return false;\n }\n /**\n * Gets a boolean indicating if this mesh has instances\n */\n get hasInstances() {\n return false;\n }\n /**\n * Gets a boolean indicating if this mesh has thin instances\n */\n get hasThinInstances() {\n return false;\n }\n // ================================== Point of View Movement =================================\n /**\n * Perform relative position change from the point of view of behind the front of the mesh.\n * This is performed taking into account the meshes current rotation, so you do not have to care.\n * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.\n * @param amountRight defines the distance on the right axis\n * @param amountUp defines the distance on the up axis\n * @param amountForward defines the distance on the forward axis\n * @returns the current mesh\n */\n movePOV(amountRight, amountUp, amountForward) {\n this.position.addInPlace(this.calcMovePOV(amountRight, amountUp, amountForward));\n return this;\n }\n /**\n * Calculate relative position change from the point of view of behind the front of the mesh.\n * This is performed taking into account the meshes current rotation, so you do not have to care.\n * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.\n * @param amountRight defines the distance on the right axis\n * @param amountUp defines the distance on the up axis\n * @param amountForward defines the distance on the forward axis\n * @returns the new displacement vector\n */\n calcMovePOV(amountRight, amountUp, amountForward) {\n const rotMatrix = new Matrix();\n const rotQuaternion = this.rotationQuaternion ? this.rotationQuaternion : Quaternion.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z);\n rotQuaternion.toRotationMatrix(rotMatrix);\n const translationDelta = Vector3.Zero();\n const defForwardMult = this.definedFacingForward ? -1 : 1;\n Vector3.TransformCoordinatesFromFloatsToRef(amountRight * defForwardMult, amountUp, amountForward * defForwardMult, rotMatrix, translationDelta);\n return translationDelta;\n }\n // ================================== Point of View Rotation =================================\n /**\n * Perform relative rotation change from the point of view of behind the front of the mesh.\n * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.\n * @param flipBack defines the flip\n * @param twirlClockwise defines the twirl\n * @param tiltRight defines the tilt\n * @returns the current mesh\n */\n rotatePOV(flipBack, twirlClockwise, tiltRight) {\n this.rotation.addInPlace(this.calcRotatePOV(flipBack, twirlClockwise, tiltRight));\n return this;\n }\n /**\n * Calculate relative rotation change from the point of view of behind the front of the mesh.\n * Supports definition of mesh facing forward or backward {@link definedFacingForwardSearch | See definedFacingForwardSearch }.\n * @param flipBack defines the flip\n * @param twirlClockwise defines the twirl\n * @param tiltRight defines the tilt\n * @returns the new rotation vector\n */\n calcRotatePOV(flipBack, twirlClockwise, tiltRight) {\n const defForwardMult = this.definedFacingForward ? 1 : -1;\n return new Vector3(flipBack * defForwardMult, twirlClockwise, tiltRight * defForwardMult);\n }\n /**\n * @internal\n */\n _refreshBoundingInfo(data, bias) {\n if (data) {\n const extend = extractMinAndMax(data, 0, this.getTotalVertices(), bias);\n if (this._boundingInfo) {\n this._boundingInfo.reConstruct(extend.minimum, extend.maximum);\n }\n else {\n this._boundingInfo = new BoundingInfo(extend.minimum, extend.maximum);\n }\n }\n if (this.subMeshes) {\n for (let index = 0; index < this.subMeshes.length; index++) {\n this.subMeshes[index].refreshBoundingInfo(data);\n }\n }\n this._updateBoundingInfo();\n }\n /**\n * @internal\n */\n _refreshBoundingInfoDirect(extend) {\n if (this._boundingInfo) {\n this._boundingInfo.reConstruct(extend.minimum, extend.maximum);\n }\n else {\n this._boundingInfo = new BoundingInfo(extend.minimum, extend.maximum);\n }\n if (this.subMeshes) {\n for (let index = 0; index < this.subMeshes.length; index++) {\n this.subMeshes[index].refreshBoundingInfo(null);\n }\n }\n this._updateBoundingInfo();\n }\n // This function is only here so we can apply the nativeOverride decorator.\n static _ApplySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData) {\n applySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData);\n }\n /** @internal */\n _getData(options, data, kind = VertexBuffer.PositionKind) {\n const cache = options.cache;\n const getVertexData = (kind) => {\n if (cache) {\n const vertexData = (cache._vertexData || (cache._vertexData = {}));\n if (!vertexData[kind]) {\n this.copyVerticesData(kind, vertexData);\n }\n return vertexData[kind];\n }\n return this.getVerticesData(kind);\n };\n data || (data = getVertexData(kind));\n if (!data) {\n return null;\n }\n if (cache) {\n if (cache._outputData) {\n cache._outputData.set(data);\n }\n else {\n cache._outputData = new Float32Array(data);\n }\n data = cache._outputData;\n }\n else if ((options.applyMorph && this.morphTargetManager) || (options.applySkeleton && this.skeleton)) {\n data = data.slice();\n }\n if (options.applyMorph && this.morphTargetManager) {\n applyMorph(data, kind, this.morphTargetManager);\n }\n if (options.applySkeleton && this.skeleton) {\n const matricesIndicesData = getVertexData(VertexBuffer.MatricesIndicesKind);\n const matricesWeightsData = getVertexData(VertexBuffer.MatricesWeightsKind);\n if (matricesWeightsData && matricesIndicesData) {\n const needExtras = this.numBoneInfluencers > 4;\n const matricesIndicesExtraData = needExtras ? getVertexData(VertexBuffer.MatricesIndicesExtraKind) : null;\n const matricesWeightsExtraData = needExtras ? getVertexData(VertexBuffer.MatricesWeightsExtraKind) : null;\n const skeletonMatrices = this.skeleton.getTransformMatrices(this);\n AbstractMesh._ApplySkeleton(data, kind, skeletonMatrices, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData);\n }\n }\n if (options.updatePositionsArray !== false && kind === VertexBuffer.PositionKind) {\n const positions = this._internalAbstractMeshDataInfo._positions || [];\n const previousLength = positions.length;\n positions.length = data.length / 3;\n if (previousLength < positions.length) {\n for (let positionIndex = previousLength; positionIndex < positions.length; positionIndex++) {\n positions[positionIndex] = new Vector3();\n }\n }\n for (let positionIndex = 0, dataIndex = 0; positionIndex < positions.length; positionIndex++, dataIndex += 3) {\n positions[positionIndex].copyFromFloats(data[dataIndex], data[dataIndex + 1], data[dataIndex + 2]);\n }\n this._internalAbstractMeshDataInfo._positions = positions;\n }\n return data;\n }\n /**\n * Get the normals vertex data and optionally apply skeleton and morphing.\n * @param applySkeleton defines whether to apply the skeleton\n * @param applyMorph defines whether to apply the morph target\n * @returns the normals data\n */\n getNormalsData(applySkeleton = false, applyMorph = false) {\n return this._getData({ applySkeleton, applyMorph, updatePositionsArray: false }, null, VertexBuffer.NormalKind);\n }\n /**\n * Get the position vertex data and optionally apply skeleton and morphing.\n * @param applySkeleton defines whether to apply the skeleton\n * @param applyMorph defines whether to apply the morph target\n * @param data defines the position data to apply the skeleton and morph to\n * @returns the position data\n */\n getPositionData(applySkeleton = false, applyMorph = false, data = null) {\n return this._getData({ applySkeleton, applyMorph, updatePositionsArray: false }, data, VertexBuffer.PositionKind);\n }\n /** @internal */\n _updateBoundingInfo() {\n if (this._boundingInfo) {\n this._boundingInfo.update(this.worldMatrixFromCache);\n }\n else {\n this._boundingInfo = new BoundingInfo(Vector3.Zero(), Vector3.Zero(), this.worldMatrixFromCache);\n }\n this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache);\n return this;\n }\n /**\n * @internal\n */\n _updateSubMeshesBoundingInfo(matrix) {\n if (!this.subMeshes) {\n return this;\n }\n const count = this.subMeshes.length;\n for (let subIndex = 0; subIndex < count; subIndex++) {\n const subMesh = this.subMeshes[subIndex];\n if (count > 1 || !subMesh.IsGlobal) {\n subMesh.updateBoundingInfo(matrix);\n }\n }\n return this;\n }\n /** @internal */\n _afterComputeWorldMatrix() {\n if (this.doNotSyncBoundingInfo) {\n return;\n }\n // Bounding info\n this._boundingInfoIsDirty = true;\n }\n /**\n * Returns `true` if the mesh is within the frustum defined by the passed array of planes.\n * A mesh is in the frustum if its bounding box intersects the frustum\n * @param frustumPlanes defines the frustum to test\n * @returns true if the mesh is in the frustum planes\n */\n isInFrustum(frustumPlanes) {\n return this.getBoundingInfo().isInFrustum(frustumPlanes, this.cullingStrategy);\n }\n /**\n * Returns `true` if the mesh is completely in the frustum defined be the passed array of planes.\n * A mesh is completely in the frustum if its bounding box it completely inside the frustum.\n * @param frustumPlanes defines the frustum to test\n * @returns true if the mesh is completely in the frustum planes\n */\n isCompletelyInFrustum(frustumPlanes) {\n return this.getBoundingInfo().isCompletelyInFrustum(frustumPlanes);\n }\n /**\n * True if the mesh intersects another mesh or a SolidParticle object\n * @param mesh defines a target mesh or SolidParticle to test\n * @param precise Unless the parameter `precise` is set to `true` the intersection is computed according to Axis Aligned Bounding Boxes (AABB), else according to OBB (Oriented BBoxes)\n * @param includeDescendants Can be set to true to test if the mesh defined in parameters intersects with the current mesh or any child meshes\n * @returns true if there is an intersection\n */\n intersectsMesh(mesh, precise = false, includeDescendants) {\n const boundingInfo = this.getBoundingInfo();\n const otherBoundingInfo = mesh.getBoundingInfo();\n if (boundingInfo.intersects(otherBoundingInfo, precise)) {\n return true;\n }\n if (includeDescendants) {\n for (const child of this.getChildMeshes()) {\n if (child.intersectsMesh(mesh, precise, true)) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Returns true if the passed point (Vector3) is inside the mesh bounding box\n * @param point defines the point to test\n * @returns true if there is an intersection\n */\n intersectsPoint(point) {\n return this.getBoundingInfo().intersectsPoint(point);\n }\n // Collisions\n /**\n * Gets or sets a boolean indicating that this mesh can be used in the collision engine\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions\n */\n get checkCollisions() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions;\n }\n set checkCollisions(collisionEnabled) {\n this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions = collisionEnabled;\n }\n /**\n * Gets Collider object used to compute collisions (not physics)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions\n */\n get collider() {\n return this._internalAbstractMeshDataInfo._meshCollisionData._collider;\n }\n /**\n * Move the mesh using collision engine\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions\n * @param displacement defines the requested displacement vector\n * @returns the current mesh\n */\n moveWithCollisions(displacement) {\n const globalPosition = this.getAbsolutePosition();\n globalPosition.addToRef(this.ellipsoidOffset, this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);\n const coordinator = this.getScene().collisionCoordinator;\n if (!this._internalAbstractMeshDataInfo._meshCollisionData._collider) {\n this._internalAbstractMeshDataInfo._meshCollisionData._collider = coordinator.createCollider();\n }\n this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius = this.ellipsoid;\n coordinator.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions, displacement, this._internalAbstractMeshDataInfo._meshCollisionData._collider, this.collisionRetryCount, this, this._onCollisionPositionChange, this.uniqueId);\n return this;\n }\n // Collisions\n /**\n * @internal\n */\n _collideForSubMesh(subMesh, transformMatrix, collider) {\n this._generatePointsArray();\n if (!this._positions) {\n return this;\n }\n // Transformation\n if (!subMesh._lastColliderWorldVertices || !subMesh._lastColliderTransformMatrix.equals(transformMatrix)) {\n subMesh._lastColliderTransformMatrix = transformMatrix.clone();\n subMesh._lastColliderWorldVertices = [];\n subMesh._trianglePlanes = [];\n const start = subMesh.verticesStart;\n const end = subMesh.verticesStart + subMesh.verticesCount;\n for (let i = start; i < end; i++) {\n subMesh._lastColliderWorldVertices.push(Vector3.TransformCoordinates(this._positions[i], transformMatrix));\n }\n }\n // Collide\n collider._collide(subMesh._trianglePlanes, subMesh._lastColliderWorldVertices, this.getIndices(), subMesh.indexStart, subMesh.indexStart + subMesh.indexCount, subMesh.verticesStart, !!subMesh.getMaterial(), this, this._shouldConvertRHS(), subMesh.getMaterial()?.fillMode === 7);\n return this;\n }\n /**\n * @internal\n */\n _processCollisionsForSubMeshes(collider, transformMatrix) {\n const subMeshes = this._scene.getCollidingSubMeshCandidates(this, collider);\n const len = subMeshes.length;\n for (let index = 0; index < len; index++) {\n const subMesh = subMeshes.data[index];\n // Bounding test\n if (len > 1 && !subMesh._checkCollision(collider)) {\n continue;\n }\n this._collideForSubMesh(subMesh, transformMatrix, collider);\n }\n return this;\n }\n /** @internal */\n _shouldConvertRHS() {\n return false;\n }\n /**\n * @internal\n */\n _checkCollision(collider) {\n // Bounding box test\n if (!this.getBoundingInfo()._checkCollision(collider)) {\n return this;\n }\n // Transformation matrix\n const collisionsScalingMatrix = TmpVectors.Matrix[0];\n const collisionsTransformMatrix = TmpVectors.Matrix[1];\n Matrix.ScalingToRef(1.0 / collider._radius.x, 1.0 / collider._radius.y, 1.0 / collider._radius.z, collisionsScalingMatrix);\n this.worldMatrixFromCache.multiplyToRef(collisionsScalingMatrix, collisionsTransformMatrix);\n this._processCollisionsForSubMeshes(collider, collisionsTransformMatrix);\n return this;\n }\n // Picking\n /** @internal */\n _generatePointsArray() {\n return false;\n }\n /**\n * Checks if the passed Ray intersects with the mesh. A mesh triangle can be picked both from its front and back sides,\n * irrespective of orientation.\n * @param ray defines the ray to use. It should be in the mesh's LOCAL coordinate space.\n * @param fastCheck defines if fast mode (but less precise) must be used (false by default)\n * @param trianglePredicate defines an optional predicate used to select faces when a mesh intersection is detected\n * @param onlyBoundingInfo defines a boolean indicating if picking should only happen using bounding info (false by default)\n * @param worldToUse defines the world matrix to use to get the world coordinate of the intersection point\n * @param skipBoundingInfo a boolean indicating if we should skip the bounding info check\n * @returns the picking info\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/mesh_intersect\n */\n intersects(ray, fastCheck, trianglePredicate, onlyBoundingInfo = false, worldToUse, skipBoundingInfo = false) {\n const pickingInfo = new PickingInfo();\n const className = this.getClassName();\n const intersectionThreshold = className === \"InstancedLinesMesh\" || className === \"LinesMesh\" || className === \"GreasedLineMesh\" ? this.intersectionThreshold : 0;\n const boundingInfo = this.getBoundingInfo();\n if (!this.subMeshes) {\n return pickingInfo;\n }\n if (!skipBoundingInfo &&\n (!ray.intersectsSphere(boundingInfo.boundingSphere, intersectionThreshold) || !ray.intersectsBox(boundingInfo.boundingBox, intersectionThreshold))) {\n return pickingInfo;\n }\n if (onlyBoundingInfo) {\n pickingInfo.hit = skipBoundingInfo ? false : true;\n pickingInfo.pickedMesh = skipBoundingInfo ? null : this;\n pickingInfo.distance = skipBoundingInfo ? 0 : Vector3.Distance(ray.origin, boundingInfo.boundingSphere.center);\n pickingInfo.subMeshId = 0;\n return pickingInfo;\n }\n if (!this._generatePointsArray()) {\n return pickingInfo;\n }\n let intersectInfo = null;\n const subMeshes = this._scene.getIntersectingSubMeshCandidates(this, ray);\n const len = subMeshes.length;\n // Check if all submeshes are using a material that don't allow picking (point/lines rendering)\n // if no submesh can be picked that way, then fallback to BBox picking\n let anySubmeshSupportIntersect = false;\n for (let index = 0; index < len; index++) {\n const subMesh = subMeshes.data[index];\n const material = subMesh.getMaterial();\n if (!material) {\n continue;\n }\n if (material.fillMode == 7 ||\n material.fillMode == 0 ||\n material.fillMode == 1 ||\n material.fillMode == 2 ||\n material.fillMode == 4) {\n anySubmeshSupportIntersect = true;\n break;\n }\n }\n // no sub mesh support intersection, fallback to BBox that has already be done\n if (!anySubmeshSupportIntersect) {\n pickingInfo.hit = true;\n pickingInfo.pickedMesh = this;\n pickingInfo.distance = Vector3.Distance(ray.origin, boundingInfo.boundingSphere.center);\n pickingInfo.subMeshId = -1;\n return pickingInfo;\n }\n // at least 1 submesh supports intersection, keep going\n for (let index = 0; index < len; index++) {\n const subMesh = subMeshes.data[index];\n // Bounding test\n if (len > 1 && !skipBoundingInfo && !subMesh.canIntersects(ray)) {\n continue;\n }\n const currentIntersectInfo = subMesh.intersects(ray, this._positions, this.getIndices(), fastCheck, trianglePredicate);\n if (currentIntersectInfo) {\n if (fastCheck || !intersectInfo || currentIntersectInfo.distance < intersectInfo.distance) {\n intersectInfo = currentIntersectInfo;\n intersectInfo.subMeshId = index;\n if (fastCheck) {\n break;\n }\n }\n }\n }\n if (intersectInfo) {\n // Get picked point\n const world = worldToUse ?? this.getWorldMatrix();\n const worldOrigin = TmpVectors.Vector3[0];\n const direction = TmpVectors.Vector3[1];\n Vector3.TransformCoordinatesToRef(ray.origin, world, worldOrigin);\n ray.direction.scaleToRef(intersectInfo.distance, direction);\n const worldDirection = Vector3.TransformNormal(direction, world);\n const pickedPoint = worldDirection.addInPlace(worldOrigin);\n // Return result\n pickingInfo.hit = true;\n pickingInfo.distance = Vector3.Distance(worldOrigin, pickedPoint);\n pickingInfo.pickedPoint = pickedPoint;\n pickingInfo.pickedMesh = this;\n pickingInfo.bu = intersectInfo.bu || 0;\n pickingInfo.bv = intersectInfo.bv || 0;\n pickingInfo.subMeshFaceId = intersectInfo.faceId;\n pickingInfo.faceId = intersectInfo.faceId + subMeshes.data[intersectInfo.subMeshId].indexStart / (this.getClassName().indexOf(\"LinesMesh\") !== -1 ? 2 : 3);\n pickingInfo.subMeshId = intersectInfo.subMeshId;\n return pickingInfo;\n }\n return pickingInfo;\n }\n /**\n * Clones the current mesh\n * @param name defines the mesh name\n * @param newParent defines the new mesh parent\n * @param doNotCloneChildren defines a boolean indicating that children must not be cloned (false by default)\n * @returns the new mesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n clone(name, newParent, doNotCloneChildren) {\n return null;\n }\n /**\n * Disposes all the submeshes of the current mesh\n * @param immediate should dispose the effects immediately or not\n * @returns the current mesh\n */\n releaseSubMeshes(immediate = false) {\n if (this.subMeshes) {\n while (this.subMeshes.length) {\n this.subMeshes[0].dispose(immediate);\n }\n }\n else {\n this.subMeshes = [];\n }\n return this;\n }\n /**\n * Releases resources associated with this abstract mesh.\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 let index;\n const scene = this.getScene();\n // mesh map release.\n if (this._scene.useMaterialMeshMap) {\n // remove from material mesh map id needed\n if (this._internalAbstractMeshDataInfo._material && this._internalAbstractMeshDataInfo._material.meshMap) {\n this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId] = undefined;\n }\n }\n // Smart Array Retainers.\n scene.freeActiveMeshes();\n scene.freeRenderingGroups();\n if (scene.renderingManager.maintainStateBetweenFrames) {\n scene.renderingManager.restoreDispachedFlags();\n }\n // Action manager\n if (this.actionManager !== undefined && this.actionManager !== null) {\n // If we are the only mesh using the action manager, dispose of the action manager too unless it has opted out from that behavior\n if (this.actionManager.disposeWhenUnowned && !this._scene.meshes.some((m) => m !== this && m.actionManager === this.actionManager)) {\n this.actionManager.dispose();\n }\n this.actionManager = null;\n }\n // Skeleton\n this._internalAbstractMeshDataInfo._skeleton = null;\n if (this._transformMatrixTexture) {\n this._transformMatrixTexture.dispose();\n this._transformMatrixTexture = null;\n }\n // Intersections in progress\n for (index = 0; index < this._intersectionsInProgress.length; index++) {\n const other = this._intersectionsInProgress[index];\n const pos = other._intersectionsInProgress.indexOf(this);\n other._intersectionsInProgress.splice(pos, 1);\n }\n this._intersectionsInProgress.length = 0;\n // Lights\n const lights = scene.lights;\n lights.forEach((light) => {\n let meshIndex = light.includedOnlyMeshes.indexOf(this);\n if (meshIndex !== -1) {\n light.includedOnlyMeshes.splice(meshIndex, 1);\n }\n meshIndex = light.excludedMeshes.indexOf(this);\n if (meshIndex !== -1) {\n light.excludedMeshes.splice(meshIndex, 1);\n }\n // Shadow generators\n const generators = light.getShadowGenerators();\n if (generators) {\n const iterator = generators.values();\n for (let key = iterator.next(); key.done !== true; key = iterator.next()) {\n const generator = key.value;\n const shadowMap = generator.getShadowMap();\n if (shadowMap && shadowMap.renderList) {\n meshIndex = shadowMap.renderList.indexOf(this);\n if (meshIndex !== -1) {\n shadowMap.renderList.splice(meshIndex, 1);\n }\n }\n }\n }\n });\n // SubMeshes\n if (this.getClassName() !== \"InstancedMesh\" || this.getClassName() !== \"InstancedLinesMesh\") {\n this.releaseSubMeshes(true);\n }\n // Query\n const engine = scene.getEngine();\n if (this._occlusionQuery !== null) {\n this.isOcclusionQueryInProgress = false;\n engine.deleteQuery(this._occlusionQuery);\n this._occlusionQuery = null;\n }\n // Engine\n engine.wipeCaches();\n // Remove from scene\n scene.removeMesh(this);\n if (this._parentContainer) {\n const index = this._parentContainer.meshes.indexOf(this);\n if (index > -1) {\n this._parentContainer.meshes.splice(index, 1);\n }\n this._parentContainer = null;\n }\n if (disposeMaterialAndTextures) {\n if (this.material) {\n if (this.material.getClassName() === \"MultiMaterial\") {\n this.material.dispose(false, true, true);\n }\n else {\n this.material.dispose(false, true);\n }\n }\n }\n if (!doNotRecurse) {\n // Particles\n for (index = 0; index < scene.particleSystems.length; index++) {\n if (scene.particleSystems[index].emitter === this) {\n scene.particleSystems[index].dispose();\n index--;\n }\n }\n }\n // facet data\n if (this._internalAbstractMeshDataInfo._facetData.facetDataEnabled) {\n this.disableFacetData();\n }\n this._uniformBuffer.dispose();\n this.onAfterWorldMatrixUpdateObservable.clear();\n this.onCollideObservable.clear();\n this.onCollisionPositionChangeObservable.clear();\n this.onRebuildObservable.clear();\n super.dispose(doNotRecurse, disposeMaterialAndTextures);\n }\n // Facet data\n /** @internal */\n _initFacetData() {\n const data = this._internalAbstractMeshDataInfo._facetData;\n if (!data.facetNormals) {\n data.facetNormals = [];\n }\n if (!data.facetPositions) {\n data.facetPositions = [];\n }\n if (!data.facetPartitioning) {\n data.facetPartitioning = new Array();\n }\n data.facetNb = (this.getIndices().length / 3) | 0;\n data.partitioningSubdivisions = data.partitioningSubdivisions ? data.partitioningSubdivisions : 10; // default nb of partitioning subdivisions = 10\n data.partitioningBBoxRatio = data.partitioningBBoxRatio ? data.partitioningBBoxRatio : 1.01; // default ratio 1.01 = the partitioning is 1% bigger than the bounding box\n for (let f = 0; f < data.facetNb; f++) {\n data.facetNormals[f] = Vector3.Zero();\n data.facetPositions[f] = Vector3.Zero();\n }\n data.facetDataEnabled = true;\n return this;\n }\n /**\n * Updates the mesh facetData arrays and the internal partitioning when the mesh is morphed or updated.\n * This method can be called within the render loop.\n * You don't need to call this method by yourself in the render loop when you update/morph a mesh with the methods CreateXXX() as they automatically manage this computation\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n updateFacetData() {\n const data = this._internalAbstractMeshDataInfo._facetData;\n if (!data.facetDataEnabled) {\n this._initFacetData();\n }\n const positions = this.getVerticesData(VertexBuffer.PositionKind);\n const indices = this.getIndices();\n const normals = this.getVerticesData(VertexBuffer.NormalKind);\n const bInfo = this.getBoundingInfo();\n if (data.facetDepthSort && !data.facetDepthSortEnabled) {\n // init arrays, matrix and sort function on first call\n data.facetDepthSortEnabled = true;\n if (indices instanceof Uint16Array) {\n data.depthSortedIndices = new Uint16Array(indices);\n }\n else if (indices instanceof Uint32Array) {\n data.depthSortedIndices = new Uint32Array(indices);\n }\n else {\n let needs32bits = false;\n for (let i = 0; i < indices.length; i++) {\n if (indices[i] > 65535) {\n needs32bits = true;\n break;\n }\n }\n if (needs32bits) {\n data.depthSortedIndices = new Uint32Array(indices);\n }\n else {\n data.depthSortedIndices = new Uint16Array(indices);\n }\n }\n data.facetDepthSortFunction = function (f1, f2) {\n return f2.sqDistance - f1.sqDistance;\n };\n if (!data.facetDepthSortFrom) {\n const camera = this.getScene().activeCamera;\n data.facetDepthSortFrom = camera ? camera.position : Vector3.Zero();\n }\n data.depthSortedFacets = [];\n for (let f = 0; f < data.facetNb; f++) {\n const depthSortedFacet = { ind: f * 3, sqDistance: 0.0 };\n data.depthSortedFacets.push(depthSortedFacet);\n }\n data.invertedMatrix = Matrix.Identity();\n data.facetDepthSortOrigin = Vector3.Zero();\n }\n data.bbSize.x = bInfo.maximum.x - bInfo.minimum.x > Epsilon ? bInfo.maximum.x - bInfo.minimum.x : Epsilon;\n data.bbSize.y = bInfo.maximum.y - bInfo.minimum.y > Epsilon ? bInfo.maximum.y - bInfo.minimum.y : Epsilon;\n data.bbSize.z = bInfo.maximum.z - bInfo.minimum.z > Epsilon ? bInfo.maximum.z - bInfo.minimum.z : Epsilon;\n let bbSizeMax = data.bbSize.x > data.bbSize.y ? data.bbSize.x : data.bbSize.y;\n bbSizeMax = bbSizeMax > data.bbSize.z ? bbSizeMax : data.bbSize.z;\n data.subDiv.max = data.partitioningSubdivisions;\n data.subDiv.X = Math.floor((data.subDiv.max * data.bbSize.x) / bbSizeMax); // adjust the number of subdivisions per axis\n data.subDiv.Y = Math.floor((data.subDiv.max * data.bbSize.y) / bbSizeMax); // according to each bbox size per axis\n data.subDiv.Z = Math.floor((data.subDiv.max * data.bbSize.z) / bbSizeMax);\n data.subDiv.X = data.subDiv.X < 1 ? 1 : data.subDiv.X; // at least one subdivision\n data.subDiv.Y = data.subDiv.Y < 1 ? 1 : data.subDiv.Y;\n data.subDiv.Z = data.subDiv.Z < 1 ? 1 : data.subDiv.Z;\n // set the parameters for ComputeNormals()\n data.facetParameters.facetNormals = this.getFacetLocalNormals();\n data.facetParameters.facetPositions = this.getFacetLocalPositions();\n data.facetParameters.facetPartitioning = this.getFacetLocalPartitioning();\n data.facetParameters.bInfo = bInfo;\n data.facetParameters.bbSize = data.bbSize;\n data.facetParameters.subDiv = data.subDiv;\n data.facetParameters.ratio = this.partitioningBBoxRatio;\n data.facetParameters.depthSort = data.facetDepthSort;\n if (data.facetDepthSort && data.facetDepthSortEnabled) {\n this.computeWorldMatrix(true);\n this._worldMatrix.invertToRef(data.invertedMatrix);\n Vector3.TransformCoordinatesToRef(data.facetDepthSortFrom, data.invertedMatrix, data.facetDepthSortOrigin);\n data.facetParameters.distanceTo = data.facetDepthSortOrigin;\n }\n data.facetParameters.depthSortedFacets = data.depthSortedFacets;\n if (normals) {\n VertexData.ComputeNormals(positions, indices, normals, data.facetParameters);\n }\n if (data.facetDepthSort && data.facetDepthSortEnabled) {\n data.depthSortedFacets.sort(data.facetDepthSortFunction);\n const l = (data.depthSortedIndices.length / 3) | 0;\n for (let f = 0; f < l; f++) {\n const sind = data.depthSortedFacets[f].ind;\n data.depthSortedIndices[f * 3] = indices[sind];\n data.depthSortedIndices[f * 3 + 1] = indices[sind + 1];\n data.depthSortedIndices[f * 3 + 2] = indices[sind + 2];\n }\n this.updateIndices(data.depthSortedIndices, undefined, true);\n }\n return this;\n }\n /**\n * Returns the facetLocalNormals array.\n * The normals are expressed in the mesh local spac\n * @returns an array of Vector3\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetLocalNormals() {\n const facetData = this._internalAbstractMeshDataInfo._facetData;\n if (!facetData.facetNormals) {\n this.updateFacetData();\n }\n return facetData.facetNormals;\n }\n /**\n * Returns the facetLocalPositions array.\n * The facet positions are expressed in the mesh local space\n * @returns an array of Vector3\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetLocalPositions() {\n const facetData = this._internalAbstractMeshDataInfo._facetData;\n if (!facetData.facetPositions) {\n this.updateFacetData();\n }\n return facetData.facetPositions;\n }\n /**\n * Returns the facetLocalPartitioning array\n * @returns an array of array of numbers\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetLocalPartitioning() {\n const facetData = this._internalAbstractMeshDataInfo._facetData;\n if (!facetData.facetPartitioning) {\n this.updateFacetData();\n }\n return facetData.facetPartitioning;\n }\n /**\n * Returns the i-th facet position in the world system.\n * This method allocates a new Vector3 per call\n * @param i defines the facet index\n * @returns a new Vector3\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetPosition(i) {\n const pos = Vector3.Zero();\n this.getFacetPositionToRef(i, pos);\n return pos;\n }\n /**\n * Sets the reference Vector3 with the i-th facet position in the world system\n * @param i defines the facet index\n * @param ref defines the target vector\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetPositionToRef(i, ref) {\n const localPos = this.getFacetLocalPositions()[i];\n const world = this.getWorldMatrix();\n Vector3.TransformCoordinatesToRef(localPos, world, ref);\n return this;\n }\n /**\n * Returns the i-th facet normal in the world system.\n * This method allocates a new Vector3 per call\n * @param i defines the facet index\n * @returns a new Vector3\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetNormal(i) {\n const norm = Vector3.Zero();\n this.getFacetNormalToRef(i, norm);\n return norm;\n }\n /**\n * Sets the reference Vector3 with the i-th facet normal in the world system\n * @param i defines the facet index\n * @param ref defines the target vector\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetNormalToRef(i, ref) {\n const localNorm = this.getFacetLocalNormals()[i];\n Vector3.TransformNormalToRef(localNorm, this.getWorldMatrix(), ref);\n return this;\n }\n /**\n * Returns the facets (in an array) in the same partitioning block than the one the passed coordinates are located (expressed in the mesh local system)\n * @param x defines x coordinate\n * @param y defines y coordinate\n * @param z defines z coordinate\n * @returns the array of facet indexes\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetsAtLocalCoordinates(x, y, z) {\n const bInfo = this.getBoundingInfo();\n const data = this._internalAbstractMeshDataInfo._facetData;\n const ox = Math.floor(((x - bInfo.minimum.x * data.partitioningBBoxRatio) * data.subDiv.X * data.partitioningBBoxRatio) / data.bbSize.x);\n const oy = Math.floor(((y - bInfo.minimum.y * data.partitioningBBoxRatio) * data.subDiv.Y * data.partitioningBBoxRatio) / data.bbSize.y);\n const oz = Math.floor(((z - bInfo.minimum.z * data.partitioningBBoxRatio) * data.subDiv.Z * data.partitioningBBoxRatio) / data.bbSize.z);\n if (ox < 0 || ox > data.subDiv.max || oy < 0 || oy > data.subDiv.max || oz < 0 || oz > data.subDiv.max) {\n return null;\n }\n return data.facetPartitioning[ox + data.subDiv.max * oy + data.subDiv.max * data.subDiv.max * oz];\n }\n /**\n * Returns the closest mesh facet index at (x,y,z) World coordinates, null if not found\n * @param x defines x coordinate\n * @param y defines y coordinate\n * @param z defines z coordinate\n * @param projected sets as the (x,y,z) world projection on the facet\n * @param checkFace if true (default false), only the facet \"facing\" to (x,y,z) or only the ones \"turning their backs\", according to the parameter \"facing\" are returned\n * @param facing if facing and checkFace are true, only the facet \"facing\" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet \"turning their backs\" to (x, y, z) are returned : negative dot (x, y, z) * facet position\n * @returns the face index if found (or null instead)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getClosestFacetAtCoordinates(x, y, z, projected, checkFace = false, facing = true) {\n const world = this.getWorldMatrix();\n const invMat = TmpVectors.Matrix[5];\n world.invertToRef(invMat);\n const invVect = TmpVectors.Vector3[8];\n Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, invMat, invVect); // transform (x,y,z) to coordinates in the mesh local space\n const closest = this.getClosestFacetAtLocalCoordinates(invVect.x, invVect.y, invVect.z, projected, checkFace, facing);\n if (projected) {\n // transform the local computed projected vector to world coordinates\n Vector3.TransformCoordinatesFromFloatsToRef(projected.x, projected.y, projected.z, world, projected);\n }\n return closest;\n }\n /**\n * Returns the closest mesh facet index at (x,y,z) local coordinates, null if not found\n * @param x defines x coordinate\n * @param y defines y coordinate\n * @param z defines z coordinate\n * @param projected sets as the (x,y,z) local projection on the facet\n * @param checkFace if true (default false), only the facet \"facing\" to (x,y,z) or only the ones \"turning their backs\", according to the parameter \"facing\" are returned\n * @param facing if facing and checkFace are true, only the facet \"facing\" to (x, y, z) are returned : positive dot (x, y, z) * facet position. If facing si false and checkFace is true, only the facet \"turning their backs\" to (x, y, z) are returned : negative dot (x, y, z) * facet position\n * @returns the face index if found (or null instead)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getClosestFacetAtLocalCoordinates(x, y, z, projected, checkFace = false, facing = true) {\n let closest = null;\n let tmpx = 0.0;\n let tmpy = 0.0;\n let tmpz = 0.0;\n let d = 0.0; // tmp dot facet normal * facet position\n let t0 = 0.0;\n let projx = 0.0;\n let projy = 0.0;\n let projz = 0.0;\n // Get all the facets in the same partitioning block than (x, y, z)\n const facetPositions = this.getFacetLocalPositions();\n const facetNormals = this.getFacetLocalNormals();\n const facetsInBlock = this.getFacetsAtLocalCoordinates(x, y, z);\n if (!facetsInBlock) {\n return null;\n }\n // Get the closest facet to (x, y, z)\n let shortest = Number.MAX_VALUE; // init distance vars\n let tmpDistance = shortest;\n let fib; // current facet in the block\n let norm; // current facet normal\n let p0; // current facet barycenter position\n // loop on all the facets in the current partitioning block\n for (let idx = 0; idx < facetsInBlock.length; idx++) {\n fib = facetsInBlock[idx];\n norm = facetNormals[fib];\n p0 = facetPositions[fib];\n d = (x - p0.x) * norm.x + (y - p0.y) * norm.y + (z - p0.z) * norm.z;\n if (!checkFace || (checkFace && facing && d >= 0.0) || (checkFace && !facing && d <= 0.0)) {\n // compute (x,y,z) projection on the facet = (projx, projy, projz)\n d = norm.x * p0.x + norm.y * p0.y + norm.z * p0.z;\n t0 = -(norm.x * x + norm.y * y + norm.z * z - d) / (norm.x * norm.x + norm.y * norm.y + norm.z * norm.z);\n projx = x + norm.x * t0;\n projy = y + norm.y * t0;\n projz = z + norm.z * t0;\n tmpx = projx - x;\n tmpy = projy - y;\n tmpz = projz - z;\n tmpDistance = tmpx * tmpx + tmpy * tmpy + tmpz * tmpz; // compute length between (x, y, z) and its projection on the facet\n if (tmpDistance < shortest) {\n // just keep the closest facet to (x, y, z)\n shortest = tmpDistance;\n closest = fib;\n if (projected) {\n projected.x = projx;\n projected.y = projy;\n projected.z = projz;\n }\n }\n }\n }\n return closest;\n }\n /**\n * Returns the object \"parameter\" set with all the expected parameters for facetData computation by ComputeNormals()\n * @returns the parameters\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n getFacetDataParameters() {\n return this._internalAbstractMeshDataInfo._facetData.facetParameters;\n }\n /**\n * Disables the feature FacetData and frees the related memory\n * @returns the current mesh\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/facetData\n */\n disableFacetData() {\n const facetData = this._internalAbstractMeshDataInfo._facetData;\n if (facetData.facetDataEnabled) {\n facetData.facetDataEnabled = false;\n facetData.facetPositions = [];\n facetData.facetNormals = [];\n facetData.facetPartitioning = new Array();\n facetData.facetParameters = {};\n facetData.depthSortedIndices = new Uint32Array(0);\n }\n return this;\n }\n /**\n * Updates the AbstractMesh indices array\n * @param indices defines the data source\n * @param offset defines the offset in the index buffer where to store the new data (can be null)\n * @param gpuMemoryOnly defines a boolean indicating that only the GPU memory must be updated leaving the CPU version of the indices unchanged (false by default)\n * @returns the current mesh\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n updateIndices(indices, offset, gpuMemoryOnly = false) {\n return this;\n }\n /**\n * Creates new normals data for the mesh\n * @param updatable defines if the normal vertex buffer must be flagged as updatable\n * @returns the current mesh\n */\n createNormals(updatable) {\n const positions = this.getVerticesData(VertexBuffer.PositionKind);\n const indices = this.getIndices();\n let normals;\n if (this.isVerticesDataPresent(VertexBuffer.NormalKind)) {\n normals = this.getVerticesData(VertexBuffer.NormalKind);\n }\n else {\n normals = [];\n }\n VertexData.ComputeNormals(positions, indices, normals, { useRightHandedSystem: this.getScene().useRightHandedSystem });\n this.setVerticesData(VertexBuffer.NormalKind, normals, updatable);\n return this;\n }\n /**\n * Align the mesh with a normal\n * @param normal defines the normal to use\n * @param upDirection can be used to redefined the up vector to use (will use the (0, 1, 0) by default)\n * @returns the current mesh\n */\n alignWithNormal(normal, upDirection) {\n if (!upDirection) {\n upDirection = Axis.Y;\n }\n const axisX = TmpVectors.Vector3[0];\n const axisZ = TmpVectors.Vector3[1];\n Vector3.CrossToRef(upDirection, normal, axisZ);\n Vector3.CrossToRef(normal, axisZ, axisX);\n if (this.rotationQuaternion) {\n Quaternion.RotationQuaternionFromAxisToRef(axisX, normal, axisZ, this.rotationQuaternion);\n }\n else {\n Vector3.RotationFromAxisToRef(axisX, normal, axisZ, this.rotation);\n }\n return this;\n }\n /** @internal */\n _checkOcclusionQuery() {\n // Will be replaced by correct code if Occlusion queries are referenced\n return false;\n }\n // eslint-disable-next-line jsdoc/require-returns-check\n /**\n * Disables the mesh edge rendering mode\n * @returns the currentAbstractMesh\n */\n disableEdgesRendering() {\n throw _WarnImport(\"EdgesRenderer\");\n }\n // eslint-disable-next-line jsdoc/require-returns-check\n /**\n * Enables the edge rendering mode on the mesh.\n * This mode makes the mesh edges visible\n * @param epsilon defines the maximal distance between two angles to detect a face\n * @param checkVerticesInsteadOfIndices indicates that we should check vertex list directly instead of faces\n * @param options options to the edge renderer\n * @returns the currentAbstractMesh\n * @see https://www.babylonjs-playground.com/#19O9TU#0\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n enableEdgesRendering(epsilon, checkVerticesInsteadOfIndices, options) {\n throw _WarnImport(\"EdgesRenderer\");\n }\n /**\n * This function returns all of the particle systems in the scene that use the mesh as an emitter.\n * @returns an array of particle systems in the scene that use the mesh as an emitter\n */\n getConnectedParticleSystems() {\n return this._scene.particleSystems.filter((particleSystem) => particleSystem.emitter === this);\n }\n}\n/** No occlusion */\nAbstractMesh.OCCLUSION_TYPE_NONE = 0;\n/** Occlusion set to optimistic */\nAbstractMesh.OCCLUSION_TYPE_OPTIMISTIC = 1;\n/** Occlusion set to strict */\nAbstractMesh.OCCLUSION_TYPE_STRICT = 2;\n/** Use an accurate occlusion algorithm */\nAbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE = 0;\n/** Use a conservative occlusion algorithm */\nAbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE = 1;\n/** Default culling strategy : this is an exclusion test and it's the more accurate.\n * Test order :\n * Is the bounding sphere outside the frustum ?\n * If not, are the bounding box vertices outside the frustum ?\n * It not, then the cullable object is in the frustum.\n */\nAbstractMesh.CULLINGSTRATEGY_STANDARD = 0;\n/** Culling strategy : Bounding Sphere Only.\n * This is an exclusion test. It's faster than the standard strategy because the bounding box is not tested.\n * It's also less accurate than the standard because some not visible objects can still be selected.\n * Test : is the bounding sphere outside the frustum ?\n * If not, then the cullable object is in the frustum.\n */\nAbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1;\n/** Culling strategy : Optimistic Inclusion.\n * This in an inclusion test first, then the standard exclusion test.\n * This can be faster when a cullable object is expected to be almost always in the camera frustum.\n * This could also be a little slower than the standard test when the tested object center is not the frustum but one of its bounding box vertex is still inside.\n * Anyway, it's as accurate as the standard strategy.\n * Test :\n * Is the cullable object bounding sphere center in the frustum ?\n * If not, apply the default culling strategy.\n */\nAbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2;\n/** Culling strategy : Optimistic Inclusion then Bounding Sphere Only.\n * This in an inclusion test first, then the bounding sphere only exclusion test.\n * This can be the fastest test when a cullable object is expected to be almost always in the camera frustum.\n * This could also be a little slower than the BoundingSphereOnly strategy when the tested object center is not in the frustum but its bounding sphere still intersects it.\n * It's less accurate than the standard strategy and as accurate as the BoundingSphereOnly strategy.\n * Test :\n * Is the cullable object bounding sphere center in the frustum ?\n * If not, apply the Bounding Sphere Only strategy. No Bounding Box is tested here.\n */\nAbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3;\n__decorate([\n nativeOverride.filter((...[data, matricesIndicesData, matricesWeightsData, matricesIndicesExtraData, matricesWeightsExtraData]) => !Array.isArray(data) &&\n !Array.isArray(matricesIndicesData) &&\n !Array.isArray(matricesWeightsData) &&\n !Array.isArray(matricesIndicesExtraData) &&\n !Array.isArray(matricesWeightsExtraData))\n], AbstractMesh, \"_ApplySkeleton\", null);\nRegisterClass(\"BABYLON.AbstractMesh\", AbstractMesh);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,UAAU,EAAEC,MAAM,EAAEC,OAAO,EA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AI,EAAE;IAClB,OAAO,IAAI;EACf;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACI;EACA4S,eAAeA,CAAC5S,IAAI,EAAED,IAAI,EAAE8S,SAAS,EAAEC,MAAM,EAAE;IAC3C,OAAO,IAAI;EACf;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACI;EACAC,kBAAkBA,CAAC/S,IAAI,EAAED,IAAI,EAAEiT,aAAa,EAAEC,YAAY,EAAE;IACxD,OAAO,IAAI;EACf;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;EACI;EACAC,UAAUA,CAACC,OAAO,EAAEC,aAAa,EAAE;IAC/B,OAAO,IAAI;EACf;EACA;AACJ;AACA;AACA;AACA;EACI;EACAC,qBAAqBA,CAACrT,IAAI,EAAE;IACxB,OAAO,KAAK;EAChB;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;EACIsT,eAAeA,CAAA,EAAG;IACd,IAAI,IAAI,CAAChG,WAAW,EAAE;MAClB,OAAO,IAAI,CAACA,WAAW,CAACgG,eAAe,CAAC,CAAC;IAC7C;IACA,IAAI,IAAI,CAAC9F,oBAAoB,EAAE;MAC3B,IAAI,CAACA,oBAAoB,GAAG,KAAK;MACjC;MACA,IAAI,CAAC+F,mBAAmB,CAAC,CAAC;IAC9B;IACA;IACA,OAAO,IAAI,CAAChG,aAAa;EAC7B;EACA;AACJ;AACA;AACA;EACIiG,kBAAkBA,CAAA,EAAG;IAAA,IAAAC,qBAAA;IACjB,QAAAA,qBAAA,GAAO,IAAI,CAAC5M,eAAe,cAAA4M,qBAAA,cAAAA,qBAAA,GAAI,IAAI,CAACH,eAAe,CAAC,CAAC;EACzD;EACA;AACJ;AACA;AACA;AACA;EACII,eAAeA,CAAC5M,YAAY,EAAE;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UAAU,CAAC,CACPoB,cAAc,CAACqnB,MAAM,CAAC,CAAC,GAAG,CAAClnB,IAAI,EAAEuB,mBAAmB,EAAEC,mBAAmB,EAAEC,wBAAwB,EAAEC,wBAAwB,CAAC,KAAK,CAACkM,KAAK,CAACga,OAAO,CAAC5nB,IAAI,CAAC,IACnJ,CAAC4N,KAAK,CAACga,OAAO,CAACrmB,mBAAmB,CAAC,IACnC,CAACqM,KAAK,CAACga,OAAO,CAACpmB,mBAAmB,CAAC,IACnC,CAACoM,KAAK,CAACga,OAAO,CAACnmB,wBAAwB,CAAC,IACxC,CAACmM,KAAK,CAACga,OAAO,CAAClmB,wBAAwB,CAAC,CAAC,CAChD,EAAE8D,YAAY,EAAE,gBAAgB,EAAE,IAAI,CAAC;AACxC5F,aAAa,CAAC,sBAAsB,EAAE4F,YAAY,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}