UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
pyramidworks::geometry::GeometricShape Class Referenceabstract

#include "pyramidworks/geometry/geometricshape.h"

Inheritance diagram for pyramidworks::geometry::GeometricShape:

Public Member Functions

virtual ~GeometricShape ()
 
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. More...
 
virtual bool Intersects (const ugdk::math::Vector2D &this_pos, const Circle *obj, const ugdk::math::Vector2D &that_pos) const =0
 Checks if there's an intersection with a Circle. More...
 
virtual bool Intersects (const ugdk::math::Vector2D &this_pos, const Rect *obj, const ugdk::math::Vector2D &that_pos) const =0
 Checks if there's an intersection with a Rect. More...
 
virtual bool Intersects (const ugdk::math::Vector2D &this_pos, const ConvexPolygon *obj, const ugdk::math::Vector2D &that_pos) const =0
 Checks if there's an intersection with a Convex Polygon. More...
 
virtual ugdk::structure::Box< 2 > GetBoundingBox (const ugdk::math::Vector2D &position) const =0
 Returns a bounding box for this shape. More...
 

Protected Member Functions

 GeometricShape ()
 

Detailed Description

A geometric shape.

Constructor & Destructor Documentation

virtual pyramidworks::geometry::GeometricShape::~GeometricShape ( )
inlinevirtual
pyramidworks::geometry::GeometricShape::GeometricShape ( )
inlineprotected
Parameters
offsetAn offset to the position. Defaults to (0,0)

Member Function Documentation

virtual ugdk::structure::Box<2> pyramidworks::geometry::GeometricShape::GetBoundingBox ( const ugdk::math::Vector2D position) const
pure virtual

Returns a bounding box for this shape.

The box is at the shape's position and offset

Parameters
positionThe absolute position for this shape.
Returns
A 2D Box around this shape

Implemented in pyramidworks::geometry::Rect, pyramidworks::geometry::Circle, and pyramidworks::geometry::ConvexPolygon.

virtual bool pyramidworks::geometry::GeometricShape::Intersects ( const ugdk::math::Vector2D this_pos,
const GeometricShape obj,
const ugdk::math::Vector2D that_pos 
) const
pure virtual

Checks if this shape intersects another shape.

Parameters
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns
True if there's an intersection.

Implemented in pyramidworks::geometry::Rect, pyramidworks::geometry::Circle, and pyramidworks::geometry::ConvexPolygon.

virtual bool pyramidworks::geometry::GeometricShape::Intersects ( const ugdk::math::Vector2D this_pos,
const Circle obj,
const ugdk::math::Vector2D that_pos 
) const
pure virtual

Checks if there's an intersection with a Circle.

Parameters
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns
True if there's an intersection.

Implemented in pyramidworks::geometry::Rect, pyramidworks::geometry::Circle, and pyramidworks::geometry::ConvexPolygon.

virtual bool pyramidworks::geometry::GeometricShape::Intersects ( const ugdk::math::Vector2D this_pos,
const Rect obj,
const ugdk::math::Vector2D that_pos 
) const
pure virtual

Checks if there's an intersection with a Rect.

Parameters
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns
True if there's an intersection.

Implemented in pyramidworks::geometry::Rect, pyramidworks::geometry::Circle, and pyramidworks::geometry::ConvexPolygon.

virtual bool pyramidworks::geometry::GeometricShape::Intersects ( const ugdk::math::Vector2D this_pos,
const ConvexPolygon obj,
const ugdk::math::Vector2D that_pos 
) const
pure virtual

Checks if there's an intersection with a Convex Polygon.

Parameters
this_posThe absolute position for this shape.
objThe shape to compare with.
that_posThe absolute position of the other shape.
Returns
True if there's an intersection.

Implemented in pyramidworks::geometry::Rect, pyramidworks::geometry::Circle, and pyramidworks::geometry::ConvexPolygon.


The documentation for this class was generated from the following file: