ソースを参照

camera support rotationQuaternion

jackcaron 10 年 前
コミット
c69f9be8ab
1 ファイル変更6 行追加1 行削除
  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;