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
 };
