Public Member Functions | Public Attributes | Friends | List of all members
ion::SRect2< T > Class Template Reference

2D rectangle More...

#include <SRect2.h>

Public Member Functions

 SRect2 ()
 
 SRect2 (vec2< T > const &position, vec2< T > const &size)
 
 SRect2 (T const x, T const y, T const w, T const h)
 
vec2< TOtherCorner () const
 
vec2< TGetCenter () const
 
bool Intersects (SRect2< T > const &r) const
 
SRect2 GetIntersection (SRect2< T > const &r) const
 
bool IsPointInside (vec2< T > const &v) const
 
bool IsPointInsideOrOn (vec2< T > const &v) const
 
T GetArea () const
 
void Bounds (vec2< T > const &pos1, vec2< T > const &pos2)
 
void ClipTo (SRect2 const &r)
 
bool operator< (SRect2< T > const &other) const
 
bool operator== (SRect2< T > const &other)
 

Public Attributes

vec2< TPosition
 
vec2< TSize
 

Friends

std::ostream & operator<< (std::ostream &stream, SRect2< T > const &rect)
 

Detailed Description

template<typename T>
class ion::SRect2< T >

2D rectangle

Constructor & Destructor Documentation

template<typename T>
ion::SRect2< T >::SRect2 ( )
inline
template<typename T>
ion::SRect2< T >::SRect2 ( vec2< T > const &  position,
vec2< T > const &  size 
)
inline
template<typename T>
ion::SRect2< T >::SRect2 ( T const  x,
T const  y,
T const  w,
T const  h 
)
inline

Member Function Documentation

template<typename T>
void ion::SRect2< T >::Bounds ( vec2< T > const &  pos1,
vec2< T > const &  pos2 
)
inline
template<typename T>
void ion::SRect2< T >::ClipTo ( SRect2< T > const &  r)
inline
template<typename T>
T ion::SRect2< T >::GetArea ( ) const
inline
template<typename T>
vec2<T> ion::SRect2< T >::GetCenter ( ) const
inline
template<typename T>
SRect2 ion::SRect2< T >::GetIntersection ( SRect2< T > const &  r) const
inline
template<typename T>
bool ion::SRect2< T >::Intersects ( SRect2< T > const &  r) const
inline
template<typename T>
bool ion::SRect2< T >::IsPointInside ( vec2< T > const &  v) const
inline
template<typename T>
bool ion::SRect2< T >::IsPointInsideOrOn ( vec2< T > const &  v) const
inline
template<typename T>
bool ion::SRect2< T >::operator< ( SRect2< T > const &  other) const
inline
template<typename T>
bool ion::SRect2< T >::operator== ( SRect2< T > const &  other)
inline
template<typename T>
vec2<T> ion::SRect2< T >::OtherCorner ( ) const
inline

Friends And Related Function Documentation

template<typename T>
std::ostream& operator<< ( std::ostream &  stream,
SRect2< T > const &  rect 
)
friend

Member Data Documentation

template<typename T>
vec2<T> ion::SRect2< T >::Position
template<typename T>
vec2<T> ion::SRect2< T >::Size

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