Explorar o código

camera support rotationQuaternion

jackcaron %!s(int64=10) %!d(string=hai) anos
pai
achega
c69f9be8ab
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      src/Loading/Plugins/babylon.babylonFileLoader.ts

+ 6 - 1
src/Loading/Plugins/babylon.babylonFileLoader.ts

@@ -478,7 +478,12 @@
                 camera.target = BABYLON.Vector3.FromArray(parsedCamera.target);
             }
         } else {
-            camera.rotation = BABYLON.Vector3.FromArray(parsedCamera.rotation);
+            if (parsedCamera.rotationQuaternion) {
+                camera.rotationQuaternion = BABYLON.Quaternion.FromArray(parsedCamera.rotationQuaternion);
+            }
+            else {
+                camera.rotation = BABYLON.Vector3.FromArray(parsedCamera.rotation);
+            }
         }
 
         camera.fov = parsedCamera.fov;