Pārlūkot izejas kodu

camera support rotationQuaternion

jackcaron 10 gadi atpakaļ
vecāks
revīzija
c69f9be8ab
1 mainītis faili ar 6 papildinājumiem un 1 dzēšanām
  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;