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