Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Namespace Members   Data Fields   Globals  

ExCVec2D Class Reference

#include <ExCVec2D.h>


Public Methods

 ExCVec2D ()
 ExCVec2D (float x, float y)
 ~ExCVec2D ()
float GetVectorLenght (void)
ExCVec2D GetVecNormale (void)
void SetValue (float x, float y)
void SetX (double val)
void SetY (double val)
double GetX (void)
double GetY (void)
ExCVec2D & operator= (const ExCVec2D &Vec)
bool operator== (const ExCVec2D &Vec)
ExCVec2D operator+ (const ExCVec2D &Vec)
ExCVec2D operator- (const ExCVec2D &Vec)
ExCVec2D operator * (const ExCVec2D &Vec)
ExCVec2D operator * (float scalar)
ExCVec2D operator/ (const ExCVec2D &Vec)
ExCVec2D operator/ (float scalar)

Data Fields

float m_Vector [2]

Friends

std::ostream & operator<< (std::ostream &s, const ExCVec2D &vec)


Constructor & Destructor Documentation

ExCVec2D  
 

Definition at line 28 of file ExCVec2D.cpp.

References m_Vector.

00029 {
00030         m_Vector[0]=0;m_Vector[1]=0;
00031 }

ExCVec2D float    x,
float    y
 

Definition at line 33 of file ExCVec2D.cpp.

References m_Vector.

00034 {
00035         m_Vector[0]=x;m_Vector[1]=y;
00036 }

~ExCVec2D  
 

Definition at line 38 of file ExCVec2D.cpp.

00039 {
00040 
00041 }


Member Function Documentation

ExCVec2D GetVecNormale void   
 

Definition at line 49 of file ExCVec2D.cpp.

References GetVectorLenght().

00050 {
00051         ExCVec2D VecNorm;
00052         VecNorm=*this;
00053         VecNorm=*this/this->GetVectorLenght();
00054         return VecNorm;
00055 }

float GetVectorLenght void   
 

Definition at line 45 of file ExCVec2D.cpp.

References m_Vector.

Referenced by GetVecNormale().

00046 {
00047         return sqrt((m_Vector[0]*m_Vector[0])+(m_Vector[1]*m_Vector[1]));
00048 }

double GetX void    [inline]
 

Definition at line 53 of file ExCVec2D.h.

References m_Vector.

Referenced by ExCModel3DS::BuildList(), and ExCModelMD2::Draw().

00053 {return m_Vector[0];}

double GetY void    [inline]
 

Definition at line 54 of file ExCVec2D.h.

References m_Vector.

Referenced by ExCModel3DS::BuildList(), and ExCModelMD2::Draw().

00054 {return m_Vector[1];}

ExCVec2D operator * float    scalar
 

Definition at line 99 of file ExCVec2D.cpp.

References m_Vector.

00100 {
00101         ExCVec2D RetVec;
00102         RetVec.m_Vector[0]=m_Vector[0]*scalar;
00103         RetVec.m_Vector[1]=m_Vector[1]*scalar;
00104         return RetVec;
00105 }

ExCVec2D operator * const ExCVec2D &    Vec
 

Definition at line 92 of file ExCVec2D.cpp.

References m_Vector.

00093 {
00094         ExCVec2D RetVec;
00095         RetVec.m_Vector[0]=m_Vector[0]*Vec.m_Vector[0];
00096         RetVec.m_Vector[1]=m_Vector[1]*Vec.m_Vector[1];
00097         return RetVec;
00098 }

ExCVec2D operator+ const ExCVec2D &    Vec
 

Definition at line 77 of file ExCVec2D.cpp.

References m_Vector.

00078 {
00079         ExCVec2D RetVec;
00080         RetVec.m_Vector[0]=m_Vector[0]+Vec.m_Vector[0];
00081         RetVec.m_Vector[1]=m_Vector[1]+Vec.m_Vector[1];
00082         return RetVec;
00083 }

ExCVec2D operator- const ExCVec2D &    Vec
 

Definition at line 85 of file ExCVec2D.cpp.

References m_Vector.

00086 {
00087         ExCVec2D RetVec;
00088         RetVec.m_Vector[0]=m_Vector[0]-Vec.m_Vector[0];
00089         RetVec.m_Vector[1]=m_Vector[1]-Vec.m_Vector[1];
00090         return RetVec;
00091 }

ExCVec2D operator/ float    scalar
 

Definition at line 113 of file ExCVec2D.cpp.

References m_Vector.

00114 {
00115         ExCVec2D RetVec;
00116         RetVec.m_Vector[0]=m_Vector[0]/scalar;
00117         RetVec.m_Vector[1]=m_Vector[1]/scalar;
00118         return RetVec;
00119 }

ExCVec2D operator/ const ExCVec2D &    Vec
 

Definition at line 106 of file ExCVec2D.cpp.

References m_Vector.

00107 {
00108         ExCVec2D RetVec;
00109         RetVec.m_Vector[0]=m_Vector[0]/Vec.m_Vector[0];
00110         RetVec.m_Vector[1]=m_Vector[1]/Vec.m_Vector[1];
00111         return RetVec;
00112 }

ExCVec2D & operator= const ExCVec2D &    Vec
 

Definition at line 65 of file ExCVec2D.cpp.

References m_Vector.

00066 {
00067         m_Vector[0]=Vec.m_Vector[0];
00068         m_Vector[1]=Vec.m_Vector[1];
00069         return *this;
00070 }

bool operator== const ExCVec2D &    Vec
 

Definition at line 71 of file ExCVec2D.cpp.

References m_Vector.

00072 {
00073         if(m_Vector[0]==Vec.m_Vector[0]||m_Vector[1]==Vec.m_Vector[1]) return true;
00074         else return false;
00075 }

void SetValue float    x,
float    y
 

Definition at line 56 of file ExCVec2D.cpp.

References m_Vector.

00057 {
00058         m_Vector[0]=x;
00059         m_Vector[1]=y;
00060         
00061 }

void SetX double    val [inline]
 

Definition at line 51 of file ExCVec2D.h.

References m_Vector, and val.

Referenced by ExCModel3DS::BuildList(), ExCModelMD2::Draw(), ExCModelMD2::Load(), ExCModelASC::LoadFile(), and ExCModel3DS::ReadUVCoordinates().

00051 {m_Vector[0]=val;}

void SetY double    val [inline]
 

Definition at line 52 of file ExCVec2D.h.

References m_Vector, and val.

Referenced by ExCModel3DS::BuildList(), ExCModelMD2::Draw(), ExCModelMD2::Load(), ExCModelASC::LoadFile(), and ExCModel3DS::ReadUVCoordinates().

00052 {m_Vector[1]=val;}


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &    s,
const ExCVec2D &    vec
[friend]
 

Definition at line 122 of file ExCVec2D.cpp.

00123 {
00124         s<<"X:"<<(float)vec.m_Vector[0]<<" Y:"<<(float)vec.m_Vector[1];
00125         return s;
00126 }


Field Documentation

float m_Vector[2]
 

Definition at line 38 of file ExCVec2D.h.

Referenced by ExCVec2D(), GetVectorLenght(), GetX(), GetY(), operator *(), operator+(), operator-(), operator/(), operator<<(), operator=(), operator==(), SetValue(), SetX(), and SetY().


The documentation for this class was generated from the following files:
Generated on Tue Dec 10 18:20:32 2002 for ExNihilo by doxygen1.3-rc1