Merge branch 'master' into findDegeneratesOptimization

pull/3484/head
Malcolm Tyrrell 2020-11-17 09:44:13 +00:00 committed by GitHub
commit c4573a6d5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -3481,10 +3481,11 @@ void FBXConverter::ConvertOrphanedEmbeddedTextures() {
const char *obtype = key.begin();
const size_t length = static_cast<size_t>(key.end() - key.begin());
if (strncmp(obtype, "Texture", length) == 0) {
const Texture *texture = static_cast<const Texture *>(object->Get());
if (texture->Media() && texture->Media()->ContentLength() > 0) {
realTexture = texture;
}
if (const Texture *texture = static_cast<const Texture *>(object->Get())) {
if (texture->Media() && texture->Media()->ContentLength() > 0) {
realTexture = texture;
}
}
}
} catch (...) {
// do nothing

View File

@ -1282,7 +1282,7 @@ inline void Light::Read(Value &obj, Asset & /*r*/) {
Value *spot = FindObject(obj, "spot");
if (!spot) throw DeadlyImportError("GLTF: Light missing its spot parameters");
innerConeAngle = MemberOrDefault(*spot, "innerConeAngle", 0.0f);
outerConeAngle = MemberOrDefault(*spot, "outerConeAngle", M_PI / 4.0f);
outerConeAngle = MemberOrDefault(*spot, "outerConeAngle", static_cast<float>(M_PI / 4.0f));
}
}