Index: trunk/include/FlairCore/Vector3D.h
===================================================================
--- trunk/include/FlairCore/Vector3D.h	(revision 13)
+++ trunk/include/FlairCore/Vector3D.h	(revision 50)
@@ -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
