scene.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef SCENE_H
  2. #define SCENE_H
  3. #include <vector>
  4. #include <queue>
  5. #include "model.h"
  6. #include "camera.h"
  7. //Keeps track of all the lights, models and cameras contained in a current
  8. //scene. Also performs frustrumc ulling to determine what objects to send to
  9. //the render queue visibility.
  10. class Scene{
  11. public:
  12. //Builds a scene based on a path to the folder containing the scene's
  13. //content
  14. Scene(const std::string &sceneFolder);
  15. ~Scene();
  16. //Updates all models, lights and cameras in scene
  17. void update();
  18. //Returns the list of models not culled by the frustrum
  19. std::queue<Model*>* getVisiblemodels();
  20. Camera * getCurrentCamera();
  21. //Used in the scene loading check to determine if models were loaded
  22. //correctly. It sends this info upstream to the scene manager to abort
  23. //the load procedure.
  24. bool checkIfEmpty();
  25. private:
  26. Camera mainCamera;
  27. bool emptyScene;
  28. std::vector<Model*> modelsInScene;
  29. //Contains the models that remain after frustrum culling
  30. std::queue<Model*> visibleModels;
  31. bool loadSceneModels(const std::string &sceneFolder);
  32. //Cull objects that should not be visible and add the visible to the
  33. //visibleModels list for rendering TO DO
  34. void frustrumCulling();
  35. };
  36. #endif