Index: /trunk/lib/FlairSimulator/src/GenericObject.cpp
===================================================================
--- /trunk/lib/FlairSimulator/src/GenericObject.cpp	(revision 133)
+++ /trunk/lib/FlairSimulator/src/GenericObject.cpp	(revision 134)
@@ -17,8 +17,12 @@
 #ifdef GL
 #include "GenericObject.h"
+#include "Simulator.h"
 #include "Simulator_impl.h"
+#include "Gui.h"
 
 #include "Quaternion.h"
+#include "Euler.h"
 #include <ISceneManager.h>
+#include <IMeshSceneNode.h>
 
 using namespace irr;
@@ -33,15 +37,12 @@
 namespace simulator {
 
-GenericObject::GenericObject(Simulator *parent, std::string name,
-                             ISceneManager *sceneManager)
-    : IMeshSceneNode(sceneManager->getRootSceneNode(), sceneManager,
-                     -1) //, IODevice(parent,name)
+GenericObject::GenericObject(Simulator *parent, IMesh *mesh)
 {
-  setMaterialFlag(EMF_LIGHTING, false);
-  Material = getMaterial(0);
-  // setMaterialTexture(0,sceneManager->getVideoDriver()->getTexture("/home/cesar/igep/uav_dev_svn/trunk/media/nskinbl.jpg"));
-  Material.NormalizeNormals = true;
-  Material.Wireframe = false;
-  Material.Lighting = false;
+	meshSceneNode=getGui()->getSceneManager()->addMeshSceneNode(mesh);
+	
+  selector = getGui()->getSceneManager()->createTriangleSelector(mesh, meshSceneNode);
+  meshSceneNode->setTriangleSelector(selector);
+	
+  meshSceneNode->setMaterialFlag(EMF_LIGHTING, false);
 
   parent->pimpl_->objects.push_back(this);
@@ -50,43 +51,19 @@
 GenericObject::~GenericObject() {}
 
+ITriangleSelector *GenericObject::TriangleSelector(void) { return selector; }
+
 void GenericObject::setScale(float value) {
-  ISceneNode::setScale(vector3df(value, value, value));
+  meshSceneNode->setScale(vector3df(value, value, value));
 }
 
-void GenericObject::setScale(vector3df scale) { ISceneNode::setScale(scale); }
-
-ITriangleSelector *GenericObject::TriangleSelector(void) { return selector; }
-
-void GenericObject::OnRegisterSceneNode(void) {
-  if (IsVisible)
-    SceneManager->registerNodeForRendering(this);
-
-  ISceneNode::OnRegisterSceneNode();
+void GenericObject::setScale(const vector3df& scale) { 
+	meshSceneNode->setScale(scale);
 }
 
-void GenericObject::render(void) {
-  IVideoDriver *driver = SceneManager->getVideoDriver();
-
-  driver->setMaterial(Material);
-
-  driver->setTransform(ETS_WORLD, AbsoluteTransformation);
-  driver->drawMeshBuffer(mesh->getMeshBuffer(0));
+void GenericObject::setPosition(const vector3df& pos) {
+  meshSceneNode->setPosition(ToIrrlichtCoordinates(pos));
 }
 
-void GenericObject::setMesh(IMesh *mesh) {
-  this->mesh = mesh;
-  box = mesh->getBoundingBox();
-
-  selector = getSceneManager()->createTriangleSelector(mesh, this);
-  setTriangleSelector(selector);
-}
-
-IMesh *GenericObject::getMesh(void) { return mesh; }
-
-void GenericObject::setPosition(irr::core::vector3df pos) {
-  ISceneNode::setPosition(ToIrrlichtCoordinates(pos));
-}
-
-void GenericObject::setRotation(irr::core::vector3df rotation) {
+void GenericObject::setRotation(const vector3df& rotation) {
   Euler eulerA(rotation.X, rotation.Y, rotation.Z);
   Euler eulerB;
@@ -96,5 +73,5 @@
   quatB.ToEuler(eulerB);
 
-  ISceneNode::setRotation(Euler::ToDegree(1) *
+  meshSceneNode->setRotation(Euler::ToDegree(1) *
                           vector3df(eulerB.roll, eulerB.pitch, eulerB.yaw));
 }
Index: /trunk/lib/FlairSimulator/src/Gui_impl.cpp
===================================================================
--- /trunk/lib/FlairSimulator/src/Gui_impl.cpp	(revision 133)
+++ /trunk/lib/FlairSimulator/src/Gui_impl.cpp	(revision 134)
@@ -22,4 +22,6 @@
 #include "Model.h"
 #include "Model_impl.h"
+#include "VisualizationCamera.h"
+#include "FollowMeCamera.h"
 #include <Object.h>
 #include <Euler.h>
Index: /trunk/lib/FlairSimulator/src/Man.cpp
===================================================================
--- /trunk/lib/FlairSimulator/src/Man.cpp	(revision 133)
+++ /trunk/lib/FlairSimulator/src/Man.cpp	(revision 134)
@@ -27,4 +27,5 @@
 #include "FollowMeCamera.h"
 
+class addAnimatedMeshSceneNode;
 using namespace irr;
 using namespace irr::core;
Index: /trunk/lib/FlairSimulator/src/Parser.cpp
===================================================================
--- /trunk/lib/FlairSimulator/src/Parser.cpp	(revision 133)
+++ /trunk/lib/FlairSimulator/src/Parser.cpp	(revision 134)
@@ -18,11 +18,13 @@
 #include "Parser.h"
 #include "Simulator.h"
+#include "FixedCamera.h"
 #include "GenericObject.h"
-#include "FixedCamera.h"
 #include <vector3d.h>
 #include <Vector3D.h>
 #include <IrrlichtDevice.h>
 #include <IFileSystem.h>
-#include "GenericObject.h"
+#include <IAnimatedMesh.h>
+#include <IGeometryCreator.h>
+#include <ISceneManager.h>
 
 using namespace irr;
@@ -108,24 +110,16 @@
 
 void Parser::processObjects(xmlNode *a_node) {
-  FILE *fp;
-  std::string fileName;
-  xmlNode *cur_node = NULL;
-
-  const IGeometryCreator *geo;
-
-  geo = getGui()->getSceneManager()->getGeometryCreator();
+  xmlNode *cur_node = NULL;
 
   for (cur_node = a_node; cur_node; cur_node = cur_node->next) {
     if (xmlStrEqual(cur_node->name, (xmlChar *)"mesh")) {
-      fileName = this->media_path;
+			FILE *fp;
+			std::string fileName = this->media_path+"/";
       fp = NULL;
       fp = fopen(fileName.append((char *)xmlGetProp(
-                                     cur_node, (xmlChar *)"model")).c_str(),
-                 "rb");
+                                     cur_node, (xmlChar *)"model")).c_str(),"rb");
       if (fp != NULL) {
         GenericObject *object =
-            new GenericObject(parent, "Object", getSceneManager());
-        object->setMesh(getGui()->getMesh(
-            (char *)xmlGetProp(cur_node, (xmlChar *)"model")));
+            new GenericObject(parent, getGui()->getMesh((char *)xmlGetProp(cur_node, (xmlChar *)"model")));
         object->setPosition(
             getMeshVect(cur_node->children, (xmlChar *)"position"));
@@ -133,19 +127,30 @@
             getMeshVect(cur_node->children, (xmlChar *)"rotation"));
         object->setScale(getMeshVect(cur_node->children, (xmlChar *)"scale"));
-        object->render();
       } else {
-        Err("FATAL ERROR : File %s doesn't exist !\r\n",
-            (char *)xmlGetProp(cur_node, (xmlChar *)"model"));
+        Err("FATAL ERROR : File %s %s doesn't exist !\r\n",
+            (char *)xmlGetProp(cur_node, (xmlChar *)"model"),fileName.c_str());
       }
     } else if (xmlStrEqual(cur_node->name, (xmlChar *)"cylinder")) {
+			const IGeometryCreator *geo;
+			geo = getGui()->getSceneManager()->getGeometryCreator();
+			IMesh* mesh=geo->createCylinderMesh(
+          ToIrrlichtScale(atof((char *)xmlGetProp(cur_node, (xmlChar *)"radius"))),
+          ToIrrlichtScale(atof((char *)xmlGetProp(cur_node, (xmlChar *)"length"))),
+          atof((char *)xmlGetProp(cur_node, (xmlChar *)"tesselation")),
+          SColor(100, 255, 100, 100));
+      GenericObject *object = new GenericObject(parent, mesh);
+      object->setPosition(getMeshVect(cur_node->children, (xmlChar *)"position"));
+      object->setRotation(getMeshVect(cur_node->children, (xmlChar *)"rotation"));
+      object->setScale(getMeshVect(cur_node->children, (xmlChar *)"scale"));
+    } else if (xmlStrEqual(cur_node->name, (xmlChar *)"eight")) {
+			const IGeometryCreator *geo;
+			geo = getGui()->getSceneManager()->getGeometryCreator();
+			IMesh* mesh=geo->createCubeMesh(
+          vector3df(atof((char *)xmlGetProp(cur_node, (xmlChar *)"length")),
+                    atof((char *)xmlGetProp(cur_node, (xmlChar *)"width")),
+                    atof((char *)xmlGetProp(cur_node, (xmlChar *)"eight"))));
+			
       GenericObject *object =
-          new GenericObject(parent, "Object", getSceneManager());
-      object->setMesh(geo->createCylinderMesh(
-          ToIrrlichtScale(
-              atof((char *)xmlGetProp(cur_node, (xmlChar *)"radius"))),
-          ToIrrlichtScale(
-              atof((char *)xmlGetProp(cur_node, (xmlChar *)"length"))),
-          atof((char *)xmlGetProp(cur_node, (xmlChar *)"tesselation")),
-          SColor(100, 255, 100, 100)));
+          new GenericObject(parent, mesh);
       object->setPosition(
           getMeshVect(cur_node->children, (xmlChar *)"position"));
@@ -153,24 +158,4 @@
           getMeshVect(cur_node->children, (xmlChar *)"rotation"));
       object->setScale(getMeshVect(cur_node->children, (xmlChar *)"scale"));
-      // object->setMaterialTexture(0,getTexture("/home/apeiron/igep/uav_dev_svn/trunk/media/nskinbl.jpg"));
-      object->setMaterialType(video::EMT_SOLID);
-      object->render();
-    } else if (xmlStrEqual(cur_node->name, (xmlChar *)"eight")) {
-      GenericObject *object =
-          new GenericObject(parent, "Object", getSceneManager());
-      object->setMesh(geo->createCubeMesh(
-          vector3df(atof((char *)xmlGetProp(cur_node, (xmlChar *)"length")),
-                    atof((char *)xmlGetProp(cur_node, (xmlChar *)"width")),
-                    atof((char *)xmlGetProp(cur_node, (xmlChar *)"eight")))));
-      object->setPosition(
-          getMeshVect(cur_node->children, (xmlChar *)"position"));
-      object->setRotation(
-          getMeshVect(cur_node->children, (xmlChar *)"rotation"));
-      object->setScale(getMeshVect(cur_node->children, (xmlChar *)"scale"));
-      object->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL);
-      // object->getMaterial(0).Textures[0] =
-      // getTexture("/home/apeiron/igep/uav_dev_svn/trunk/media/nskinbl.jpg");
-      object->setMaterialFlag(EMF_LIGHTING, false);
-      object->render();
     }
   }
Index: /trunk/lib/FlairSimulator/src/unexported/GenericObject.h
===================================================================
--- /trunk/lib/FlairSimulator/src/unexported/GenericObject.h	(revision 133)
+++ /trunk/lib/FlairSimulator/src/unexported/GenericObject.h	(revision 134)
@@ -19,87 +19,38 @@
 #ifdef GL
 
-#include "Simulator.h"
-
-#include "ConditionVariable.h"
-#include "Gui.h"
-#include "Gui_impl.h"
-#include <ISceneManager.h>
-#include <ISceneNodeAnimatorCollisionResponse.h>
-#include <IMetaTriangleSelector.h>
-#include <IVideoDriver.h>
-#include <ICameraSceneNode.h>
-#include "FollowMeCamera.h"
-
-#include <IODevice.h>
-#include <Euler.h>
-#include <Vector3D.h>
-
-#include <aabbox3d.h>
-#include <IMeshSceneNode.h>
+#include <vector3d.h>
 
 namespace irr {
-class SEvent;
-namespace scene {
-class IMesh;
-class ISceneManager;
-class ITriangleSelector;
-class IMetaTriangleSelector;
-class ISceneNodeAnimatorCollisionResponse;
-}
+	namespace scene {
+		class IMesh;
+		class IMeshSceneNode;
+		class ITriangleSelector;
+		class ISceneNode;
+	}
 }
 
-class Gui_impl;
 class Simulator_impl;
 
 namespace flair {
-namespace core {
-class ConditionVariable;
-}
 namespace simulator {
 class Simulator;
-class AnimPoursuite;
 
-class GenericObject : public irr::scene::IMeshSceneNode {
+class GenericObject {
   friend class ::Simulator_impl;
 
 public:
-  GenericObject(Simulator *parent, std::string name,
-                irr::scene::ISceneManager *sceneManager);
+  GenericObject(Simulator *parent,irr::scene::IMesh *mesh);
   virtual ~GenericObject();
 
-  // FROM IMPL
   irr::scene::ITriangleSelector *TriangleSelector(void);
-  irr::core::aabbox3d<irr::f32> box;
-  // END FROM IMPL
-
-  irr::scene::ISceneNode *getSceneNode();
-  virtual const irr::core::aabbox3d<irr::f32> &getBoundingBox(void) const {
-    return box;
-  }
-
-  void setPosition(irr::core::vector3df position);
   void setScale(float value);
-  void setScale(irr::core::vector3df scale);
-  void setRotation(irr::core::vector3df rotation);
-  void OnRegisterSceneNode(void);
-  void setMesh(irr::scene::IMesh *mesh);
-  irr::scene::IMesh *getMesh(void);
-  void render(void);
-  virtual void setReadOnlyMaterials(bool readonly){};
-  virtual bool isReadOnlyMaterials(void) const { return false; }
-  virtual irr::scene::IShadowVolumeSceneNode *
-  addShadowVolumeSceneNode(const irr::scene::IMesh *shadowMesh = 0,
-                           irr::s32 id = -1, bool zfailmethod = true,
-                           irr::f32 infinity = 1000.0f) {
-    return NULL;
-  }
-
+  void setScale(const irr::core::vector3df& scale);
+	void setPosition(const irr::core::vector3df& position);
+  void setRotation(const irr::core::vector3df& rotation);
+ 
 private:
-  void UpdateFrom(core::io_data *data){};
-  irr::scene::IMesh *mesh;
   irr::scene::ITriangleSelector *selector;
-  flair::core::ConditionVariable *cond;
-  irr::video::SMaterial Material;
-};
+	irr::scene::IMeshSceneNode *meshSceneNode;
+}; 
 } // end namespace simulator
 } // end namespace flair
