BsEditorUtility.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. /**
  26. * Calculates world space center of the specified scene objects.
  27. */
  28. static Vector3 calculateCenter(const Vector<HSceneObject>& objects);
  29. private:
  30. /**
  31. * Retrieves all components containing meshes on the specified object and outputs their bounds.
  32. *
  33. * @param[in] object Object to calculate bounds for.
  34. * @param[in] bounds Output bounds, if successful.
  35. * @return True if a mesh component was found, otherwise false (bounds will not be updated).
  36. */
  37. static bool calculateMeshBounds(const HSceneObject& object, AABox& bounds);
  38. };
  39. /** @} */
  40. }