CmRect.h 801 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include "CmPrerequisitesUtil.h"
  3. namespace CamelotFramework
  4. {
  5. class CM_UTILITY_EXPORT Rect
  6. {
  7. public:
  8. Rect();
  9. Rect(int _x, int _y, int _width, int _height);
  10. bool contains(const Int2& point) const;
  11. bool overlaps(const Rect& other) const;
  12. void encapsulate(const Rect& other);
  13. void clip(const Rect& clipRect);
  14. /**
  15. * @brief Transforms the bounds by the given matrix.
  16. * Resulting value is an axis aligned rectangle encompassing the transformed points.
  17. *
  18. * @note Since the resulting value is an AA rectangle of the original transformed rectangle, the bounds
  19. * will be larger than needed. Oriented rectangle would provide a much tighter fit.
  20. */
  21. void transform(const Matrix4& matrix);
  22. int x, y, width, height;
  23. };
  24. }