123456789101112131415161718192021222324252627282930 |
- #ifndef COLLISION_BOX_H
- #define COLLISION_BOX_H
- #include "math/Vector.h"
- #include "utils/StringBuffer.h"
- class Box {
- Vector3 min;
- Vector3 max;
- Box(const Vector3& min, const Vector3& max);
- public:
- Box(const Vector3& size);
- Box offset(const Vector3& offset) const;
- bool collidesWith(const Box& other) const;
- Box expand(const Vector3& offset) const;
- Box grow(const Vector3& growth) const;
- const Vector3& getMin() const;
- const Vector3& getMax() const;
- template<int L>
- void toString(StringBuffer<L>& s) const {
- s.append("Box(").append(min).append(", ").append(max).append(")");
- }
- };
- #endif
|