Pixel Dust Game Engine  v0.9.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | Public Attributes | List of all members
QuadT Class Reference
Collaboration diagram for QuadT:
Collaboration graph
[legend]

Public Member Functions

RectT< T > getBounds () const
 return a rectangle that bounds the quad
 
PointT< T > centerPoint () const
 return the calculated centerpoint of the quad
 
 QuadT ()
 
 QuadT (const RectT< T > &rect)
 create a quad from a rectangle
 
 QuadT (const RotatedRectT< T > &rr)
 
 QuadT (const PointT< T > &_lftTop, const PointT< T > &_rgtTop, const PointT< T > &_rgtBot, const PointT< T > &_lftBot)
 create a quad given its corner points
 
bool operator== (const QuadT< T > &q2) const
 
bool contains (const PointT< T > &point) const
 Determines if the point is contained within this quad.
 
void moveLeft (T delta)
 move the rectangle to the left by some amount
 
void moveRight (T delta)
 move the rectangle to the right by some amount
 
void moveUp (T delta)
 move the rectangle up by some amount
 
void moveDown (T delta)
 move the rectangle down by some amount
 
void rotate (float rotationRadians)
 rotate the quad by a rotation in radians (around the calculated center point of the quad)
 
void rotate (float rotationRadians, const PointT< T > &centerPtOffset)
 rotate the quad by a rotation in radians around an offset center point
 

Public Attributes

PointT< T > points [4]
 

Detailed Description

a 4 point polygon in 2D system. Quad is a class that provides support for dealing with 4 point ploygons in 2 dimensional space

Constructor & Destructor Documentation

QuadT ( )
inline
QuadT ( const RectT< T > &  rect)
inline

create a quad from a rectangle

QuadT ( const RotatedRectT< T > &  rr)
inline
QuadT ( const PointT< T > &  _lftTop,
const PointT< T > &  _rgtTop,
const PointT< T > &  _rgtBot,
const PointT< T > &  _lftBot 
)
inline

create a quad given its corner points

Member Function Documentation

PointT<T> centerPoint ( ) const

return the calculated centerpoint of the quad

bool contains ( const PointT< T > &  point) const

Determines if the point is contained within this quad.

RectT<T> getBounds ( ) const

return a rectangle that bounds the quad

void moveDown ( delta)
inline

move the rectangle down by some amount

void moveLeft ( delta)
inline

move the rectangle to the left by some amount

void moveRight ( delta)
inline

move the rectangle to the right by some amount

void moveUp ( delta)
inline

move the rectangle up by some amount

bool operator== ( const QuadT< T > &  q2) const
void rotate ( float  rotationRadians)
inline

rotate the quad by a rotation in radians (around the calculated center point of the quad)

void rotate ( float  rotationRadians,
const PointT< T > &  centerPtOffset 
)

rotate the quad by a rotation in radians around an offset center point

Member Data Documentation

PointT<T> points[4]