Crazy Eddie's GUI System  0.8.3
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGUI::Vector2< T > Class Template Reference

Class used as a two dimensional vector (aka a Point) More...

+ Inheritance diagram for CEGUI::Vector2< T >:
+ Collaboration diagram for CEGUI::Vector2< T >:

Public Types

typedef T value_type
 

Public Member Functions

 Vector2 (const T x, const T y)
 
 Vector2 (const Vector2 &v)
 
Vector2operator*= (const Vector2 &vec)
 
Vector2operator/= (const Vector2 &vec)
 
Vector2operator+= (const Vector2 &vec)
 
Vector2operator-= (const Vector2 &vec)
 
Vector2 operator+ (const Vector2 &vec) const
 
Vector2 operator- (const Vector2 &vec) const
 
Vector2 operator* (const Vector2 &vec) const
 
Vector2 operator/ (const Vector2 &vec) const
 
Vector2 operator* (const T c) const
 
Vector2operator*= (const T c)
 
Vector2 operator/ (const T c) const
 
bool operator== (const Vector2 &vec) const
 
bool operator!= (const Vector2 &vec) const
 

Static Public Member Functions

static Vector2 zero ()
 finger saving alias for Vector2(0, 0)
 
static Vector2 one ()
 finger saving alias for Vector2(1, 1)
 
static Vector2 one_x ()
 finger saving alias for Vector2(1, 0)
 
static Vector2 one_y ()
 finger saving alias for Vector2(0, 1)
 

Public Attributes

d_x
 
d_y
 

Friends

std::ostream & operator<< (std::ostream &s, const Vector2 &v)
 allows writing the vector2 to std ostream
 

Detailed Description

template<typename T>
class CEGUI::Vector2< T >

Class used as a two dimensional vector (aka a Point)

This class is templated now, this allows us to use it as a Vector2 of floats, ints or even UDims without replicating the code all over the place.
For a simple Vector2 of floats (what was called Vector2 before), use Vector2f as the T template parameter defaults to float to save fingertips.