CmSceneManager.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmModule.h"
  4. namespace CamelotEngine
  5. {
  6. /**
  7. * @brief Manages all objects in the scene and provides various query methods
  8. * for finding objects you need. This is just the base class with basic
  9. * query functionality. You should override it with your own version that
  10. * implements a spatial data structure of your choice for faster queries.
  11. */
  12. class CM_EXPORT SceneManager : public Module<SceneManager>
  13. {
  14. public:
  15. SceneManager();
  16. virtual ~SceneManager();
  17. GameObjectPtr getRootNode() const { return mRootNode; }
  18. private:
  19. friend class GameObject;
  20. GameObjectPtr mRootNode;
  21. /**
  22. * @brief Register a new node in the scene manager, on the top-most level of the hierarchy.
  23. *
  24. * @note After you add a node in the scene manager, it takes ownership of its memory and is responsible for releasing it.
  25. * Do NOT add nodes that have already been added (i.e. if you just want to change their parent). Normally this method will only be called by GameObject.
  26. *
  27. * @param [in] node Node you wish to add. It's your responsibility not to add duplicate or null nodes. This method won't check.
  28. */
  29. void registerNewGO(GameObjectPtr node);
  30. };
  31. CM_EXPORT SceneManager& gSceneManager();
  32. }