Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

V2 Class Reference


Detailed Description

Vector x,y.

Constant object.

Definition at line 13 of file V2.h.

Public Member Functions

 V2 (int x, int y)
int getX () const
int getY () const
V2 plus (const V2 &other) const
V2 minus (const V2 &other) const
V2 scale (int rate) const
V2 shrink (int rate) const
std::string toString () const


Constructor & Destructor Documentation

V2::V2 int  x,
int  y
[inline]
 

Definition at line 18 of file V2.h.

00018 { m_x = x; m_y = y; }


Member Function Documentation

int V2::getX  )  const [inline]
 

Definition at line 20 of file V2.h.

00020 { return m_x; }

int V2::getY  )  const [inline]
 

Definition at line 21 of file V2.h.

00021 { return m_y; }

V2 V2::minus const V2 other  )  const [inline]
 

Definition at line 27 of file V2.h.

00028         {
00029             return V2(m_x - other.m_x, m_y - other.m_y);
00030         }

V2 V2::plus const V2 other  )  const [inline]
 

Definition at line 23 of file V2.h.

00024         {
00025             return V2(m_x + other.m_x, m_y + other.m_y);
00026         }

V2 V2::scale int  rate  )  const [inline]
 

Definition at line 31 of file V2.h.

00032         {
00033             return V2(m_x * rate, m_y * rate);
00034         }

V2 V2::shrink int  rate  )  const [inline]
 

Definition at line 35 of file V2.h.

00036         {
00037             assert(rate != 0);
00038             return V2(m_x / rate, m_y / rate);
00039         }

std::string V2::toString  )  const [inline]
 

Definition at line 41 of file V2.h.

00042         {
00043             return "[" + StringTool::toString(m_x)
00044                 + "," + StringTool::toString(m_y) + "]";
00045         }


The documentation for this class was generated from the following file:
Generated on Wed Jun 1 09:57:07 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2