Merge pull request #2158 from migenius/migenius-rsws52

Merge fix to prevent errors when orthographic cameras encountered in glTF 2.0
pull/2162/head
Kim Kulling 2018-09-27 18:18:27 +02:00 committed by GitHub
commit bf347b82ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

7
code/glTF2Asset.inl 100644 → 100755
View File

@ -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";