Fix 'spot' light export.

This commit is contained in:
Par Winzell 2019-02-21 12:45:02 -08:00
parent 5ec3184a8a
commit 70c3823eb7
2 changed files with 10 additions and 2 deletions

View File

@ -479,8 +479,8 @@ static void ReadLight(RawModel& raw, FbxScene* pScene, FbxNode* pNode) {
RAW_LIGHT_TYPE_SPOT,
color,
intensity,
(float)pLight->InnerAngle.Get(),
(float)pLight->OuterAngle.Get());
(float)pLight->InnerAngle.Get() * M_PI / 180,
(float)pLight->OuterAngle.Get() * M_PI / 180);
break;
}
default: {

View File

@ -34,6 +34,14 @@ json LightData::serialize() const {
break;
case Spot:
result["type"] = "spot";
json spotJson;
if (innerConeAngle != 0) {
spotJson["innerConeAngle"] = innerConeAngle;
}
if (outerConeAngle != M_PI_4) {
spotJson["outerConeAngle"] = outerConeAngle;
}
result["spot"] = spotJson;
break;
}
return result;