BsEditorUtility.h 1.0 KB

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