00001 #pragma once 00002 #ifdef _WIN32 00003 #include <windows.h> 00004 #endif 00005 #include <GL/gl.h> 00006 00007 class uSE_GLVector 00008 { 00009 public: 00010 uSE_GLVector(); 00011 uSE_GLVector(GLfloat inX, GLfloat inY, GLfloat inZ); 00012 virtual ~uSE_GLVector(); 00013 00014 private: // members 00015 GLfloat m_x, 00016 m_y, 00017 m_z; 00018 00019 public: //methods 00020 GLfloat getX() const {return m_x;} 00021 GLfloat getY() const {return m_y;} 00022 GLfloat getZ() const {return m_z;} 00023 00024 void setX( const GLfloat inX ) { m_x = inX; } 00025 void setY( const GLfloat inY ) { m_y = inY; } 00026 void setZ( const GLfloat inZ ) { m_z = inZ; } 00027 00028 void set(GLfloat inX, GLfloat inY, GLfloat inZ); 00029 00030 void getNormSquared( GLfloat &outNorm ); 00031 void getNorm( GLfloat &outNorm ); 00032 00033 void normalize(); 00034 00035 uSE_GLVector getOpposite() const; 00036 00037 uSE_GLVector operator+ ( const uSE_GLVector &inVector ); 00038 uSE_GLVector operator- ( const uSE_GLVector &inVector ); 00039 uSE_GLVector operator* ( const float &inValue ); 00040 GLfloat operator* ( const uSE_GLVector &inVector ); // scalar product (dot product) 00041 uSE_GLVector operator^ ( const uSE_GLVector &inVector ); // vector product (cross product) 00042 bool operator== ( const uSE_GLVector &inVector ); 00043 };