Explorar o código

Merge pull request #204 from blackberry-gaming/next-kcunney

Fix for unset active camera in scene.
Sean Paul Taylor %!s(int64=13) %!d(string=hai) anos
pai
achega
15889025a4
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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();
     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);
 }