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

#include "pyramidworks/geometry/rect.h"

Inheritance diagram for pyramidworks::geometry::Rect:
Collaboration diagram for pyramidworks::geometry::Rect:

Public Member Functions

 Rect (double _width, double _height)
 
double width () const
 Returns the rect width. More...
 
double height () const
 Returns the rect height. More...
 
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. More...
 
bool Intersects (const ugdk::math::Vector2D &this_pos, const Rect *obj, const ugdk::math::Vector2D &that_pos) const
 Checks if there's an intersection with a Rect. More...
 
bool Intersects (const ugdk::math::Vector2D &this_pos, const Circle *obj, const ugdk::math::Vector2D &that_pos) const
 Checks if there's an intersection with a Circle. More...
 
bool Intersects (const ugdk::math::Vector2D &this_pos, const ConvexPolygon *obj, const ugdk::math::Vector2D &that_pos) const
 Checks if there's an intersection with a Convex Polygon. More...
 
ugdk::structure::Box< 2 > GetBoundingBox (const ugdk::math::Vector2D &position) const
 Returns a bounding box for this shape. More...
 
- Public Member Functions inherited from pyramidworks::geometry::GeometricShape
virtual ~GeometricShape ()
 

Additional Inherited Members

- Protected Member Functions inherited from pyramidworks::geometry::GeometricShape
 GeometricShape ()
 

Detailed Description

A rect, one type of GeometricShape.

Constructor & Destructor Documentation

pyramidworks::geometry::Rect::Rect ( double  _width,
double  _height 
)
inline
Parameters
widthThe rect width.
heightThe rect height.

Member Function Documentation

ugdk::structure::Box<2> pyramidworks::geometry::Rect::GetBoundingBox ( const ugdk::math::Vector2D position) const
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

Implements pyramidworks::geometry::GeometricShape.

double pyramidworks::geometry::Rect::height ( ) const
inline

Returns the rect height.

Returns
A double.
bool pyramidworks::geometry::Rect::Intersects ( const ugdk::math::Vector2D this_pos,
const GeometricShape obj,
const ugdk::math::Vector2D that_pos 
) const
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.

Implements pyramidworks::geometry::GeometricShape.

bool pyramidworks::geometry::Rect::Intersects ( const ugdk::math::Vector2D this_pos,
const Rect obj,
const ugdk::math::Vector2D that_pos 
) const
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.

Implements pyramidworks::geometry::GeometricShape.

bool pyramidworks::geometry::Rect::Intersects ( const ugdk::math::Vector2D this_pos,
const Circle obj,
const ugdk::math::Vector2D that_pos 
) const
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.

Implements pyramidworks::geometry::GeometricShape.

bool pyramidworks::geometry::Rect::Intersects ( const ugdk::math::Vector2D this_pos,
const ConvexPolygon obj,
const ugdk::math::Vector2D that_pos 
) const
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.

Implements pyramidworks::geometry::GeometricShape.

double pyramidworks::geometry::Rect::width ( ) const
inline

Returns the rect width.

Returns
A double.

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