FMath/FMVector2.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005-2006 Feeling Software Inc.
00003     MIT License: http://www.opensource.org/licenses/mit-license.php
00004 */
00005 
00012 #ifndef _FM_VECTOR2_H_
00013 #define _FM_VECTOR2_H_
00014 
00021 class FCOLLADA_EXPORT FMVector2
00022 {
00023 public:
00024     float u;    
00025     float v;    
00027 public:
00031     #ifndef _DEBUG
00032     FMVector2() {}
00033     #else
00034     FMVector2() { u = 123456789.0f; v = 123456789.0f; }
00035     #endif 
00036 
00043     FMVector2(float _u, float _v) { u = _u; v = _v; }
00044 
00050     inline operator float*() { return &u; }
00051 
00061     inline FMVector2& operator +=(const FMVector2& a) { u += a.u; v += a.v; return *this; }
00062 
00072     inline FMVector2& operator *=(float a) { u *= a; v *= a; return *this; }
00073     
00084     inline FMVector2& operator =(const float* f) { u = *f; v = *(f + 1); return *this; }
00085 };
00086 
00094 inline FMVector2 operator + (const FMVector2& a, const FMVector2& b) { return FMVector2(a.u + b.u, a.v + b.v); }
00095 
00103 inline FMVector2 operator -(const FMVector2& a, const FMVector2& b) { return FMVector2(a.u - b.u, a.v - b.v); }
00104 
00112 inline float operator *(const FMVector2& a, const FMVector2& b) { return a.u * b.u + a.v * b.v; }
00113 
00121 inline FMVector2 operator *(const FMVector2& a, float b) { return FMVector2(a.u * b, a.v * b); }
00122 
00130 inline FMVector2 operator *(float a, const FMVector2& b) { return FMVector2(a * b.u, a * b.v); }
00131 
00132 #endif // _FM_VECTOR2_H_

Generated on Fri May 12 16:44:39 2006 for FCollada by  doxygen 1.4.6-NO