Browse Source

Merge pull request #630 from jackcaron/BlenderQuaternions

Blender quaternions
David Catuhe 10 years ago
parent
commit
922885fb03
2 changed files with 400 additions and 342 deletions
  1. 394 341
      Exporters/Blender/io_export_babylon.py
  2. 6 1
      src/Loading/Plugins/babylon.babylonFileLoader.ts

File diff suppressed because it is too large
+ 394 - 341
Exporters/Blender/io_export_babylon.py


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

@@ -478,7 +478,12 @@
                 camera.target = BABYLON.Vector3.FromArray(parsedCamera.target);
                 camera.target = BABYLON.Vector3.FromArray(parsedCamera.target);
             }
             }
         } else {
         } 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;
         camera.fov = parsedCamera.fov;