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

ExCVec3D Class Reference

#include <ExCVec3D.h>


Public Methods

 ExCVec3D ()
 ExCVec3D (float x, float y, float z)
 ~ExCVec3D ()
float GetVectorLenght (void)
void SetValue (float x, float y, float z)
void SetX (double val)
void SetY (double val)
void SetZ (double val)
double GetX (void)
double GetY (void)
double GetZ (void)
void Draw (void)
ExCVec3D & operator= (const ExCVec3D &Vec)
bool operator== (const ExCVec3D &Vec)
ExCVec3D operator+ (const ExCVec3D &Vec)
ExCVec3D operator- (const ExCVec3D &Vec)
ExCVec3D operator * (const ExCVec3D &Vec)
ExCVec3D operator * (float scalar)
ExCVec3D operator/ (const ExCVec3D &Vec)
ExCVec3D operator/ (float scalar)

Data Fields

float m_Vector [3]
ExCVec3D GetVecNormale (void)

Friends

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


Constructor & Destructor Documentation

ExCVec3D  
 

Definition at line 28 of file ExCVec3D.cpp.

References m_Vector.

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

ExCVec3D float    x,
float    y,
float    z
 

Definition at line 33 of file ExCVec3D.cpp.

References m_Vector.

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

~ExCVec3D  
 

Definition at line 38 of file ExCVec3D.cpp.

00039 {
00040 
00041 }


Member Function Documentation

void Draw void   
 

Definition at line 63 of file ExCVec3D.cpp.

References m_Vector, and SetValue().

00064 {
00065         ExCVec3D vx,vy,vz;
00066         ExCVec3D source;
00067 
00068         source.SetValue(0.0f,0.0f,0.0f);
00069 
00070         
00071 
00072         vx.m_Vector[0]=this->m_Vector[0]+1.0f;
00073         vy.m_Vector[1]=this->m_Vector[1]+1.0f;
00074         vz.m_Vector[2]=this->m_Vector[2]+1.0f;
00075 
00076 
00077         glBegin(GL_TRIANGLES);
00078                 glColor3ub(255,255,255);
00079                 glVertex3f(0.0f,0.0f,0.0f);
00080                 glVertex3f(1.0f,1.0f,1.0f);
00081                 glVertex3f(-1.0f,-1.0f,-1.0f);
00082         glEnd();
00083 
00084         glBegin(GL_LINE);
00085                 glColor3ub(255,0,0);
00086                         glVertex3fv(source.m_Vector);
00087                         glVertex3fv(vx.m_Vector);
00088                 glColor3ub(0,255,0);
00089                         glVertex3fv(source.m_Vector);
00090                         glVertex3fv(vy.m_Vector);
00091                 glColor3ub(0,0,255);
00092                         glVertex3fv(source.m_Vector);
00093                         glVertex3fv(vz.m_Vector);
00094         glEnd();
00095 }

float GetVectorLenght void   
 

Definition at line 45 of file ExCVec3D.cpp.

References m_Vector.

Referenced by ExCCamera::Draw(), GetAxisFromQuaternion(), and GetVecNormale().

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

double GetX void    [inline]
 

Definition at line 54 of file ExCVec3D.h.

References m_Vector.

Referenced by ExCEntite::Draw(), ExCComposed::Draw(), ExCCameraTarget::Draw(), ExCCamera::Draw(), ExCLight::GetPositionX(), ExCLight::GetTargetX(), ExCCamera::GoToView(), ExCLight::SetPosition(), ExCLight::SetPositionX(), ExCLight::SetPositionY(), ExCLight::SetPositionZ(), ExCLight::SetTarget(), ExCLight::SetTargetX(), ExCLight::SetTargetY(), ExCLight::SetTargetZ(), and ExCObject::ShowInfo().

00054 {return m_Vector[0];}

double GetY void    [inline]
 

Definition at line 55 of file ExCVec3D.h.

References m_Vector.

Referenced by ExCEntite::Draw(), ExCComposed::Draw(), ExCCameraTarget::Draw(), ExCCamera::Draw(), ExCLight::GetPositionY(), ExCLight::GetTargetY(), ExCCamera::GoToView(), ExCLight::SetPosition(), ExCLight::SetPositionX(), ExCLight::SetPositionY(), ExCLight::SetPositionZ(), ExCLight::SetTarget(), ExCLight::SetTargetX(), ExCLight::SetTargetY(), ExCLight::SetTargetZ(), and ExCObject::ShowInfo().

00055 {return m_Vector[1];}

double GetZ void    [inline]
 

Definition at line 56 of file ExCVec3D.h.

References m_Vector.

Referenced by ExCEntite::Draw(), ExCComposed::Draw(), ExCCameraTarget::Draw(), ExCCamera::Draw(), ExCLight::GetPositionZ(), ExCLight::GetTargetZ(), ExCCamera::GoToView(), ExCLight::SetPosition(), ExCLight::SetPositionX(), ExCLight::SetPositionY(), ExCLight::SetPositionZ(), ExCLight::SetTarget(), ExCLight::SetTargetX(), ExCLight::SetTargetY(), ExCLight::SetTargetZ(), and ExCObject::ShowInfo().

00056 {return m_Vector[2];}

ExCVec3D operator * float    scalar
 

Definition at line 136 of file ExCVec3D.cpp.

References m_Vector.

00137 {
00138         ExCVec3D RetVec;
00139         RetVec.m_Vector[0]=m_Vector[0]*scalar;
00140         RetVec.m_Vector[1]=m_Vector[1]*scalar;
00141         RetVec.m_Vector[2]=m_Vector[2]*scalar;
00142         return RetVec;
00143 }

ExCVec3D operator * const ExCVec3D &    Vec
 

Definition at line 128 of file ExCVec3D.cpp.

References m_Vector.

00129 {
00130         ExCVec3D RetVec;
00131         RetVec.m_Vector[0]=m_Vector[0]*Vec.m_Vector[0];
00132         RetVec.m_Vector[1]=m_Vector[1]*Vec.m_Vector[1];
00133         RetVec.m_Vector[2]=m_Vector[2]*Vec.m_Vector[2];
00134         return RetVec;
00135 }

ExCVec3D operator+ const ExCVec3D &    Vec
 

Definition at line 111 of file ExCVec3D.cpp.

References m_Vector.

00112 {
00113         ExCVec3D RetVec;
00114         RetVec.m_Vector[0]=m_Vector[0]+Vec.m_Vector[0];
00115         RetVec.m_Vector[1]=m_Vector[1]+Vec.m_Vector[1];
00116         RetVec.m_Vector[2]=m_Vector[2]+Vec.m_Vector[2];
00117         return RetVec;
00118 }

ExCVec3D operator- const ExCVec3D &    Vec
 

Definition at line 120 of file ExCVec3D.cpp.

References m_Vector.

00121 {
00122         ExCVec3D RetVec;
00123         RetVec.m_Vector[0]=m_Vector[0]-Vec.m_Vector[0];
00124         RetVec.m_Vector[1]=m_Vector[1]-Vec.m_Vector[1];
00125         RetVec.m_Vector[2]=m_Vector[2]-Vec.m_Vector[2];
00126         return RetVec;
00127 }

ExCVec3D operator/ float    scalar
 

Definition at line 152 of file ExCVec3D.cpp.

References m_Vector.

00153 {
00154         ExCVec3D RetVec;
00155         RetVec.m_Vector[0]=m_Vector[0]/scalar;
00156         RetVec.m_Vector[1]=m_Vector[1]/scalar;
00157         RetVec.m_Vector[2]=m_Vector[2]/scalar;
00158         return RetVec;
00159 }

ExCVec3D operator/ const ExCVec3D &    Vec
 

Definition at line 144 of file ExCVec3D.cpp.

References m_Vector.

00145 {
00146         ExCVec3D RetVec;
00147         RetVec.m_Vector[0]=m_Vector[0]/Vec.m_Vector[0];
00148         RetVec.m_Vector[1]=m_Vector[1]/Vec.m_Vector[1];
00149         RetVec.m_Vector[2]=m_Vector[2]/Vec.m_Vector[2];
00150         return RetVec;
00151 }

ExCVec3D & operator= const ExCVec3D &    Vec
 

Definition at line 98 of file ExCVec3D.cpp.

References m_Vector.

00099 {
00100         m_Vector[0]=Vec.m_Vector[0];
00101         m_Vector[1]=Vec.m_Vector[1];
00102         m_Vector[2]=Vec.m_Vector[2];
00103         return *this;
00104 }

bool operator== const ExCVec3D &    Vec
 

Definition at line 105 of file ExCVec3D.cpp.

References m_Vector.

00106 {
00107         if(m_Vector[0]==Vec.m_Vector[0]||m_Vector[1]==Vec.m_Vector[1]||m_Vector[2]==Vec.m_Vector[2]) return true;
00108         else return false;
00109 }

void SetValue float    x,
float    y,
float    z
 

Definition at line 56 of file ExCVec3D.cpp.

References m_Vector.

Referenced by Draw(), ExCSystemeParticule::Draw(), ExCParticule::Draw(), ExCCamera::ExCCamera(), ExCObject::ExCObject(), ExCParticule::ExCParticule(), ExCSystemeParticule::ExCSystemeParticule(), GetAxisFromQuaternion(), and ExCSystemeParticule::LoadParticuleSysteme().

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

void SetX double    val [inline]
 

Definition at line 51 of file ExCVec3D.h.

References m_Vector.

Referenced by ExCCamera::Draw(), ExCCamera::GoToView(), ExCLight::Reset(), ExCLight::SetPositionX(), and ExCLight::SetTargetX().

00051 {m_Vector[0]=val;}

void SetY double    val [inline]
 

Definition at line 52 of file ExCVec3D.h.

References m_Vector.

Referenced by ExCCamera::Draw(), ExCCamera::GoToView(), ExCLight::Reset(), ExCLight::SetPositionY(), and ExCLight::SetTargetY().

00052 {m_Vector[1]=val;}

void SetZ double    val [inline]
 

Definition at line 53 of file ExCVec3D.h.

References m_Vector.

Referenced by ExCCamera::Draw(), ExCCamera::GoToView(), ExCLight::Reset(), ExCLight::SetPositionZ(), and ExCLight::SetTargetZ().

00053 {m_Vector[2]=val;}


Friends And Related Function Documentation

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

Definition at line 162 of file ExCVec3D.cpp.

00163 {
00164         s<<"X:"<<(float)vec.m_Vector[0]<<" Y:"<<(float)vec.m_Vector[1]<<" Z:"<<(float)vec.m_Vector[2];
00165         return s;
00166 }


Field Documentation

ExCVec3D GetVecNormale
 

Definition at line 49 of file ExCVec3D.cpp.

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

float m_Vector[3]
 

Definition at line 38 of file ExCVec3D.h.

Referenced by Draw(), ExCSystemeParticule::Draw(), ExCParticule::Draw(), ExCEntite::Draw(), ExCComposed::Draw(), ExCCamera::Draw(), ExCVec3D(), GetCrossProduct(), GetDotProduct(), GetNewVecFromEuler(), GetVectorLenght(), GetX(), GetY(), GetZ(), ExCCamera::MoveCamera(), operator *(), operator+(), operator-(), operator/(), operator<<(), operator=(), operator==(), ExCParticule::PrecalculeParticuleTrajectory(), ExCCamera::RotateView(), SetValue(), SetX(), SetY(), and SetZ().


The documentation for this class was generated from the following files:
Generated on Tue Aug 6 20:27:23 2002 for ExNihilo by doxygen1.2.17