UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
geometricshape.h
Go to the documentation of this file.
1 #ifndef PYRAMIDWORKS_GEOMETRY_GEOMETRYOBJECT_H_
2 #define PYRAMIDWORKS_GEOMETRY_GEOMETRYOBJECT_H_
3 
4 #include <ugdk/math/vector2D.h>
5 #include <ugdk/structure.h>
7 
8 namespace pyramidworks {
9 namespace geometry {
10 
14  public:
15  virtual ~GeometricShape() {}
16 
18 
22  virtual bool Intersects(const ugdk::math::Vector2D& this_pos, const GeometricShape *obj, const ugdk::math::Vector2D& that_pos) const = 0;
23 
25 
29  virtual bool Intersects(const ugdk::math::Vector2D& this_pos, const Circle *obj, const ugdk::math::Vector2D& that_pos) const = 0;
30 
32 
36  virtual bool Intersects(const ugdk::math::Vector2D& this_pos, const Rect *obj, const ugdk::math::Vector2D& that_pos) const = 0;
37 
39 
43  virtual bool Intersects(const ugdk::math::Vector2D& this_pos, const ConvexPolygon *obj, const ugdk::math::Vector2D& that_pos) const = 0;
44 
46 
49  virtual ugdk::structure::Box<2> GetBoundingBox(const ugdk::math::Vector2D& position) const = 0;
50 
51  protected:
54 };
55 
56 } // namespace geometry
57 } // namespace pyramidworks
58 
59 #endif /* PYRAMIDWORKS_GEOMETRY_GEOMETRYOBJECT_H_ */
virtual ugdk::structure::Box< 2 > GetBoundingBox(const ugdk::math::Vector2D &position) const =0
Returns a bounding box for this shape.
Definition: vector2D.h:18
Definition: collisionclass.h:13
virtual ~GeometricShape()
Definition: geometricshape.h:15
Definition: circle.h:11
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
GeometricShape()
Definition: geometricshape.h:53
virtual bool Intersects(const ugdk::math::Vector2D &this_pos, const GeometricShape *obj, const ugdk::math::Vector2D &that_pos) const =0
Checks if this shape intersects another shape.
Definition: rect.h:11