瀏覽代碼

Ensures the active camera gets set in the scene when encoding a .fbx to .gpb

Kieran Cunney 13 年之前
父節點
當前提交
11f5553727
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      gameplay-encoder/src/FBXSceneEncoder.cpp

+ 6 - 0
gameplay-encoder/src/FBXSceneEncoder.cpp

@@ -250,6 +250,12 @@ void FBXSceneEncoder::loadScene(KFbxScene* fbxScene)
     KFbxColor ambientColor = fbxScene->GetGlobalSettings().GetAmbientColor();
     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 
+	// active camera.
+	// TODO: add logic to find the "active" camera node in the fbxScene
+	scene->setActiveCameraNode(scene->getFirstCameraNode());
+
     _gamePlayFile.addScene(scene);
     _gamePlayFile.addScene(scene);
 }
 }