Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Rect Class Reference

The Rect class represents a rectangular section, usually used to represent rectangles in world coordinates. More...

#include <Rect.h>

List of all members.

Public Methods

 Rect ()
 Rect (float x2, float y2, float w2, float h2)
void init (float x2, float y2, float w2, float h2)
float getRight () const
float getBottom () const
Point getUpperLeft () const
Point getLowerRight () const
Point getUpperRight () const
Point getLowerLeft () const
Point getCenter () const
void setCenter (const Point &cent)
bool isCollision (const Point &other) const
bool isCollision (const Rect &other) const
float distTo (const Rect &other) const
 Finds distance based on midpoints.


Public Attributes

float x
float y
float w
float h


Detailed Description

The Rect class represents a rectangular section, usually used to represent rectangles in world coordinates.


Constructor & Destructor Documentation

Rect::Rect   [inline]
 

Rect::Rect float    x2,
float    y2,
float    w2,
float    h2
[inline]
 


Member Function Documentation

float Rect::distTo const Rect &    other const [inline]
 

Finds distance based on midpoints.

float Rect::getBottom   const [inline]
 

Point Rect::getCenter   const [inline]
 

Point Rect::getLowerLeft   const [inline]
 

Point Rect::getLowerRight   const [inline]
 

float Rect::getRight   const [inline]
 

Point Rect::getUpperLeft   const [inline]
 

Point Rect::getUpperRight   const [inline]
 

void Rect::init float    x2,
float    y2,
float    w2,
float    h2
[inline]
 

bool Rect::isCollision const Rect &    other const [inline]
 

Returns:
true if the two rectangles collide.

bool Rect::isCollision const Point   other const [inline]
 

Returns:
true if the point is in or on the border of this rect.

void Rect::setCenter const Point   cent [inline]
 


Member Data Documentation

float Rect::h
 

float Rect::w
 

float Rect::x
 

float Rect::y
 


The documentation for this class was generated from the following file:
Generated on Tue Mar 4 02:29:26 2003 for SuperIsoBomb by doxygen1.2.18