Skip to content

Commit

Permalink
Update ColladaLoader.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kimkulling authored Sep 30, 2020
1 parent 0191c66 commit c7f7ed8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions code/AssetLib/Collada/ColladaLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,11 @@ void ColladaLoader::BuildLightsForNode(const ColladaParser &pParser, const Colla
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
if ( 0.0f == srcLight->mFalloffExponent ) {
srcLight->mFalloffExponent = 1.0f;
float f = 1.0f;
if ( 0.0f != srcLight->mFalloffExponent ) {
f = 1.f / srcLight->mFalloffExponent;
}
out->mAngleOuterCone = std::acos(std::pow(0.1f, 1.f / srcLight->mFalloffExponent)) +
out->mAngleOuterCone = std::acos(std::pow(0.1f, f)) +
out->mAngleInnerCone;
} else {
out->mAngleOuterCone = out->mAngleInnerCone + AI_DEG_TO_RAD(srcLight->mPenumbraAngle);
Expand Down

0 comments on commit c7f7ed8

Please sign in to comment.