|
@@ -89345,27 +89345,32 @@ var BABYLON;
|
|
|
*/
|
|
|
function AxisDragGizmo(gizmoLayer, dragAxis, color) {
|
|
|
var _this = _super.call(this, gizmoLayer) || this;
|
|
|
- _this.updateGizmoRotationToMatchAttachedMesh = false;
|
|
|
+ _this._pointerObserver = null;
|
|
|
// Create Material
|
|
|
var coloredMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
|
|
|
coloredMaterial.disableLighting = true;
|
|
|
coloredMaterial.emissiveColor = color;
|
|
|
+ var hoverMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
|
|
|
+ hoverMaterial.disableLighting = true;
|
|
|
+ hoverMaterial.emissiveColor = color.add(new BABYLON.Color3(0.2, 0.2, 0.2));
|
|
|
// Build mesh on root node
|
|
|
+ var arrow = new BABYLON.AbstractMesh("", gizmoLayer.utilityLayerScene);
|
|
|
var arrowMesh = BABYLON.MeshBuilder.CreateCylinder("yPosMesh", { diameterTop: 0, height: 2, tessellation: 96 }, gizmoLayer.utilityLayerScene);
|
|
|
- var arrowTail = BABYLON.MeshBuilder.CreateCylinder("yPosMesh", { diameter: 0.03, height: 0.2, tessellation: 96 }, gizmoLayer.utilityLayerScene);
|
|
|
- _this._rootMesh.addChild(arrowMesh);
|
|
|
- _this._rootMesh.addChild(arrowTail);
|
|
|
+ var arrowTail = BABYLON.MeshBuilder.CreateCylinder("yPosMesh", { diameter: 0.015, height: 0.3, tessellation: 96 }, gizmoLayer.utilityLayerScene);
|
|
|
+ arrow.addChild(arrowMesh);
|
|
|
+ arrow.addChild(arrowTail);
|
|
|
// Position arrow pointing in its drag axis
|
|
|
- arrowMesh.scaling.scaleInPlace(0.1);
|
|
|
+ arrowMesh.scaling.scaleInPlace(0.05);
|
|
|
arrowMesh.material = coloredMaterial;
|
|
|
arrowMesh.rotation.x = Math.PI / 2;
|
|
|
arrowMesh.position.z += 0.3;
|
|
|
arrowTail.rotation.x = Math.PI / 2;
|
|
|
arrowTail.material = coloredMaterial;
|
|
|
- arrowTail.position.z += 0.2;
|
|
|
- _this._rootMesh.lookAt(_this._rootMesh.position.subtract(dragAxis));
|
|
|
+ arrowTail.position.z += 0.15;
|
|
|
+ arrow.lookAt(_this._rootMesh.position.subtract(dragAxis));
|
|
|
+ _this._rootMesh.addChild(arrow);
|
|
|
// Add drag behavior to handle events when the gizmo is dragged
|
|
|
- _this._dragBehavior = new BABYLON.PointerDragBehavior({ dragAxis: new BABYLON.Vector3(0, 0, 1) });
|
|
|
+ _this._dragBehavior = new BABYLON.PointerDragBehavior({ dragAxis: dragAxis });
|
|
|
_this._dragBehavior.moveAttached = false;
|
|
|
_this._rootMesh.addBehavior(_this._dragBehavior);
|
|
|
_this._dragBehavior.onDragObservable.add(function (event) {
|
|
@@ -89376,6 +89381,18 @@ var BABYLON;
|
|
|
_this.attachedMesh.position.addInPlace(event.delta);
|
|
|
}
|
|
|
});
|
|
|
+ _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
|
|
|
+ if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
|
|
|
+ _this._rootMesh.getChildMeshes().forEach(function (m) {
|
|
|
+ m.material = hoverMaterial;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _this._rootMesh.getChildMeshes().forEach(function (m) {
|
|
|
+ m.material = coloredMaterial;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
return _this;
|
|
|
}
|
|
|
AxisDragGizmo.prototype._onInteractionsEnabledChanged = function (value) {
|
|
@@ -89385,6 +89402,7 @@ var BABYLON;
|
|
|
* Disposes of the gizmo
|
|
|
*/
|
|
|
AxisDragGizmo.prototype.dispose = function () {
|
|
|
+ this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver);
|
|
|
this._dragBehavior.detach();
|
|
|
_super.prototype.dispose.call(this);
|
|
|
};
|
|
@@ -89411,16 +89429,20 @@ var BABYLON;
|
|
|
*/
|
|
|
function AxisScaleGizmo(gizmoLayer, dragAxis, color) {
|
|
|
var _this = _super.call(this, gizmoLayer) || this;
|
|
|
- _this.updateGizmoRotationToMatchAttachedMesh = false;
|
|
|
+ _this._pointerObserver = null;
|
|
|
// Create Material
|
|
|
var coloredMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
|
|
|
coloredMaterial.disableLighting = true;
|
|
|
coloredMaterial.emissiveColor = color;
|
|
|
+ var hoverMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
|
|
|
+ hoverMaterial.disableLighting = true;
|
|
|
+ hoverMaterial.emissiveColor = color.add(new BABYLON.Color3(0.2, 0.2, 0.2));
|
|
|
// Build mesh on root node
|
|
|
- var arrowMesh = BABYLON.MeshBuilder.CreateBox("yPosMesh", { size: 1 }, gizmoLayer.utilityLayerScene);
|
|
|
- var arrowTail = BABYLON.MeshBuilder.CreateCylinder("yPosMesh", { diameter: 0.03, height: 0.2, tessellation: 96 }, gizmoLayer.utilityLayerScene);
|
|
|
- _this._rootMesh.addChild(arrowMesh);
|
|
|
- _this._rootMesh.addChild(arrowTail);
|
|
|
+ var arrow = new BABYLON.AbstractMesh("", gizmoLayer.utilityLayerScene);
|
|
|
+ var arrowMesh = BABYLON.MeshBuilder.CreateBox("yPosMesh", { size: 0.5 }, gizmoLayer.utilityLayerScene);
|
|
|
+ var arrowTail = BABYLON.MeshBuilder.CreateCylinder("yPosMesh", { diameter: 0.015, height: 0.3, tessellation: 96 }, gizmoLayer.utilityLayerScene);
|
|
|
+ arrow.addChild(arrowMesh);
|
|
|
+ arrow.addChild(arrowTail);
|
|
|
// Position arrow pointing in its drag axis
|
|
|
arrowMesh.scaling.scaleInPlace(0.1);
|
|
|
arrowMesh.material = coloredMaterial;
|
|
@@ -89428,18 +89450,48 @@ var BABYLON;
|
|
|
arrowMesh.position.z += 0.3;
|
|
|
arrowTail.rotation.x = Math.PI / 2;
|
|
|
arrowTail.material = coloredMaterial;
|
|
|
- arrowTail.position.z += 0.2;
|
|
|
- _this._rootMesh.lookAt(_this._rootMesh.position.subtract(dragAxis));
|
|
|
+ arrowTail.position.z += 0.15;
|
|
|
+ arrow.lookAt(_this._rootMesh.position.subtract(dragAxis));
|
|
|
+ _this._rootMesh.addChild(arrow);
|
|
|
// Add drag behavior to handle events when the gizmo is dragged
|
|
|
- _this._dragBehavior = new BABYLON.PointerDragBehavior({ dragAxis: new BABYLON.Vector3(0, 0, 1) });
|
|
|
+ _this._dragBehavior = new BABYLON.PointerDragBehavior({ dragAxis: dragAxis });
|
|
|
_this._dragBehavior.moveAttached = false;
|
|
|
_this._rootMesh.addBehavior(_this._dragBehavior);
|
|
|
+ var tmpVector = new BABYLON.Vector3();
|
|
|
_this._dragBehavior.onDragObservable.add(function (event) {
|
|
|
if (!_this.interactionsEnabled) {
|
|
|
return;
|
|
|
}
|
|
|
if (_this.attachedMesh) {
|
|
|
- _this.attachedMesh.scaling.addInPlace(event.delta);
|
|
|
+ dragAxis.scaleToRef(event.dragDistance, tmpVector);
|
|
|
+ var invertCount = 0;
|
|
|
+ if (_this.attachedMesh.scaling["x"] < 0) {
|
|
|
+ invertCount++;
|
|
|
+ }
|
|
|
+ if (_this.attachedMesh.scaling["y"] < 0) {
|
|
|
+ invertCount++;
|
|
|
+ }
|
|
|
+ if (_this.attachedMesh.scaling["z"] < 0) {
|
|
|
+ invertCount++;
|
|
|
+ }
|
|
|
+ if (invertCount % 2 == 0) {
|
|
|
+ _this.attachedMesh.scaling.addInPlace(tmpVector);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _this.attachedMesh.scaling.subtractInPlace(tmpVector);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
|
|
|
+ if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
|
|
|
+ _this._rootMesh.getChildMeshes().forEach(function (m) {
|
|
|
+ m.material = hoverMaterial;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _this._rootMesh.getChildMeshes().forEach(function (m) {
|
|
|
+ m.material = coloredMaterial;
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
return _this;
|
|
@@ -89451,6 +89503,7 @@ var BABYLON;
|
|
|
* Disposes of the gizmo
|
|
|
*/
|
|
|
AxisScaleGizmo.prototype.dispose = function () {
|
|
|
+ this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver);
|
|
|
this._dragBehavior.detach();
|
|
|
_super.prototype.dispose.call(this);
|
|
|
};
|
|
@@ -89477,21 +89530,26 @@ var BABYLON;
|
|
|
*/
|
|
|
function PlaneRotationGizmo(gizmoLayer, planeNormal, color) {
|
|
|
var _this = _super.call(this, gizmoLayer) || this;
|
|
|
- _this.updateGizmoRotationToMatchAttachedMesh = false;
|
|
|
+ _this._pointerObserver = null;
|
|
|
// Create Material
|
|
|
var coloredMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
|
|
|
coloredMaterial.disableLighting = true;
|
|
|
coloredMaterial.emissiveColor = color;
|
|
|
+ var hoverMaterial = new BABYLON.StandardMaterial("", gizmoLayer.utilityLayerScene);
|
|
|
+ hoverMaterial.disableLighting = true;
|
|
|
+ hoverMaterial.emissiveColor = color.add(new BABYLON.Color3(0.2, 0.2, 0.2));
|
|
|
// Build mesh on root node
|
|
|
- var rotationMesh = BABYLON.Mesh.CreateTorus("torus", 3, 0.3, 20, gizmoLayer.utilityLayerScene, false);
|
|
|
- _this._rootMesh.addChild(rotationMesh);
|
|
|
+ var parentMesh = new BABYLON.AbstractMesh("", gizmoLayer.utilityLayerScene);
|
|
|
+ var rotationMesh = BABYLON.Mesh.CreateTorus("torus", 3, 0.15, 20, gizmoLayer.utilityLayerScene, false);
|
|
|
// Position arrow pointing in its drag axis
|
|
|
rotationMesh.scaling.scaleInPlace(0.1);
|
|
|
rotationMesh.material = coloredMaterial;
|
|
|
rotationMesh.rotation.x = Math.PI / 2;
|
|
|
- _this._rootMesh.lookAt(_this._rootMesh.position.subtract(planeNormal));
|
|
|
+ parentMesh.addChild(rotationMesh);
|
|
|
+ parentMesh.lookAt(_this._rootMesh.position.subtract(planeNormal));
|
|
|
+ _this._rootMesh.addChild(parentMesh);
|
|
|
// Add drag behavior to handle events when the gizmo is dragged
|
|
|
- _this._dragBehavior = new BABYLON.PointerDragBehavior({ dragPlaneNormal: new BABYLON.Vector3(0, 0, 1) });
|
|
|
+ _this._dragBehavior = new BABYLON.PointerDragBehavior({ dragPlaneNormal: planeNormal });
|
|
|
_this._dragBehavior.moveAttached = false;
|
|
|
_this._rootMesh.addBehavior(_this._dragBehavior);
|
|
|
var lastDragPosition = null;
|
|
@@ -89501,6 +89559,9 @@ var BABYLON;
|
|
|
}
|
|
|
lastDragPosition = e.dragPlanePoint;
|
|
|
});
|
|
|
+ var rotationMatrix = new BABYLON.Matrix();
|
|
|
+ var planeNormalTowardsCamera = new BABYLON.Vector3();
|
|
|
+ var localPlaneNormalTowardsCamera = new BABYLON.Vector3();
|
|
|
_this._dragBehavior.onDragObservable.add(function (event) {
|
|
|
if (!_this.interactionsEnabled) {
|
|
|
return;
|
|
@@ -89515,25 +89576,43 @@ var BABYLON;
|
|
|
var cross = BABYLON.Vector3.Cross(newVector, originalVector);
|
|
|
var dot = BABYLON.Vector3.Dot(newVector, originalVector);
|
|
|
var angle = Math.atan2(cross.length(), dot);
|
|
|
- var up = planeNormal.clone();
|
|
|
+ planeNormalTowardsCamera.copyFrom(planeNormal);
|
|
|
+ localPlaneNormalTowardsCamera.copyFrom(planeNormal);
|
|
|
+ if (_this.updateGizmoRotationToMatchAttachedMesh) {
|
|
|
+ _this.attachedMesh.rotationQuaternion.toRotationMatrix(rotationMatrix);
|
|
|
+ localPlaneNormalTowardsCamera = BABYLON.Vector3.TransformCoordinates(planeNormalTowardsCamera, rotationMatrix);
|
|
|
+ }
|
|
|
// Flip up vector depending on which side the camera is on
|
|
|
if (gizmoLayer.utilityLayerScene.activeCamera) {
|
|
|
var camVec = gizmoLayer.utilityLayerScene.activeCamera.position.subtract(_this.attachedMesh.position);
|
|
|
- if (BABYLON.Vector3.Dot(camVec, up) > 0) {
|
|
|
- up.scaleInPlace(-1);
|
|
|
+ if (BABYLON.Vector3.Dot(camVec, localPlaneNormalTowardsCamera) > 0) {
|
|
|
+ planeNormalTowardsCamera.scaleInPlace(-1);
|
|
|
+ localPlaneNormalTowardsCamera.scaleInPlace(-1);
|
|
|
}
|
|
|
}
|
|
|
- var halfCircleSide = BABYLON.Vector3.Dot(up, cross) > 0.0;
|
|
|
+ var halfCircleSide = BABYLON.Vector3.Dot(localPlaneNormalTowardsCamera, cross) > 0.0;
|
|
|
if (halfCircleSide)
|
|
|
angle = -angle;
|
|
|
// Convert angle and axis to quaternion (http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm)
|
|
|
var quaternionCoefficient = Math.sin(angle / 2);
|
|
|
- var amountToRotate = new BABYLON.Quaternion(up.x * quaternionCoefficient, up.y * quaternionCoefficient, up.z * quaternionCoefficient, Math.cos(angle / 2));
|
|
|
+ var amountToRotate = new BABYLON.Quaternion(planeNormalTowardsCamera.x * quaternionCoefficient, planeNormalTowardsCamera.y * quaternionCoefficient, planeNormalTowardsCamera.z * quaternionCoefficient, Math.cos(angle / 2));
|
|
|
// Rotate selected mesh quaternion over fixed axis
|
|
|
- amountToRotate.multiplyToRef(_this.attachedMesh.rotationQuaternion, _this.attachedMesh.rotationQuaternion);
|
|
|
+ _this.attachedMesh.rotationQuaternion.multiplyToRef(amountToRotate, _this.attachedMesh.rotationQuaternion);
|
|
|
lastDragPosition = event.dragPlanePoint;
|
|
|
}
|
|
|
});
|
|
|
+ _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
|
|
|
+ if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
|
|
|
+ _this._rootMesh.getChildMeshes().forEach(function (m) {
|
|
|
+ m.material = hoverMaterial;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _this._rootMesh.getChildMeshes().forEach(function (m) {
|
|
|
+ m.material = coloredMaterial;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
return _this;
|
|
|
}
|
|
|
PlaneRotationGizmo.prototype._onInteractionsEnabledChanged = function (value) {
|
|
@@ -89543,6 +89622,7 @@ var BABYLON;
|
|
|
* Disposes of the gizmo
|
|
|
*/
|
|
|
PlaneRotationGizmo.prototype.dispose = function () {
|
|
|
+ this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver);
|
|
|
this._dragBehavior.detach();
|
|
|
_super.prototype.dispose.call(this);
|
|
|
};
|
|
@@ -89567,9 +89647,9 @@ var BABYLON;
|
|
|
*/
|
|
|
function PositionGizmo(gizmoLayer) {
|
|
|
var _this = _super.call(this, gizmoLayer) || this;
|
|
|
- _this._xDrag = new BABYLON.AxisDragGizmo(gizmoLayer, new BABYLON.Vector3(1, 0, 0), BABYLON.Color3.FromHexString("#00b894"));
|
|
|
- _this._yDrag = new BABYLON.AxisDragGizmo(gizmoLayer, new BABYLON.Vector3(0, 1, 0), BABYLON.Color3.FromHexString("#d63031"));
|
|
|
- _this._zDrag = new BABYLON.AxisDragGizmo(gizmoLayer, new BABYLON.Vector3(0, 0, 1), BABYLON.Color3.FromHexString("#0984e3"));
|
|
|
+ _this._xDrag = new BABYLON.AxisDragGizmo(gizmoLayer, new BABYLON.Vector3(1, 0, 0), BABYLON.Color3.Green().scale(0.5));
|
|
|
+ _this._yDrag = new BABYLON.AxisDragGizmo(gizmoLayer, new BABYLON.Vector3(0, 1, 0), BABYLON.Color3.Red().scale(0.5));
|
|
|
+ _this._zDrag = new BABYLON.AxisDragGizmo(gizmoLayer, new BABYLON.Vector3(0, 0, 1), BABYLON.Color3.Blue().scale(0.5));
|
|
|
return _this;
|
|
|
}
|
|
|
Object.defineProperty(PositionGizmo.prototype, "attachedMesh", {
|
|
@@ -89586,6 +89666,20 @@ var BABYLON;
|
|
|
this._yDrag.interactionsEnabled = value;
|
|
|
this._zDrag.interactionsEnabled = value;
|
|
|
};
|
|
|
+ Object.defineProperty(PositionGizmo.prototype, "updateGizmoRotationToMatchAttachedMesh", {
|
|
|
+ get: function () {
|
|
|
+ return this._xDrag.updateGizmoRotationToMatchAttachedMesh;
|
|
|
+ },
|
|
|
+ set: function (value) {
|
|
|
+ if (this._xDrag) {
|
|
|
+ this._xDrag.updateGizmoRotationToMatchAttachedMesh = value;
|
|
|
+ this._yDrag.updateGizmoRotationToMatchAttachedMesh = value;
|
|
|
+ this._zDrag.updateGizmoRotationToMatchAttachedMesh = value;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
/**
|
|
|
* Disposes of the gizmo
|
|
|
*/
|
|
@@ -89615,9 +89709,9 @@ var BABYLON;
|
|
|
*/
|
|
|
function RotationGizmo(gizmoLayer) {
|
|
|
var _this = _super.call(this, gizmoLayer) || this;
|
|
|
- _this._xDrag = new BABYLON.PlaneRotationGizmo(gizmoLayer, new BABYLON.Vector3(1, 0, 0), BABYLON.Color3.FromHexString("#00b894"));
|
|
|
- _this._yDrag = new BABYLON.PlaneRotationGizmo(gizmoLayer, new BABYLON.Vector3(0, 1, 0), BABYLON.Color3.FromHexString("#d63031"));
|
|
|
- _this._zDrag = new BABYLON.PlaneRotationGizmo(gizmoLayer, new BABYLON.Vector3(0, 0, 1), BABYLON.Color3.FromHexString("#0984e3"));
|
|
|
+ _this._xDrag = new BABYLON.PlaneRotationGizmo(gizmoLayer, new BABYLON.Vector3(1, 0, 0), BABYLON.Color3.Green().scale(0.5));
|
|
|
+ _this._yDrag = new BABYLON.PlaneRotationGizmo(gizmoLayer, new BABYLON.Vector3(0, 1, 0), BABYLON.Color3.Red().scale(0.5));
|
|
|
+ _this._zDrag = new BABYLON.PlaneRotationGizmo(gizmoLayer, new BABYLON.Vector3(0, 0, 1), BABYLON.Color3.Blue().scale(0.5));
|
|
|
return _this;
|
|
|
}
|
|
|
Object.defineProperty(RotationGizmo.prototype, "attachedMesh", {
|
|
@@ -89634,6 +89728,20 @@ var BABYLON;
|
|
|
this._yDrag.interactionsEnabled = value;
|
|
|
this._zDrag.interactionsEnabled = value;
|
|
|
};
|
|
|
+ Object.defineProperty(RotationGizmo.prototype, "updateGizmoRotationToMatchAttachedMesh", {
|
|
|
+ get: function () {
|
|
|
+ return this._xDrag.updateGizmoRotationToMatchAttachedMesh;
|
|
|
+ },
|
|
|
+ set: function (value) {
|
|
|
+ if (this._xDrag) {
|
|
|
+ this._xDrag.updateGizmoRotationToMatchAttachedMesh = value;
|
|
|
+ this._yDrag.updateGizmoRotationToMatchAttachedMesh = value;
|
|
|
+ this._zDrag.updateGizmoRotationToMatchAttachedMesh = value;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
/**
|
|
|
* Disposes of the gizmo
|
|
|
*/
|
|
@@ -89663,9 +89771,9 @@ var BABYLON;
|
|
|
*/
|
|
|
function ScaleGizmo(gizmoLayer) {
|
|
|
var _this = _super.call(this, gizmoLayer) || this;
|
|
|
- _this._xDrag = new BABYLON.AxisScaleGizmo(gizmoLayer, new BABYLON.Vector3(1, 0, 0), BABYLON.Color3.FromHexString("#00b894"));
|
|
|
- _this._yDrag = new BABYLON.AxisScaleGizmo(gizmoLayer, new BABYLON.Vector3(0, 1, 0), BABYLON.Color3.FromHexString("#d63031"));
|
|
|
- _this._zDrag = new BABYLON.AxisScaleGizmo(gizmoLayer, new BABYLON.Vector3(0, 0, 1), BABYLON.Color3.FromHexString("#0984e3"));
|
|
|
+ _this._xDrag = new BABYLON.AxisScaleGizmo(gizmoLayer, new BABYLON.Vector3(1, 0, 0), BABYLON.Color3.Green().scale(0.5));
|
|
|
+ _this._yDrag = new BABYLON.AxisScaleGizmo(gizmoLayer, new BABYLON.Vector3(0, 1, 0), BABYLON.Color3.Red().scale(0.5));
|
|
|
+ _this._zDrag = new BABYLON.AxisScaleGizmo(gizmoLayer, new BABYLON.Vector3(0, 0, 1), BABYLON.Color3.Blue().scale(0.5));
|
|
|
return _this;
|
|
|
}
|
|
|
Object.defineProperty(ScaleGizmo.prototype, "attachedMesh", {
|
|
@@ -89682,6 +89790,20 @@ var BABYLON;
|
|
|
this._yDrag.interactionsEnabled = value;
|
|
|
this._zDrag.interactionsEnabled = value;
|
|
|
};
|
|
|
+ Object.defineProperty(ScaleGizmo.prototype, "updateGizmoRotationToMatchAttachedMesh", {
|
|
|
+ get: function () {
|
|
|
+ return this._xDrag.updateGizmoRotationToMatchAttachedMesh;
|
|
|
+ },
|
|
|
+ set: function (value) {
|
|
|
+ if (this._xDrag) {
|
|
|
+ this._xDrag.updateGizmoRotationToMatchAttachedMesh = value;
|
|
|
+ this._yDrag.updateGizmoRotationToMatchAttachedMesh = value;
|
|
|
+ this._zDrag.updateGizmoRotationToMatchAttachedMesh = value;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
/**
|
|
|
* Disposes of the gizmo
|
|
|
*/
|