BsEditorUtility.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. /** @addtogroup Utility-Editor
  9. * @{
  10. */
  11. /** Contains miscellaneous helper methods. */
  12. class BS_ED_EXPORT EditorUtility
  13. {
  14. public:
  15. /**
  16. * Calculates world space bounds of the specified scene object. This will consider components with bounds like
  17. * Renderable.
  18. */
  19. static AABox calculateBounds(const HSceneObject& object);
  20. /**
  21. * Calculates world space bounds of the specified scene objects. This will consider components with bounds like
  22. * Renderable.
  23. */
  24. static AABox calculateBounds(const Vector<HSceneObject>& objects);
  25. /** Calculates world space center of the specified scene objects. */
  26. static Vector3 calculateCenter(const Vector<HSceneObject>& objects);
  27. private:
  28. /**
  29. * Retrieves all components containing meshes on the specified object and outputs their bounds.
  30. *
  31. * @param[in] object Object to calculate bounds for.
  32. * @param[in] bounds Output bounds, if successful.
  33. * @return True if a mesh component was found, otherwise false (bounds will not be updated).
  34. */
  35. static bool calculateMeshBounds(const HSceneObject& object, AABox& bounds);
  36. };
  37. /** @} */
  38. }