From 7911faf130360a23fb0c48854b52cc4711b4e150 Mon Sep 17 00:00:00 2001 From: Paul Arden Date: Thu, 13 Sep 2018 16:04:04 +1000 Subject: [PATCH] Fixed problem getting glTF 2.0 camera type, fixes #2138. --- code/glTF2Asset.inl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) mode change 100644 => 100755 code/glTF2Asset.inl diff --git a/code/glTF2Asset.inl b/code/glTF2Asset.inl old mode 100644 new mode 100755 index 5a87715ce..b17df3d4e --- a/code/glTF2Asset.inl +++ b/code/glTF2Asset.inl @@ -1023,7 +1023,12 @@ inline void Mesh::Read(Value& pJSON_Object, Asset& pAsset_Root) inline void Camera::Read(Value& obj, Asset& /*r*/) { - type = MemberOrDefault(obj, "type", Camera::Perspective); + std::string type_string = std::string(MemberOrDefault(obj, "type", "perspective")); + if (type_string == "orthographic") { + type = Camera::Orthographic; + } else { + type = Camera::Perspective; + } const char* subobjId = (type == Camera::Orthographic) ? "orthographic" : "perspective";