UGDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
pyramidworks::geometry::Rect Class Reference

#include <pyramidworks/geometry/rect.h>

Inheritance diagram for pyramidworks::geometry::Rect:
Inheritance graph
[legend]
Collaboration diagram for pyramidworks::geometry::Rect:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Rect (double _width, double _height)
double width () const
 Returns the rect width.
double height () const
 Returns the rect height.
bool Intersects (const ugdk::Vector2D &this_pos, const GeometricShape *obj, const ugdk::Vector2D &that_pos) const
 Checks if this shape intersects another shape.
bool Intersects (const ugdk::Vector2D &this_pos, const Rect *obj, const ugdk::Vector2D &that_pos) const
 Checks if there's an intersection with a Rect.
bool Intersects (const ugdk::Vector2D &this_pos, const Circle *obj, const ugdk::Vector2D &that_pos) const
 Checks if there's an intersection with a Circle.
bool Intersects (const ugdk::Vector2D &this_pos, const ConvexPolygon *obj, const ugdk::Vector2D &that_pos) const
 Checks if there's an intersection with a Convex Polygon.
ugdk::ikdtree::Box< 2 > GetBoundingBox (const ugdk::Vector2D &position) const
 Returns a bounding box for this shape.

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

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::Vector2D this_pos,
const GeometricShape obj,
const ugdk::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::Vector2D this_pos,
const Rect obj,
const ugdk::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::Vector2D this_pos,
const Circle obj,
const ugdk::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::Vector2D this_pos,
const ConvexPolygon obj,
const ugdk::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 files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines