summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-11-13 08:20:56 +0100
committerGitHub <noreply@github.com>2017-11-13 08:20:56 +0100
commit77d3c26fc382249bb491b8b335516e8230704bc9 (patch)
treede5403f1d14eb27fddfac932f40bea9405e95bbc /editor
parentf6232efed99d8190864564a0886764d88e2a58dc (diff)
parent05dce362d5d86c96f509a1d11f3ae94f97487ed2 (diff)
Merge pull request #12868 from Web-eWorks/gltf-fixes
Fix #12056: Crash while loading gtlf files.
Diffstat (limited to 'editor')
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index 831eb74b66..397bb6ad68 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -1,5 +1,6 @@
#include "editor_scene_importer_gltf.h"
#include "io/json.h"
+#include "math_defs.h"
#include "os/file_access.h"
#include "os/os.h"
#include "scene/3d/camera.h"
@@ -1378,8 +1379,8 @@ Error EditorSceneImporterGLTF::_parse_skins(GLTFState &state) {
state.nodes[skin_node]->skeleton_children.push_back(i);
}
- state.skins.push_back(skin);
}
+ state.skins.push_back(skin);
}
print_line("total skins: " + itos(state.skins.size()));
@@ -1419,7 +1420,8 @@ Error EditorSceneImporterGLTF::_parse_cameras(GLTFState &state) {
camera.perspective = true;
if (d.has("perspective")) {
Dictionary ppt = d["perspective"];
- camera.fov_size = ppt["yfov"];
+ // GLTF spec is in radians, Godot's camera is in degrees.
+ camera.fov_size = (double)ppt["yfov"] * 180.0 / Math_PI;
camera.zfar = ppt["zfar"];
camera.znear = ppt["znear"];
} else {