diff --git a/src/fbx/Fbx2Raw.cpp b/src/fbx/Fbx2Raw.cpp index 3b31cc7..189828e 100644 --- a/src/fbx/Fbx2Raw.cpp +++ b/src/fbx/Fbx2Raw.cpp @@ -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: { diff --git a/src/gltf/properties/LightData.cpp b/src/gltf/properties/LightData.cpp index d090f9e..34bdd40 100644 --- a/src/gltf/properties/LightData.cpp +++ b/src/gltf/properties/LightData.cpp @@ -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;