inlib  1.2.0
/Users/barrand/private/dev/softinex/old/inexlib-1.2/inlib/inlib/vec4f
Go to the documentation of this file.
00001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
00002 // See the file inlib.license for terms.
00003 
00004 #ifndef inlib_vec4f
00005 #define inlib_vec4f
00006 
00007 #include "a4"
00008 
00009 //#include "fmath"
00010 
00011 namespace inlib {
00012 
00013 class vec4f : public inlib::a4::vec<float> {
00014 public:
00015   vec4f(): inlib::a4::vec<float>() {}
00016   vec4f(const float a_vec[4]): inlib::a4::vec<float>(a_vec) {}
00017   vec4f(const float& a0,const float& a1,const float& a2,const float& a3)
00018   : inlib::a4::vec<float>(a0,a1,a2,a3){}
00019   virtual ~vec4f() {}
00020 public:
00021   vec4f(const vec4f& a_from): inlib::a4::vec<float>(a_from){}
00022   vec4f& operator=(const vec4f& a_from){
00023     inlib::a4::vec<float>::operator=(a_from);
00024     return *this;
00025   }
00026 public:
00027   float operator[](unsigned int a_index) const {
00028     //WARNING : no check on a_index.
00029     return m_vector[a_index];
00030   }
00031   /*float length() const {
00032     return fsqrt(m_vector[0] * m_vector[0] + 
00033                  m_vector[1] * m_vector[1] + 
00034                  m_vector[2] * m_vector[2] + 
00035                  m_vector[3] * m_vector[3]); 
00036   }
00037   float normalize() {
00038     float norme = length();
00039     if(norme==0) return 0;
00040     divide(norme);
00041     return norme;
00042   }*/
00043   bool operator==(const vec4f& a_v) const {return equal(a_v);}
00044   bool operator!=(const vec4f& a_v) const {return !operator==(a_v);}
00045 };
00046 
00047 }
00048 
00049 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines