Box.cppm 587 B

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