|
@@ -59442,12 +59442,14 @@ var BABYLON;
|
|
|
// get the difference of the two closest points
|
|
|
var qtc = BABYLON.Tmp.Vector3[4];
|
|
|
v.scaleToRef(tc, qtc);
|
|
|
- var dP = BABYLON.Tmp.Vector3[5];
|
|
|
- u.scaleToRef(sc, dP);
|
|
|
- dP.addInPlace(w).subtractInPlace(qtc); // = S1(sc) - S2(tc)
|
|
|
+ var qsc = BABYLON.Tmp.Vector3[5];
|
|
|
+ u.scaleToRef(sc, qsc);
|
|
|
+ qsc.addInPlace(w);
|
|
|
+ var dP = BABYLON.Tmp.Vector3[6];
|
|
|
+ qsc.subtractToRef(qtc, dP); // = S1(sc) - S2(tc)
|
|
|
var isIntersected = (tc > 0) && (tc <= this.length) && (dP.lengthSquared() < (threshold * threshold)); // return intersection result
|
|
|
if (isIntersected) {
|
|
|
- return qtc.length();
|
|
|
+ return qsc.length();
|
|
|
}
|
|
|
return -1;
|
|
|
};
|
|
@@ -104305,9 +104307,6 @@ var BABYLON;
|
|
|
rotateSpheres[index].lookAt(BABYLON.Vector3.Cross(BABYLON.Vector3.Forward(), rotateSpheres[index].position.normalizeToNew()).normalizeToNew().add(rotateSpheres[index].position));
|
|
|
}
|
|
|
if (this.fixedDragMeshScreenSize) {
|
|
|
- this._rootMesh.computeWorldMatrix();
|
|
|
- this._rotateSpheresParent.computeWorldMatrix();
|
|
|
- rotateSpheres[index].computeWorldMatrix();
|
|
|
rotateSpheres[index].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);
|
|
|
var distanceFromCamera = this.rotationSphereSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor;
|
|
|
rotateSpheres[index].scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera);
|
|
@@ -104329,9 +104328,6 @@ var BABYLON;
|
|
|
scaleBoxes[index].position.set(this._boundingDimensions.x * i, this._boundingDimensions.y * j, this._boundingDimensions.z * k);
|
|
|
scaleBoxes[index].position.addInPlace(new BABYLON.Vector3(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2));
|
|
|
if (this.fixedDragMeshScreenSize) {
|
|
|
- this._rootMesh.computeWorldMatrix();
|
|
|
- this._scaleBoxesParent.computeWorldMatrix();
|
|
|
- scaleBoxes[index].computeWorldMatrix();
|
|
|
scaleBoxes[index].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);
|
|
|
var distanceFromCamera = this.scaleBoxSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor;
|
|
|
scaleBoxes[index].scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera);
|