David Catuhe 9 lat temu
rodzic
commit
8fec836127

Plik diff jest za duży
+ 4 - 4
dist/preview release/babylon.core.js


Plik diff jest za duży
+ 1458 - 1458
dist/preview release/babylon.d.ts


Plik diff jest za duży
+ 5 - 5
dist/preview release/babylon.js


Plik diff jest za duży
+ 5 - 3
dist/preview release/babylon.max.js


Plik diff jest za duży
+ 4 - 4
dist/preview release/babylon.noworker.js


+ 3 - 2
src/Math/babylon.math.js

@@ -1657,7 +1657,9 @@ var BABYLON;
             return new Quaternion(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);
         };
         Quaternion.RotationYawPitchRoll = function (yaw, pitch, roll) {
-            return Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, new Quaternion());
+            var q = new Quaternion();
+            Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, q);
+            return q;
         };
         Quaternion.RotationYawPitchRollToRef = function (yaw, pitch, roll, result) {
             // Produces a quaternion from Euler angles in the z-y-x orientation (Tait-Bryan angles)
@@ -1674,7 +1676,6 @@ var BABYLON;
             result.y = (sinYaw * cosPitch * cosRoll) - (cosYaw * sinPitch * sinRoll);
             result.z = (cosYaw * cosPitch * sinRoll) - (sinYaw * sinPitch * cosRoll);
             result.w = (cosYaw * cosPitch * cosRoll) + (sinYaw * sinPitch * sinRoll);
-            return result;
         };
         Quaternion.RotationAlphaBetaGamma = function (alpha, beta, gamma) {
             var result = new Quaternion();

+ 1 - 0
src/Mesh/babylon.abstractMesh.js

@@ -682,6 +682,7 @@ var BABYLON;
             var yaw = -Math.atan2(dv.z, dv.x) - Math.PI / 2;
             var len = Math.sqrt(dv.x * dv.x + dv.z * dv.z);
             var pitch = Math.atan2(dv.y, len);
+            this.rotationQuaternion = this.rotationQuaternion || new BABYLON.Quaternion();
             BABYLON.Quaternion.RotationYawPitchRollToRef(yaw + yawCor, pitch + pitchCor, rollCor, this.rotationQuaternion);
         };
         AbstractMesh.prototype.attachToBone = function (bone, affectedMesh) {