|
@@ -2940,18 +2940,7 @@ var BABYLON;
|
|
|
* @returns a new Quaternion object, computed from the Vector3 coordinates
|
|
|
*/
|
|
|
Vector3.prototype.toQuaternion = function () {
|
|
|
- var result = new Quaternion(0.0, 0.0, 0.0, 1.0);
|
|
|
- var cosxPlusz = Math.cos((this.x + this.z) * 0.5);
|
|
|
- var sinxPlusz = Math.sin((this.x + this.z) * 0.5);
|
|
|
- var coszMinusx = Math.cos((this.z - this.x) * 0.5);
|
|
|
- var sinzMinusx = Math.sin((this.z - this.x) * 0.5);
|
|
|
- var cosy = Math.cos(this.y * 0.5);
|
|
|
- var siny = Math.sin(this.y * 0.5);
|
|
|
- result.x = coszMinusx * siny;
|
|
|
- result.y = -sinzMinusx * siny;
|
|
|
- result.z = sinxPlusz * cosy;
|
|
|
- result.w = cosxPlusz * cosy;
|
|
|
- return result;
|
|
|
+ return BABYLON.Quaternion.RotationYawPitchRoll(this.x, this.y, this.z);
|
|
|
};
|
|
|
/**
|
|
|
* Adds the given vector to the current Vector3
|
|
@@ -104843,7 +104832,7 @@ var BABYLON;
|
|
|
});
|
|
|
loadAttribute("TANGENT", BABYLON.VertexBuffer.TangentKind, function (babylonVertexBuffer, data) {
|
|
|
var dataIndex = 0;
|
|
|
- babylonVertexBuffer.forEach(data.length, function (value, index) {
|
|
|
+ babylonVertexBuffer.forEach(data.length / 3 * 4, function (value, index) {
|
|
|
// Tangent data for morph targets is stored as xyz delta.
|
|
|
// The vertexData.tangent is stored as xyzw.
|
|
|
// So we need to skip every fourth vertexData.tangent.
|