|
@@ -90680,6 +90680,10 @@ var BABYLON;
|
|
|
this._scaleFactor = 3;
|
|
|
this._tmpMatrix = new BABYLON.Matrix();
|
|
|
/**
|
|
|
+ * If a custom mesh has been set (Default: false)
|
|
|
+ */
|
|
|
+ this._customMeshSet = false;
|
|
|
+ /**
|
|
|
* If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
|
|
|
*/
|
|
|
this.updateGizmoRotationToMatchAttachedMesh = true;
|
|
@@ -90748,6 +90752,20 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ /**
|
|
|
+ * Disposes and replaces the current meshes in the gizmo with the specified mesh
|
|
|
+ * @param mesh The mesh to replace the default mesh of the gizmo
|
|
|
+ */
|
|
|
+ Gizmo.prototype.setCustomMesh = function (mesh) {
|
|
|
+ if (mesh.getScene() != this.gizmoLayer.utilityLayerScene) {
|
|
|
+ throw "When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";
|
|
|
+ }
|
|
|
+ this._rootMesh.getChildMeshes().forEach(function (c) {
|
|
|
+ c.dispose();
|
|
|
+ });
|
|
|
+ mesh.parent = this._rootMesh;
|
|
|
+ this._customMeshSet = true;
|
|
|
+ };
|
|
|
Gizmo.prototype._attachedMeshChanged = function (value) {
|
|
|
};
|
|
|
/**
|
|
@@ -90845,6 +90863,9 @@ var BABYLON;
|
|
|
}
|
|
|
});
|
|
|
_this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
|
|
|
+ if (_this._customMeshSet) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
|
|
|
_this._rootMesh.getChildMeshes().forEach(function (m) {
|
|
|
m.material = hoverMaterial;
|
|
@@ -90965,6 +90986,9 @@ var BABYLON;
|
|
|
}
|
|
|
});
|
|
|
_this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
|
|
|
+ if (_this._customMeshSet) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
|
|
|
_this._rootMesh.getChildMeshes().forEach(function (m) {
|
|
|
m.material = hoverMaterial;
|
|
@@ -91122,6 +91146,9 @@ var BABYLON;
|
|
|
}
|
|
|
});
|
|
|
_this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
|
|
|
+ if (_this._customMeshSet) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
|
|
|
_this._rootMesh.getChildMeshes().forEach(function (m) {
|
|
|
m.material = hoverMaterial;
|
|
@@ -91210,6 +91237,13 @@ var BABYLON;
|
|
|
this.yGizmo.dispose();
|
|
|
this.zGizmo.dispose();
|
|
|
};
|
|
|
+ /**
|
|
|
+ * CustomMeshes are not supported by this gizmo
|
|
|
+ * @param mesh The mesh to replace the default mesh of the gizmo
|
|
|
+ */
|
|
|
+ PositionGizmo.prototype.setCustomMesh = function (mesh) {
|
|
|
+ BABYLON.Tools.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)");
|
|
|
+ };
|
|
|
return PositionGizmo;
|
|
|
}(BABYLON.Gizmo));
|
|
|
BABYLON.PositionGizmo = PositionGizmo;
|
|
@@ -91271,6 +91305,13 @@ var BABYLON;
|
|
|
this.yGizmo.dispose();
|
|
|
this.zGizmo.dispose();
|
|
|
};
|
|
|
+ /**
|
|
|
+ * CustomMeshes are not supported by this gizmo
|
|
|
+ * @param mesh The mesh to replace the default mesh of the gizmo
|
|
|
+ */
|
|
|
+ RotationGizmo.prototype.setCustomMesh = function (mesh) {
|
|
|
+ BABYLON.Tools.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)");
|
|
|
+ };
|
|
|
return RotationGizmo;
|
|
|
}(BABYLON.Gizmo));
|
|
|
BABYLON.RotationGizmo = RotationGizmo;
|
|
@@ -91746,6 +91787,13 @@ var BABYLON;
|
|
|
box.visibility = 0;
|
|
|
return box;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * CustomMeshes are not supported by this gizmo
|
|
|
+ * @param mesh The mesh to replace the default mesh of the gizmo
|
|
|
+ */
|
|
|
+ BoundingBoxGizmo.prototype.setCustomMesh = function (mesh) {
|
|
|
+ BABYLON.Tools.Error("Custom meshes are not supported on this gizmo");
|
|
|
+ };
|
|
|
return BoundingBoxGizmo;
|
|
|
}(BABYLON.Gizmo));
|
|
|
BABYLON.BoundingBoxGizmo = BoundingBoxGizmo;
|