Box.cppm 599 B

12345678910111213141516171819202122232425262728
  1. module;
  2. export module Core.Box;
  3. import Core.Vector;
  4. import Core.Types;
  5. export namespace Core {
  6. class Box final {
  7. Vector3 min;
  8. Vector3 max;
  9. Box(const Vector3& min, const Vector3& max);
  10. public:
  11. Box(const Vector3& size);
  12. Box offset(const Vector3& offset) const;
  13. bool collidesWith(const Box& other) const;
  14. Box expand(const Vector3& offset) const;
  15. Box grow(const Vector3& growth) const;
  16. const Vector3& getMin() const;
  17. const Vector3& getMax() const;
  18. size_t toString(char* s, size_t n) const;
  19. };
  20. }