MathFu
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Friends Groups Pages
mathfu::Rect< T > Class Template Reference

Rect of type T containing position (pos) and width. More...

#include "mathfu/rect.h"

Detailed Description

template<class T>
class mathfu::Rect< T >

Rect of type T containing position (pos) and width.

Rect contains two 2D Vectors of type T representing position (pos) and size.

Template Parameters
Ttype of Rect elements.

Public Member Functions

 Rect (const Vector< T, 4 > &v)
 Create a rect from a vector4 of the same type. More...
 
 Rect (T x=static_cast< T >(0), T y=static_cast< T >(0), T width=static_cast< T >(0), T height=static_cast< T >(0))
 Create a rect from x, y, width and height values. More...
 
 Rect (const Vector< T, 2 > &pos, const Vector< T, 2 > &size)
 Create a rect from two vector2 representing position and size. More...
 

Public Attributes

Vector< T, 2 > pos
 
Vector< T, 2 > size
 

Constructor & Destructor Documentation

template<class T>
mathfu::Rect< T >::Rect ( const Vector< T, 4 > &  v)
inlineexplicit

Create a rect from a vector4 of the same type.

Parameters
vVector that the data will be copied from.
template<class T>
mathfu::Rect< T >::Rect ( x = static_cast<T>(0),
y = static_cast<T>(0),
width = static_cast<T>(0),
height = static_cast<T>(0) 
)
inline

Create a rect from x, y, width and height values.

Parameters
xthe given x value.
ythe given y value.
widththe given width value.
heightthe given height value.
template<class T>
mathfu::Rect< T >::Rect ( const Vector< T, 2 > &  pos,
const Vector< T, 2 > &  size 
)
inline

Create a rect from two vector2 representing position and size.

Parameters
posVector representing the position vector (x and y values).
sizeVector represening the size vector (width and height values).

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