|
@@ -66605,6 +66605,8 @@ var BABYLON;
|
|
*/
|
|
*/
|
|
function AxesViewer(scene, scaleLines) {
|
|
function AxesViewer(scene, scaleLines) {
|
|
if (scaleLines === void 0) { scaleLines = 1; }
|
|
if (scaleLines === void 0) { scaleLines = 1; }
|
|
|
|
+ this._tmpVector = new BABYLON.Vector3();
|
|
|
|
+ this._scaleLinesFactor = 4;
|
|
/**
|
|
/**
|
|
* Gets or sets a number used to scale line length
|
|
* Gets or sets a number used to scale line length
|
|
*/
|
|
*/
|
|
@@ -66623,11 +66625,11 @@ var BABYLON;
|
|
this._ymesh = BABYLON.AxisDragGizmo._CreateArrow(scene, greenColoredMaterial);
|
|
this._ymesh = BABYLON.AxisDragGizmo._CreateArrow(scene, greenColoredMaterial);
|
|
this._zmesh = BABYLON.AxisDragGizmo._CreateArrow(scene, blueColoredMaterial);
|
|
this._zmesh = BABYLON.AxisDragGizmo._CreateArrow(scene, blueColoredMaterial);
|
|
this._xmesh.rotationQuaternion = new BABYLON.Quaternion();
|
|
this._xmesh.rotationQuaternion = new BABYLON.Quaternion();
|
|
- this._xmesh.scaling.scaleInPlace(4);
|
|
|
|
|
|
+ this._xmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
|
|
this._ymesh.rotationQuaternion = new BABYLON.Quaternion();
|
|
this._ymesh.rotationQuaternion = new BABYLON.Quaternion();
|
|
- this._ymesh.scaling.scaleInPlace(4);
|
|
|
|
|
|
+ this._ymesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
|
|
this._zmesh.rotationQuaternion = new BABYLON.Quaternion();
|
|
this._zmesh.rotationQuaternion = new BABYLON.Quaternion();
|
|
- this._zmesh.scaling.scaleInPlace(4);
|
|
|
|
|
|
+ this._zmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
|
|
AxesViewer._recursiveChangeRenderingGroupId(this._xmesh, 2);
|
|
AxesViewer._recursiveChangeRenderingGroupId(this._xmesh, 2);
|
|
AxesViewer._recursiveChangeRenderingGroupId(this._ymesh, 2);
|
|
AxesViewer._recursiveChangeRenderingGroupId(this._ymesh, 2);
|
|
AxesViewer._recursiveChangeRenderingGroupId(this._zmesh, 2);
|
|
AxesViewer._recursiveChangeRenderingGroupId(this._zmesh, 2);
|
|
@@ -66674,21 +66676,21 @@ var BABYLON;
|
|
AxesViewer.prototype.update = function (position, xaxis, yaxis, zaxis) {
|
|
AxesViewer.prototype.update = function (position, xaxis, yaxis, zaxis) {
|
|
if (this._xmesh) {
|
|
if (this._xmesh) {
|
|
this._xmesh.position.copyFrom(position);
|
|
this._xmesh.position.copyFrom(position);
|
|
- var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), xaxis);
|
|
|
|
- this._xmesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), xaxis));
|
|
|
|
- this._xmesh.rotationQuaternion.normalize();
|
|
|
|
|
|
+ xaxis.scaleToRef(-1, this._tmpVector);
|
|
|
|
+ this._xmesh.setDirection(this._tmpVector);
|
|
|
|
+ this._xmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
|
|
}
|
|
}
|
|
if (this._ymesh) {
|
|
if (this._ymesh) {
|
|
this._ymesh.position.copyFrom(position);
|
|
this._ymesh.position.copyFrom(position);
|
|
- var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), yaxis);
|
|
|
|
- this._ymesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), yaxis));
|
|
|
|
- this._ymesh.rotationQuaternion.normalize();
|
|
|
|
|
|
+ yaxis.scaleToRef(-1, this._tmpVector);
|
|
|
|
+ this._ymesh.setDirection(this._tmpVector);
|
|
|
|
+ this._ymesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
|
|
}
|
|
}
|
|
if (this._zmesh) {
|
|
if (this._zmesh) {
|
|
this._zmesh.position.copyFrom(position);
|
|
this._zmesh.position.copyFrom(position);
|
|
- var cross = BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), zaxis);
|
|
|
|
- this._zmesh.rotationQuaternion.set(cross.x, cross.y, cross.z, 1 + BABYLON.Vector3.Dot(BABYLON.Vector3.Forward(), zaxis));
|
|
|
|
- this._zmesh.rotationQuaternion.normalize();
|
|
|
|
|
|
+ zaxis.scaleToRef(-1, this._tmpVector);
|
|
|
|
+ this._zmesh.setDirection(this._tmpVector);
|
|
|
|
+ this._zmesh.scaling.setAll(this.scaleLines * this._scaleLinesFactor);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
/** Releases resources */
|
|
/** Releases resources */
|
|
@@ -67002,7 +67004,7 @@ var BABYLON;
|
|
* @returns true if visible otherwise, false
|
|
* @returns true if visible otherwise, false
|
|
*/
|
|
*/
|
|
DebugLayer.prototype.isVisible = function () {
|
|
DebugLayer.prototype.isVisible = function () {
|
|
- return this.BJSINSPECTOR.Inspector.IsVisible;
|
|
|
|
|
|
+ return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Hide the inspector and close its window.
|
|
* Hide the inspector and close its window.
|