diff --git a/code/ColladaHelper.h b/code/ColladaHelper.h index 64f68849b..f9bd4fb5a 100644 --- a/code/ColladaHelper.h +++ b/code/ColladaHelper.h @@ -119,6 +119,7 @@ struct Camera }; #define aiLightSource_AMBIENT 0xdeaddead +#define ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET 1e9f /** A collada light source. */ struct Light @@ -129,8 +130,8 @@ struct Light , mAttQuadratic (0.f) , mFalloffAngle (180.f) , mFalloffExponent (0.f) - , mPenumbraAngle (10e10f) - , mOuterAngle (10e10f) + , mPenumbraAngle (ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET) + , mOuterAngle (ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET) , mIntensity (1.f) {} diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index d201ff44f..9b3392a5c 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -325,11 +325,11 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll out->mAngleInnerCone = AI_DEG_TO_RAD( srcLight->mFalloffAngle ); - // ... some extension magic. O - if (srcLight->mOuterAngle == 10e10f) + // ... some extension magic. + if (srcLight->mOuterAngle >= ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET*(1-1e-6f)) { // ... some deprecation magic. - if (srcLight->mPenumbraAngle == 10e10f) + if (srcLight->mPenumbraAngle >= ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET*(1-1e-6f)) { // Need to rely on falloff_exponent. I don't know how to interpret it, so I need to guess .... // epsilon chosen to be 0.1