Box.h 505 B

12345678910111213141516171819202122
  1. #ifndef CORE_BOX_H
  2. #define CORE_BOX_H
  3. #include "core/Vector.h"
  4. typedef union {
  5. struct {
  6. Vector3 min;
  7. Vector3 max;
  8. };
  9. Vector3 v[2];
  10. } Box;
  11. #define BOX ((Box){0})
  12. void setBox(Box* box, const Vector3* size);
  13. void offsetBox(Box* box, const Vector3* offset);
  14. bool collidesWithBox(const Box* box, const Box* other);
  15. void expandBox(Box* box, const Vector3* offset);
  16. void growBox(Box* box, const Vector3* growth);
  17. size_t toStringBox(const Box* box, char* buffer, size_t n);
  18. #endif