1 #ifndef PYRAMIDWORKS_GEOMETRY_RECT_H_
2 #define PYRAMIDWORKS_GEOMETRY_RECT_H_
15 Rect(
double _width,
double _height) :
GeometricShape(), half_width_(_width/2), half_height_(_height/2) {}
19 double width()
const {
return 2*half_width_; }
23 double height()
const {
return 2*half_height_; }
32 double half_width_, half_height_;
Definition: vector2D.h:18
double width() const
Returns the rect width.
Definition: rect.h:19
Rect(double _width, double _height)
Definition: rect.h:15
Definition: collisionclass.h:13
ugdk::structure::Box< 2 > GetBoundingBox(const ugdk::math::Vector2D &position) const
Returns a bounding box for this shape.
bool Intersects(const ugdk::math::Vector2D &this_pos, const GeometricShape *obj, const ugdk::math::Vector2D &that_pos) const
Checks if this shape intersects another shape.
Definition: geometricshape.h:13
A convex polygon, one type of GeometricShape. This determines a polygon conposed by at least 3 vertic...
Definition: convexpolygon.h:11
double height() const
Returns the rect height.
Definition: rect.h:23