|
@@ -100805,6 +100805,7 @@ var BABYLON;
|
|
|
this._scene = this._ownerNode.getScene();
|
|
|
if (!SixDofDragBehavior._virtualScene) {
|
|
|
SixDofDragBehavior._virtualScene = new BABYLON.Scene(this._scene.getEngine());
|
|
|
+ SixDofDragBehavior._virtualScene.detachControl();
|
|
|
this._scene.getEngine().scenes.pop();
|
|
|
}
|
|
|
var pickedMesh = null;
|
|
@@ -101836,15 +101837,28 @@ var BABYLON;
|
|
|
var PositionGizmo = /** @class */ (function (_super) {
|
|
|
__extends(PositionGizmo, _super);
|
|
|
/**
|
|
|
- * Creates a PositionGizmo
|
|
|
- * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
- */
|
|
|
+ * Creates a PositionGizmo
|
|
|
+ * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
+ */
|
|
|
function PositionGizmo(gizmoLayer) {
|
|
|
if (gizmoLayer === void 0) { gizmoLayer = BABYLON.UtilityLayerRenderer.DefaultUtilityLayer; }
|
|
|
var _this = _super.call(this, gizmoLayer) || this;
|
|
|
+ /** Fires an event when any of it's sub gizmos are dragged */
|
|
|
+ _this.onDragStartObservable = new BABYLON.Observable();
|
|
|
+ /** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
+ _this.onDragEndObservable = new BABYLON.Observable();
|
|
|
_this.xGizmo = new BABYLON.AxisDragGizmo(new BABYLON.Vector3(1, 0, 0), BABYLON.Color3.Red().scale(0.5), gizmoLayer);
|
|
|
_this.yGizmo = new BABYLON.AxisDragGizmo(new BABYLON.Vector3(0, 1, 0), BABYLON.Color3.Green().scale(0.5), gizmoLayer);
|
|
|
_this.zGizmo = new BABYLON.AxisDragGizmo(new BABYLON.Vector3(0, 0, 1), BABYLON.Color3.Blue().scale(0.5), gizmoLayer);
|
|
|
+ // Relay drag events
|
|
|
+ [_this.xGizmo, _this.yGizmo, _this.zGizmo].forEach(function (gizmo) {
|
|
|
+ gizmo.dragBehavior.onDragStartObservable.add(function () {
|
|
|
+ _this.onDragStartObservable.notifyObservers({});
|
|
|
+ });
|
|
|
+ gizmo.dragBehavior.onDragEndObservable.add(function () {
|
|
|
+ _this.onDragEndObservable.notifyObservers({});
|
|
|
+ });
|
|
|
+ });
|
|
|
_this.attachedMesh = null;
|
|
|
return _this;
|
|
|
}
|
|
@@ -101914,6 +101928,8 @@ var BABYLON;
|
|
|
this.xGizmo.dispose();
|
|
|
this.yGizmo.dispose();
|
|
|
this.zGizmo.dispose();
|
|
|
+ this.onDragStartObservable.clear();
|
|
|
+ this.onDragEndObservable.clear();
|
|
|
};
|
|
|
/**
|
|
|
* CustomMeshes are not supported by this gizmo
|
|
@@ -101946,9 +101962,22 @@ var BABYLON;
|
|
|
if (gizmoLayer === void 0) { gizmoLayer = BABYLON.UtilityLayerRenderer.DefaultUtilityLayer; }
|
|
|
if (tessellation === void 0) { tessellation = 32; }
|
|
|
var _this = _super.call(this, gizmoLayer) || this;
|
|
|
+ /** Fires an event when any of it's sub gizmos are dragged */
|
|
|
+ _this.onDragStartObservable = new BABYLON.Observable();
|
|
|
+ /** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
+ _this.onDragEndObservable = new BABYLON.Observable();
|
|
|
_this.xGizmo = new BABYLON.PlaneRotationGizmo(new BABYLON.Vector3(1, 0, 0), BABYLON.Color3.Red().scale(0.5), gizmoLayer, tessellation);
|
|
|
_this.yGizmo = new BABYLON.PlaneRotationGizmo(new BABYLON.Vector3(0, 1, 0), BABYLON.Color3.Green().scale(0.5), gizmoLayer, tessellation);
|
|
|
_this.zGizmo = new BABYLON.PlaneRotationGizmo(new BABYLON.Vector3(0, 0, 1), BABYLON.Color3.Blue().scale(0.5), gizmoLayer, tessellation);
|
|
|
+ // Relay drag events
|
|
|
+ [_this.xGizmo, _this.yGizmo, _this.zGizmo].forEach(function (gizmo) {
|
|
|
+ gizmo.dragBehavior.onDragStartObservable.add(function () {
|
|
|
+ _this.onDragStartObservable.notifyObservers({});
|
|
|
+ });
|
|
|
+ gizmo.dragBehavior.onDragEndObservable.add(function () {
|
|
|
+ _this.onDragEndObservable.notifyObservers({});
|
|
|
+ });
|
|
|
+ });
|
|
|
_this.attachedMesh = null;
|
|
|
return _this;
|
|
|
}
|
|
@@ -102018,6 +102047,8 @@ var BABYLON;
|
|
|
this.xGizmo.dispose();
|
|
|
this.yGizmo.dispose();
|
|
|
this.zGizmo.dispose();
|
|
|
+ this.onDragStartObservable.clear();
|
|
|
+ this.onDragEndObservable.clear();
|
|
|
};
|
|
|
/**
|
|
|
* CustomMeshes are not supported by this gizmo
|
|
@@ -102048,6 +102079,10 @@ var BABYLON;
|
|
|
function ScaleGizmo(gizmoLayer) {
|
|
|
if (gizmoLayer === void 0) { gizmoLayer = BABYLON.UtilityLayerRenderer.DefaultUtilityLayer; }
|
|
|
var _this = _super.call(this, gizmoLayer) || this;
|
|
|
+ /** Fires an event when any of it's sub gizmos are dragged */
|
|
|
+ _this.onDragStartObservable = new BABYLON.Observable();
|
|
|
+ /** Fires an event when any of it's sub gizmos are released from dragging */
|
|
|
+ _this.onDragEndObservable = new BABYLON.Observable();
|
|
|
_this.xGizmo = new BABYLON.AxisScaleGizmo(new BABYLON.Vector3(1, 0, 0), BABYLON.Color3.Red().scale(0.5), gizmoLayer);
|
|
|
_this.yGizmo = new BABYLON.AxisScaleGizmo(new BABYLON.Vector3(0, 1, 0), BABYLON.Color3.Green().scale(0.5), gizmoLayer);
|
|
|
_this.zGizmo = new BABYLON.AxisScaleGizmo(new BABYLON.Vector3(0, 0, 1), BABYLON.Color3.Blue().scale(0.5), gizmoLayer);
|
|
@@ -102062,6 +102097,15 @@ var BABYLON;
|
|
|
octahedron.scaling.scaleInPlace(0.007);
|
|
|
uniformScalingMesh.addChild(octahedron);
|
|
|
_this.uniformScaleGizmo.setCustomMesh(uniformScalingMesh, true);
|
|
|
+ // Relay drag events
|
|
|
+ [_this.xGizmo, _this.yGizmo, _this.zGizmo, _this.uniformScaleGizmo].forEach(function (gizmo) {
|
|
|
+ gizmo.dragBehavior.onDragStartObservable.add(function () {
|
|
|
+ _this.onDragStartObservable.notifyObservers({});
|
|
|
+ });
|
|
|
+ gizmo.dragBehavior.onDragEndObservable.add(function () {
|
|
|
+ _this.onDragEndObservable.notifyObservers({});
|
|
|
+ });
|
|
|
+ });
|
|
|
_this.attachedMesh = null;
|
|
|
return _this;
|
|
|
}
|
|
@@ -102138,6 +102182,8 @@ var BABYLON;
|
|
|
this.yGizmo.dispose();
|
|
|
this.zGizmo.dispose();
|
|
|
this.uniformScaleGizmo.dispose();
|
|
|
+ this.onDragStartObservable.clear();
|
|
|
+ this.onDragEndObservable.clear();
|
|
|
};
|
|
|
return ScaleGizmo;
|
|
|
}(BABYLON.Gizmo));
|