BsEditorUtility.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "BsAABox.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Contains miscelanous helper methods.
  10. */
  11. class BS_ED_EXPORT EditorUtility
  12. {
  13. public:
  14. /**
  15. * @brief Calculates world space bounds of the specified scene object. This will
  16. * consider components with bounds like Renderable.
  17. */
  18. static AABox calculateBounds(const HSceneObject& object);
  19. /**
  20. * @brief Calculates world space bounds of the specified scene objects. This will
  21. * consider components with bounds like Renderable.
  22. */
  23. static AABox calculateBounds(const Vector<HSceneObject>& objects);
  24. private:
  25. /**
  26. * @brief Retrieves all components containing meshes on the specified object and outputs
  27. * their bounds.
  28. *
  29. * @param object Object to calculate bounds for.
  30. * @param bounds Output bounds, if successful.
  31. *
  32. * @returns true if a mesh component was found, otherwise false (bounds will not be updated).
  33. */
  34. static bool calculateMeshBounds(const HSceneObject& object, AABox& bounds);
  35. };
  36. }