rect Class Template Reference

#include <rect.h>


Detailed Description

template<class T>
class irr::core::rect< T >

Mostly used by 2D GUI elements and for 2D drawing methods. It has 2 positions instead of position and dimension and a fast method for collision detection with other rectangles and points.

Public Member Functions

Data Fields


Constructor & Destructor Documentation

rect (  )  [inline]

rect ( x,
y,
x2,
y2 
) [inline]

rect ( const position2d< T > &  upperLeft,
const position2d< T > &  lowerRight 
) [inline]

rect ( const rect< T > &  other  )  [inline]

rect ( const position2d< T > &  pos,
const dimension2d< T > &  size 
) [inline]


Member Function Documentation

void clipAgainst ( const rect< T > &  other  )  [inline]

position2d<T> getCenter (  )  const [inline]

T getHeight (  )  const [inline]

dimension2d<T> getSize (  )  const [inline]

T getWidth (  )  const [inline]

bool isPointInside ( const position2d< T > &  pos  )  const [inline]

Returns if a 2d point is within this rectangle.

Parameters:
pos,: Position to test if it lies within this rectangle.
Returns:
Returns true if the position is within the rectangle, false if not.

bool isRectCollided ( const rect< T > &  other  )  const [inline]

bool isValid (  )  const [inline]

Returns if the rect is valid to draw. It could be invalid, if The UpperLeftCorner is lower or more right than the LowerRightCorner, or if the area described by the rect is 0.

const T& LRX (  )  const [inline]

T& LRX (  )  [inline]

const T& LRY (  )  const [inline]

T& LRY (  )  [inline]

bool operator!= ( const rect< T > &  other  )  const [inline]

rect<T> operator+ ( const position2d< T > &  pos  )  const [inline]

const rect<T>& operator+= ( const position2d< T > &  pos  )  [inline]

const rect<T>& operator= ( const rect< T > &  other  )  [inline]

bool operator== ( const rect< T > &  other  )  const [inline]

void repair (  )  [inline]

If the lower right corner of the rect is smaller then the upper left, the points are swapped.

void set ( const T &  ulX,
const T &  ulY,
const T &  lrX,
const T &  lrY 
) [inline]

const T& ULX (  )  const [inline]

T& ULX (  )  [inline]

const T& ULY (  )  const [inline]

T& ULY (  )  [inline]


Field Documentation

position2d<T> LowerRightCorner

position2d<T> UpperLeftCorner


Generated on Fri Apr 27 14:47:02 2007 for IrrSpintz by  doxygen 1.5.1-p1