Index: trunk/src/world_entities/environments/water.cc
===================================================================
--- trunk/src/world_entities/environments/water.cc	(revision 6692)
+++ trunk/src/world_entities/environments/water.cc	(revision 6695)
@@ -28,4 +28,5 @@
 #include "skybox.h"
 
+#include "network_game_manager.h"
 
 using namespace std;
@@ -238,2 +239,118 @@
   this->grid->rebuildNormals(this->height);
 }
+
+
+/**
+ * Writes data from network containing information about the state
+ * @param data pointer to data
+ * @param length length of data
+ * @param sender hostID of sender
+ */
+int Water::writeBytes( const byte * data, int length, int sender )
+{
+  setRequestedSync( false );
+  setIsOutOfSync( false );
+
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_FKT( Water::writeState );
+
+  return SYNCHELP_READ_N;
+}
+
+
+/**
+ * data copied in data will bee sent to another host
+ * @param data pointer to data
+ * @param maxLength max length of data
+ * @return the number of bytes writen
+ */
+int Water::readBytes( byte * data, int maxLength, int * reciever )
+{
+  SYNCHELP_WRITE_BEGIN();
+
+  if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
+  {
+    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
+    setRequestedSync( true );
+  }
+
+  int rec = this->getRequestSync();
+  if ( rec > 0 )
+  {
+    *reciever = rec;
+    SYNCHELP_WRITE_FKT( Water::readState );
+  }
+
+  *reciever = 0;
+  return SYNCHELP_WRITE_N;
+}
+
+
+
+/**
+ * data copied in data will bee sent to another host
+ * @param data pointer to data
+ * @param maxLength max length of data
+ * @return the number of bytes writen
+ */
+int Water::readState( byte * data, int maxLength )
+{
+  SYNCHELP_WRITE_BEGIN();
+
+  SYNCHELP_WRITE_FKT( WorldEntity::readState );
+
+  // sync the size
+  SYNCHELP_WRITE_FLOAT( this->sizeX );
+  SYNCHELP_WRITE_FLOAT( this->sizeY );
+
+  //sync resolution
+  SYNCHELP_WRITE_INT( this->resX );
+  SYNCHELP_WRITE_INT( this->resY );
+
+  //sync the height
+  SYNCHELP_WRITE_FLOAT( this->height );
+
+  return SYNCHELP_WRITE_N;
+}
+
+
+/**
+ * Writes data from network containing information about the state
+ * @param data pointer to data
+ * @param length length of data
+ * @param sender hostID of sender
+ */
+int Water::writeState( const byte * data, int length, int sender )
+{
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_FKT( WorldEntity::writeState );
+
+  float f1, f2;
+  int i1, i2;
+
+  //read the size
+  SYNCHELP_READ_FLOAT( f1 );
+  SYNCHELP_READ_FLOAT( f2 );
+  this->sizeX = f1;
+  this->sizeY = f2;
+  PRINTF(0)("Setting Water to size: %f x %f\n", f1, f2);
+
+  //read the resolution
+  SYNCHELP_READ_INT( i1 );
+  SYNCHELP_READ_INT( i2 );
+  this->resX = i1;
+  this->resY = i2;
+  PRINTF(0)("Setting Water to resolution: %i x %i\n", i1, i2);
+
+  //read the height
+  SYNCHELP_READ_FLOAT( f1 );
+  this->height = f1;
+
+  this->rebuildGrid();
+
+  return SYNCHELP_READ_N;
+}
+
+
Index: trunk/src/world_entities/environments/water.h
===================================================================
--- trunk/src/world_entities/environments/water.h	(revision 6692)
+++ trunk/src/world_entities/environments/water.h	(revision 6695)
@@ -35,4 +35,11 @@
    void tick(float dt);
 
+   virtual int writeBytes(const byte* data, int length, int sender);
+   virtual int readBytes(byte* data, int maxLength, int * reciever);
+
+   int writeState( const byte * data, int length, int sender );
+   int readState( byte * data, int maxLength );
+
+
   private:
     Grid*           grid;            //!< The water-surface-model to render with
Index: trunk/src/world_entities/movie_entity.cc
===================================================================
--- trunk/src/world_entities/movie_entity.cc	(revision 6692)
+++ trunk/src/world_entities/movie_entity.cc	(revision 6695)
@@ -40,5 +40,6 @@
   this->toList(OM_COMMON);
 
-  this->loadParams(root);
+  if( root != NULL)
+    this->loadParams(root);
 
   counter = 0;
@@ -52,5 +53,6 @@
 MovieEntity::~MovieEntity ()
 {
-  delete this->media_container;
+  if( this->media_container)
+    delete this->media_container;
 }
 
Index: trunk/src/world_entities/planet.cc
===================================================================
--- trunk/src/world_entities/planet.cc	(revision 6692)
+++ trunk/src/world_entities/planet.cc	(revision 6695)
@@ -27,4 +27,6 @@
 #include "network_game_manager.h"
 #include "converter.h"
+#include "vertex_array_model.h"
+#include "primitive_model.h"
 
 using namespace std;
@@ -44,7 +46,20 @@
 
   this->material = new Material();
-  this->material->setIllum(10);
+  //this->material->setIllum(20);
+  //this->material->setAmbient(0.1, 0.1, 0.1);
+
+
+
+      //st float radius, const unsigned int loops, const unsigned int segmentsPerLoop
 
   this->loadParams(root);
+
+//   VertexArrayModel* model = new VertexArrayModel();
+//   model->spiralSphere(this->size, 10, 10);
+//   this->setModel(model);
+//   model->debug();
+//
+  PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, this->size, 50);
+  this->setModel(model);
 }
 
@@ -98,6 +113,9 @@
 {
 
+
   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
+
+  glShadeModel(GL_SMOOTH);
 
   /* translate */
@@ -109,72 +127,7 @@
   this->material->select();
 
-
-  Vector c;
-  double r = this->size;
-  int n = 200;
-  int method = 1;
-  double theta1 = 0;
-  double theta2 = 2 * M_PI;
-  double phi1 = -M_PI/2.0;
-  double phi2 = M_PI/2.0;
-
-
-  int i,j;
-  double jdivn,j1divn,idivn,dosdivn,unodivn=1/(double)n,ndiv2=(double)n/2,t1,t2,t3,cost1,cost2,cte1,cte3;
-  cte3 = (theta2-theta1)/n;
-  cte1 = (phi2-phi1)/ndiv2;
-  dosdivn = 2*unodivn;
-  Vector e,p,e2,p2;
-
-
-  t2=phi1;
-  cost2=cos(phi1);
-  j1divn=0;
-  for (j=0;j<ndiv2;j++) {
-    t1 = t2;//t1 = phi1 + j * cte1;
-    t2 += cte1;//t2 = phi1 + (j + 1) * cte1;
-    t3 = theta1 - cte3;
-    cost1 = cost2;//cost1=cos(t1);
-    cost2 = cos(t2);
-    e.y = sin(t1);
-    e2.y = sin(t2);
-    p.y = c.y + r * e.y;
-    p2.y = c.y + r * e2.y;
-
-    if (method == 0)
-      glBegin(GL_QUAD_STRIP);
-    else
-      glBegin(GL_TRIANGLE_STRIP);
-
-    idivn=0;
-    jdivn=j1divn;
-    j1divn+=dosdivn;//=2*(j+1)/(double)n;
-    for (i=0;i<=n;i++) {
-       //t3 = theta1 + i * (theta2 - theta1) / n;
-      t3 += cte3;
-      e.x = cost1 * cos(t3);
-       //e.y = sin(t1);
-      e.z = cost1 * sin(t3);
-      p.x = c.x + r * e.x;
-       //p.y = c.y + r * e.y;
-      p.z = c.z + r * e.z;
-      glNormal3f(e.x,e.y,e.z);
-      glTexCoord2f(idivn,jdivn);
-      glVertex3f(p.x,p.y,p.z);
-
-
-      e2.x = cost2 * cos(t3);
-       //e.y = sin(t2);
-      e2.z = cost2 * sin(t3);
-      p2.x = c.x + r * e2.x;
-       //p.y = c.y + r * e.y;
-      p2.z = c.z + r * e2.z;
-      glNormal3f(e2.x,e2.y,e2.z);
-      glTexCoord2f(idivn,j1divn);
-      glVertex3f(p2.x,p2.y,p2.z);
-      idivn += unodivn;
-    }
-    glEnd();
-  }
+//   /WorldEntity::draw();
+  this->getModel(0)->draw();
+ // static_cast<VertexArrayModel*>(this->getModel(0))->debug();
 }
 
Index: trunk/src/world_entities/playable.cc
===================================================================
--- trunk/src/world_entities/playable.cc	(revision 6692)
+++ trunk/src/world_entities/playable.cc	(revision 6695)
@@ -36,5 +36,9 @@
   // the reference to the Current Player is NULL, because we dont have one at the beginning.
   this->currentPlayer = NULL;
-}
+
+  this->setSynchronized(true);
+}
+
+
 
 Playable::~Playable()
@@ -57,4 +61,5 @@
 }
 
+
 void Playable::removeWeapon(Weapon* weapon)
 {
@@ -63,4 +68,5 @@
     this->weaponConfigChanged();
 }
+
 
 void Playable::nextWeaponConfig()
@@ -70,4 +76,5 @@
 }
 
+
 void Playable::previousWeaponConfig()
 {
@@ -76,4 +83,5 @@
 }
 
+
 void Playable::weaponConfigChanged()
 {
@@ -81,4 +89,5 @@
     this->currentPlayer->weaponConfigChanged();
 }
+
 
 /**
Index: trunk/src/world_entities/power_ups/param_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/param_power_up.cc	(revision 6692)
+++ trunk/src/world_entities/power_ups/param_power_up.cc	(revision 6695)
@@ -46,5 +46,6 @@
 {
   this->init();
-  this->loadParams(root);
+  if( root != NULL)
+    this->loadParams(root);
 }
 
Index: trunk/src/world_entities/power_ups/turret_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/turret_power_up.cc	(revision 6692)
+++ trunk/src/world_entities/power_ups/turret_power_up.cc	(revision 6695)
@@ -36,5 +36,6 @@
   this->init();
 
-  this->loadParams(root);
+  if( root != NULL)
+    this->loadParams(root);
 }
 
Index: trunk/src/world_entities/power_ups/weapon_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/weapon_power_up.cc	(revision 6692)
+++ trunk/src/world_entities/power_ups/weapon_power_up.cc	(revision 6695)
@@ -39,5 +39,6 @@
 {
   this->init();
-  this->loadParams(root);
+  if( root != NULL)
+    this->loadParams(root);
 }
 
Index: trunk/src/world_entities/projectiles/laser.cc
===================================================================
--- trunk/src/world_entities/projectiles/laser.cc	(revision 6692)
+++ trunk/src/world_entities/projectiles/laser.cc	(revision 6695)
@@ -30,4 +30,5 @@
 #include <cassert>
 
+#include "assert.h"
 
 
Index: trunk/src/world_entities/skybox.cc
===================================================================
--- trunk/src/world_entities/skybox.cc	(revision 6692)
+++ trunk/src/world_entities/skybox.cc	(revision 6695)
@@ -51,5 +51,6 @@
   this->preInit();
 
-  this->loadParams(root);
+  if( root != NULL)
+    this->loadParams(root);
 
   this->postInit();
Index: trunk/src/world_entities/space_ships/space_ship.cc
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.cc	(revision 6692)
+++ trunk/src/world_entities/space_ships/space_ship.cc	(revision 6695)
@@ -97,4 +97,21 @@
   if (root != NULL)
     this->loadParams(root);
+  else
+  {
+    this->loadModel("models/ships/reap_#.obj");
+  }
+
+}
+
+
+/**
+ * initializes a Spaceship
+ */
+void SpaceShip::init()
+{
+//  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
+  this->setClassID(CL_SPACE_SHIP, "SpaceShip");
+
+  PRINTF(4)("SPACESHIP INIT\n");
 
   //weapons:
@@ -112,16 +129,4 @@
 
   this->getWeaponManager()->changeWeaponConfig(1);
-}
-
-
-/**
- * initializes a Spaceship
- */
-void SpaceShip::init()
-{
-//  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
-  this->setClassID(CL_SPACE_SHIP, "SpaceShip");
-
-  PRINTF(4)("SPACESHIP INIT\n");
 
   EventHandler::getInstance()->grabEvents(true);
@@ -206,4 +211,5 @@
   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
 }
+
 
 /**
Index: trunk/src/world_entities/terrain.cc
===================================================================
--- trunk/src/world_entities/terrain.cc	(revision 6692)
+++ trunk/src/world_entities/terrain.cc	(revision 6695)
@@ -39,5 +39,6 @@
 {
   this->init();
-  this->loadParams(root);
+  if( root != NULL)
+    this->loadParams(root);
 
 //  if (this->model != NULL)
Index: trunk/src/world_entities/weapons/targeting_turret.cc
===================================================================
--- trunk/src/world_entities/weapons/targeting_turret.cc	(revision 6692)
+++ trunk/src/world_entities/weapons/targeting_turret.cc	(revision 6695)
@@ -48,5 +48,6 @@
 {
   this->init();
-  this->loadParams(root);
+  if( root != NULL)
+    this->loadParams(root);
 }
 
Index: trunk/src/world_entities/weapons/weapon.cc
===================================================================
--- trunk/src/world_entities/weapons/weapon.cc	(revision 6692)
+++ trunk/src/world_entities/weapons/weapon.cc	(revision 6695)
@@ -100,4 +100,7 @@
 
   this->energyWidget = NULL;
+
+  // set this object to be synchronized over network
+  //this->setSynchronized(true);
 }
 
Index: trunk/src/world_entities/world_entity.cc
===================================================================
--- trunk/src/world_entities/world_entity.cc	(revision 6692)
+++ trunk/src/world_entities/world_entity.cc	(revision 6695)
@@ -54,9 +54,11 @@
   this->energyMax = 1.0f;
   this->energy = 1.0f;
+  this->scaling = 1.0f;
+
+  /* OSOLETE */
+  this->bVisible = true;
+  this->bCollide = true;
 
   this->md2TextureFileName = NULL;
-
-
-  this->setVisibiliy(true);
 
   this->objectListNumber = OM_INIT;
@@ -122,4 +124,5 @@
 void WorldEntity::loadModel(const char* fileName, float scaling, unsigned int modelNumber)
 {
+  this->modelLODName = fileName;
   this->scaling = scaling;
   if ( fileName != NULL && strcmp(fileName, "") )
@@ -515,7 +518,11 @@
   //check if modelFileName is relative to datadir or absolute
 
+
+  PRINTF(0)("================ LOADING MODEL %s, %f\n", modelFileName, scaling);
+
   if ( strcmp(modelFileName, "") )
   {
-    loadModel( modelFileName, scaling );
+    loadModel( modelFileName, scaling);
+    PRINTF(0)("modelfilename: %s\n", getModel( 0 )->getName());
   }
   delete[] modelFileName;
Index: trunk/src/world_entities/world_entity.h
===================================================================
--- trunk/src/world_entities/world_entity.h	(revision 6692)
+++ trunk/src/world_entities/world_entity.h	(revision 6695)
@@ -111,4 +111,5 @@
   std::vector<Model*>     models;             //!< The model that should be loaded for this entity.
   const char*             md2TextureFileName; //!< the file name of the md2 model texture, only if this
+  const char*             modelLODName;       //!< the name of the model lod file
   BVTree*                 obbTree;            //!< this is the obb tree reference needed for collision detection
 
