|
|
@@ -248,7 +248,7 @@ void FBXSceneEncoder::loadScene(KFbxScene* fbxScene)
|
|
|
|
|
|
// Find the ambient light of the scene
|
|
|
KFbxColor ambientColor = fbxScene->GetGlobalSettings().GetAmbientColor();
|
|
|
- scene->setAmbientColor((float)ambientColor.mRed, (float)ambientColor.mGreen, (float)ambientColor.mBlue);
|
|
|
+ scene->setAmbientColor((float)ambientColor.mRed, (float)ambientColor.mGreen, (float)ambientColor.mBlue);
|
|
|
|
|
|
// Assign the first camera node (if there is one) in the scene as the active camera
|
|
|
// This ensures that if there's a camera in the scene that it is assigned as the
|
|
|
@@ -651,64 +651,20 @@ void FBXSceneEncoder::loadLight(KFbxNode* fbxNode, Node* node)
|
|
|
|
|
|
switch (fbxLight->LightType.Get())
|
|
|
{
|
|
|
- case KFbxLight::ePOINT:
|
|
|
- {
|
|
|
- KFbxLight::EDecayType decayType = fbxLight->DecayType.Get();
|
|
|
- switch (decayType)
|
|
|
- {
|
|
|
- case KFbxLight::eNONE:
|
|
|
- // No decay.
|
|
|
- light->setAmbientLight();
|
|
|
- break;
|
|
|
- case KFbxLight::eLINEAR:
|
|
|
- light->setPointLight();
|
|
|
- light->setLinearAttenuation((float)fbxLight->DecayStart.Get());
|
|
|
- break;
|
|
|
- case KFbxLight::eQUADRATIC:
|
|
|
- light->setPointLight();
|
|
|
- light->setQuadraticAttenuation((float)fbxLight->DecayStart.Get());
|
|
|
- break;
|
|
|
- case KFbxLight::eCUBIC:
|
|
|
- default:
|
|
|
- // Not supported..
|
|
|
- break;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- case KFbxLight::eDIRECTIONAL:
|
|
|
- {
|
|
|
- light->setDirectionalLight();
|
|
|
- break;
|
|
|
- }
|
|
|
- case KFbxLight::eSPOT:
|
|
|
- {
|
|
|
- light->setSpotLight();
|
|
|
-
|
|
|
- KFbxLight::EDecayType decayType = fbxLight->DecayType.Get();
|
|
|
- switch (decayType)
|
|
|
- {
|
|
|
- case KFbxLight::eNONE:
|
|
|
- // No decay.
|
|
|
- break;
|
|
|
- case KFbxLight::eLINEAR:
|
|
|
- light->setLinearAttenuation((float)fbxLight->DecayStart.Get());
|
|
|
- break;
|
|
|
- case KFbxLight::eQUADRATIC:
|
|
|
- light->setQuadraticAttenuation((float)fbxLight->DecayStart.Get());
|
|
|
- break;
|
|
|
- case KFbxLight::eCUBIC:
|
|
|
- // Not supported..
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- light->setFalloffAngle(MATH_DEG_TO_RAD((float)fbxLight->ConeAngle.Get()) * 2.0f); // fall off angle
|
|
|
- break;
|
|
|
- }
|
|
|
- default:
|
|
|
- {
|
|
|
- warning("Unknown light type in node.");
|
|
|
- return;
|
|
|
- }
|
|
|
+ case KFbxLight::ePOINT:
|
|
|
+ light->setPointLight();
|
|
|
+ // TODO: range
|
|
|
+ break;
|
|
|
+ case KFbxLight::eDIRECTIONAL:
|
|
|
+ light->setDirectionalLight();
|
|
|
+ break;
|
|
|
+ case KFbxLight::eSPOT:
|
|
|
+ light->setSpotLight();
|
|
|
+ // TODO: range and angles
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ warning("Unknown light type in node.");
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
_gamePlayFile.addLight(light);
|