|
@@ -858,15 +858,15 @@ var BABYLON;
|
|
x = -t * Math.sqrt(1 / (1 + t * t));
|
|
x = -t * Math.sqrt(1 / (1 + t * t));
|
|
z = Math.sqrt(1 / (1 + t * t));
|
|
z = Math.sqrt(1 / (1 + t * t));
|
|
}
|
|
}
|
|
- w2 = new BABYLON.Vector3(x, y, z);
|
|
|
|
- v2 = BABYLON.Vector3.Cross(w2, u1); // v2 image of v1 through rotation around u1
|
|
|
|
- cross = BABYLON.Vector3.Cross(w, w2); // returns same direction as u1 (=local x) if positive angle : cross(source, image)
|
|
|
|
- if (BABYLON.Vector3.Dot(u1, cross) < 0) {
|
|
|
|
|
|
+ w2 = new Vector3(x, y, z);
|
|
|
|
+ v2 = Vector3.Cross(w2, u1); // v2 image of v1 through rotation around u1
|
|
|
|
+ cross = Vector3.Cross(w, w2); // returns same direction as u1 (=local x) if positive angle : cross(source, image)
|
|
|
|
+ if (Vector3.Dot(u1, cross) < 0) {
|
|
sign = 1;
|
|
sign = 1;
|
|
}
|
|
}
|
|
- dot = BABYLON.Vector3.Dot(w, w2);
|
|
|
|
|
|
+ dot = Vector3.Dot(w, w2);
|
|
pitch = Math.acos(dot) * sign;
|
|
pitch = Math.acos(dot) * sign;
|
|
- if (BABYLON.Vector3.Dot(v2, Y) < 0) {
|
|
|
|
|
|
+ if (Vector3.Dot(v2, Y) < 0) {
|
|
pitch = Math.PI + pitch;
|
|
pitch = Math.PI + pitch;
|
|
v2 = v2.scaleInPlace(-1);
|
|
v2 = v2.scaleInPlace(-1);
|
|
w2 = w2.scaleInPlace(-1);
|
|
w2 = w2.scaleInPlace(-1);
|
|
@@ -875,16 +875,16 @@ var BABYLON;
|
|
// step 3 : rotate around v2
|
|
// step 3 : rotate around v2
|
|
// Rv2(u1) = X, same as Rv2(w2) = Z, with X=(1,0,0) and Z=(0,0,1)
|
|
// Rv2(u1) = X, same as Rv2(w2) = Z, with X=(1,0,0) and Z=(0,0,1)
|
|
sign = -1;
|
|
sign = -1;
|
|
- cross = BABYLON.Vector3.Cross(X, u1); // returns same direction as Y if positive angle : cross(source, image)
|
|
|
|
- if (BABYLON.Vector3.Dot(cross, Y) < 0) {
|
|
|
|
|
|
+ cross = Vector3.Cross(X, u1); // returns same direction as Y if positive angle : cross(source, image)
|
|
|
|
+ if (Vector3.Dot(cross, Y) < 0) {
|
|
sign = 1;
|
|
sign = 1;
|
|
}
|
|
}
|
|
- dot = BABYLON.Vector3.Dot(u1, X);
|
|
|
|
|
|
+ dot = Vector3.Dot(u1, X);
|
|
yaw = -Math.acos(dot) * sign; // negative : plane zOx oriented clockwise
|
|
yaw = -Math.acos(dot) * sign; // negative : plane zOx oriented clockwise
|
|
if (dot < 0 && nbRevert < 2) {
|
|
if (dot < 0 && nbRevert < 2) {
|
|
yaw = Math.PI + yaw;
|
|
yaw = Math.PI + yaw;
|
|
}
|
|
}
|
|
- return new BABYLON.Vector3(pitch, yaw, roll);
|
|
|
|
|
|
+ return new Vector3(pitch, yaw, roll);
|
|
};
|
|
};
|
|
return Vector3;
|
|
return Vector3;
|
|
})();
|
|
})();
|
|
@@ -2882,7 +2882,7 @@ var BABYLON;
|
|
var hermite = new Array();
|
|
var hermite = new Array();
|
|
var step = 1 / nbPoints;
|
|
var step = 1 / nbPoints;
|
|
for (var i = 0; i <= nbPoints; i++) {
|
|
for (var i = 0; i <= nbPoints; i++) {
|
|
- hermite.push(BABYLON.Vector3.Hermite(p1, t1, p2, t2, i * step));
|
|
|
|
|
|
+ hermite.push(Vector3.Hermite(p1, t1, p2, t2, i * step));
|
|
}
|
|
}
|
|
return new Curve3(hermite);
|
|
return new Curve3(hermite);
|
|
};
|
|
};
|
|
@@ -2976,7 +2976,7 @@ var BABYLON;
|
|
Matrix.LookAtLHToRef = Matrix.LookAtLHToRefSIMD;
|
|
Matrix.LookAtLHToRef = Matrix.LookAtLHToRefSIMD;
|
|
Vector3.TransformCoordinatesToRef = Vector3.TransformCoordinatesToRefSIMD;
|
|
Vector3.TransformCoordinatesToRef = Vector3.TransformCoordinatesToRefSIMD;
|
|
Vector3.TransformCoordinatesFromFloatsToRef = Vector3.TransformCoordinatesFromFloatsToRefSIMD;
|
|
Vector3.TransformCoordinatesFromFloatsToRef = Vector3.TransformCoordinatesFromFloatsToRefSIMD;
|
|
- Object.defineProperty(BABYLON.Vector3.prototype, "x", {
|
|
|
|
|
|
+ Object.defineProperty(Vector3.prototype, "x", {
|
|
get: function () { return this._data[0]; },
|
|
get: function () { return this._data[0]; },
|
|
set: function (value) {
|
|
set: function (value) {
|
|
if (!this._data) {
|
|
if (!this._data) {
|
|
@@ -2985,13 +2985,13 @@ var BABYLON;
|
|
this._data[0] = value;
|
|
this._data[0] = value;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- Object.defineProperty(BABYLON.Vector3.prototype, "y", {
|
|
|
|
|
|
+ Object.defineProperty(Vector3.prototype, "y", {
|
|
get: function () { return this._data[1]; },
|
|
get: function () { return this._data[1]; },
|
|
set: function (value) {
|
|
set: function (value) {
|
|
this._data[1] = value;
|
|
this._data[1] = value;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- Object.defineProperty(BABYLON.Vector3.prototype, "z", {
|
|
|
|
|
|
+ Object.defineProperty(Vector3.prototype, "z", {
|
|
get: function () { return this._data[2]; },
|
|
get: function () { return this._data[2]; },
|
|
set: function (value) {
|
|
set: function (value) {
|
|
this._data[2] = value;
|
|
this._data[2] = value;
|