Index: trunk/lib/FlairCore/src/AhrsData.cpp
===================================================================
--- trunk/lib/FlairCore/src/AhrsData.cpp	(revision 166)
+++ trunk/lib/FlairCore/src/AhrsData.cpp	(revision 167)
@@ -43,5 +43,5 @@
   void CopyData(char *destination) const {
     float data;
-    Vector3D angularRates;
+    Vector3Df angularRates;
     Euler eulerAngles;
     Quaternion quaternion;
@@ -138,6 +138,6 @@
 }
 
-Vector3D AhrsData::GetAngularRates(void) const {
-  Vector3D out;
+Vector3Df AhrsData::GetAngularRates(void) const {
+  Vector3Df out;
   GetMutex();
   out = angularRates;
@@ -147,5 +147,5 @@
 
 void AhrsData::GetQuaternionAndAngularRates(Quaternion &outQuaternion,
-                                            Vector3D &outAngularRates) const {
+                                            Vector3Df &outAngularRates) const {
   GetMutex();
   outQuaternion = quaternion;
@@ -155,5 +155,5 @@
 
 void AhrsData::SetQuaternionAndAngularRates(const Quaternion &inQuaternion,
-                                            const Vector3D &inAngularRates) {
+                                            const Vector3Df &inAngularRates) {
   GetMutex();
   quaternion = inQuaternion;
@@ -168,5 +168,5 @@
 }
 
-void AhrsData::SetAngularRates(const Vector3D &inAngularRates) {
+void AhrsData::SetAngularRates(const Vector3Df &inAngularRates) {
   GetMutex();
   angularRates = inAngularRates;
Index: trunk/lib/FlairCore/src/AhrsData.h
===================================================================
--- trunk/lib/FlairCore/src/AhrsData.h	(revision 166)
+++ trunk/lib/FlairCore/src/AhrsData.h	(revision 167)
@@ -121,5 +121,5 @@
   *
   */
-  void SetAngularRates(const Vector3D &angularRates);
+  void SetAngularRates(const Vector3Df &angularRates);
 
   /*!
@@ -131,5 +131,5 @@
   *
   */
-  Vector3D GetAngularRates(void) const;
+  Vector3Df GetAngularRates(void) const;
 
   /*!
@@ -143,5 +143,5 @@
   */
   void GetQuaternionAndAngularRates(Quaternion &quaternion,
-                                    Vector3D &angularRates) const;
+                                    Vector3Df &angularRates) const;
 
   /*!
@@ -155,5 +155,5 @@
   */
   void SetQuaternionAndAngularRates(const Quaternion &quaternion,
-                                    const Vector3D &angularRates);
+                                    const Vector3Df &angularRates);
 
   const Type &GetDataType() const { return dataType; }
@@ -182,5 +182,5 @@
   *
   */
-  Vector3D angularRates;
+  Vector3Df angularRates;
 
   Type dataType;
Index: trunk/lib/FlairCore/src/GpsData.h
===================================================================
--- trunk/lib/FlairCore/src/GpsData.h	(revision 166)
+++ trunk/lib/FlairCore/src/GpsData.h	(revision 167)
@@ -19,5 +19,4 @@
 
   class IODataElement;
-  class Vector3D;
 
 /*! \class GpsData
Index: trunk/lib/FlairCore/src/ImuData.cpp
===================================================================
--- trunk/lib/FlairCore/src/ImuData.cpp	(revision 166)
+++ trunk/lib/FlairCore/src/ImuData.cpp	(revision 167)
@@ -44,7 +44,7 @@
   void CopyData(char *dst) const {
     float data;
-    Vector3D rawAcc = imudata->GetRawAcc();
-    Vector3D rawMag = imudata->GetRawMag();
-    Vector3D rawGyr = imudata->GetRawGyr();
+    Vector3Df rawAcc = imudata->GetRawAcc();
+    Vector3Df rawMag = imudata->GetRawMag();
+    Vector3Df rawGyr = imudata->GetRawGyr();
     switch (plotableData) {
     case ImuData::RawAx:
@@ -121,6 +121,6 @@
 ImuData::~ImuData() {}
 
-Vector3D ImuData::GetRawAcc(void) const {
-  Vector3D out;
+Vector3Df ImuData::GetRawAcc(void) const {
+  Vector3Df out;
   GetMutex();
   out = rawAcc;
@@ -129,6 +129,6 @@
 }
 
-Vector3D ImuData::GetRawMag(void) const {
-  Vector3D out;
+Vector3Df ImuData::GetRawMag(void) const {
+  Vector3Df out;
   GetMutex();
   out = rawMag;
@@ -137,6 +137,6 @@
 }
 
-Vector3D ImuData::GetRawGyr(void) const {
-  Vector3D out;
+Vector3Df ImuData::GetRawGyr(void) const {
+  Vector3Df out;
   GetMutex();
   out = rawGyr;
@@ -145,6 +145,6 @@
 }
 
-void ImuData::GetRawAccMagAndGyr(Vector3D &inRawAcc, Vector3D &inRawMag,
-                                 Vector3D &inRawGyr) const {
+void ImuData::GetRawAccMagAndGyr(Vector3Df &inRawAcc, Vector3Df &inRawMag,
+                                 Vector3Df &inRawGyr) const {
   GetMutex();
   inRawAcc = rawAcc;
@@ -154,5 +154,5 @@
 }
 
-void ImuData::SetRawAcc(const Vector3D &inRawAcc) {
+void ImuData::SetRawAcc(const Vector3Df &inRawAcc) {
   GetMutex();
   rawAcc = inRawAcc;
@@ -160,5 +160,5 @@
 }
 
-void ImuData::SetRawMag(const Vector3D &inRawMag) {
+void ImuData::SetRawMag(const Vector3Df &inRawMag) {
   GetMutex();
   rawMag = inRawMag;
@@ -166,5 +166,5 @@
 }
 
-void ImuData::SetRawGyr(const Vector3D &inRawGyr) {
+void ImuData::SetRawGyr(const Vector3Df &inRawGyr) {
   GetMutex();
   rawGyr = inRawGyr;
@@ -172,7 +172,7 @@
 }
 
-void ImuData::SetRawAccMagAndGyr(const Vector3D &inRawAcc,
-                                 const Vector3D &inRawMag,
-                                 const Vector3D &inRawGyr) {
+void ImuData::SetRawAccMagAndGyr(const Vector3Df &inRawAcc,
+                                 const Vector3Df &inRawMag,
+                                 const Vector3Df &inRawGyr) {
   GetMutex();
   rawAcc = inRawAcc;
Index: trunk/lib/FlairCore/src/ImuData.h
===================================================================
--- trunk/lib/FlairCore/src/ImuData.h	(revision 166)
+++ trunk/lib/FlairCore/src/ImuData.h	(revision 167)
@@ -104,5 +104,5 @@
   *
   */
-  Vector3D GetRawAcc(void) const;
+  Vector3Df GetRawAcc(void) const;
 
   /*!
@@ -114,5 +114,5 @@
   *
   */
-  Vector3D GetRawMag(void) const;
+  Vector3Df GetRawMag(void) const;
 
   /*!
@@ -124,5 +124,5 @@
   *
   */
-  Vector3D GetRawGyr(void) const;
+  Vector3Df GetRawGyr(void) const;
 
   /*!
@@ -136,6 +136,6 @@
   *
   */
-  void GetRawAccMagAndGyr(Vector3D &rawAcc, Vector3D &rawMag,
-                          Vector3D &rawGyr) const;
+  void GetRawAccMagAndGyr(Vector3Df &rawAcc, Vector3Df &rawMag,
+                          Vector3Df &rawGyr) const;
 
   /*!
@@ -147,5 +147,5 @@
   *
   */
-  void SetRawAcc(const Vector3D &rawAcc);
+  void SetRawAcc(const Vector3Df &rawAcc);
 
   /*!
@@ -157,5 +157,5 @@
   *
   */
-  void SetRawMag(const Vector3D &rawMag);
+  void SetRawMag(const Vector3Df &rawMag);
 
   /*!
@@ -167,5 +167,5 @@
   *
   */
-  void SetRawGyr(const Vector3D &rawGyr);
+  void SetRawGyr(const Vector3Df &rawGyr);
 
   /*!
@@ -179,6 +179,6 @@
   *
   */
-  void SetRawAccMagAndGyr(const Vector3D &rawAcc, const Vector3D &rawMag,
-                          const Vector3D &rawGyr);
+  void SetRawAccMagAndGyr(const Vector3Df &rawAcc, const Vector3Df &rawMag,
+                          const Vector3Df &rawGyr);
 
   Type const &GetDataType() const { return dataType; }
@@ -199,5 +199,5 @@
   *
   */
-  Vector3D rawAcc;
+  Vector3Df rawAcc;
 
   /*!
@@ -205,5 +205,5 @@
   *
   */
-  Vector3D rawGyr;
+  Vector3Df rawGyr;
 
   /*!
@@ -211,5 +211,5 @@
   *
   */
-  Vector3D rawMag;
+  Vector3Df rawMag;
 
   void Queue(char **dst, const void *src, size_t size) const;
Index: trunk/lib/FlairCore/src/OneAxisRotation.cpp
===================================================================
--- trunk/lib/FlairCore/src/OneAxisRotation.cpp	(revision 166)
+++ trunk/lib/FlairCore/src/OneAxisRotation.cpp	(revision 167)
@@ -24,5 +24,4 @@
 #include "OneAxisRotation.h"
 #include "OneAxisRotation_impl.h"
-#include <Vector3D.h>
 #include <Euler.h>
 
@@ -32,4 +31,7 @@
 namespace core {
 
+template void OneAxisRotation::ComputeRotation(core::Vector3D<float> &) const;
+template void OneAxisRotation::ComputeRotation(core::Vector3D<double> &) const;
+  
 OneAxisRotation::OneAxisRotation(const gui::LayoutPosition *position,
                                  string name)
@@ -40,5 +42,5 @@
 OneAxisRotation::~OneAxisRotation() { delete pimpl_; }
 
-void OneAxisRotation::ComputeRotation(Vector3D &vector) const {
+template <typename T> void OneAxisRotation::ComputeRotation(Vector3D<T> &vector) const {
   pimpl_->ComputeRotation(vector);
 }
Index: trunk/lib/FlairCore/src/OneAxisRotation.h
===================================================================
--- trunk/lib/FlairCore/src/OneAxisRotation.h	(revision 166)
+++ trunk/lib/FlairCore/src/OneAxisRotation.h	(revision 167)
@@ -15,4 +15,5 @@
 
 #include <GroupBox.h>
+#include <Vector3D.h>
 
 class OneAxisRotation_impl;
@@ -24,5 +25,4 @@
 
 namespace core {
-class Vector3D;
 class Euler;
 class Quaternion;
@@ -57,7 +57,7 @@
   * \brief Compute rotation
   *
-  * \param vector Vector3D to rotate
+  * \param vector Vector3Df to rotate
   */
-  void ComputeRotation(core::Vector3D &vector) const;
+  template <typename T> void ComputeRotation(core::Vector3D<T> &vector) const;
 
   /*!
Index: trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp
===================================================================
--- trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp	(revision 166)
+++ trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp	(revision 167)
@@ -20,5 +20,4 @@
 #include "ComboBox.h"
 #include "DoubleSpinBox.h"
-#include <Vector3D.h>
 #include <Euler.h>
 #include <Quaternion.h>
@@ -27,4 +26,7 @@
 using namespace flair::core;
 using namespace flair::gui;
+
+template void OneAxisRotation_impl::ComputeRotation(Vector3D<float>&) const;
+template void OneAxisRotation_impl::ComputeRotation(Vector3D<double>&) const;
 
 OneAxisRotation_impl::OneAxisRotation_impl(GroupBox *box) {
@@ -41,5 +43,5 @@
 // compute rotation of each axis through ComputeRotation(Vector3D& vector)
 void OneAxisRotation_impl::ComputeRotation(Quaternion &quat) const {
-  Vector3D rot = Vector3D(quat.q1, quat.q2, quat.q3);
+  Vector3Df rot = Vector3Df(quat.q1, quat.q2, quat.q3);
   ComputeRotation(rot);
   quat.q1 = rot.x;
@@ -54,5 +56,5 @@
 // on utilise la rotation d'un vector pour faire une rotation de repere
 // d'ou le signe negatif
-void OneAxisRotation_impl::ComputeRotation(Vector3D &vector) const {
+template <typename T> void OneAxisRotation_impl::ComputeRotation(Vector3D<T> &vector) const {
   switch (rot_axe->CurrentIndex()) {
   case 0:
Index: trunk/lib/FlairCore/src/Quaternion.cpp
===================================================================
--- trunk/lib/FlairCore/src/Quaternion.cpp	(revision 166)
+++ trunk/lib/FlairCore/src/Quaternion.cpp	(revision 167)
@@ -17,5 +17,4 @@
 
 #include "Quaternion.h"
-#include "Vector3D.h"
 #include "Euler.h"
 #include "RotationMatrix.h"
@@ -63,5 +62,5 @@
 }
 
-void Quaternion::GetLogarithm(Vector3D &logarithm) {
+void Quaternion::GetLogarithm(Vector3Df &logarithm) {
   Normalize();
   float v_norm = sqrtf(q1 * q1 + q2 * q2 + q3 * q3);
@@ -79,16 +78,16 @@
 }
 
-Vector3D Quaternion::GetLogarithm(void) {
-  Vector3D vector;
+Vector3Df Quaternion::GetLogarithm(void) {
+  Vector3Df vector;
   GetLogarithm(vector);
   return vector;
 }
 
-Quaternion Quaternion::GetDerivative(const Vector3D &angularSpeed) const {
+Quaternion Quaternion::GetDerivative(const Vector3Df &angularSpeed) const {
   const Quaternion Qw(0, angularSpeed.x, angularSpeed.y, angularSpeed.z);
   return 0.5 * (*this) * Qw;
 }
 
-void Quaternion::Derivate(const Vector3D &angularSpeed) {
+void Quaternion::Derivate(const Vector3Df &angularSpeed) {
   Quaternion Q = GetDerivative(angularSpeed);
   (*this) = Q;
Index: trunk/lib/FlairCore/src/Quaternion.h
===================================================================
--- trunk/lib/FlairCore/src/Quaternion.h	(revision 166)
+++ trunk/lib/FlairCore/src/Quaternion.h	(revision 167)
@@ -13,8 +13,9 @@
 #define QUATERNION_H
 
+#include <Vector3D.h>
+
 namespace flair {
 namespace core {
 class Euler;
-class Vector3D;
 class RotationMatrix;
 
@@ -62,5 +63,5 @@
   * \param logarithm output logarithm
   */
-  void GetLogarithm(Vector3D &logarithm);
+  void GetLogarithm(Vector3Df &logarithm);
 
   /*!
@@ -71,5 +72,5 @@
   * \return output logarithm
   */
-  Vector3D GetLogarithm(void);
+  Vector3Df GetLogarithm(void);
 
   /*!
@@ -92,5 +93,5 @@
   * \return derivative
   */
-  Quaternion GetDerivative(const Vector3D &angularSpeed) const;
+  Quaternion GetDerivative(const Vector3Df &angularSpeed) const;
 
   /*!
@@ -99,5 +100,5 @@
   * \param w rotationonal speed
   */
-  void Derivate(const Vector3D &angularSpeed);
+  void Derivate(const Vector3Df &angularSpeed);
 
   /*!
Index: trunk/lib/FlairCore/src/Vector2D.cpp
===================================================================
--- trunk/lib/FlairCore/src/Vector2D.cpp	(revision 166)
+++ trunk/lib/FlairCore/src/Vector2D.cpp	(revision 167)
@@ -22,16 +22,26 @@
 namespace flair {
 namespace core {
+  
+template class Vector2D<double>;
+template Vector2D<double> operator+(const Vector2D<double>&, const Vector2D<double>&);
+template Vector2D<double> operator-(const Vector2D<double>&, const Vector2D<double>&);
+template Vector2D<double> operator-(const Vector2D<double>&);
+template Vector2D<double> operator/(const Vector2D<double>&, float);
+template Vector2D<double> operator*(const Vector2D<double>&, float);
+template Vector2D<double> operator*(float, const Vector2D<double>&);
 
-Vector2D::Vector2D(float inX, float inY) : x(inX), y(inY) {}
+template class Vector2D<float>;
+template Vector2D<float> operator+(const Vector2D<float>&, const Vector2D<float>&);
+template Vector2D<float> operator-(const Vector2D<float>&, const Vector2D<float>&);
+template Vector2D<float> operator-(const Vector2D<float>&);
+template Vector2D<float> operator/(const Vector2D<float>&, float);
+template Vector2D<float> operator*(const Vector2D<float>&, float);
+template Vector2D<float> operator*(float, const Vector2D<float>&);
 
-Vector2D::~Vector2D() {}
+template <typename T> Vector2D<T>::Vector2D(T inX, T inY) : x(inX), y(inY) {}
 
-Vector2D &Vector2D::operator=(const Vector2D &vector) {
-  x = vector.x;
-  y = vector.y;
-  return (*this);
-}
+template <typename T> Vector2D<T>::~Vector2D() {}
 
-Vector2D &Vector2D::operator+=(const Vector2D &vector) {
+template <typename T> Vector2D<T> &Vector2D<T>::operator+=(const Vector2D<T> &vector) {
   x += vector.x;
   y += vector.y;
@@ -39,5 +49,5 @@
 }
 
-Vector2D &Vector2D::operator-=(const Vector2D &vector) {
+template <typename T> Vector2D<T> &Vector2D<T>::operator-=(const Vector2D<T> &vector) {
   x -= vector.x;
   y -= vector.y;
@@ -45,33 +55,33 @@
 }
 
-Vector2D operator+(const Vector2D &vectorA, const Vector2D &vectorB) {
-  return Vector2D(vectorA.x + vectorB.x, vectorA.y + vectorB.y);
+template <typename T> Vector2D<T> operator+(const Vector2D<T> &vectorA, const Vector2D<T> &vectorB) {
+  return Vector2D<T>(vectorA.x + vectorB.x, vectorA.y + vectorB.y);
 }
 
-Vector2D operator-(const Vector2D &vectorA, const Vector2D &vectorB) {
-  return Vector2D(vectorA.x - vectorB.x, vectorA.y - vectorB.y);
+template <typename T> Vector2D<T> operator-(const Vector2D<T> &vectorA, const Vector2D<T> &vectorB) {
+  return Vector2D<T>(vectorA.x - vectorB.x, vectorA.y - vectorB.y);
 }
 
-Vector2D operator-(const Vector2D &vectorA) {
- return Vector2D(-vectorA.x, -vectorA.y);
+template <typename T> Vector2D<T> operator-(const Vector2D<T> &vectorA) {
+ return Vector2D<T>(-vectorA.x, -vectorA.y);
 }
 
-Vector2D operator/(const Vector2D &vector, float coeff) {
+template <typename T> Vector2D<T> operator/(const Vector2D<T> &vector, float coeff) {
   if (coeff != 0) {
-    return Vector2D(vector.x / coeff, vector.y / coeff);
+    return Vector2D<T>(vector.x / coeff, vector.y / coeff);
   } else {
-    return Vector2D(0, 0);
+    return Vector2D<T>(0, 0);
   }
 }
 
-Vector2D operator*(const Vector2D &vector, float coeff) {
-  return Vector2D(vector.x * coeff, vector.y * coeff);
+template <typename T> Vector2D<T> operator*(const Vector2D<T> &vector, float coeff) {
+  return Vector2D<T>(vector.x * coeff, vector.y * coeff);
 }
 
-Vector2D operator*(float coeff, const Vector2D &vector) {
-  return Vector2D(vector.x * coeff, vector.y * coeff);
+template <typename T> Vector2D<T> operator*(float coeff, const Vector2D<T> &vector) {
+  return Vector2D<T>(vector.x * coeff, vector.y * coeff);
 }
 
-void Vector2D::Rotate(float value) {
+template <typename T> void Vector2D<T>::Rotate(float value) {
   float xTmp;
   xTmp = x * cosf(value) - y * sinf(value);
@@ -80,9 +90,9 @@
 }
 
-void Vector2D::RotateDeg(float value) { Rotate(Euler::ToRadian(value)); }
+template <typename T> void Vector2D<T>::RotateDeg(float value) { Rotate(Euler::ToRadian(value)); }
 
-float Vector2D::GetNorm(void) const { return sqrt(x * x + y * y); }
+template <typename T> float Vector2D<T>::GetNorm(void) const { return sqrt(x * x + y * y); }
 
-void Vector2D::Normalize(void) {
+template <typename T> void Vector2D<T>::Normalize(void) {
   float n = GetNorm();
   if (n != 0) {
@@ -92,5 +102,5 @@
 }
 
-void Vector2D::Saturate(Vector2D min, Vector2D max) {
+template <typename T> void Vector2D<T>::Saturate(Vector2D min, Vector2D max) {
   if (x < min.x)
     x = min.x;
@@ -104,9 +114,9 @@
 }
 
-void Vector2D::Saturate(float min, float max) {
+template <typename T> void Vector2D<T>::Saturate(float min, float max) {
   Saturate(Vector2D(min, min), Vector2D(max, max));
 }
 
-void Vector2D::Saturate(const Vector2D &value) {
+template <typename T> void Vector2D<T>::Saturate(const Vector2D &value) {
   float x = fabs(value.x);
   float y = fabs(value.y);
@@ -114,5 +124,5 @@
 }
 
-void Vector2D::Saturate(float value) {
+template <typename T> void Vector2D<T>::Saturate(float value) {
   float sat = fabs(value);
   Saturate(Vector2D(-sat, -sat), Vector2D(sat, sat));
Index: trunk/lib/FlairCore/src/Vector2D.h
===================================================================
--- trunk/lib/FlairCore/src/Vector2D.h	(revision 166)
+++ trunk/lib/FlairCore/src/Vector2D.h	(revision 167)
@@ -21,4 +21,5 @@
 * \brief Class defining a 2D vector
 */
+template <typename T>
 class Vector2D {
 public:
@@ -31,5 +32,5 @@
   * \param y
   */
-  Vector2D(float x = 0, float y = 0);
+  Vector2D(T x = 0, T y = 0);
 
   /*!
@@ -73,5 +74,5 @@
   * \param max maximum Vector2D value
   */
-  void Saturate(Vector2D min, Vector2D max);
+  void Saturate(Vector2D<T> min, Vector2D<T> max);
 
   /*!
@@ -92,5 +93,5 @@
   * \param value saturation Vector2D value
   */
-  void Saturate(const Vector2D &value);
+  void Saturate(const Vector2D<T> &value);
 
   /*!
@@ -106,15 +107,21 @@
   * \brief x
   */
-  float x;
+  T x;
 
   /*!
   * \brief y
   */
-  float y;
+  T y;
 
-  Vector2D &operator=(const Vector2D &vector);
-  Vector2D &operator+=(const Vector2D &vector);
-  Vector2D &operator-=(const Vector2D &vector);
+  template<typename S> Vector2D<T> &operator=(const Vector2D<S> &vector) {
+    x = vector.x;
+    y = vector.y;
+    return (*this);
+  }
+  Vector2D<T> &operator+=(const Vector2D<T> &vector);
+  Vector2D<T> &operator-=(const Vector2D<T> &vector);
 };
+
+typedef Vector2D<float> Vector2Df;
 
 /*! Add
@@ -125,5 +132,5 @@
 * \param vectorB vector
 */
-Vector2D operator+(const Vector2D &vectorA, const Vector2D &vectorB);
+template<typename T> Vector2D<T> operator+(const Vector2D<T> &vectorA, const Vector2D<T> &vectorB);
 
 /*! Substract
@@ -134,5 +141,5 @@
 * \param vectorB vector
 */
-Vector2D operator-(const Vector2D &vectorA, const Vector2D &vectorB);
+template<typename T> Vector2D<T> operator-(const Vector2D<T> &vectorA, const Vector2D<T> &vectorB);
 
 /*! Opposite
@@ -144,5 +151,5 @@
 * \return -vectorA
 */
-Vector2D operator-(const Vector2D &vectorA);
+template<typename T> Vector2D<T> operator-(const Vector2D<T> &vectorA);
 
 /*! Divid
@@ -154,5 +161,5 @@
 * \return vector/coefficient
 */
-Vector2D operator/(const Vector2D &vector, float coeff);
+template<typename T> Vector2D<T> operator/(const Vector2D<T> &vector, float coeff);
 
 /*! Multiply
@@ -164,5 +171,5 @@
 * \return coefficient*vector
 */
-Vector2D operator*(const Vector2D &vector, float coeff);
+template<typename T> Vector2D<T> operator*(const Vector2D<T> &vector, float coeff);
 
 /*! Multiply
@@ -174,5 +181,5 @@
 * \return coefficient*vector
 */
-Vector2D operator*(float coeff, const Vector2D &vector);
+template<typename T> Vector2D<T> operator*(float coeff, const Vector2D<T> &vector);
 
 } // end namespace core
Index: trunk/lib/FlairCore/src/Vector3D.cpp
===================================================================
--- trunk/lib/FlairCore/src/Vector3D.cpp	(revision 166)
+++ trunk/lib/FlairCore/src/Vector3D.cpp	(revision 167)
@@ -23,12 +23,38 @@
 #include "Object.h"
 #include <math.h>
-//#include "Vector3DSpinBox.h"
 
 namespace flair {
 namespace core {
-
-Vector3D::Vector3D(float inX, float inY, float inZ) : x(inX), y(inY), z(inZ) {}
-
-Vector3D::~Vector3D() {}
+  
+template class Vector3D<double>;
+template Vector3D<double> operator+(const Vector3D<double>&, const Vector3D<double>&);
+template Vector3D<double> operator-(const Vector3D<double>&, const Vector3D<double>&);
+template Vector3D<double> operator-(const Vector3D<double>&);
+template Vector3D<double> operator/(const Vector3D<double>&, float);
+template Vector3D<double> operator*(const Vector3D<double>&, const Vector3D<double>&);
+template Vector3D<double> operator*(const Vector3D<double>&, float);
+template Vector3D<double> operator*(float, const Vector3D<double>&);
+template Vector3D<double> CrossProduct(const Vector3D<double>&, const Vector3D<double>&);
+template float DotProduct(const Vector3D<double>&, const Vector3D<double>&);
+
+template class Vector3D<float>;
+template Vector3D<float> operator+(const Vector3D<float>&, const Vector3D<float>&);
+template Vector3D<float> operator-(const Vector3D<float>&, const Vector3D<float>&);
+template Vector3D<float> operator-(const Vector3D<float>&);
+template Vector3D<float> operator/(const Vector3D<float>&, float);
+template Vector3D<float> operator*(const Vector3D<float>&, const Vector3D<float>&);
+template Vector3D<float> operator*(const Vector3D<float>&, float);
+template Vector3D<float> operator*(float, const Vector3D<float>&);
+template Vector3D<float> CrossProduct(const Vector3D<float>&, const Vector3D<float>&);
+template float DotProduct(const Vector3D<float>&, const Vector3D<float>&);
+
+template <typename T> Vector3D<T>::Vector3D(T inX, T inY, T inZ) {
+  x=inX;
+  y=inY;
+  z=inZ;
+}
+
+template <typename T> Vector3D<T>::~Vector3D() {}
+
 /*
 void Vector3D::operator=(const gui::Vector3DSpinBox *vector) {
@@ -38,6 +64,7 @@
     z=vect.z;
 }*/
-
-Vector3D &Vector3D::operator=(const Vector3D &vector) {
+/*
+template<typename T,typename S> Vector3D<T> &Vector3D<T>::operator=(const Vector3D<S> &vector) {
+//template <typename T> Vector3D<T> &Vector3D<T>::operator=(const Vector3D<T> &vector) {
   x = vector.x;
   y = vector.y;
@@ -45,6 +72,6 @@
   return (*this);
 }
-
-Vector3D &Vector3D::operator+=(const Vector3D &vector) {
+*/
+template <typename T> Vector3D<T> &Vector3D<T>::operator+=(const Vector3D<T> &vector) {
   x += vector.x;
   y += vector.y;
@@ -53,5 +80,5 @@
 }
 
-Vector3D &Vector3D::operator-=(const Vector3D &vector) {
+template <typename T> Vector3D<T> &Vector3D<T>::operator-=(const Vector3D<T> &vector) {
   x -= vector.x;
   y -= vector.y;
@@ -60,5 +87,5 @@
 }
 
-float &Vector3D::operator[](size_t idx) {
+template <typename T> T &Vector3D<T>::operator[](size_t idx) {
   if (idx == 0) {
     return x;
@@ -73,5 +100,5 @@
 }
 
-const float &Vector3D::operator[](size_t idx) const {
+template <typename T> const T &Vector3D<T>::operator[](size_t idx) const {
   if (idx == 0) {
     return x;
@@ -86,51 +113,51 @@
 }
 
-Vector3D CrossProduct(const Vector3D &vectorA, const Vector3D &vectorB) {
-  return Vector3D(vectorA.y * vectorB.z - vectorA.z * vectorB.y,
+template <typename T> Vector3D<T> CrossProduct(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB) {
+  return Vector3D<T>(vectorA.y * vectorB.z - vectorA.z * vectorB.y,
                   vectorA.z * vectorB.x - vectorA.x * vectorB.z,
                   vectorA.x * vectorB.y - vectorA.y * vectorB.x);
 }
 
-float DotProduct(const Vector3D &vectorA, const Vector3D &vectorB) {
+template <typename T> float DotProduct(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB) {
   return vectorA.x * vectorB.x + vectorA.y * vectorB.y + vectorA.z * vectorB.z;
 }
 
-Vector3D operator+(const Vector3D &vectorA, const Vector3D &vectorB) {
-  return Vector3D(vectorA.x + vectorB.x, vectorA.y + vectorB.y,
+template <typename T> Vector3D<T> operator+(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB) {
+  return Vector3D<T>(vectorA.x + vectorB.x, vectorA.y + vectorB.y,
                   vectorA.z + vectorB.z);
 }
 
-Vector3D operator-(const Vector3D &vectorA, const Vector3D &vectorB) {
-  return Vector3D(vectorA.x - vectorB.x, vectorA.y - vectorB.y,
+template <typename T> Vector3D<T> operator-(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB) {
+  return Vector3D<T>(vectorA.x - vectorB.x, vectorA.y - vectorB.y,
                   vectorA.z - vectorB.z);
 }
 
-Vector3D operator-(const Vector3D &vector) {
-  return Vector3D(-vector.x, -vector.y, -vector.z);
-}
-
-Vector3D operator*(const Vector3D &vectorA, const Vector3D &vectorB) {
-  return Vector3D(vectorA.x * vectorB.x, vectorA.y * vectorB.y,
+template <typename T> Vector3D<T> operator-(const Vector3D<T> &vector) {
+  return Vector3D<T>(-vector.x, -vector.y, -vector.z);
+}
+
+template <typename T> Vector3D<T> operator*(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB) {
+  return Vector3D<T>(vectorA.x * vectorB.x, vectorA.y * vectorB.y,
                   vectorA.z * vectorB.z);
 }
 
-Vector3D operator*(const Vector3D &vector, float coeff) {
-  return Vector3D(vector.x * coeff, vector.y * coeff, vector.z * coeff);
-}
-
-Vector3D operator*(float coeff, const Vector3D &vector) {
-  return Vector3D(vector.x * coeff, vector.y * coeff, vector.z * coeff);
-}
-
-Vector3D operator/(const Vector3D &vector, float coeff) {
+template <typename T> Vector3D<T> operator*(const Vector3D<T> &vector, float coeff) {
+  return Vector3D<T>(vector.x * coeff, vector.y * coeff, vector.z * coeff);
+}
+
+template <typename T> Vector3D<T> operator*(float coeff, const Vector3D<T> &vector) {
+  return Vector3D<T>(vector.x * coeff, vector.y * coeff, vector.z * coeff);
+}
+
+template <typename T> Vector3D<T> operator/(const Vector3D<T> &vector, float coeff) {
   if (coeff != 0) {
-    return Vector3D(vector.x / coeff, vector.y / coeff, vector.z / coeff);
+    return Vector3D<T>(vector.x / coeff, vector.y / coeff, vector.z / coeff);
   } else {
     printf("Vector3D: err divinding by 0\n");
-    return Vector3D(0, 0, 0);
-  }
-}
-
-void Vector3D::RotateX(float value) {
+    return Vector3D<T>(0, 0, 0);
+  }
+}
+
+template <typename T> void Vector3D<T>::RotateX(float value) {
   float y_tmp;
   y_tmp = y * cosf(value) - z * sinf(value);
@@ -139,7 +166,7 @@
 }
 
-void Vector3D::RotateXDeg(float value) { RotateX(Euler::ToRadian(value)); }
-
-void Vector3D::RotateY(float value) {
+template <typename T> void Vector3D<T>::RotateXDeg(float value) { RotateX(Euler::ToRadian(value)); }
+
+template <typename T> void Vector3D<T>::RotateY(float value) {
   float x_tmp;
   x_tmp = x * cosf(value) + z * sinf(value);
@@ -148,7 +175,7 @@
 }
 
-void Vector3D::RotateYDeg(float value) { RotateY(Euler::ToRadian(value)); }
-
-void Vector3D::RotateZ(float value) {
+template <typename T> void Vector3D<T>::RotateYDeg(float value) { RotateY(Euler::ToRadian(value)); }
+
+template <typename T> void Vector3D<T>::RotateZ(float value) {
   float x_tmp;
   x_tmp = x * cosf(value) - y * sinf(value);
@@ -157,9 +184,9 @@
 }
 
-void Vector3D::RotateZDeg(float value) { RotateZ(Euler::ToRadian(value)); }
-
-void Vector3D::Rotate(const RotationMatrix &matrix) {
-  float a[3] = {0, 0, 0};
-  float b[3] = {x, y, z};
+template <typename T> void Vector3D<T>::RotateZDeg(float value) { RotateZ(Euler::ToRadian(value)); }
+
+template <typename T> void Vector3D<T>::Rotate(const RotationMatrix &matrix) {
+  T a[3] = {0, 0, 0};
+  T b[3] = {x, y, z};
 
   for (int i = 0; i < 3; i++) {
@@ -174,5 +201,5 @@
 }
 
-void Vector3D::Rotate(const Quaternion &quaternion) {
+template <typename T> void Vector3D<T>::Rotate(const Quaternion &quaternion) {
   RotationMatrix matrix;
   quaternion.ToRotationMatrix(matrix);
@@ -180,18 +207,18 @@
 }
 
-void Vector3D::To2Dxy(Vector2D &vector) const {
+template <typename T> void Vector3D<T>::To2Dxy(Vector2D<T> &vector) const {
   vector.x = x;
   vector.y = y;
 }
 
-Vector2D Vector3D::To2Dxy(void) const {
-  Vector2D vect;
+template <typename T> Vector2D<T> Vector3D<T>::To2Dxy(void) const {
+  Vector2D<T> vect;
   To2Dxy(vect);
   return vect;
 }
 
-float Vector3D::GetNorm(void) const { return sqrt(x * x + y * y + z * z); }
-
-void Vector3D::Normalize(void) {
+template <typename T> float Vector3D<T>::GetNorm(void) const { return sqrt(x * x + y * y + z * z); }
+
+template <typename T> void Vector3D<T>::Normalize(void) {
   float n = GetNorm();
   if (n != 0) {
@@ -202,5 +229,5 @@
 }
 
-void Vector3D::Saturate(const Vector3D &min, const Vector3D &max) {
+template <typename T> void Vector3D<T>::Saturate(const Vector3D<T> &min, const Vector3D<T> &max) {
   if (x < min.x)
     x = min.x;
@@ -219,18 +246,18 @@
 }
 
-void Vector3D::Saturate(float min, float max) {
-  Saturate(Vector3D(min, min, min), Vector3D(max, max, max));
-}
-
-void Vector3D::Saturate(const Vector3D &value) {
+template <typename T> void Vector3D<T>::Saturate(float min, float max) {
+  Saturate(Vector3D<T>(min, min, min), Vector3D<T>(max, max, max));
+}
+
+template <typename T> void Vector3D<T>::Saturate(const Vector3D<T> &value) {
   float x = fabs(value.x);
   float y = fabs(value.y);
   float z = fabs(value.z);
-  Saturate(Vector3D(-x, -y, -z), Vector3D(x, y, z));
-}
-
-void Vector3D::Saturate(float value) {
+  Saturate(Vector3D<T>(-x, -y, -z), Vector3D<T>(x, y, z));
+}
+
+template <typename T> void Vector3D<T>::Saturate(float value) {
   float sat = fabs(value);
-  Saturate(Vector3D(-sat, -sat, -sat), Vector3D(sat, sat, sat));
+  Saturate(Vector3D<T>(-sat, -sat, -sat), Vector3D<T>(sat, sat, sat));
 }
 
Index: trunk/lib/FlairCore/src/Vector3D.h
===================================================================
--- trunk/lib/FlairCore/src/Vector3D.h	(revision 166)
+++ trunk/lib/FlairCore/src/Vector3D.h	(revision 167)
@@ -15,8 +15,8 @@
 
 #include <stddef.h>
+#include <Vector2D.h>
 
 namespace flair {
 namespace core {
-class Vector2D;
 class RotationMatrix;
 class Quaternion;
@@ -26,4 +26,5 @@
 * \brief Class defining a 3D vector
 */
+template <typename T>
 class Vector3D {
 public:
@@ -37,5 +38,5 @@
   * \param z
   */
-  Vector3D(float x = 0, float y = 0, float z = 0);
+  Vector3D(T x = 0, T y = 0, T z = 0);
 
   /*!
@@ -48,15 +49,15 @@
   * \brief x
   */
-  float x;
+  T x;
 
   /*!
   * \brief y
   */
-  float y;
+  T y;
 
   /*!
   * \brief z
   */
-  float z;
+  T z;
 
   /*!
@@ -126,5 +127,5 @@
   * \param vector destination
   */
-  void To2Dxy(Vector2D &vector) const;
+  void To2Dxy(Vector2D<T> &vector) const;
 
   /*!
@@ -135,5 +136,5 @@
   * \return destination
   */
-  Vector2D To2Dxy(void) const;
+  Vector2D<T> To2Dxy(void) const;
 
   /*!
@@ -157,5 +158,5 @@
   * \param max maximum value
   */
-  void Saturate(const Vector3D &min, const Vector3D &max);
+  void Saturate(const Vector3D<T> &min, const Vector3D<T> &max);
 
   /*!
@@ -176,5 +177,5 @@
   * \param value saturation Vector3D value
   */
-  void Saturate(const Vector3D &value);
+  void Saturate(const Vector3D<T> &value);
 
   /*!
@@ -188,13 +189,21 @@
   void Saturate(float value);
 
-  float &operator[](size_t idx);
-  const float &operator[](size_t idx) const;
-  Vector3D &operator=(const Vector3D &vector);
-  Vector3D &operator+=(const Vector3D &vector);
-  Vector3D &operator-=(const Vector3D &vector);
+  T &operator[](size_t idx);
+  const T &operator[](size_t idx) const;
+  //Vector3D<T> &operator=(const Vector3D<T> &vector);
+  template<typename S> Vector3D<T> &operator=(const Vector3D<S> &vector) {
+    x = vector.x;
+    y = vector.y;
+    z = vector.z;
+    return (*this);
+  }
+  Vector3D<T> &operator+=(const Vector3D<T> &vector);
+  Vector3D<T> &operator-=(const Vector3D<T> &vector);
 
 private:
 };
 
+typedef Vector3D<float> Vector3Df;
+
 /*! Add
 *
@@ -206,5 +215,5 @@
 * \return vectorA+vectorB
 */
-Vector3D operator+(const Vector3D &vectorA, const Vector3D &vectorB);
+template<typename T> Vector3D<T> operator+(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB);
 
 /*! Substract
@@ -217,5 +226,5 @@
 * \return vectorA-vectorB
 */
-Vector3D operator-(const Vector3D &vectorA, const Vector3D &vectorB);
+template<typename T> Vector3D<T> operator-(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB);
 
 /*! Minus
@@ -227,5 +236,5 @@
 * \return -vector
 */
-Vector3D operator-(const Vector3D &vector);
+template<typename T> Vector3D<T> operator-(const Vector3D<T> &vector);
 
 /*! Divid
@@ -238,5 +247,5 @@
 * \return vector/coefficient
 */
-Vector3D operator/(const Vector3D &vector, float coeff);
+template<typename T> Vector3D<T> operator/(const Vector3D<T> &vector, float coeff);
 
 /*! Hadamard product
@@ -249,5 +258,5 @@
 * \return Hadamard product
 */
-Vector3D operator*(const Vector3D &vectorA, const Vector3D &vectorB);
+template<typename T> Vector3D<T> operator*(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB);
 
 /*! Multiply
@@ -260,5 +269,5 @@
 * \return coefficient*vector
 */
-Vector3D operator*(const Vector3D &vector, float coeff);
+template<typename T> Vector3D<T> operator*(const Vector3D<T> &vector, float coeff);
 
 /*! Multiply
@@ -271,5 +280,5 @@
 * \return coefficient*vector
 */
-Vector3D operator*(float coeff, const Vector3D &vector);
+template<typename T> Vector3D<T> operator*(float coeff, const Vector3D<T> &vector);
 
 /*! Cross product
@@ -282,5 +291,5 @@
 * \return cross product
 */
-Vector3D CrossProduct(const Vector3D &vectorA, const Vector3D &vectorB);
+template<typename T> Vector3D<T> CrossProduct(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB);
 
 /*! Dot product
@@ -293,5 +302,5 @@
 * \return dot product
 */
-float DotProduct(const Vector3D &vectorA, const Vector3D &vectorB);
+template<typename T> float DotProduct(const Vector3D<T> &vectorA, const Vector3D<T> &vectorB);
 
 } // end namespace core
Index: trunk/lib/FlairCore/src/Vector3DSpinBox.cpp
===================================================================
--- trunk/lib/FlairCore/src/Vector3DSpinBox.cpp	(revision 166)
+++ trunk/lib/FlairCore/src/Vector3DSpinBox.cpp	(revision 167)
@@ -26,5 +26,5 @@
 Vector3DSpinBox::Vector3DSpinBox(const LayoutPosition *position, string name,
                                  double min, double max, double step,
-                                 int decimals, core::Vector3D default_value)
+                                 int decimals, core::Vector3Df default_value)
     : Box(position, name, "Vector3DSpinBox") {
   // update value from xml file
@@ -52,6 +52,6 @@
 }
 */
-core::Vector3D Vector3DSpinBox::Value(void) const {
-  core::Vector3D tmp;
+core::Vector3Df Vector3DSpinBox::Value(void) const {
+  core::Vector3Df tmp;
 
   GetMutex();
Index: trunk/lib/FlairCore/src/Vector3DSpinBox.h
===================================================================
--- trunk/lib/FlairCore/src/Vector3DSpinBox.h	(revision 166)
+++ trunk/lib/FlairCore/src/Vector3DSpinBox.h	(revision 167)
@@ -44,5 +44,5 @@
   Vector3DSpinBox(const LayoutPosition *position, std::string name, double min,
                   double max, double step, int decimals = 2,
-                  core::Vector3D default_value = core::Vector3D(0, 0, 0));
+                  core::Vector3Df default_value = core::Vector3Df(0, 0, 0));
 
   /*!
@@ -57,5 +57,5 @@
   * \return value
   */
-  core::Vector3D Value(void) const;
+  core::Vector3Df Value(void) const;
   // operator core::Vector3D() const;
 private:
@@ -68,5 +68,5 @@
   void XmlEvent(void);
 
-  core::Vector3D box_value;
+  core::Vector3Df box_value;
 };
 
Index: trunk/lib/FlairCore/src/Vector3Ddata.h
===================================================================
--- trunk/lib/FlairCore/src/Vector3Ddata.h	(revision 166)
+++ trunk/lib/FlairCore/src/Vector3Ddata.h	(revision 167)
@@ -26,5 +26,5 @@
 * User must manually use the io_data's Mutex to access to Vector3D values.
 */
-class Vector3Ddata : public io_data, public Vector3D {
+class Vector3Ddata : public io_data, public Vector3Df {
 public:
   /*!
Index: trunk/lib/FlairCore/src/unexported/OneAxisRotation_impl.h
===================================================================
--- trunk/lib/FlairCore/src/unexported/OneAxisRotation_impl.h	(revision 166)
+++ trunk/lib/FlairCore/src/unexported/OneAxisRotation_impl.h	(revision 167)
@@ -14,7 +14,8 @@
 #define ONEAXISROTATION_IMPL_H
 
+#include <Vector3D.h>
+
 namespace flair {
 namespace core {
-class Vector3D;
 class Euler;
 class Quaternion;
@@ -36,5 +37,5 @@
   OneAxisRotation_impl(flair::gui::GroupBox *box);
   ~OneAxisRotation_impl();
-  void ComputeRotation(flair::core::Vector3D &point) const;
+  template <typename T> void ComputeRotation(flair::core::Vector3D<T> &point) const;
   void ComputeRotation(flair::core::Quaternion &quat) const;
   void ComputeRotation(flair::core::RotationMatrix &matrix) const;
Index: trunk/lib/FlairFilter/src/Ahrs.h
===================================================================
--- trunk/lib/FlairFilter/src/Ahrs.h	(revision 166)
+++ trunk/lib/FlairFilter/src/Ahrs.h	(revision 167)
@@ -19,8 +19,4 @@
 namespace flair {
   namespace core {
-    class Euler;
-    class Vector3D;
-    class ImuData;
-    class Quaternion;
     class AhrsData;
   }
Index: trunk/lib/FlairFilter/src/AhrsComplementaryFilter.cpp
===================================================================
--- trunk/lib/FlairFilter/src/AhrsComplementaryFilter.cpp	(revision 166)
+++ trunk/lib/FlairFilter/src/AhrsComplementaryFilter.cpp	(revision 167)
@@ -64,5 +64,5 @@
     AhrsData* ahrsData;
     GetDatas(&ahrsData);
-    Vector3D rawAcc,rawMag,rawGyr;
+    Vector3Df rawAcc,rawMag,rawGyr;
     input->GetRawAccMagAndGyr(rawAcc,rawMag,rawGyr);
 
@@ -70,7 +70,7 @@
     previous_time=data->DataTime();
 
-    Vector3D aBar,aHat,aTilde;
-    Vector3D mBar,mHat,mTilde;
-    Vector3D alpha,dBHat,omegaHat;
+    Vector3Df aBar,aHat,aTilde;
+    Vector3Df mBar,mHat,mTilde;
+    Vector3Df alpha,dBHat,omegaHat;
     Quaternion dQHat;
 
Index: trunk/lib/FlairFilter/src/AhrsComplementaryFilter.h
===================================================================
--- trunk/lib/FlairFilter/src/AhrsComplementaryFilter.h	(revision 166)
+++ trunk/lib/FlairFilter/src/AhrsComplementaryFilter.h	(revision 167)
@@ -66,5 +66,5 @@
             bool isInit;
             core::Quaternion QHat;
-            core::Vector3D BHat;
+            core::Vector3Df BHat;
             gui::DoubleSpinBox *ka[3];
             gui::DoubleSpinBox *kb[3];
Index: trunk/lib/FlairFilter/src/AhrsKalman_impl.cpp
===================================================================
--- trunk/lib/FlairFilter/src/AhrsKalman_impl.cpp	(revision 166)
+++ trunk/lib/FlairFilter/src/AhrsKalman_impl.cpp	(revision 167)
@@ -86,5 +86,5 @@
     ImuData *input=(ImuData*)data;
     float delta_t;
-    Vector3D rawAcc,rawMag,rawGyr;
+    Vector3Df rawAcc,rawMag,rawGyr;
 
     input->GetRawAccMagAndGyr(rawAcc,rawMag,rawGyr);
@@ -115,5 +115,5 @@
 
         ahrsData->SetQuaternionAndAngularRates(euler.ToQuaternion(),
-                                               rawGyr-Vector3D(ars_roll.x_bias,ars_pitch.x_bias,0));
+                                               rawGyr-Vector3Df(ars_roll.x_bias,ars_pitch.x_bias,0));
     } else {
         is_init=true;
Index: trunk/lib/FlairFilter/src/Gx3_25_ahrs.cpp
===================================================================
--- trunk/lib/FlairFilter/src/Gx3_25_ahrs.cpp	(revision 166)
+++ trunk/lib/FlairFilter/src/Gx3_25_ahrs.cpp	(revision 167)
@@ -44,5 +44,5 @@
 
   Quaternion quaternion;
-  Vector3D filteredAngRates;
+  Vector3Df filteredAngRates;
   input->GetQuaternionAndAngularRates(quaternion, filteredAngRates);
   GetImu()->GetOneAxisRotation()->ComputeRotation(quaternion);
Index: trunk/lib/FlairFilter/src/JoyReference_impl.cpp
===================================================================
--- trunk/lib/FlairFilter/src/JoyReference_impl.cpp	(revision 166)
+++ trunk/lib/FlairFilter/src/JoyReference_impl.cpp	(revision 167)
@@ -168,8 +168,8 @@
   input->GetMutex();
 
-  Vector3D theta_xy(
+  Vector3Df theta_xy(
       -Euler::ToRadian(input->ValueNoMutex(0, 0) * deb_roll->Value()),
       -Euler::ToRadian(input->ValueNoMutex(1, 0) * deb_pitch->Value()), 0);
-  Vector3D e_bar = theta_xy;
+  Vector3Df e_bar = theta_xy;
   e_bar.Normalize();
   Quaternion q_xy(cos(theta_xy.GetNorm() / 2.0f),
@@ -192,5 +192,5 @@
   input->ReleaseMutex();
 
-  ahrsData->SetQuaternionAndAngularRates(q_ref, Vector3D(0, 0, wz_ref));
+  ahrsData->SetQuaternionAndAngularRates(q_ref, Vector3Df(0, 0, wz_ref));
 
   // ouput quaternion for control law
Index: trunk/lib/FlairFilter/src/SimuAhrs.cpp
===================================================================
--- trunk/lib/FlairFilter/src/SimuAhrs.cpp	(revision 166)
+++ trunk/lib/FlairFilter/src/SimuAhrs.cpp	(revision 167)
@@ -42,5 +42,5 @@
 
   Quaternion quaternion;
-  Vector3D filteredAngRates;
+  Vector3Df filteredAngRates;
   input->GetQuaternionAndAngularRates(quaternion, filteredAngRates);
   output->SetQuaternionAndAngularRates(quaternion, filteredAngRates);
Index: trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle.cpp
===================================================================
--- trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle.cpp	(revision 166)
+++ trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle.cpp	(revision 167)
@@ -48,5 +48,5 @@
 }
 
-void TrajectoryGenerator2DCircle::StartTraj(const Vector2D &start_pos,
+void TrajectoryGenerator2DCircle::StartTraj(const Vector2Df &start_pos,
                                             float nb_lap) {
   pimpl_->StartTraj(start_pos, nb_lap);
@@ -57,19 +57,19 @@
 void TrajectoryGenerator2DCircle::StopTraj(void) { pimpl_->is_running = false; }
 
-void TrajectoryGenerator2DCircle::GetPosition(Vector2D &point) const {
+void TrajectoryGenerator2DCircle::GetPosition(Vector2Df &point) const {
   point.x = pimpl_->output->Value(0, 0);
   point.y = pimpl_->output->Value(0, 1);
 }
 
-void TrajectoryGenerator2DCircle::SetCenter(const Vector2D &value) {
+void TrajectoryGenerator2DCircle::SetCenter(const Vector2Df &value) {
   pimpl_->pos_off = value;
 }
 
-void TrajectoryGenerator2DCircle::GetSpeed(Vector2D &point) const {
+void TrajectoryGenerator2DCircle::GetSpeed(Vector2Df &point) const {
   point.x = pimpl_->output->Value(1, 0);
   point.y = pimpl_->output->Value(1, 1);
 }
 
-void TrajectoryGenerator2DCircle::SetCenterSpeed(const Vector2D &value) {
+void TrajectoryGenerator2DCircle::SetCenterSpeed(const Vector2Df &value) {
   pimpl_->vel_off = value;
 }
Index: trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle.h
===================================================================
--- trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle.h	(revision 166)
+++ trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle.h	(revision 167)
@@ -15,9 +15,9 @@
 
 #include <IODevice.h>
+#include <Vector2D.h>
 
 namespace flair {
 namespace core {
 class cvmatrix;
-class Vector2D;
 }
 namespace gui {
@@ -72,5 +72,5 @@
   * \param nb_lap number of laps, -1 for infinite
   */
-  void StartTraj(const core::Vector2D &start_pos, float nb_lap = -1);
+  void StartTraj(const core::Vector2Df &start_pos, float nb_lap = -1);
 
   /*!
@@ -93,5 +93,5 @@
   * \param value center position
   */
-  void SetCenter(const core::Vector2D &value);
+  void SetCenter(const core::Vector2Df &value);
 
   /*!
@@ -100,5 +100,5 @@
   * \param value center speed
   */
-  void SetCenterSpeed(const core::Vector2D &value);
+  void SetCenterSpeed(const core::Vector2Df &value);
 
   /*!
@@ -117,5 +117,5 @@
   * \param point returned position
   */
-  void GetPosition(core::Vector2D &point) const;
+  void GetPosition(core::Vector2Df &point) const;
 
   /*!
@@ -124,5 +124,5 @@
   * \param point returned speed
   */
-  void GetSpeed(core::Vector2D &point) const;
+  void GetSpeed(core::Vector2Df &point) const;
 
   /*!
Index: trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle_impl.cpp
===================================================================
--- trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle_impl.cpp	(revision 166)
+++ trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle_impl.cpp	(revision 167)
@@ -64,5 +64,5 @@
 }
 
-void TrajectoryGenerator2DCircle_impl::StartTraj(const Vector2D &start_pos,
+void TrajectoryGenerator2DCircle_impl::StartTraj(const Vector2Df &start_pos,
                                                  float nb_lap) {
   is_running = true;
@@ -89,5 +89,5 @@
   float A = acceleration->Value();
   float R = rayon->Value();
-  Vector2D v;
+  Vector2Df v;
 
   if (V < 0)
Index: trunk/lib/FlairFilter/src/unexported/TrajectoryGenerator2DCircle_impl.h
===================================================================
--- trunk/lib/FlairFilter/src/unexported/TrajectoryGenerator2DCircle_impl.h	(revision 166)
+++ trunk/lib/FlairFilter/src/unexported/TrajectoryGenerator2DCircle_impl.h	(revision 167)
@@ -43,9 +43,9 @@
   ~TrajectoryGenerator2DCircle_impl();
   void Update(flair::core::Time time);
-  void StartTraj(const flair::core::Vector2D &start_pos, float nb_lap);
+  void StartTraj(const flair::core::Vector2Df &start_pos, float nb_lap);
   void FinishTraj(void);
   bool is_running;
   flair::core::cvmatrix *output;
-  flair::core::Vector2D pos_off, vel_off;
+  flair::core::Vector2Df pos_off, vel_off;
 
 private:
@@ -53,5 +53,5 @@
   float CurrentTime, FinishTime;
   bool first_update, is_finishing;
-  flair::core::Vector2D pos;
+  flair::core::Vector2Df pos;
   float angle_off;
   flair::gui::DoubleSpinBox *T, *veloctity, *acceleration, *rayon;
Index: trunk/lib/FlairMeta/src/MetaVrpnObject.cpp
===================================================================
--- trunk/lib/FlairMeta/src/MetaVrpnObject.cpp	(revision 166)
+++ trunk/lib/FlairMeta/src/MetaVrpnObject.cpp	(revision 167)
@@ -28,5 +28,4 @@
 #include <TabWidget.h>
 #include <cvmatrix.h>
-#include <Vector3D.h>
 
 using std::string;
@@ -55,5 +54,5 @@
     desc->SetElementName(i, 0, Output()->Name(i, 0));
   }
-  cvmatrix *prev_value = new cvmatrix(this, desc, elementDataType, name);
+  cvmatrix *prev_value = new cvmatrix(this, desc, floatType, name);
   delete desc;
 
@@ -66,5 +65,5 @@
     desc->SetElementName(i, 0, "d" + Output()->Name(i, 0));
   }
-  prev_value = new cvmatrix(this, desc, elementDataType, name);
+  prev_value = new cvmatrix(this, desc, floatType, name);
   delete desc;
 
@@ -95,5 +94,5 @@
 DataPlot2D *MetaVrpnObject::XyPlot(void) const { return xy_plot; }
 
-void MetaVrpnObject::GetSpeed(Vector3D &speed) const {
+void MetaVrpnObject::GetSpeed(Vector3Df &speed) const {
   speed.x = euler->Output(4, 0);
   speed.y = euler->Output(5, 0);
Index: trunk/lib/FlairMeta/src/MetaVrpnObject.h
===================================================================
--- trunk/lib/FlairMeta/src/MetaVrpnObject.h	(revision 166)
+++ trunk/lib/FlairMeta/src/MetaVrpnObject.h	(revision 167)
@@ -15,11 +15,8 @@
 
 #include <VrpnObject.h>
-#include "io_data.h"
+#include <io_data.h>
+#include <Vector3D.h>
 
 namespace flair {
-	namespace core {
-		class Vector3D;
-		class FloatType;
-	}
 	namespace gui {
 		class DataPlot1D;
@@ -51,5 +48,5 @@
   gui::DataPlot1D *VzPlot(void) const; // 1,2
   gui::DataPlot2D *XyPlot(void) const;
-  void GetSpeed(core::Vector3D &speed) const;
+  void GetSpeed(core::Vector3Df &speed) const;
 
 private:
@@ -60,5 +57,4 @@
   gui::DataPlot1D *vx_opti_plot, *vy_opti_plot, *vz_opti_plot;
   gui::Tab *plot_tab;
-  core::FloatType elementDataType;
 };
 } // end namespace meta
Index: trunk/lib/FlairMeta/src/UavStateMachine.cpp
===================================================================
--- trunk/lib/FlairMeta/src/UavStateMachine.cpp	(revision 166)
+++ trunk/lib/FlairMeta/src/UavStateMachine.cpp	(revision 167)
@@ -132,5 +132,5 @@
 }
 
-const Vector3D &UavStateMachine::GetCurrentAngularSpeed(void) const {
+const Vector3Df &UavStateMachine::GetCurrentAngularSpeed(void) const {
   return currentAngularSpeed;
 }
@@ -423,5 +423,5 @@
     const AhrsData *refOrientation = ComputeReferenceOrientation();
     Quaternion refQuaternion;
-    Vector3D refAngularRates;
+    Vector3Df refAngularRates;
     refOrientation->GetQuaternionAndAngularRates(refQuaternion,
                                                  refAngularRates);
Index: trunk/lib/FlairMeta/src/UavStateMachine.h
===================================================================
--- trunk/lib/FlairMeta/src/UavStateMachine.h	(revision 166)
+++ trunk/lib/FlairMeta/src/UavStateMachine.h	(revision 167)
@@ -107,5 +107,5 @@
   const core::Quaternion &GetCurrentQuaternion(void) const;
 
-  const core::Vector3D &GetCurrentAngularSpeed(void) const;
+  const core::Vector3Df &GetCurrentAngularSpeed(void) const;
 
         void Land(void);
@@ -267,5 +267,5 @@
 
   core::Quaternion currentQuaternion;
-  core::Vector3D currentAngularSpeed;
+  core::Vector3Df currentAngularSpeed;
 
   const core::AhrsData *ComputeReferenceOrientation(void);
Index: trunk/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp	(revision 166)
+++ trunk/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp	(revision 167)
@@ -130,5 +130,5 @@
       eulerAngles.yaw = Dequeue(&buf);
 
-      Vector3D filteredAngRates;
+      Vector3Df filteredAngRates;
       filteredAngRates.x = Dequeue(&buf);
       filteredAngRates.y = Dequeue(&buf);
@@ -143,10 +143,10 @@
       GetData(response, sizeof(response), &imuTime);
 
-      Vector3D rawAcc;
+      Vector3Df rawAcc;
       rawAcc.x = 9.80665 * Dequeue(&buf);
       rawAcc.y = 9.80665 * Dequeue(&buf);
       rawAcc.z = 9.80665 * Dequeue(&buf);
 
-      Vector3D filteredAngRates;
+      Vector3Df filteredAngRates;
       filteredAngRates.x = Dequeue(&buf);
       filteredAngRates.y = Dequeue(&buf);
@@ -178,5 +178,5 @@
       quaternion.q3 = Dequeue(&buf);
 
-      Vector3D filteredAngRates;
+      Vector3Df filteredAngRates;
       filteredAngRates.x = 0;
       filteredAngRates.y = 0;
Index: trunk/lib/FlairSensorActuator/src/Imu.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Imu.cpp	(revision 166)
+++ trunk/lib/FlairSensorActuator/src/Imu.cpp	(revision 167)
@@ -69,5 +69,5 @@
     return;
   }
-  Vector3D rawAcc, rawMag, rawGyr;
+  Vector3Df rawAcc, rawMag, rawGyr;
   imuData->GetRawAccMagAndGyr(rawAcc, rawMag, rawGyr);
   rotation->ComputeRotation(rawAcc);
Index: trunk/lib/FlairSensorActuator/src/NmeaGps.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/NmeaGps.cpp	(revision 166)
+++ trunk/lib/FlairSensorActuator/src/NmeaGps.cpp	(revision 167)
@@ -173,5 +173,5 @@
 void NmeaGps::SetRef(void) { takeRef = true; }
 
-void NmeaGps::GetEnu(Vector3D *point) {
+void NmeaGps::GetEnu(Vector3Df *point) {
   gpsData->GetMutex();
   gpsData->GetEnu(point->x,point->y,point->z);
Index: trunk/lib/FlairSensorActuator/src/NmeaGps.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/NmeaGps.h	(revision 166)
+++ trunk/lib/FlairSensorActuator/src/NmeaGps.h	(revision 167)
@@ -15,4 +15,5 @@
 
 #include <IODevice.h>
+#include <Vector3D.h>
 #include <nmea/nmea.h>
 
@@ -21,5 +22,4 @@
     class FrameworkManager;
     class GeoCoordinate;
-    class Vector3D;
     class GpsData;
   }
@@ -168,5 +168,5 @@
   * \param point to store position
   */
-  void GetEnu(core::Vector3D *point);
+  void GetEnu(core::Vector3Df *point);
 
 protected:
Index: trunk/lib/FlairSensorActuator/src/SimuImu.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuImu.cpp	(revision 166)
+++ trunk/lib/FlairSensorActuator/src/SimuImu.cpp	(revision 167)
@@ -107,5 +107,5 @@
     ahrsData->SetQuaternionAndAngularRates(
         Quaternion(state.q0, state.q1, state.q2, state.q3),
-        Vector3D(state.wx, state.wy, state.wz));
+        Vector3Df(state.wx, state.wy, state.wz));
 
     imuData->SetDataTime(GetTime());
Index: trunk/lib/FlairSensorActuator/src/VrpnClient_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnClient_impl.cpp	(revision 166)
+++ trunk/lib/FlairSensorActuator/src/VrpnClient_impl.cpp	(revision 167)
@@ -104,5 +104,5 @@
 }
 
-void VrpnClient_impl::ComputeRotations(Vector3D &point) {
+void VrpnClient_impl::ComputeRotations(Vector3Df &point) {
   rotation_1->ComputeRotation(point);
   rotation_2->ComputeRotation(point);
Index: trunk/lib/FlairSensorActuator/src/VrpnObject.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnObject.cpp	(revision 166)
+++ trunk/lib/FlairSensorActuator/src/VrpnObject.cpp	(revision 167)
@@ -77,5 +77,5 @@
 }
 
-void VrpnObject::GetPosition(Vector3D &point) const {
+void VrpnObject::GetPosition(Vector3Df &point) const {
   pimpl_->GetPosition(point);
 }
Index: trunk/lib/FlairSensorActuator/src/VrpnObject.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnObject.h	(revision 166)
+++ trunk/lib/FlairSensorActuator/src/VrpnObject.h	(revision 167)
@@ -16,4 +16,5 @@
 
 #include <IODevice.h>
+#include <Vector3D.h>
 #include <stdint.h>
 
@@ -21,5 +22,4 @@
 	namespace core {
 		class cvmatrix;
-		class Vector3D;
 		class Quaternion;
 	}
@@ -110,5 +110,5 @@
   * \param point output datas
   */
-  void GetPosition(core::Vector3D &point) const;
+  void GetPosition(core::Vector3Df &point) const;
 
   /*!
Index: trunk/lib/FlairSensorActuator/src/VrpnObject_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnObject_impl.cpp	(revision 166)
+++ trunk/lib/FlairSensorActuator/src/VrpnObject_impl.cpp	(revision 167)
@@ -129,5 +129,5 @@
 }
 
-void VrpnObject_impl::GetPosition(Vector3D &point) {
+void VrpnObject_impl::GetPosition(Vector3Df &point) {
   output->GetMutex();
   point.x = output->ValueNoMutex(4, 0);
@@ -163,5 +163,5 @@
   // flair::core::Quaternion
 	Quaternion quaternion(t.quat[3],t.quat[0],t.quat[1],t.quat[2]);
-  Vector3D pos((float)t.pos[0], (float)t.pos[1], (float)t.pos[2]);
+  Vector3Df pos((float)t.pos[0], (float)t.pos[1], (float)t.pos[2]);
 
   // on effectue les rotation
Index: trunk/lib/FlairSensorActuator/src/unexported/VrpnClient_impl.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/unexported/VrpnClient_impl.h	(revision 166)
+++ trunk/lib/FlairSensorActuator/src/unexported/VrpnClient_impl.h	(revision 167)
@@ -21,9 +21,9 @@
 #include <string>
 #include <vector>
+#include "Vector3D.h"
 
 namespace flair {
 namespace core {
 class OneAxisRotation;
-class Vector3D;
 class Quaternion;
 class Mutex;
@@ -54,5 +54,5 @@
   void AddTrackable(VrpnObject_impl *obj, uint8_t id);  // xbee
   void RemoveTrackable(VrpnObject_impl *obj);           // normal+xbee
-  void ComputeRotations(flair::core::Vector3D &point);
+  void ComputeRotations(flair::core::Vector3Df &point);
   void ComputeRotations(flair::core::Quaternion &quat);
   bool UseXbee(void);
Index: trunk/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h	(revision 166)
+++ trunk/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h	(revision 167)
@@ -24,9 +24,9 @@
 #include <vrpn_Tracker.h>
 #include "Quaternion.h"
+#include "Vector3D.h"
 
 namespace flair {
 	namespace core {
 		class cvmatrix;
-		class Vector3D;
 	}
 	namespace gui {
@@ -51,5 +51,5 @@
 
   void GetQuaternion(flair::core::Quaternion &quaternion);
-  void GetPosition(flair::core::Vector3D &point);
+  void GetPosition(flair::core::Vector3Df &point);
   bool IsTracked(unsigned int timeout_ms);
 
Index: trunk/lib/FlairSimulator/src/FixedCamera.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/FixedCamera.cpp	(revision 166)
+++ trunk/lib/FlairSimulator/src/FixedCamera.cpp	(revision 167)
@@ -35,5 +35,5 @@
 namespace simulator {
 
-FixedCamera::FixedCamera(std::string name,core::Vector3D position,core::Vector3D lookat,float inRotateSpeed,float inZoomSpeed):VisualizationCamera(name)  {
+FixedCamera::FixedCamera(std::string name,core::Vector3Df position,core::Vector3Df lookat,float inRotateSpeed,float inZoomSpeed):VisualizationCamera(name)  {
   Rotating = false;
   rotateSpeed=inRotateSpeed;
@@ -62,5 +62,5 @@
 
       //normal between target and up vector
-      cameraAxeY=target.crossProduct(irr::core::vector3df(0,0,1));
+      cameraAxeY=target.crossProduct(vector3df(0,0,1));
       cameraAxeY.normalize();
 
@@ -81,7 +81,7 @@
 
       //check angle
-      irr::core::vector3df newTarget(q3.X,q3.Y,q3.Z);
-      float angle=acos(newTarget.dotProduct(irr::core::vector3df(0,0,1))/newTarget.getLength());
-      irr::core::vector3df cross = newTarget.crossProduct(irr::core::vector3df(0,0,1));
+      vector3df newTarget(q3.X,q3.Y,q3.Z);
+      float angle=acos(newTarget.dotProduct(vector3df(0,0,1))/newTarget.getLength());
+      vector3df cross = newTarget.crossProduct(vector3df(0,0,1));
       if (cross.dotProduct(cameraAxeY) > 0) {
         newTarget += camera->getAbsolutePosition();
Index: trunk/lib/FlairSimulator/src/FixedCamera.h
===================================================================
--- trunk/lib/FlairSimulator/src/FixedCamera.h	(revision 166)
+++ trunk/lib/FlairSimulator/src/FixedCamera.h	(revision 167)
@@ -26,5 +26,5 @@
 class FixedCamera : public VisualizationCamera {
 public:
-  FixedCamera(std::string name,core::Vector3D position,core::Vector3D lookat=core::Vector3D(0,0,0),float rotateSpeed = -3.0f, float zoomSpeed = .05f);
+  FixedCamera(std::string name,core::Vector3Df position,core::Vector3Df lookat=core::Vector3Df(0,0,0),float rotateSpeed = -3.0f, float zoomSpeed = .05f);
   ~FixedCamera();
 
Index: trunk/lib/FlairSimulator/src/Gui.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Gui.cpp	(revision 166)
+++ trunk/lib/FlairSimulator/src/Gui.cpp	(revision 167)
@@ -109,10 +109,10 @@
 }
 
-vector3df ToIrrlichtCoordinates(Vector3D vect) {
+template<typename T> vector3df ToIrrlichtCoordinates(Vector3D<T> vect) {
   return ToIrrlichtScale(1) * vector3df(vect.x, vect.y, -vect.z);
 }
 
-Vector3D ToSimulatorCoordinates(vector3df vect) {
-  return ToSimulatorScale(1) * Vector3D(vect.X, vect.Y, -vect.Z);
+Vector3Df ToSimulatorCoordinates(vector3df vect) {
+  return ToSimulatorScale(1) * Vector3Df(vect.X, vect.Y, -vect.Z);
 }
 
@@ -132,4 +132,8 @@
   return Quaternion(quat.q0, -quat.q1, -quat.q2, quat.q3);
 }
+
+
+template irr::core::vector3df ToIrrlichtCoordinates(core::Vector3D<double>);
+template irr::core::vector3df ToIrrlichtCoordinates(core::Vector3D<float>);
 
 Gui::Gui(std::string name, int app_width,
Index: trunk/lib/FlairSimulator/src/Gui.h
===================================================================
--- trunk/lib/FlairSimulator/src/Gui.h	(revision 166)
+++ trunk/lib/FlairSimulator/src/Gui.h	(revision 167)
@@ -19,4 +19,5 @@
 
 #include <Object.h>
+#include <Vector3D.h>
 #include <EDriverTypes.h>
 #include <vector3d.h>
@@ -36,5 +37,4 @@
 namespace core {
 class Object;
-class Vector3D;
 class Euler;
 class Quaternion;
@@ -125,5 +125,5 @@
 * \return vector in irrlicht coordinates
 */
-irr::core::vector3df ToIrrlichtCoordinates(core::Vector3D vect);
+template<typename T>  irr::core::vector3df ToIrrlichtCoordinates(core::Vector3D<T> vect);
 
 /*!
@@ -136,5 +136,5 @@
 * \return vector in simulator coordinates
 */
-core::Vector3D ToSimulatorCoordinates(irr::core::vector3df vect);
+core::Vector3Df ToSimulatorCoordinates(irr::core::vector3df vect);
 
 /*!
Index: trunk/lib/FlairSimulator/src/Man.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Man.cpp	(revision 166)
+++ trunk/lib/FlairSimulator/src/Man.cpp	(revision 167)
@@ -73,5 +73,5 @@
   state[0].Quat.Normalize();
 
-  Vector3D dir = state[0].Vel;
+  Vector3D<double> dir = state[0].Vel;
   dir.Rotate(state[0].Quat);
   state[0].Pos = state[-1].Pos + dT() * dir;
Index: trunk/lib/FlairSimulator/src/Model.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Model.cpp	(revision 166)
+++ trunk/lib/FlairSimulator/src/Model.cpp	(revision 167)
@@ -69,5 +69,5 @@
 TabWidget *Model::GetTabWidget(void) const { return pimpl_->tabwidget; }
 
-float Model::dT(void) const { return pimpl_->dT->Value(); }
+double Model::dT(void) const { return pimpl_->dT->Value(); }
 
 int Model::GetId(void) const {
Index: trunk/lib/FlairSimulator/src/Model.h
===================================================================
--- trunk/lib/FlairSimulator/src/Model.h	(revision 166)
+++ trunk/lib/FlairSimulator/src/Model.h	(revision 167)
@@ -69,7 +69,7 @@
   typedef struct simu_state {
     core::Quaternion Quat;
-    core::Vector3D W;
-    core::Vector3D Pos;
-    core::Vector3D Vel;
+    core::Vector3Df W;
+    core::Vector3D<double> Pos;
+    core::Vector3D<double> Vel;
   } simu_state_t;
 
@@ -96,5 +96,5 @@
 protected:
   DiscreteTimeVariable<simu_state_t, 3> state;
-  float dT(void) const;
+  double dT(void) const;
   virtual void CalcModel(void) = 0;
 #ifdef GL
Index: trunk/lib/FlairSimulator/src/Model_impl.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Model_impl.cpp	(revision 166)
+++ trunk/lib/FlairSimulator/src/Model_impl.cpp	(revision 167)
@@ -160,5 +160,5 @@
   states_mutex->GetMutex();
   Quaternion quat = getSimulator()->ToVRPNReference(self->state[0].Quat);
-  Vector3D position = getSimulator()->ToVRPNReference(self->state[0].Pos);
+  Vector3D<double> position = getSimulator()->ToVRPNReference(self->state[0].Pos);
   states_mutex->ReleaseMutex();
 
Index: trunk/lib/FlairSimulator/src/Parser.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Parser.cpp	(revision 166)
+++ trunk/lib/FlairSimulator/src/Parser.cpp	(revision 167)
@@ -210,14 +210,14 @@
 }
 
-Vector3D Parser::getMeshVector3D(xmlNode *mesh_node, xmlChar *param) {
+Vector3Df Parser::getMeshVector3D(xmlNode *mesh_node, xmlChar *param) {
   xmlNode *cur_node = NULL;
   for (cur_node = mesh_node; cur_node; cur_node = cur_node->next) {
     if (xmlStrEqual(cur_node->name, param)) {
-      return Vector3D(atof((char *)xmlGetProp(cur_node, (xmlChar *)"x")),
+      return Vector3Df(atof((char *)xmlGetProp(cur_node, (xmlChar *)"x")),
                        atof((char *)xmlGetProp(cur_node, (xmlChar *)"y")),
                        atof((char *)xmlGetProp(cur_node, (xmlChar *)"z")));
     }
   }
-  return Vector3D(0, 0, 0);
+  return Vector3Df(0, 0, 0);
 }
 
Index: trunk/lib/FlairSimulator/src/Parser.h
===================================================================
--- trunk/lib/FlairSimulator/src/Parser.h	(revision 166)
+++ trunk/lib/FlairSimulator/src/Parser.h	(revision 167)
@@ -19,13 +19,8 @@
 
 #include <Gui.h>
+#include <Vector3D.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 #include <SColor.h>
-
-namespace flair {
-  namespace core {
-    class Vector3D;
-  }
-}
 
 namespace flair {
@@ -53,5 +48,5 @@
   irr::core::vector3df getSceneVect(xmlNode *mesh_node, xmlChar *param,
                                     bool isScale = false);
-  core::Vector3D getMeshVector3D(xmlNode *mesh_node, xmlChar *param);
+  core::Vector3Df getMeshVector3D(xmlNode *mesh_node, xmlChar *param);
 };
 }
Index: trunk/lib/FlairSimulator/src/SimuUsGL.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/SimuUsGL.cpp	(revision 166)
+++ trunk/lib/FlairSimulator/src/SimuUsGL.cpp	(revision 167)
@@ -43,5 +43,5 @@
   position = new Vector3DSpinBox(setup_tab->NewRow(), "position", -2, 2, .01);
   direction = new Vector3DSpinBox(setup_tab->NewRow(), "direction", -2, 2, .01);
-  range = new DoubleSpinBox(setup_tab->NewRow(), "range:", 0, 6, 1);
+  range = new DoubleSpinBox(setup_tab->NewRow(), "range:", 0, 1000, 1,0,6.);
 }
 
Index: trunk/lib/FlairSimulator/src/Simulator.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Simulator.cpp	(revision 166)
+++ trunk/lib/FlairSimulator/src/Simulator.cpp	(revision 167)
@@ -56,5 +56,5 @@
 }
 
-Vector3D Simulator::ToVRPNReference(Vector3D point_in) {
+Vector3D<double> Simulator::ToVRPNReference(Vector3D<double> point_in) {
   Quaternion yaw_rot_quat;
   Euler yaw_rot_euler(
Index: trunk/lib/FlairSimulator/src/Simulator.h
===================================================================
--- trunk/lib/FlairSimulator/src/Simulator.h	(revision 166)
+++ trunk/lib/FlairSimulator/src/Simulator.h	(revision 167)
@@ -19,4 +19,5 @@
 
 #include <FrameworkManager.h>
+#include <Vector3D.h>
 #include <stdint.h>
 
@@ -27,5 +28,4 @@
 namespace core {
 class Quaternion;
-class Vector3D;
 }
 }
@@ -53,5 +53,5 @@
   // coordinate, around z axis
   core::Quaternion ToVRPNReference(core::Quaternion quat_in);
-  core::Vector3D ToVRPNReference(core::Vector3D point_in);
+  core::Vector3D<double> ToVRPNReference(core::Vector3D<double> point_in);
 
 private:
Index: trunk/lib/FlairSimulator/src/X4.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/X4.cpp	(revision 166)
+++ trunk/lib/FlairSimulator/src/X4.cpp	(revision 167)
@@ -282,5 +282,5 @@
   u_thrust = k_mot->Value() * (fl_speed * fl_speed + fr_speed * fr_speed +
                                rl_speed * rl_speed + rr_speed * rr_speed);
-  Vector3D vect(0, 0, -u_thrust);
+  Vector3D<double> vect(0, 0, -u_thrust);
   vect.Rotate(state[0].Quat);
 
@@ -291,11 +291,11 @@
       ** ===================================================================
       */
+      
   state[0].Pos.x =
       (dT() * dT() / m->Value()) *
-          (vect.x -
-           f_air_lat->Value() * (state[-1].Pos.x - state[-2].Pos.x) / dT()) +
+          (vect.x - f_air_lat->Value() * (state[-1].Pos.x - state[-2].Pos.x) / dT()) +
       2 * state[-1].Pos.x - state[-2].Pos.x;
   state[0].Vel.x = (state[0].Pos.x - state[-1].Pos.x) / dT();
-
+ 
   /*
   ** ===================================================================
Index: trunk/lib/FlairSimulator/src/X8.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/X8.cpp	(revision 166)
+++ trunk/lib/FlairSimulator/src/X8.cpp	(revision 167)
@@ -339,5 +339,5 @@
        sigma->Value() * trr_speed * trr_speed + bfl_speed * bfl_speed +
        bfr_speed * bfr_speed + brl_speed * brl_speed + brr_speed * brr_speed);
-  Vector3D vect(0, 0, -u_thrust);
+  Vector3D<double> vect(0, 0, -u_thrust);
   vect.Rotate(state[0].Quat);
 
Index: trunk/lib/FlairSimulator/src/unexported/Model_impl.h
===================================================================
--- trunk/lib/FlairSimulator/src/unexported/Model_impl.h	(revision 166)
+++ trunk/lib/FlairSimulator/src/unexported/Model_impl.h	(revision 167)
@@ -120,5 +120,5 @@
   flair::core::Mutex *collision_mutex;
   bool collision_occured;
-  flair::core::Vector3D collision_point;
+  flair::core::Vector3D<double> collision_point;
 #endif
 };
Index: trunk/lib/FlairVisionFilter/src/OpticalFlow.cpp
===================================================================
--- trunk/lib/FlairVisionFilter/src/OpticalFlow.cpp	(revision 166)
+++ trunk/lib/FlairVisionFilter/src/OpticalFlow.cpp	(revision 167)
@@ -128,5 +128,5 @@
     //apply rotation
     for(i=0;i<count;i++) {
-        Vector3D tmp;
+        Vector3Df tmp;
         tmp.x=pointsA[i].x;
         tmp.y=pointsA[i].y;
