1 |
- {"ast":null,"code":"import { Logger } from \"../Misc/logger.js\";\nimport { Observable } from \"../Misc/observable.js\";\nimport { Vector3 } from \"../Maths/math.vector.js\";\nimport { Color3 } from \"../Maths/math.color.js\";\nimport { Gizmo } from \"./gizmo.js\";\nimport { AxisDragGizmo } from \"./axisDragGizmo.js\";\nimport { PlaneDragGizmo } from \"./planeDragGizmo.js\";\nimport { UtilityLayerRenderer } from \"../Rendering/utilityLayerRenderer.js\";\n/**\n * Gizmo that enables dragging a mesh along 3 axis\n */\nexport class PositionGizmo extends Gizmo {\n get attachedMesh() {\n return this._meshAttached;\n }\n set attachedMesh(mesh) {\n this._meshAttached = mesh;\n this._nodeAttached = mesh;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n if (gizmo.isEnabled) {\n gizmo.attachedMesh = mesh;\n } else {\n gizmo.attachedMesh = null;\n }\n });\n }\n get attachedNode() {\n return this._nodeAttached;\n }\n set attachedNode(node) {\n this._meshAttached = null;\n this._nodeAttached = node;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n if (gizmo.isEnabled) {\n gizmo.attachedNode = node;\n } else {\n gizmo.attachedNode = null;\n }\n });\n }\n /**\n * True when the mouse pointer is hovering a gizmo mesh\n */\n get isHovered() {\n return this.xGizmo.isHovered || this.yGizmo.isHovered || this.zGizmo.isHovered || this.xPlaneGizmo.isHovered || this.yPlaneGizmo.isHovered || this.zPlaneGizmo.isHovered;\n }\n get isDragging() {\n return this.xGizmo.dragBehavior.dragging || this.yGizmo.dragBehavior.dragging || this.zGizmo.dragBehavior.dragging || this.xPlaneGizmo.dragBehavior.dragging || this.yPlaneGizmo.dragBehavior.dragging || this.zPlaneGizmo.dragBehavior.dragging;\n }\n get additionalTransformNode() {\n return this._additionalTransformNode;\n }\n set additionalTransformNode(transformNode) {\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n gizmo.additionalTransformNode = transformNode;\n });\n }\n /**\n * Creates a PositionGizmo\n * @param gizmoLayer The utility layer the gizmo will be added to\n * @param thickness display gizmo axis thickness\n * @param gizmoManager\n * @param options More options\n */\n constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, thickness = 1, gizmoManager, options) {\n super(gizmoLayer);\n /**\n * protected variables\n */\n this._meshAttached = null;\n this._nodeAttached = null;\n this._observables = [];\n /** Node Caching for quick lookup */\n this._gizmoAxisCache = new Map();\n /** Fires an event when any of it's sub gizmos are dragged */\n this.onDragStartObservable = new Observable();\n /** Fires an event when any of it's sub gizmos are being dragged */\n this.onDragObservable = new Observable();\n /** Fires an event when any of it's sub gizmos are released from dragging */\n this.onDragEndObservable = new Observable();\n /**\n * If set to true, planar drag is enabled\n */\n this._planarGizmoEnabled = false;\n this.xGizmo = new AxisDragGizmo(new Vector3(1, 0, 0), Color3.Red().scale(0.5), gizmoLayer, this, thickness);\n this.yGizmo = new AxisDragGizmo(new Vector3(0, 1, 0), Color3.Green().scale(0.5), gizmoLayer, this, thickness);\n this.zGizmo = new AxisDragGizmo(new Vector3(0, 0, 1), Color3.Blue().scale(0.5), gizmoLayer, this, thickness);\n this.xPlaneGizmo = new PlaneDragGizmo(new Vector3(1, 0, 0), Color3.Red().scale(0.5), this.gizmoLayer, this);\n this.yPlaneGizmo = new PlaneDragGizmo(new Vector3(0, 1, 0), Color3.Green().scale(0.5), this.gizmoLayer, this);\n this.zPlaneGizmo = new PlaneDragGizmo(new Vector3(0, 0, 1), Color3.Blue().scale(0.5), this.gizmoLayer, this);\n this.additionalTransformNode = options === null || options === void 0 ? void 0 : options.additionalTransformNode;\n // Relay drag events\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n gizmo.dragBehavior.onDragStartObservable.add(() => {\n this.onDragStartObservable.notifyObservers({});\n });\n gizmo.dragBehavior.onDragObservable.add(() => {\n this.onDragObservable.notifyObservers({});\n });\n gizmo.dragBehavior.onDragEndObservable.add(() => {\n this.onDragEndObservable.notifyObservers({});\n });\n });\n this.attachedMesh = null;\n if (gizmoManager) {\n gizmoManager.addToAxisCache(this._gizmoAxisCache);\n } else {\n // Only subscribe to pointer event if gizmoManager isnt\n Gizmo.GizmoAxisPointerObserver(gizmoLayer, this._gizmoAxisCache);\n }\n }\n /**\n * If the planar drag gizmo is enabled\n * setting this will enable/disable XY, XZ and YZ planes regardless of individual gizmo settings.\n */\n set planarGizmoEnabled(value) {\n this._planarGizmoEnabled = value;\n [this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n if (gizmo) {\n gizmo.isEnabled = value;\n if (value) {\n if (gizmo.attachedMesh) {\n gizmo.attachedMesh = this.attachedMesh;\n } else {\n gizmo.attachedNode = this.attachedNode;\n }\n }\n }\n }, this);\n }\n get planarGizmoEnabled() {\n return this._planarGizmoEnabled;\n }\n /**\n * posture that the gizmo will be display\n * When set null, default value will be used (Quaternion(0, 0, 0, 1))\n */\n get customRotationQuaternion() {\n return this._customRotationQuaternion;\n }\n set customRotationQuaternion(customRotationQuaternion) {\n this._customRotationQuaternion = customRotationQuaternion;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n if (gizmo) {\n gizmo.customRotationQuaternion = customRotationQuaternion;\n }\n });\n }\n /**\n * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)\n * NOTE: This is only possible for meshes with uniform scaling, as otherwise it's not possible to decompose the rotation\n */\n set updateGizmoRotationToMatchAttachedMesh(value) {\n this._updateGizmoRotationToMatchAttachedMesh = value;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n if (gizmo) {\n gizmo.updateGizmoRotationToMatchAttachedMesh = value;\n }\n });\n }\n get updateGizmoRotationToMatchAttachedMesh() {\n return this._updateGizmoRotationToMatchAttachedMesh;\n }\n set updateGizmoPositionToMatchAttachedMesh(value) {\n this._updateGizmoPositionToMatchAttachedMesh = value;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n if (gizmo) {\n gizmo.updateGizmoPositionToMatchAttachedMesh = value;\n }\n });\n }\n get updateGizmoPositionToMatchAttachedMesh() {\n return this._updateGizmoPositionToMatchAttachedMesh;\n }\n set anchorPoint(value) {\n this._anchorPoint = value;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n gizmo.anchorPoint = value;\n });\n }\n get anchorPoint() {\n return this._anchorPoint;\n }\n /**\n * Set the coordinate system to use. By default it's local.\n * But it's possible for a user to tweak so its local for translation and world for rotation.\n * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`\n */\n set coordinatesMode(coordinatesMode) {\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n gizmo.coordinatesMode = coordinatesMode;\n });\n }\n set updateScale(value) {\n if (this.xGizmo) {\n this.xGizmo.updateScale = value;\n this.yGizmo.updateScale = value;\n this.zGizmo.updateScale = value;\n }\n }\n get updateScale() {\n return this.xGizmo.updateScale;\n }\n /**\n * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)\n */\n set snapDistance(value) {\n this._snapDistance = value;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n if (gizmo) {\n gizmo.snapDistance = value;\n }\n });\n }\n get snapDistance() {\n return this._snapDistance;\n }\n /**\n * Ratio for the scale of the gizmo (Default: 1)\n */\n set scaleRatio(value) {\n this._scaleRatio = value;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n if (gizmo) {\n gizmo.scaleRatio = value;\n }\n });\n }\n get scaleRatio() {\n return this._scaleRatio;\n }\n /**\n * Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation\n * @param mesh Axis gizmo mesh\n * @param cache Gizmo axis definition used for reactive gizmo UI\n */\n addToAxisCache(mesh, cache) {\n this._gizmoAxisCache.set(mesh, cache);\n }\n /**\n * Force release the drag action by code\n */\n releaseDrag() {\n this.xGizmo.dragBehavior.releaseDrag();\n this.yGizmo.dragBehavior.releaseDrag();\n this.zGizmo.dragBehavior.releaseDrag();\n this.xPlaneGizmo.dragBehavior.releaseDrag();\n this.yPlaneGizmo.dragBehavior.releaseDrag();\n this.zPlaneGizmo.dragBehavior.releaseDrag();\n }\n /**\n * Disposes of the gizmo\n */\n dispose() {\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(gizmo => {\n if (gizmo) {\n gizmo.dispose();\n }\n });\n this._observables.forEach(obs => {\n this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(obs);\n });\n this.onDragStartObservable.clear();\n this.onDragObservable.clear();\n this.onDragEndObservable.clear();\n super.dispose();\n }\n /**\n * CustomMeshes are not supported by this gizmo\n */\n setCustomMesh() {\n Logger.Error(\"Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)\");\n }\n}","map":{"version":3,"names":["Logger","Observable","Vector3","Color3","Gizmo","AxisDragGizmo","PlaneDragGizmo","UtilityLayerRenderer","PositionGizmo","attachedMesh","_meshAttached","mesh","_nodeAttached","xGizmo","yGizmo","zGizmo","xPlaneGizmo","yPlaneGizmo","zPlaneGizmo","forEach","gizmo","isEnabled","attachedNode","node","isHovered","isDragging","dragBehavior","dragging","additionalTransformNode","_additionalTransformNode","transformNode","constructor","gizmoLayer","DefaultUtilityLayer","thickness","gizmoManager","options","_observables","_gizmoAxisCache","Map","onDragStartObservable","onDragObservable","onDragEndObservable","_planarGizmoEnabled","Red","scale","Green","Blue","add","notifyObservers","addToAxisCache","GizmoAxisPointerObserver","planarGizmoEnabled","value","customRotationQuaternion","_customRotationQuaternion","updateGizmoRotationToMatchAttachedMesh","_updateGizmoRotationToMatchAttachedMesh","updateGizmoPositionToMatchAttachedMesh","_updateGizmoPositionToMatchAttachedMesh","anchorPoint","_anchorPoint","coordinatesMode","updateScale","snapDistance","_snapDistance","scaleRatio","_scaleRatio","cache","set","releaseDrag","dispose","obs","utilityLayerScene","onPointerObservable","remove","clear","setCustomMesh","Error"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Gizmos/positionGizmo.js"],"sourcesContent":["import { Logger } from \"../Misc/logger.js\";\nimport { Observable } from \"../Misc/observable.js\";\nimport { Vector3 } from \"../Maths/math.vector.js\";\nimport { Color3 } from \"../Maths/math.color.js\";\nimport { Gizmo } from \"./gizmo.js\";\nimport { AxisDragGizmo } from \"./axisDragGizmo.js\";\nimport { PlaneDragGizmo } from \"./planeDragGizmo.js\";\nimport { UtilityLayerRenderer } from \"../Rendering/utilityLayerRenderer.js\";\n/**\n * Gizmo that enables dragging a mesh along 3 axis\n */\nexport class PositionGizmo extends Gizmo {\n get attachedMesh() {\n return this._meshAttached;\n }\n set attachedMesh(mesh) {\n this._meshAttached = mesh;\n this._nodeAttached = mesh;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n if (gizmo.isEnabled) {\n gizmo.attachedMesh = mesh;\n }\n else {\n gizmo.attachedMesh = null;\n }\n });\n }\n get attachedNode() {\n return this._nodeAttached;\n }\n set attachedNode(node) {\n this._meshAttached = null;\n this._nodeAttached = node;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n if (gizmo.isEnabled) {\n gizmo.attachedNode = node;\n }\n else {\n gizmo.attachedNode = null;\n }\n });\n }\n /**\n * True when the mouse pointer is hovering a gizmo mesh\n */\n get isHovered() {\n return this.xGizmo.isHovered || this.yGizmo.isHovered || this.zGizmo.isHovered || this.xPlaneGizmo.isHovered || this.yPlaneGizmo.isHovered || this.zPlaneGizmo.isHovered;\n }\n get isDragging() {\n return (this.xGizmo.dragBehavior.dragging ||\n this.yGizmo.dragBehavior.dragging ||\n this.zGizmo.dragBehavior.dragging ||\n this.xPlaneGizmo.dragBehavior.dragging ||\n this.yPlaneGizmo.dragBehavior.dragging ||\n this.zPlaneGizmo.dragBehavior.dragging);\n }\n get additionalTransformNode() {\n return this._additionalTransformNode;\n }\n set additionalTransformNode(transformNode) {\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n gizmo.additionalTransformNode = transformNode;\n });\n }\n /**\n * Creates a PositionGizmo\n * @param gizmoLayer The utility layer the gizmo will be added to\n * @param thickness display gizmo axis thickness\n * @param gizmoManager\n * @param options More options\n */\n constructor(gizmoLayer = UtilityLayerRenderer.DefaultUtilityLayer, thickness = 1, gizmoManager, options) {\n super(gizmoLayer);\n /**\n * protected variables\n */\n this._meshAttached = null;\n this._nodeAttached = null;\n this._observables = [];\n /** Node Caching for quick lookup */\n this._gizmoAxisCache = new Map();\n /** Fires an event when any of it's sub gizmos are dragged */\n this.onDragStartObservable = new Observable();\n /** Fires an event when any of it's sub gizmos are being dragged */\n this.onDragObservable = new Observable();\n /** Fires an event when any of it's sub gizmos are released from dragging */\n this.onDragEndObservable = new Observable();\n /**\n * If set to true, planar drag is enabled\n */\n this._planarGizmoEnabled = false;\n this.xGizmo = new AxisDragGizmo(new Vector3(1, 0, 0), Color3.Red().scale(0.5), gizmoLayer, this, thickness);\n this.yGizmo = new AxisDragGizmo(new Vector3(0, 1, 0), Color3.Green().scale(0.5), gizmoLayer, this, thickness);\n this.zGizmo = new AxisDragGizmo(new Vector3(0, 0, 1), Color3.Blue().scale(0.5), gizmoLayer, this, thickness);\n this.xPlaneGizmo = new PlaneDragGizmo(new Vector3(1, 0, 0), Color3.Red().scale(0.5), this.gizmoLayer, this);\n this.yPlaneGizmo = new PlaneDragGizmo(new Vector3(0, 1, 0), Color3.Green().scale(0.5), this.gizmoLayer, this);\n this.zPlaneGizmo = new PlaneDragGizmo(new Vector3(0, 0, 1), Color3.Blue().scale(0.5), this.gizmoLayer, this);\n this.additionalTransformNode = options?.additionalTransformNode;\n // Relay drag events\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n gizmo.dragBehavior.onDragStartObservable.add(() => {\n this.onDragStartObservable.notifyObservers({});\n });\n gizmo.dragBehavior.onDragObservable.add(() => {\n this.onDragObservable.notifyObservers({});\n });\n gizmo.dragBehavior.onDragEndObservable.add(() => {\n this.onDragEndObservable.notifyObservers({});\n });\n });\n this.attachedMesh = null;\n if (gizmoManager) {\n gizmoManager.addToAxisCache(this._gizmoAxisCache);\n }\n else {\n // Only subscribe to pointer event if gizmoManager isnt\n Gizmo.GizmoAxisPointerObserver(gizmoLayer, this._gizmoAxisCache);\n }\n }\n /**\n * If the planar drag gizmo is enabled\n * setting this will enable/disable XY, XZ and YZ planes regardless of individual gizmo settings.\n */\n set planarGizmoEnabled(value) {\n this._planarGizmoEnabled = value;\n [this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n if (gizmo) {\n gizmo.isEnabled = value;\n if (value) {\n if (gizmo.attachedMesh) {\n gizmo.attachedMesh = this.attachedMesh;\n }\n else {\n gizmo.attachedNode = this.attachedNode;\n }\n }\n }\n }, this);\n }\n get planarGizmoEnabled() {\n return this._planarGizmoEnabled;\n }\n /**\n * posture that the gizmo will be display\n * When set null, default value will be used (Quaternion(0, 0, 0, 1))\n */\n get customRotationQuaternion() {\n return this._customRotationQuaternion;\n }\n set customRotationQuaternion(customRotationQuaternion) {\n this._customRotationQuaternion = customRotationQuaternion;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n if (gizmo) {\n gizmo.customRotationQuaternion = customRotationQuaternion;\n }\n });\n }\n /**\n * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)\n * NOTE: This is only possible for meshes with uniform scaling, as otherwise it's not possible to decompose the rotation\n */\n set updateGizmoRotationToMatchAttachedMesh(value) {\n this._updateGizmoRotationToMatchAttachedMesh = value;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n if (gizmo) {\n gizmo.updateGizmoRotationToMatchAttachedMesh = value;\n }\n });\n }\n get updateGizmoRotationToMatchAttachedMesh() {\n return this._updateGizmoRotationToMatchAttachedMesh;\n }\n set updateGizmoPositionToMatchAttachedMesh(value) {\n this._updateGizmoPositionToMatchAttachedMesh = value;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n if (gizmo) {\n gizmo.updateGizmoPositionToMatchAttachedMesh = value;\n }\n });\n }\n get updateGizmoPositionToMatchAttachedMesh() {\n return this._updateGizmoPositionToMatchAttachedMesh;\n }\n set anchorPoint(value) {\n this._anchorPoint = value;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n gizmo.anchorPoint = value;\n });\n }\n get anchorPoint() {\n return this._anchorPoint;\n }\n /**\n * Set the coordinate system to use. By default it's local.\n * But it's possible for a user to tweak so its local for translation and world for rotation.\n * In that case, setting the coordinate system will change `updateGizmoRotationToMatchAttachedMesh` and `updateGizmoPositionToMatchAttachedMesh`\n */\n set coordinatesMode(coordinatesMode) {\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n gizmo.coordinatesMode = coordinatesMode;\n });\n }\n set updateScale(value) {\n if (this.xGizmo) {\n this.xGizmo.updateScale = value;\n this.yGizmo.updateScale = value;\n this.zGizmo.updateScale = value;\n }\n }\n get updateScale() {\n return this.xGizmo.updateScale;\n }\n /**\n * Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)\n */\n set snapDistance(value) {\n this._snapDistance = value;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n if (gizmo) {\n gizmo.snapDistance = value;\n }\n });\n }\n get snapDistance() {\n return this._snapDistance;\n }\n /**\n * Ratio for the scale of the gizmo (Default: 1)\n */\n set scaleRatio(value) {\n this._scaleRatio = value;\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n if (gizmo) {\n gizmo.scaleRatio = value;\n }\n });\n }\n get scaleRatio() {\n return this._scaleRatio;\n }\n /**\n * Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation\n * @param mesh Axis gizmo mesh\n * @param cache Gizmo axis definition used for reactive gizmo UI\n */\n addToAxisCache(mesh, cache) {\n this._gizmoAxisCache.set(mesh, cache);\n }\n /**\n * Force release the drag action by code\n */\n releaseDrag() {\n this.xGizmo.dragBehavior.releaseDrag();\n this.yGizmo.dragBehavior.releaseDrag();\n this.zGizmo.dragBehavior.releaseDrag();\n this.xPlaneGizmo.dragBehavior.releaseDrag();\n this.yPlaneGizmo.dragBehavior.releaseDrag();\n this.zPlaneGizmo.dragBehavior.releaseDrag();\n }\n /**\n * Disposes of the gizmo\n */\n dispose() {\n [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach((gizmo) => {\n if (gizmo) {\n gizmo.dispose();\n }\n });\n this._observables.forEach((obs) => {\n this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(obs);\n });\n this.onDragStartObservable.clear();\n this.onDragObservable.clear();\n this.onDragEndObservable.clear();\n super.dispose();\n }\n /**\n * CustomMeshes are not supported by this gizmo\n */\n setCustomMesh() {\n Logger.Error(\"Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)\");\n }\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,OAAO,QAAQ,yBAAyB;AACjD,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,KAAK,QAAQ,YAAY;AAClC,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,oBAAoB,QAAQ,sCAAsC;AAC3E;AACA;AACA;AACA,OAAO,MAAMC,aAAa,SAASJ,KAAK,CAAC;EACrC,IAAIK,YAAYA,CAAA,EAAG;IACf,OAAO,IAAI,CAACC,aAAa;EAC7B;EACA,IAAID,YAAYA,CAACE,IAAI,EAAE;IACnB,IAAI,CAACD,aAAa,GAAGC,IAAI;IACzB,IAAI,CAACC,aAAa,GAAGD,IAAI;IACzB,CAAC,IAAI,CAACE,MAAM,EAAE,IAAI,CAACC,MAAM,EAAE,IAAI,CAACC,MAAM,EAAE,IAAI,CAACC,WAAW,EAAE,IAAI,CAACC,WAAW,EAAE,IAAI,CAACC,WAAW,CAAC,CAACC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