Index: trunk/src/world_entities/WorldEntities.am
===================================================================
--- trunk/src/world_entities/WorldEntities.am	(revision 9110)
+++ trunk/src/world_entities/WorldEntities.am	(revision 9235)
@@ -4,7 +4,10 @@
                 world_entities/npcs/npc_test.cc \
                 world_entities/npcs/ground_turret.cc \
+                world_entities/npcs/space_turret.cc \
                 world_entities/npcs/generic_npc.cc \
                 world_entities/npcs/door.cc \
+                world_entities/npcs/gate.cc \
                 world_entities/npcs/repair_station.cc \
+                world_entities/npcs/attractor_mine.cc \
                 \
                 world_entities/environment.cc \
@@ -22,4 +25,5 @@
                 \
                 world_entities/weapons/test_gun.cc \
+                world_entities/weapons/laser_cannon.cc \
                 world_entities/weapons/turret.cc \
                 world_entities/weapons/aiming_turret.cc \
@@ -28,11 +32,15 @@
                 world_entities/weapons/hyperblaster.cc \
                 world_entities/weapons/aim.cc \
+                world_entities/weapons/aiming_system.cc \
                 world_entities/weapons/fps_sniper_rifle.cc \
+                world_entities/weapons/boomerang_gun.cc \
                 \
                 world_entities/projectiles/bomb.cc \
                 world_entities/projectiles/laser.cc \
+                world_entities/projectiles/rail_projectile.cc \
                 world_entities/projectiles/test_bullet.cc \
                 world_entities/projectiles/rocket.cc \
                 world_entities/projectiles/guided_missile.cc \
+                world_entities/projectiles/boomerang_projectile.cc \
                 world_entities/projectiles/hyperblast.cc \
                 \
@@ -70,6 +78,8 @@
                 npcs/npc_test1.h \
                 npcs/ground_turret.h \
+                npcs/space_turret.h \
                 npcs/door.cc \
-                npcs/repair_station.cc \
+                npcs/repair_station.h \
+                npcs/attractor_mine.h \
                 \
                 environment.h \
@@ -87,4 +97,5 @@
                 \
                 weapons/test_gun.h \
+                weapons/laser_cannon.cc \
                 weapons/cannon.h \
                 weapons/hyperblaster.h \
@@ -92,12 +103,16 @@
                 weapons/aiming_turret.h \
                 weapons/targeting_turret.h \
+                weapons/boomerang_gun.h \
                 weapons/aim.h \
+                weapons/aiming_system.h \
                 weapons/fps_sniper_rifle.h \
                 \
                 projectiles/bomb.h \
                 projectiles/laser.h \
+                projectiles/rail_projectile.h \
                 projectiles/test_bullet.h \
                 projectiles/rocket.h \
                 projectiles/guided_missile.h \
+                projectiles/boomerang_projectile.h \
                 projectiles/hyperblast.h \
                 \
Index: trunk/src/world_entities/camera.cc
===================================================================
--- trunk/src/world_entities/camera.cc	(revision 9110)
+++ trunk/src/world_entities/camera.cc	(revision 9235)
@@ -36,5 +36,5 @@
   this->setFovy(90);
   this->setAspectRatio(1.2f);
-  this->setClipRegion(.1, 2000);
+  this->setClipRegion(.1, 10000);
 
   this->setViewMode(Camera::ViewNormal);
Index: trunk/src/world_entities/creatures/fps_player.cc
===================================================================
--- trunk/src/world_entities/creatures/fps_player.cc	(revision 9110)
+++ trunk/src/world_entities/creatures/fps_player.cc	(revision 9235)
@@ -29,6 +29,8 @@
 #include "weapons/cannon.h"
 #include "weapons/fps_sniper_rifle.h"
+#include "weapons/aiming_system.h"
 
 #include "aabb.h"
+
 
 #include "key_mapper.h"
@@ -57,4 +59,7 @@
 {
   this->setPlayer(NULL);
+
+  if( this->aimingSystem)
+    delete this->aimingSystem;
 }
 
@@ -81,5 +86,4 @@
 {
   this->setClassID(CL_FPS_PLAYER, "FPSPlayer");
-
 
   this->bLeft = false;
@@ -89,4 +93,5 @@
   this->bJump = false;
   this->bPosBut = false;
+  this->bFire = false;
 
   this->xMouse = 0.0f;
@@ -125,9 +130,10 @@
 
 //   this->addWeapon(wpLeft, 1, 0);
-  this->addWeapon(wpRight,1, 0);
+  if( State::isOnline())
+    this->addWeapon(wpRight,1, 0);
   this->getWeaponManager().changeWeaponConfig(1);
 
   this->getWeaponManager().setSlotCount(2);
-//   this->getWeaponManager().setSlotDirection(0, Quaternion(M_PI_2, Vector(0,1,0)));
+  this->getWeaponManager().setSlotDirection(0, Quaternion(M_PI_4*-0.55f, Vector(0,0,1)));
   this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
   this->getWeaponManager().setSlotDirection(1, Quaternion(M_PI_4*.5, Vector(1,0,0)));
@@ -135,4 +141,6 @@
   this->getWeaponManager().setSlotPosition(1, Vector(5.0, 0.0, 0.0));
 
+//   this->getWeaponManager().getFixedTarget()->setRelDir(Quaternion(M_PI_4*-0.6f, Vector(0,0,1)));
+
 
   this->getWeaponManager().setParentNode(&this->cameraNode);
@@ -141,4 +149,9 @@
   this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode);
   this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0);
+
+  this->aimingSystem = new AimingSystem(this);
+  //this->addChild(this->aimingSystem);
+  wpRight->addChild(this->aimingSystem);
+//   this->getWeaponManager().sl
 
 
@@ -148,6 +161,16 @@
   registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) );
   registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableBool( &bJump, &bJump, "bJump", PERMISSION_OWNER ) );
   registerVar( new SynchronizeableFloat( &heading, &heading, "heading", PERMISSION_OWNER ) );
   registerVar( new SynchronizeableFloat( &attitude, &attitude, "attitude", PERMISSION_OWNER ) );
+
+    //subscribe to collision reaction
+  this->subscribeReaction(CREngine::CR_PHYSICS_FULL_WALK, CL_BSP_ENTITY);
+
+  this->initWeapon = false;
+  this->damageTicker = 0.0f;
+
+  if( State::isOnline())
+    toList( OM_PLAYERS );
 }
 
@@ -192,13 +215,7 @@
   this->getWeaponManager().getFixedTarget()->setRelCoor(0,0,0);
 
-
-  AABB* box = this->getModelAABB();
-  if( box != NULL)
-  {
-    State::getCameraNode()->setRelCoor(0, box->halfLength[1] * 2.0f, 0);
-    State::getCameraTargetNode()->setRelCoor(10, box->halfLength[1] * 2.0f, 0);
-
-    this->getWeaponManager().setSlotPosition(0, Vector(1.5, box->halfLength[1] * 2.0f - 0.7, 1.1));
-    this->getWeaponManager().setSlotPosition(1, Vector(5.0, box->halfLength[1] * 2.0f, 0.0));
+  if ( !State::isOnline() )
+  {
+    this->respawn();
   }
 }
@@ -219,11 +236,77 @@
 {
 
-  if( this->bPosBut)
-  {
-    this->bPosBut = false;
-    printf("mechanic2:walkTo( %f, mtheight, %f)\n",this->getAbsCoorX(),this->getAbsCoorZ());
-  }
-
-  Playable::tick( time );
+  if ( !this->initWeapon )
+  {
+    this->initWeapon = true;
+
+    this->cameraNode.setParentMode(PNODE_ROTATE_AND_MOVE);
+
+    this->getWeaponManager().getParentNode()->setParentMode(PNODE_ROTATE_AND_MOVE);
+    this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode);
+    this->getWeaponManager().getFixedTarget()->setParentMode(PNODE_ROTATE_AND_MOVE);
+
+
+    this->aimingSystem->toList(OM_GROUP_01);
+    this->aimingSystem->setParent(&this->cameraNode);
+//     this->aimingSystem->setParentMode(PNODE_ROTATE_AND_MOVE);
+    this->aimingSystem->setRelDir(Quaternion(M_PI_4*-0.58f, Vector(0,0,1)));
+    this->aimingSystem->setRelCoor(0, -1, -1);
+
+
+    AABB* box = this->getModelAABB();
+    if( box != NULL)
+    {
+      float f = 1.0;
+      this->cameraNode.setRelCoor(0, box->halfLength[1] * f, 0);
+//       this->cameraNode.setRelCoor(10, box->halfLength[1] * f, 0);
+
+      float v = 0.1f;
+      this->getWeaponManager().setSlotPosition(0, Vector(-8.0, box->halfLength[1] * v, 1.1));
+      this->getWeaponManager().setSlotPosition(1, Vector(5.0, box->halfLength[1] * v, 0.0));
+    }
+  }
+
+
+  this->getWeaponManager().tick(time);
+  if( this->bFire)
+  {
+    this->getWeaponManager().fire();
+
+//     WorldEntity* target = this->aimingSystem->getNearestTarget();
+//     if( target != NULL)
+//     {
+//       PRINTF(0)("hit hit hit, got: %s\n", target->getClassName());
+//     }
+//     else
+//     {
+//       PRINTF(0)("nothing hit\n");
+//     }
+  }
+
+
+  //dealing damage
+
+  if ( State::isOnline() && SharedNetworkData::getInstance()->isGameServer() )
+  {
+    this->damageTicker -= time;
+
+    if ( this->damageTicker <= 0.0f && this->beFire() )
+    {
+      this->damageTicker = 0.25;
+
+      WorldEntity * victim = aimingSystem->getNearestTarget();
+
+      if ( victim )
+      {
+        PRINTF(0)("FIRE: hit %s\n", victim->getClassName());
+        victim->hit( 20, this );
+      }
+      else
+      {
+        PRINTF(0)("FIRE: nothing hit\n");
+      }
+    }
+  }
+
 
   if( ( xMouse != 0 || yMouse != 0 ) && (this->getOwner() == SharedNetworkData::getInstance()->getHostID() || !State::isOnline() ) )
@@ -235,9 +318,9 @@
     attitude-= yMouse;
 
-    if ( attitude > 2.05 )
-      attitude = 2.05;
-
-    else if ( attitude < -1.15 )
-      attitude = -1.15;
+
+    if ( attitude > 1.95 )
+      attitude = 1.95;
+    else if ( attitude < -1.07 )
+      attitude = -1.07;
 
     xMouse = yMouse = 0;
@@ -304,4 +387,6 @@
     this->fallVelocity += 300.0f * time;
     velocity -= Vector(0.0, 1.0, 0.0) * this->fallVelocity;
+
+//     PRINTF(0)("vel %f\n", this->fallVelocity);
   }
   else
@@ -309,5 +394,4 @@
     this->fallVelocity = 0.0f;
   }
-
 
   this->shiftCoor( velocity*time );
@@ -346,4 +430,6 @@
   }
 
+  this->setOnGround(false);
+  this->aimingSystem->flushList();
 }
 
@@ -383,9 +469,30 @@
   }
   else if( event.type == KeyMapper::PEV_JUMP)
+  {
     this->bJump = event.bPressed;
-    this->bPosBut = event.bPressed;
-}
-
-
-
-
+  }
+  else if( event.type == KeyMapper::PEV_FIRE1)
+  {
+    this->bFire = event.bPressed;
+  }
+}
+
+
+void FPSPlayer::respawn( )
+{
+  if( State::isOnline())
+    toList( OM_PLAYERS );
+
+  this->damageTicker = 0.0f;
+
+  Playable::respawn();
+}
+
+
+void FPSPlayer::destroy( WorldEntity* killer )
+{
+  Playable::destroy( killer );
+
+  toList( OM_DEAD );
+}
+
Index: trunk/src/world_entities/creatures/fps_player.h
===================================================================
--- trunk/src/world_entities/creatures/fps_player.h	(revision 9110)
+++ trunk/src/world_entities/creatures/fps_player.h	(revision 9235)
@@ -9,4 +9,7 @@
 
 #include "playable.h"
+
+
+class AimingSystem;
 
 
@@ -27,4 +30,6 @@
     virtual void reset();
 
+    virtual void destroy(WorldEntity* killer);
+    virtual void respawn();
 
     virtual void tick(float time);
@@ -43,4 +48,5 @@
     bool                  bJump;              //!< jumping
     bool                  bPosBut;             //!< position button
+    bool                  bFire;              //!< fire button
 
     float                 xMouse;             //!< mouse moved in x-Direction
@@ -55,4 +61,10 @@
     float                 fallVelocity;        //!< velocity for falling down
     float                 jumpForce;           //!< the jump force
+
+    bool                  initWeapon;
+
+    AimingSystem*         aimingSystem;        //!< aiming system of the player
+
+    float                 damageTicker;        //!< ticker for dealing damage
 };
 
Index: trunk/src/world_entities/effects/explosion.cc
===================================================================
--- trunk/src/world_entities/effects/explosion.cc	(revision 9110)
+++ trunk/src/world_entities/effects/explosion.cc	(revision 9235)
@@ -40,5 +40,5 @@
   this->toList(OM_DEAD_TICK);
 
-  this->emitter = new BoxEmitter(Vector(10,10,10), 500, 45, M_2_PI);
+  this->emitter = new BoxEmitter(Vector(10,10,10), 200, 45, M_2_PI);
   this->emitter->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
   this->emitter->setParent(this);
@@ -83,5 +83,5 @@
     Explosion::explosionParticles->setLifeSpan(1.5, .3);
     Explosion::explosionParticles->setRadius(0.0, 10);
-    Explosion::explosionParticles->setRadius(.5, 15.0);
+    Explosion::explosionParticles->setRadius(.5, 30.0);
     Explosion::explosionParticles->setRadius(1.0, 10.0);
     Explosion::explosionParticles->setColor(0.0, 1,0,0,1);
@@ -113,5 +113,4 @@
 void Explosion::tick (float dt)
 {
-  printf("%f %f\n", this->lifeCycle, this->lifeTime);
   this->lifeCycle += dt;
   if(this->lifeTime < this->lifeCycle)
Index: trunk/src/world_entities/environments/mapped_water.cc
===================================================================
--- trunk/src/world_entities/environments/mapped_water.cc	(revision 9110)
+++ trunk/src/world_entities/environments/mapped_water.cc	(revision 9235)
@@ -337,5 +337,20 @@
 {
   // it's not too nice, but it works fine
-  PRINTF(0)("\nMappedWater XML Code:\n<MappedWater>\n  <waterpos>%f, %f, %f</waterpos>\n  <watersize>%f, %f</watersize>\n  <wateruv>%f</wateruv>\n  <waterflow>%f</waterflow>\n  <lightpos>%f, %f, %f</lightpos>\n  <waterangle>%f</waterangle>\n  <normalmapscale>%f</normalmapscale>\n  <shinesize>%f</waterpos>\n  <shinestrength>%f</shinestrength>\n  <reflstrength>%f</reflstrength>\n  <refraction>%f</refraction>\n  <watercolor>%f, %f, %f</watercolor>\n</MappedWater>\n", this->waterVerts[0], this->waterHeight, this->waterVerts[1], this->xWidth, this->zWidth, this->waterUV, this->waterFlow, this->lightPos.x, this->lightPos.y, this->lightPos.z, this->waterAngle, this->kNormalMapScale, this->shineSize, this->shineStrength, this->reflStrength, this->refraction, this->waterColor.x, this->waterColor.y, this->waterColor.z);
+  PRINT(0)("\nMappedWater XML Code:\n<MappedWater>\n");
+
+  PRINT(0)("  <waterpos>%f, %f, %f</waterpos>\n", this->waterVerts[0], this->waterHeight, this->waterVerts[1]);
+  PRINT(0)("  <watersize>%f, %f</watersize>\n", this->xWidth, this->zWidth);
+  PRINT(0)("  <wateruv>%f</wateruv>\n", this->waterUV);
+  PRINT(0)("  <waterflow>%f</waterflow>\n", this->waterFlow);
+  PRINT(0)("  <lightpos>%f, %f, %f</lightpos>\n", this->lightPos.x, this->lightPos.y, this->lightPos.z);
+  PRINT(0)("  <waterangle>%f</waterangle>\n", this->waterAngle);
+  PRINT(0)("  <normalmapscale>%f</normalmapscale>\n", this->kNormalMapScale);
+  PRINT(0)("  <shinesize>%f</shinesize>\n", this->shineSize);
+  PRINT(0)("  <shinestrength>%f</shinestrength>\n", this->shineStrength);
+  PRINT(0)("  <reflstrength>%f</reflstrength>\n", this->reflStrength);
+  PRINT(0)("  <refraction>%f</refraction>\n", this->refraction);
+  PRINT(0)("  <watercolor>%f, %f, %f</watercolor>\n", this->waterColor.x, this->waterColor.y, this->waterColor.z);
+
+  PRINT(0)("</MappedWater>\n");
 }
 
@@ -475,5 +490,5 @@
 
         OrxGui::GLGuiSlider* lightPosX = new OrxGui::GLGuiSlider();
-        lightPosX->setRange(-600, 600);
+        lightPosX->setRange(-4000, 4000);
         lightPosX->setValue(this->lightPos.x);
         lightPosX->setStep(15);
@@ -482,5 +497,5 @@
 
         OrxGui::GLGuiSlider* lightPosY = new OrxGui::GLGuiSlider();
-        lightPosY->setRange(-600, 600);
+        lightPosY->setRange(-4000, 4000);
         lightPosY->setStep(15);
         lightPosY->setValue(this->lightPos.y);
@@ -489,5 +504,5 @@
 
         OrxGui::GLGuiSlider* lightPosZ = new OrxGui::GLGuiSlider();
-        lightPosZ->setRange(-600, 600);
+        lightPosZ->setRange(-4000, 4000);
         lightPosZ->setStep(15);
         lightPosZ->setValue(this->lightPos.z);
@@ -504,7 +519,7 @@
 
         OrxGui::GLGuiSlider* waterHeight = new OrxGui::GLGuiSlider();
-        waterHeight->setRange(-500, 500);
+        waterHeight->setRange(100, 370);
         waterHeight->setValue(this->waterHeight);
-        waterHeight->setStep(10);
+        waterHeight->setStep(4);
         waterHeight->connect(SIGNAL(waterHeight, valueChanged), this, SLOT(MappedWater, setWaterHeight));
         waterHeightBox->pack(waterHeight);
@@ -547,4 +562,5 @@
   glDisable(GL_BLEND);
 
+  // TODO change texture coords, so water doesnt look distorted when xWidth != zWidth
   glBegin(GL_QUADS);
   // The back left vertice for the water
Index: trunk/src/world_entities/environments/model_entity.cc
===================================================================
--- trunk/src/world_entities/environments/model_entity.cc	(revision 9110)
+++ trunk/src/world_entities/environments/model_entity.cc	(revision 9235)
@@ -32,5 +32,5 @@
 {
   this->setClassID(CL_MODEL_ENTITY, "ModelEntity");
-  this->toList(OM_ENVIRON_NOTICK);
+  this->toList(OM_ENVIRON);
 
   this->speed = NULL;
@@ -71,7 +71,14 @@
 void ModelEntity::setMomentum (float angle, float x, float y, float z)
 {
+  Vector v(x,y,z);
+  v.debug();
+  v.normalize();
+  v.debug();
+
   if (this->momentum == NULL)
     this->momentum = new Quaternion;
-  *this->momentum = Quaternion(angle, Vector(x, y, z));
+  *this->momentum = Quaternion(angle, v);
+
+  this->momentum->debug();
 }
 
@@ -82,4 +89,7 @@
 
   if (this->momentum != NULL)
-    this->shiftDir(*this->momentum * dt);
+  {
+    this->shiftDir((*this->momentum * dt ).getNormalized());
+    //this->getAbsDir().debug();
+  }
 }
Index: trunk/src/world_entities/npcs/attractor_mine.cc
===================================================================
--- trunk/src/world_entities/npcs/attractor_mine.cc	(revision 9235)
+++ trunk/src/world_entities/npcs/attractor_mine.cc	(revision 9235)
@@ -0,0 +1,156 @@
+
+
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "attractor_mine.h"
+
+
+#include "shader.h"
+#include "state.h"
+#include "debug.h"
+
+#include "player.h"
+#include "playable.h"
+
+#include "loading/factory.h"
+#include "loading/load_param.h"
+
+#include "effects/explosion.h"
+
+CREATE_FACTORY(AttractorMine, CL_ATTRACTOR_MINE);
+#include "script_class.h"
+CREATE_SCRIPTABLE_CLASS(AttractorMine, CL_ATTRACTOR_MINE,
+                        addMethod("setName", ExecutorLua1<BaseObject,const std::string&>(&BaseObject::setName))
+                       //Coordinates
+                        ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
+                        ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
+                        ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
+                        ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
+                       );
+
+
+
+
+AttractorMine::AttractorMine(const TiXmlElement* root)
+    : NPC(NULL)
+{
+  this->setClassID(CL_ATTRACTOR_MINE, "AttractorMine");
+
+  this->toList(OM_GROUP_02);
+
+  if ((float)rand()/RAND_MAX > .5f)
+    this->loadModel("models/ships/noxon_battle_drone.obj", .3);
+  else
+    this->loadModel("models/ships/noxon_battle_drone.obj", .2);
+
+  this->setDamage(30.0f);
+
+
+
+  this->shader = NULL;
+  if (likely(Shader::checkShaderAbility()))
+    this->shader = Shader::getShader("shaders/toon.vert", "shaders/toon.frag");
+
+  this->randomRotAxis = VECTOR_RAND(1);
+
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+
+AttractorMine::~AttractorMine ()
+{
+  if (this->shader)
+    Shader::unload(this->shader);
+}
+
+
+void AttractorMine::loadParams(const TiXmlElement* root)
+{
+  NPC::loadParams(root);
+
+}
+
+
+void AttractorMine::destroy(WorldEntity* killer)
+{
+  Explosion::explode(this, Vector(10,10,10));
+  this->toList(OM_DEAD);
+
+}
+
+
+
+/**
+ *  the entity is drawn onto the screen with this function
+ *
+ * This is a central function of an entity: call it to let the entity painted to the screen.
+ * Just override this function with whatever you want to be drawn.
+ */
+void AttractorMine::draw() const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  float matrix[4][4];
+
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+  /* rotate */
+  this->getAbsDir ().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+
+  //   if (this->shader != NULL && this->shader != Shader::getActiveShader())
+  //     shader->activateShader();
+
+  this->getModel()->draw();
+  //   shader->deactivateShader();
+
+
+  /*  if (this->model)
+      this->model->draw();*/
+  glPopMatrix();
+}
+
+
+void AttractorMine::tick(float dt)
+{
+  PNode* attractNode = State::getPlayer()->getPlayable();
+  if (attractNode != NULL)
+  {
+    if (this->distance(attractNode) < 80)
+    {
+      Vector dist = (attractNode->getAbsCoor() -  this->getAbsCoor());
+      float distance = dist.len();
+      this->velocity += dist * (( 250.0 - distance) / distance * dt);
+    }
+  }
+
+  this->shiftCoor(this->velocity * dt);
+
+  //  Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor());
+
+  //if (directin.len() < 100)
+  //  this->shiftCoor(direction *dt * 5 * exp(-direction.len() / 30.0));
+  this->shiftDir(Quaternion(.5 * dt, this->randomRotAxis));
+
+}
+
+
+
Index: trunk/src/world_entities/npcs/attractor_mine.h
===================================================================
--- trunk/src/world_entities/npcs/attractor_mine.h	(revision 9235)
+++ trunk/src/world_entities/npcs/attractor_mine.h	(revision 9235)
@@ -0,0 +1,32 @@
+
+#ifndef _ATTRACTOR_MINE_H
+#define _ATTRACTOR_MINE_H
+
+#include "npc.h"
+
+class AI;
+class Shader;
+
+class AttractorMine : public NPC {
+
+ public:
+  AttractorMine (const TiXmlElement* root = NULL);
+  virtual ~AttractorMine ();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  void addAI(AI* ai);
+
+  virtual void destroy(WorldEntity* killer);
+
+  virtual void tick(float dt);
+  virtual void draw() const;
+
+ private:
+   Vector   randomRotAxis;
+   Shader*  shader;
+
+   Vector   velocity;
+};
+
+#endif /* _ATTRACTOR_MINE_H */
Index: trunk/src/world_entities/npcs/gate.cc
===================================================================
--- trunk/src/world_entities/npcs/gate.cc	(revision 9235)
+++ trunk/src/world_entities/npcs/gate.cc	(revision 9235)
@@ -0,0 +1,220 @@
+
+
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Patrick Boenzli
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+
+#include "interactive_model.h"
+
+
+#include "gate.h"
+#include "class_list.h"
+
+#include "effects/explosion.h"
+
+
+
+using namespace std;
+
+
+CREATE_FACTORY(Gate, CL_GATE);
+
+
+#include "script_class.h"
+CREATE_SCRIPTABLE_CLASS(Gate, CL_GATE,
+                            addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide))
+                            ->addMethod("unhide", ExecutorLua0<WorldEntity>(&WorldEntity::unhide))
+                           // ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy()))    
+                            ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
+                            ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
+                            ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
+                            ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
+                       );
+
+
+//! list of all different animations a std md2model supports
+sAnim Gate::animationList[3] =
+{
+ // begin, end, fps, interruptable
+  {   0,  7,  30,  0 },    //!< OPEN
+  {   8, 15,  30,  0 },    //!< CLOSE
+  {  16, 18,  30,  0 }     //!< DIE
+};
+
+
+
+Gate::Gate(const TiXmlElement* root)
+{
+
+  this->setClassID(CL_GATE, "Gate");
+  this->scale = 1.0f;
+  this->actionRadius = 1.0;
+
+  if( root != NULL)
+    this->loadParams(root);
+
+  this->toList(OM_COMMON);
+  this->bLocked = false;
+  this->bOpen = false;
+
+  this->loadMD2Texture("maps/wheel.jpg");
+  this->loadModel("models/creatures/hypergate.md2", this->scale);
+
+  this->setAnimation(GATE_CLOSE, MD2_ANIM_ONCE);
+}
+
+
+Gate::~Gate ()
+{}
+
+
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void Gate::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "action-radius", this, Gate, setActionRadius)
+      .describe("sets the action radius of the door")
+      .defaultValues(3.0);
+  LoadParam(root, "scale", this, Gate, setScale)
+      .describe("sets the scale of the door")
+      .defaultValues(1.0);
+}
+
+
+/**
+ * sets the animatin of this entity
+ */
+void  Gate::setAnimation(int animNum, int playbackMode)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->setAnimation(animationList[animNum].firstFrame,
+                                                         animationList[animNum].lastFrame,
+                                                         animationList[animNum].fps,
+                                                         animationList[animNum].bStoppable,
+                                                         playbackMode);
+}
+
+
+/**
+ * ticks the door
+ * @param time: time since last tick
+ */
+void Gate::tick (float time)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->tick(time);
+
+
+  if( !this->bOpen)
+  {
+    if( this->checkOpen())
+    {
+      this->open();
+    }
+  }
+  else
+  {
+    if( !this->checkOpen())
+    {
+      this->close();
+    }
+  }
+
+
+}
+
+
+/**
+ * open the door
+ */
+void Gate::open()
+{
+  if( this->bLocked)
+    return;
+
+  this->setAnimation(GATE_OPEN, MD2_ANIM_ONCE);
+  this->bOpen = true;
+}
+
+
+/**
+ * close the door
+ */
+void Gate::close()
+{
+  this->setAnimation(GATE_CLOSE, MD2_ANIM_ONCE);
+  this->bOpen = false;
+}
+
+
+void Gate::destroy()
+{
+  this->setAnimation(GATE_DIE, MD2_ANIM_ONCE);
+
+  Explosion::explode(this, Vector(10,10,10));
+}
+
+
+/**
+ * checks if the door is open
+ */
+bool Gate::checkOpen()
+{
+
+  std::list<BaseObject*>::const_iterator it;
+  const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);
+  WorldEntity* entity;
+  float distance;
+
+  if( list == NULL)
+    return false;
+
+  // for all players
+  for( it = list->begin(); it != list->end(); it++)
+  {
+    entity = dynamic_cast<WorldEntity*>(*it);
+
+    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
+    if( distance < this->actionRadius)
+      return true;
+  }
+
+
+  list = ClassList::getList(CL_GENERIC_NPC);
+  if( list == NULL)
+    return false;
+  for( it = list->begin(); it != list->end(); it++)
+  {
+    entity = dynamic_cast<WorldEntity*>(*it);
+
+    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
+    if( distance < this->actionRadius)
+      return true;
+  }
+
+  return false;
+}
+
+
+
Index: trunk/src/world_entities/npcs/gate.h
===================================================================
--- trunk/src/world_entities/npcs/gate.h	(revision 9235)
+++ trunk/src/world_entities/npcs/gate.h	(revision 9235)
@@ -0,0 +1,64 @@
+#ifndef _GATE_H
+#define _GATE_H
+
+#include "world_entity.h"
+
+#include "md2/md2Model.h"
+
+class TiXmlElement;
+
+
+//! animation names enumeration
+typedef enum GateAnimType
+{
+  GATE_OPEN = 0,
+  GATE_CLOSE,
+  GATE_DIE,
+
+  GATE_MAX_ANIMATIONS
+};
+
+
+class Gate : public WorldEntity
+{
+  public:
+    Gate(const TiXmlElement* root = NULL);
+    virtual ~Gate ();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    void setActionRadius(float radius) { this->actionRadius = radius; }
+    void setScale(float scale) { this->scale = scale; }
+
+    void open();
+    void close();
+    void destroy();
+
+    void lock() { this->bLocked = true; }
+    void unlock() { this->bLocked = false; }
+    bool isLocked() const { return this->bLocked; }
+
+
+    virtual void tick (float time);
+
+
+  private:
+    void init();
+    bool checkOpen();
+    void setAnimation(int animNum, int playbackMode = 0);
+
+
+  private:
+    bool           bOpen;             //!< true if the door is open
+    bool           bLocked;           //!< true if this door is locked
+    float          actionRadius;      //!< action radius
+    float          scale;             //!< the scale of the model
+
+    static sAnim   animationList[3];  //!< list of the animations
+
+    bool           bDead;
+
+
+};
+
+#endif /* _GATE_H */
Index: trunk/src/world_entities/npcs/generic_npc.cc
===================================================================
--- trunk/src/world_entities/npcs/generic_npc.cc	(revision 9110)
+++ trunk/src/world_entities/npcs/generic_npc.cc	(revision 9235)
@@ -82,4 +82,5 @@
 {
   this->setClassID(CL_GENERIC_NPC, "GenericNPC");
+
   this->toList(OM_GROUP_00);
 
@@ -206,4 +207,7 @@
 /**
  * each animation has to be initialized here
+ */
+/**
+ *
  */
 void GenericNPC::initNPC()
@@ -578,5 +582,5 @@
 
 
-void GenericNPC::destroy()
+void GenericNPC::destroy(WorldEntity* killer)
 {
   int randi = (int)(5.0f * (float)rand()/(float)RAND_MAX);
Index: trunk/src/world_entities/npcs/generic_npc.h
===================================================================
--- trunk/src/world_entities/npcs/generic_npc.h	(revision 9110)
+++ trunk/src/world_entities/npcs/generic_npc.h	(revision 9235)
@@ -77,5 +77,5 @@
 
 
-  void destroy();
+  virtual void destroy(WorldEntity* killer);
 
   private:
Index: trunk/src/world_entities/npcs/ground_turret.cc
===================================================================
--- trunk/src/world_entities/npcs/ground_turret.cc	(revision 9110)
+++ trunk/src/world_entities/npcs/ground_turret.cc	(revision 9235)
@@ -176,5 +176,5 @@
 }
 
-void GroundTurret::destroy()
+void GroundTurret::destroy(WorldEntity* killer)
 {
   this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90);
Index: trunk/src/world_entities/npcs/ground_turret.h
===================================================================
--- trunk/src/world_entities/npcs/ground_turret.h	(revision 9110)
+++ trunk/src/world_entities/npcs/ground_turret.h	(revision 9235)
@@ -25,5 +25,5 @@
   virtual void leftWorld ();
 
-  virtual void destroy();
+  virtual void destroy(WorldEntity* killer);
 
   virtual void draw() const;
Index: trunk/src/world_entities/npcs/npc.cc
===================================================================
--- trunk/src/world_entities/npcs/npc.cc	(revision 9110)
+++ trunk/src/world_entities/npcs/npc.cc	(revision 9235)
@@ -19,7 +19,4 @@
 
 #include "npc.h"
-
-
-using namespace std;
 
 
@@ -51,5 +48,4 @@
 void NPC::loadParams(const TiXmlElement* root)
 {
-  if(root != NULL)
    WorldEntity::loadParams(root);
 }
Index: trunk/src/world_entities/npcs/npc_test.cc
===================================================================
--- trunk/src/world_entities/npcs/npc_test.cc	(revision 9110)
+++ trunk/src/world_entities/npcs/npc_test.cc	(revision 9235)
@@ -23,12 +23,15 @@
 #include "shader.h"
 #include "state.h"
-#include "stdlibincl.h"
 #include "debug.h"
 
+#include "loading/factory.h"
+#include "loading/load_param.h"
 
-using namespace std;
+#include "effects/explosion.h"
+
+CREATE_FACTORY(NPC2, CL_NPC_TEST2);
 
 
-NPC2::NPC2()
+NPC2::NPC2(const TiXmlElement* root)
   : NPC(NULL)
 {
@@ -36,7 +39,10 @@
 
   if ((float)rand()/RAND_MAX > .5f)
-    this->loadModel("models/ships/bolido.obj", 3);
+    this->loadModel("models/ships/bolido.obj", 6);
   else
-    this->loadModel("models/ships/gobblin.obj", 3);
+    this->loadModel("models/ships/gobblin.obj", 6);
+
+
+
 
   this->shader = NULL;
@@ -44,7 +50,8 @@
     this->shader = Shader::getShader("shaders/toon.vert", "shaders/toon.frag");
 
-  this->obj = gluNewQuadric();
+  this->randomRotAxis = VECTOR_RAND(1);
 
-  this->randomRotAxis = VECTOR_RAND(1);
+  if (root != NULL)
+    this->loadParams(root);
 }
 
@@ -54,5 +61,19 @@
   if (this->shader)
     Shader::unload(this->shader);
-  gluDeleteQuadric(this->obj);
+}
+
+
+void NPC2::loadParams(const TiXmlElement* root)
+{
+  NPC::loadParams(root);
+
+}
+
+
+void NPC2::destroy(WorldEntity* killer)
+{
+  Explosion::explode(this, Vector(10,10,10));
+  this->toList(OM_DEAD);
+
 }
 
@@ -67,25 +88,26 @@
 void NPC2::draw() const
 {
-//   glMatrixMode(GL_MODELVIEW);
-//   glPushMatrix();
-//   float matrix[4][4];
-//
-//   /* translate */
-//   glTranslatef (this->getAbsCoor ().x,
-//                 this->getAbsCoor ().y,
-//                 this->getAbsCoor ().z);
-//   /* rotate */
-//   this->getAbsDir ().matrix (matrix);
-//   glMultMatrixf((float*)matrix);
-//
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  float matrix[4][4];
+
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+  /* rotate */
+  this->getAbsDir ().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+
 //   if (this->shader != NULL && this->shader != Shader::getActiveShader())
 //     shader->activateShader();
-//   gluSphere(this->obj, 3, 10, 10);
+
+  this->getModel()->draw();
 //   shader->deactivateShader();
-//
-//
-// /*  if (this->model)
-//     this->model->draw();*/
-//   glPopMatrix();
+
+
+/*  if (this->model)
+    this->model->draw();*/
+  glPopMatrix();
 }
 
@@ -97,5 +119,5 @@
   //if (directin.len() < 100)
 //  this->shiftCoor(direction *dt * 5 * exp(-direction.len() / 30.0));
-  this->shiftDir(Quaternion(dt, this->randomRotAxis));
+//  this->shiftDir(Quaternion(dt, this->randomRotAxis));
 
 }
Index: trunk/src/world_entities/npcs/npc_test.h
===================================================================
--- trunk/src/world_entities/npcs/npc_test.h	(revision 9110)
+++ trunk/src/world_entities/npcs/npc_test.h	(revision 9235)
@@ -11,9 +11,12 @@
 
  public:
-  NPC2 ();
+  NPC2 (const TiXmlElement* root);
   virtual ~NPC2 ();
 
+  virtual void loadParams(const TiXmlElement* root);
 
   void addAI(AI* ai);
+
+  virtual void destroy(WorldEntity* killer);
 
   virtual void tick(float dt);
@@ -23,6 +26,4 @@
    Vector   randomRotAxis;
    Shader*  shader;
-   GLUquadricObj* obj;
-
 };
 
Index: trunk/src/world_entities/npcs/npc_test1.cc
===================================================================
--- trunk/src/world_entities/npcs/npc_test1.cc	(revision 9110)
+++ trunk/src/world_entities/npcs/npc_test1.cc	(revision 9235)
@@ -24,6 +24,4 @@
 #include "power_ups/turret_power_up.h"
 #include "power_ups/laser_power_up.h"
-
-using namespace std;
 
 
Index: trunk/src/world_entities/npcs/space_turret.cc
===================================================================
--- trunk/src/world_entities/npcs/space_turret.cc	(revision 9235)
+++ trunk/src/world_entities/npcs/space_turret.cc	(revision 9235)
@@ -0,0 +1,199 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Manuel Leuenberger
+   co-programmer: ...
+*/
+
+#include "space_turret.h"
+#include "model.h"
+#include "world_entities/weapons/turret.h"
+
+#include "state.h"
+#include "playable.h"
+#include "player.h"
+
+
+#include "util/loading/factory.h"
+#include "network_game_manager.h"
+#include "util/loading/load_param.h"
+
+#include "effects/explosion.h"
+
+CREATE_FACTORY(SpaceTurret, CL_SPACE_TURRET);
+
+/**
+ * constructs and loads a SpaceTurret from a XML-element
+ * @param root the XML-element to load from
+ */
+SpaceTurret::SpaceTurret(const TiXmlElement* root)
+  : NPC(root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+
+/**
+ * standard deconstructor
+ */
+SpaceTurret::~SpaceTurret ()
+{
+
+}
+
+
+/**
+ * initializes the SpaceTurret
+ * @todo change this to what you wish
+ */
+void SpaceTurret::init()
+{
+  this->setClassID(CL_SPACE_TURRET, "SpaceTurret");
+  this->loadModel("models/ground_turret_#.obj", 7.5);
+  this->loadModel("models/comet.obj", 1.0f, 3);
+  this->left = NULL;
+  this->right = NULL;
+
+  this->setHealthMax(100);
+  this->setHealth(30);
+
+  this->weaponHolder[0].addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+  this->weaponHolder[1].addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+
+  this->weaponHolder[0].setRelCoor(0,25,0);
+  this->weaponHolder[0].setParent(this);
+  this->weaponHolder[1].setParent(this);
+}
+
+
+/**
+ * loads a SpaceTurret from a XML-element
+ * @param root the XML-element to load from
+ * @todo make the class Loadable
+ */
+void SpaceTurret::loadParams(const TiXmlElement* root)
+{
+  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
+  NPC::loadParams(root);
+
+
+  /**
+   * @todo: make the class Loadable
+   */
+  const TiXmlElement* element;
+
+  element = root->FirstChildElement("weapon-left");
+  if (element != NULL) element = element->FirstChildElement();
+  this->left = dynamic_cast<Weapon*>( Factory::fabricate( element) );
+  if (this->left)
+  {
+    this->left->setParent(this);
+    this->left->toList(this->getOMListNumber());
+    this->left->setRelCoor(0,15,-7.5);
+    this->left->requestAction( WA_ACTIVATE);
+    this->left->setParent(&this->weaponHolder[0]);
+  }
+
+  element = root->FirstChildElement("weapon-right");
+  if (element != NULL)  if (element != NULL) element = element->FirstChildElement();
+  this->right = dynamic_cast<Weapon*>( Factory::fabricate( element) );
+  if (this->right)
+  {
+    this->right->setParent(this);
+    this->right->toList(this->getOMListNumber());
+    this->right->setRelCoor(0,15,7.5);
+    this->left->requestAction( WA_ACTIVATE);
+    this->right->setParent(&this->weaponHolder[0]);
+  }
+}
+
+/**
+ * advances the SpaceTurret about time seconds
+ * @param time the Time to step
+ */
+void SpaceTurret::tick(float dt)
+{
+  if(this->getHealth() > 0.0f && State::getPlayer() &&
+     State::getPlayer()->getPlayable() &&
+     State::getPlayer()->getPlayable()->distance(this) < 300) // HACK
+  {
+  if (likely(this->left != NULL))
+  {
+//    this->left->tickW(dt);
+    this->left->requestAction(WA_SHOOT);
+  }
+  if (likely(this->right != NULL))
+  {
+//    this->right->tickW(dt);
+    this->right->requestAction(WA_SHOOT);
+  }
+  }
+}
+
+/**
+ * draws this worldEntity
+ */
+void SpaceTurret::draw () const
+{
+  glPushMatrix();
+  glTranslatef (this->getAbsCoor ().x,
+                this->getAbsCoor ().y,
+                this->getAbsCoor ().z);
+
+  Vector tmpRot = this->getAbsDir().getSpacialAxis();
+  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+  this->getModel()->draw();
+  if (this->getModel() != NULL)
+    this->getModel(3)->draw();
+  glPopMatrix();
+/*
+  if (this->left != NULL)
+    this->left->draw();
+  if (this->right != NULL)
+    this->right->draw();*/
+}
+
+
+
+/**
+ *
+ *
+ */
+void SpaceTurret::postSpawn ()
+{
+
+}
+
+/**
+ *
+ *
+ */
+void SpaceTurret::leftWorld ()
+{
+
+}
+
+void SpaceTurret::destroy(WorldEntity* killer)
+{
+  this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90);
+  Explosion::explode(this, Vector(10,10,10));
+
+  this->toList(OM_DEAD);
+
+  if (this->left)
+    this->left->toList(OM_DEAD);
+  if (this->right)
+    this->right->toList(OM_DEAD);
+
+}
Index: trunk/src/world_entities/npcs/space_turret.h
===================================================================
--- trunk/src/world_entities/npcs/space_turret.h	(revision 9235)
+++ trunk/src/world_entities/npcs/space_turret.h	(revision 9235)
@@ -0,0 +1,40 @@
+/*!
+ * @file space_turret.h
+ * @brief description
+*/
+
+#ifndef _SPACE_TURRET_H
+#define _SPACE_TURRET_H
+
+#include "npcs/npc.h"
+
+class Weapon;
+
+//! A Class to ...
+class SpaceTurret : public NPC
+{
+
+public:
+  SpaceTurret(const TiXmlElement* root = NULL);
+  virtual ~SpaceTurret();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  virtual void postSpawn ();
+  virtual void leftWorld ();
+
+  virtual void destroy(WorldEntity* killer);
+
+  virtual void draw() const;
+  virtual void tick(float time);
+
+private:
+  void init();
+
+
+private:
+  PNode  weaponHolder[2];
+  Weapon *left, *right;
+};
+
+#endif /* _SPACE_TURRET_H */
Index: trunk/src/world_entities/playable.cc
===================================================================
--- trunk/src/world_entities/playable.cc	(revision 9110)
+++ trunk/src/world_entities/playable.cc	(revision 9235)
@@ -67,6 +67,4 @@
   this->bDead = false;
 
-  //subscribe to collision reaction
-  this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);
 
   registerVar( new SynchronizeableInt( &score, &score, "score" ) );
@@ -393,5 +391,5 @@
   PRINTF(0)("Playable respawn\n");
   // only if this is the spaceship of the player
-  if( this == State::getPlayer()->getPlayable())
+  if( State::getGameRules() && State::getPlayer() && this == State::getPlayer()->getPlayable())
     State::getGameRules()->onPlayerSpawn();
 
@@ -403,9 +401,6 @@
 
 
-void Playable::destroy()
-{
-  Explosion::explode(dynamic_cast<PNode*>(this), Vector(1.0f, 1.0f, 1.0f));
-
-
+void Playable::destroy(WorldEntity* killer)
+{
   if( !this->bDead)
   {
@@ -416,13 +411,9 @@
       if( this == State::getPlayer()->getPlayable())
         State::getGameRules()->onPlayerDeath();
-
-      //     this->toList(OM_GROUP_05);
-      //HACK: moves the entity to an unknown place far far away: in the future, GameRules will look for that
-      this->setAbsCoor(-2000.0, -2000.0, -2000.0);
-
-      //explosion hack
-
     }
     this->bDead = true;
+    
+    if( State::getGameRules() != NULL)
+      State::getGameRules()->registerKill(Kill(killer, this));
   }
 }
Index: trunk/src/world_entities/playable.h
===================================================================
--- trunk/src/world_entities/playable.h	(revision 9110)
+++ trunk/src/world_entities/playable.h	(revision 9235)
@@ -80,5 +80,5 @@
 
   // WorldEntity Extensions
-  virtual void destroy();
+  virtual void destroy(WorldEntity* killer);
   virtual void respawn();
   virtual void collidesWith(WorldEntity* entity, const Vector& location);
@@ -90,4 +90,7 @@
   static const std::string& playmodeToString(Playable::Playmode playmode);
   static const std::string playmodeNames[];
+  
+  inline bool beFire(){ return this->bFire; }
+  inline void fire(bool bF){ this->bFire = bF;}
 
 protected:
Index: trunk/src/world_entities/projectiles/boomerang_projectile.cc
===================================================================
--- trunk/src/world_entities/projectiles/boomerang_projectile.cc	(revision 9235)
+++ trunk/src/world_entities/projectiles/boomerang_projectile.cc	(revision 9235)
@@ -0,0 +1,215 @@
+
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Silvan Nellen
+   co-programmer:
+
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "boomerang_projectile.h"
+
+#include "state.h"
+#include "class_list.h"
+
+#include "dot_emitter.h"
+#include "sprite_particles.h"
+
+#include "debug.h"
+
+CREATE_FAST_FACTORY_STATIC(BoomerangProjectile, CL_BOOMERANG_PROJECTILE);
+
+/**
+ *  standard constructor
+*/
+BoomerangProjectile::BoomerangProjectile () : Projectile()
+{
+  this->setClassID(CL_BOOMERANG_PROJECTILE, "BoomerangProjectile");
+
+  this->loadModel("models/projectiles/orx-rocket.obj", 2.0);
+  this->loadExplosionSound("sound/explosions/explosion_4.wav");
+
+
+  this->setMinEnergy(1);
+  this->setHealthMax(10);
+  this->lifeSpan = 2.0;
+  this->agility = 3.5;
+  this->maxVelocity = 150;
+
+  this->emitter = new DotEmitter(100, 5, M_2_PI);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI, M_PI);
+}
+
+
+/**
+ *  standard deconstructor
+*/
+BoomerangProjectile::~BoomerangProjectile ()
+{
+  // delete this->emitter;
+
+  /* this is normaly done by World.cc by deleting the ParticleEngine */
+  if (BoomerangProjectile::trailParticles != NULL && ClassList::getList(CL_BOOMERANG_PROJECTILE)->size() <= 1)
+  {
+    if (ClassList::exists(BoomerangProjectile::trailParticles, CL_PARTICLE_SYSTEM))
+      delete BoomerangProjectile::trailParticles;
+    BoomerangProjectile::trailParticles = NULL;
+  }
+  if (BoomerangProjectile::explosionParticles != NULL && ClassList::getList(CL_BOOMERANG_PROJECTILE)->size() <= 1)
+  {
+    if (ClassList::exists(BoomerangProjectile::explosionParticles, CL_PARTICLE_SYSTEM))
+      delete BoomerangProjectile::explosionParticles;
+    BoomerangProjectile::explosionParticles = NULL;
+  }
+
+}
+
+SpriteParticles* BoomerangProjectile::trailParticles = NULL;
+SpriteParticles* BoomerangProjectile::explosionParticles = NULL;
+
+
+
+void BoomerangProjectile::activate()
+{
+  if (unlikely(BoomerangProjectile::trailParticles == NULL))
+  {
+    BoomerangProjectile::trailParticles = new SpriteParticles(2000);
+    BoomerangProjectile::trailParticles->setName("BoomerangProjectileTrailParticles");
+    BoomerangProjectile::trailParticles->setMaterialTexture("maps/radial-trans-noise.png");
+    BoomerangProjectile::trailParticles->setLifeSpan(1.0, .3);
+    BoomerangProjectile::trailParticles->setRadius(0.0, .5);
+    BoomerangProjectile::trailParticles->setRadius(0.2, 4.0);
+    BoomerangProjectile::trailParticles->setRadius(.5, 1.5);
+    BoomerangProjectile::trailParticles->setRadius(1.0, 1.5);
+    BoomerangProjectile::trailParticles->setColor(0.0, 1,0,0,.7);
+    BoomerangProjectile::trailParticles->setColor(0.2, .8,.8,0,.5);
+    BoomerangProjectile::trailParticles->setColor(0.5, .8,.8,.8,.8);
+    BoomerangProjectile::trailParticles->setColor(1.0, .8,.8,.8,.0);
+  }
+  if (unlikely(BoomerangProjectile::explosionParticles == NULL))
+  {
+    BoomerangProjectile::explosionParticles = new SpriteParticles(200);
+    BoomerangProjectile::explosionParticles->setName("BoomerangProjectileExplosionParticles");
+    BoomerangProjectile::explosionParticles->setMaterialTexture("maps/radial-trans-noise.png");
+    BoomerangProjectile::explosionParticles->setLifeSpan(.5, .3);
+    BoomerangProjectile::explosionParticles->setRadius(0.0, 10);
+    BoomerangProjectile::explosionParticles->setRadius(.5, 15.0);
+    BoomerangProjectile::explosionParticles->setRadius(1.0, 10.0);
+    BoomerangProjectile::explosionParticles->setColor(0.0, 0,1,0,1);
+    BoomerangProjectile::explosionParticles->setColor(0.5, .8,.8,0,.8);
+    BoomerangProjectile::explosionParticles->setColor(0.8, .8,.8,.3,.8);
+    BoomerangProjectile::explosionParticles->setColor(1.0, 1,1,1,.0);
+  }
+
+  this->emitter->setSystem(BoomerangProjectile::trailParticles);
+
+  this->updateNode(0);
+  this->emitter->setEmissionRate(45.0);
+  this->emitter->setEmissionVelocity(0.0);
+
+  this->setHealth(10.0* (float)rand()/(float)RAND_MAX);
+}
+
+
+void BoomerangProjectile::deactivate()
+{
+  this->emitter->setSystem(NULL);
+  this->lifeCycle = 0.0;
+
+  this->toList(OM_DEAD);
+  this->removeNode();
+  BoomerangProjectile::fastFactory->kill(this);
+}
+
+
+void BoomerangProjectile::collidesWith(WorldEntity* entity, const Vector& location)
+{
+  if (this->hitEntity != entity)
+    this->destroy( entity );
+  this->hitEntity = entity;
+}
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param time since last tick
+*/
+void BoomerangProjectile::tick (float time)
+{
+
+  Vector targetFarFarAway = this->getAbsCoor() + Vector(100000, 0, 0);
+
+  {
+    speed = velocity.len();
+    diffVector = ((targetFarFarAway - this->getAbsCoor()).getNormalized());
+
+    if(velocity.dot(diffVector) != 0)
+    {
+      correctionVector = (( ( diffVector *  (speed * speed/( velocity.dot(diffVector ) ) )) - velocity).getNormalized()) * agility;
+
+      if( (diffVector *  (speed * speed/( velocity.dot(diffVector ) ) ) -velocity).len() < agility )
+        velocity = ((diffVector *  (speed * speed/( velocity.dot(diffVector ) ) )).getNormalized())*agility;
+      else if(velocity.dot(diffVector) > 0)
+        velocity += correctionVector;
+      else if (velocity.dot(diffVector) < 0)
+        velocity -= correctionVector;
+    }
+    else
+      velocity += diffVector * agility;
+
+    this->setAbsDir(Quaternion(velocity, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)));
+  }
+
+  velocity *= maxVelocity/velocity.len();
+  Vector v = this->velocity * (time);
+  this->shiftCoor(v);
+
+  if(this->tickLifeCycle(time))
+    this->deactivate();
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+ */
+void BoomerangProjectile::destroy (WorldEntity* killer)
+{
+
+  printf("THIS SHOULD WORLk\n");
+
+  Projectile::destroy( killer );
+  PRINTF(5)("DESTROY BoomerangProjectile\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+  this->emitter->setSystem(BoomerangProjectile::explosionParticles);
+
+  this->emitter->setEmissionRate(1000.0);
+  this->emitter->setEmissionVelocity(50.0);
+  //  this->deactivate();
+
+}
+
+
+void BoomerangProjectile::draw () const
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  float matrix[4][4];
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+  glScalef(2.0, 2.0, 2.0);
+  this->getModel()->draw();
+
+  glPopMatrix();
+
+}
+
Index: trunk/src/world_entities/projectiles/boomerang_projectile.h
===================================================================
--- trunk/src/world_entities/projectiles/boomerang_projectile.h	(revision 9235)
+++ trunk/src/world_entities/projectiles/boomerang_projectile.h	(revision 9235)
@@ -0,0 +1,50 @@
+/*!
+ * @file boomerang_projectile.h
+ * @brief a BoomerangProjectile Projectile
+*/
+
+#ifndef _BOOMERANG_PROJECTILE_H
+#define _BOOMERANG_PROJECTILE_H
+
+#include "projectile.h"
+
+class Weapon;
+class SpriteParticles;
+class ParticleEmitter;
+class FastFactory;
+class Aim;
+
+class BoomerangProjectile : public Projectile
+{
+  public:
+    BoomerangProjectile ();
+    virtual ~BoomerangProjectile ();
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void collidesWith(WorldEntity* entity, const Vector& location);
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float time);
+    virtual void draw () const;
+
+
+  private:
+    static FastFactory*               fastFactory;
+    static SpriteParticles*           trailParticles;
+    static SpriteParticles*           explosionParticles;
+
+    ParticleEmitter*                  emitter;
+    float                             agility;
+    float                             maxVelocity;
+    float                             speed;
+    Vector                            diffVector ;
+    Vector                            correctionVector;
+
+    WorldEntity* hitEntity; // FIXME TEMPORARY
+
+};
+
+#endif /* _BOOMERANG_PROJECTILE_H */
Index: trunk/src/world_entities/projectiles/guided_missile.cc
===================================================================
--- trunk/src/world_entities/projectiles/guided_missile.cc	(revision 9110)
+++ trunk/src/world_entities/projectiles/guided_missile.cc	(revision 9235)
@@ -35,5 +35,5 @@
   this->setClassID(CL_GUIDED_MISSILE, "GuidedMissile");
 
-  this->loadModel("models/projectiles/orx-rocket.obj", .3);
+  this->loadModel("models/projectiles/orx-rocket.obj", 2.0);
   this->loadExplosionSound("sound/explosions/explosion_4.wav");
 
@@ -88,7 +88,7 @@
     GuidedMissile::trailParticles->setLifeSpan(1.0, .3);
     GuidedMissile::trailParticles->setRadius(0.0, .5);
-    GuidedMissile::trailParticles->setRadius(0.2, 2.0);
-    GuidedMissile::trailParticles->setRadius(.5, .8);
-    GuidedMissile::trailParticles->setRadius(1.0, .8);
+    GuidedMissile::trailParticles->setRadius(0.2, 4.0);
+    GuidedMissile::trailParticles->setRadius(.5, 1.5);
+    GuidedMissile::trailParticles->setRadius(1.0, 1.5);
     GuidedMissile::trailParticles->setColor(0.0, 1,0,0,.7);
     GuidedMissile::trailParticles->setColor(0.2, .8,.8,0,.5);
@@ -135,5 +135,5 @@
 {
   if (this->hitEntity != entity)
-    this->destroy();
+    this->destroy( entity );
   this->hitEntity = entity;
 }
@@ -180,7 +180,10 @@
  *  the function gets called, when the projectile is destroyed
  */
-void GuidedMissile::destroy ()
-{
-  Projectile::destroy();
+void GuidedMissile::destroy (WorldEntity* killer)
+{
+
+  printf("THIS SHOULD WORLk\n");
+
+  Projectile::destroy( killer );
   PRINTF(5)("DESTROY GuidedMissile\n");
   this->lifeCycle = .95; //!< @todo calculate this usefully.
Index: trunk/src/world_entities/projectiles/guided_missile.h
===================================================================
--- trunk/src/world_entities/projectiles/guided_missile.h	(revision 9110)
+++ trunk/src/world_entities/projectiles/guided_missile.h	(revision 9235)
@@ -26,5 +26,5 @@
     virtual void collidesWith(WorldEntity* entity, const Vector& location);
 
-    virtual void destroy ();
+    virtual void destroy (WorldEntity* killer);
 
     virtual void tick (float time);
Index: trunk/src/world_entities/projectiles/hyperblast.cc
===================================================================
--- trunk/src/world_entities/projectiles/hyperblast.cc	(revision 9110)
+++ trunk/src/world_entities/projectiles/hyperblast.cc	(revision 9235)
@@ -126,7 +126,7 @@
  *  the function gets called, when the projectile is destroyed
 */
-void Hyperblast::destroy ()
+void Hyperblast::destroy (WorldEntity* killer)
 {
-  Projectile::destroy();
+  Projectile::destroy( killer );
 
   PRINTF(5)("DESTROY Hyperblast\n");
Index: trunk/src/world_entities/projectiles/hyperblast.h
===================================================================
--- trunk/src/world_entities/projectiles/hyperblast.h	(revision 9110)
+++ trunk/src/world_entities/projectiles/hyperblast.h	(revision 9235)
@@ -27,5 +27,5 @@
     virtual void collidesWith(WorldEntity* entity, const Vector& location);
 
-    virtual void destroy ();
+    virtual void destroy (WorldEntity* killer);
 
     virtual void tick (float time);
Index: trunk/src/world_entities/projectiles/laser.cc
===================================================================
--- trunk/src/world_entities/projectiles/laser.cc	(revision 9110)
+++ trunk/src/world_entities/projectiles/laser.cc	(revision 9235)
@@ -42,5 +42,5 @@
 
   this->setMinEnergy(10);
-  this->setHealthMax(10);
+  this->setHealthMax(0);
   this->lifeSpan = 5.0;
 
@@ -88,5 +88,6 @@
   }
 
-  this->setHealth(10);
+  this->setDamage(0);
+  this->setHealth(0);
 }
 
@@ -107,5 +108,5 @@
 {
   if (this->hitEntity != entity && entity->isA(CL_NPC))
-    this->destroy();
+    this->destroy( entity );
   this->hitEntity = entity;
 }
@@ -128,7 +129,7 @@
  *  the function gets called, when the projectile is destroyed
 */
-void Laser::destroy ()
+void Laser::destroy (WorldEntity* killer)
 {
-  Projectile::destroy();
+  Projectile::destroy( killer );
   PRINTF(5)("DESTROY Laser\n");
   this->lifeCycle = .95; //!< @todo calculate this usefully.
Index: trunk/src/world_entities/projectiles/laser.h
===================================================================
--- trunk/src/world_entities/projectiles/laser.h	(revision 9110)
+++ trunk/src/world_entities/projectiles/laser.h	(revision 9235)
@@ -27,5 +27,5 @@
     virtual void collidesWith(WorldEntity* entity, const Vector& location);
 
-    virtual void destroy ();
+    virtual void destroy (WorldEntity* killer);
 
     virtual void tick (float dt);
Index: trunk/src/world_entities/projectiles/projectile.cc
===================================================================
--- trunk/src/world_entities/projectiles/projectile.cc	(revision 9110)
+++ trunk/src/world_entities/projectiles/projectile.cc	(revision 9235)
@@ -41,5 +41,5 @@
   /* character attributes */
   this->setHealth(1.0f);
-  this->setDamage(100.0f); // default damage of a projectile set to 100.0 damage points
+  this->setDamage(1.0f); // default damage of a projectile set to 100.0 damage points
 
   this->explosionBuffer = NULL;
@@ -162,5 +162,5 @@
 
   if (this->tickLifeCycle(dt))
-    this->destroy();
+    this->destroy( NULL );
 }
 
@@ -169,5 +169,5 @@
  *  the function gets called, when the projectile is destroyed
 */
-void Projectile::destroy ()
+void Projectile::destroy (WorldEntity* killer)
 {
   if (this->explosionBuffer != NULL)
Index: trunk/src/world_entities/projectiles/projectile.h
===================================================================
--- trunk/src/world_entities/projectiles/projectile.h	(revision 9110)
+++ trunk/src/world_entities/projectiles/projectile.h	(revision 9235)
@@ -41,5 +41,5 @@
     virtual void deactivate() = 0;
 
-    virtual void destroy ();
+    virtual void destroy (WorldEntity* killer);
 
     virtual void tick (float dt);
Index: trunk/src/world_entities/projectiles/rail_projectile.cc
===================================================================
--- trunk/src/world_entities/projectiles/rail_projectile.cc	(revision 9235)
+++ trunk/src/world_entities/projectiles/rail_projectile.cc	(revision 9235)
@@ -0,0 +1,159 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Patrick Boenzli
+   co-programmer: Benjamin Grauer
+
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "rail_projectile.h"
+
+#include "state.h"
+#include "class_list.h"
+#include "model.h"
+
+#include "dot_emitter.h"
+#include "sprite_particles.h"
+
+#include <cassert>
+#include "debug.h"
+
+using namespace std;
+
+CREATE_FAST_FACTORY_STATIC(RailProjectile, CL_RAIL_PROJECTILE);
+
+/**
+ *  standard constructor
+*/
+RailProjectile::RailProjectile () : Projectile()
+{
+  this->setClassID(CL_RAIL_PROJECTILE, "RailProjectile");
+
+  this->loadModel("models/projectiles/laser_projectile.obj", 100);
+
+  this->setMinEnergy(10);
+  this->setHealthMax(10);
+  this->lifeSpan = .5f;
+
+  this->emitter = new DotEmitter(100, 5, M_2_PI);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI, M_PI);
+  this->emitter->setEmissionRate(300.0);
+  this->emitter->setEmissionVelocity(50.0);
+}
+
+
+/**
+ *  standard deconstructor
+*/
+RailProjectile::~RailProjectile ()
+{
+  // delete this->emitter;
+
+  /* this is normaly done by World.cc by deleting the ParticleEngine */
+  if (RailProjectile::explosionParticles != NULL && ClassList::getList(CL_RAIL_PROJECTILE)->size() <= 1)
+  {
+    //if (ClassList::exists(RailProjectile::explosionParticles, CL_PARTICLE_SYSTEM))
+    //  delete RailProjectile::explosionParticles;
+    PRINTF(1)("Deleting RailProjectile Particles\n");
+    RailProjectile::explosionParticles = NULL;
+  }
+
+}
+
+SpriteParticles* RailProjectile::explosionParticles = NULL;
+
+void RailProjectile::activate()
+{
+  if (unlikely(RailProjectile::explosionParticles == NULL))
+  {
+    RailProjectile::explosionParticles = new SpriteParticles(1000);
+    RailProjectile::explosionParticles->setName("RailProjectileExplosionParticles");
+    RailProjectile::explosionParticles->setLifeSpan(.5, .3);
+    RailProjectile::explosionParticles->setRadius(0.0, 10.0);
+    RailProjectile::explosionParticles->setRadius(.5, 6.0);
+    RailProjectile::explosionParticles->setRadius(1.0, 3.0);
+    RailProjectile::explosionParticles->setColor(0.0, 1,1,0,.9);
+    RailProjectile::explosionParticles->setColor(0.5, .8,.8,0,.5);
+    RailProjectile::explosionParticles->setColor(1.0, .8,.8,.7,.0);
+  }
+
+  this->setHealth(10);
+}
+
+
+void RailProjectile::deactivate()
+{
+  assert (RailProjectile::explosionParticles != NULL);
+  RailProjectile::explosionParticles->removeEmitter(this->emitter);
+  this->lifeCycle = 0.0;
+
+  this->toList(OM_NULL);
+  this->removeNode();
+  RailProjectile::fastFactory->kill(this);
+}
+
+
+void RailProjectile::collidesWith(WorldEntity* entity, const Vector& location)
+{
+  if (this->hitEntity != entity && entity->isA(CL_NPC))
+    this->destroy( entity );
+  this->hitEntity = entity;
+}
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param dt time since last tick
+*/
+void RailProjectile::tick (float dt)
+{
+  //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
+  Vector v = this->velocity * dt;
+  this->shiftCoor(v);
+
+  if (this->tickLifeCycle(dt))
+    this->deactivate();
+}
+
+/**
+ *  the function gets called, when the projectile is destroyed
+*/
+void RailProjectile::destroy (WorldEntity* killer)
+{
+  Projectile::destroy( killer );
+  PRINTF(5)("DESTROY RailProjectile\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+
+  this->emitter->setSystem(RailProjectile::explosionParticles);
+}
+
+
+void RailProjectile::draw () const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+
+  WorldEntity::draw();
+/*  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  float matrix[4][4];
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+  glScalef(2.0, 2.0, 2.0);
+  this->getModel()->draw();
+  glPopMatrix();*/
+
+  glPopAttrib();
+}
+
Index: trunk/src/world_entities/projectiles/rail_projectile.h
===================================================================
--- trunk/src/world_entities/projectiles/rail_projectile.h	(revision 9235)
+++ trunk/src/world_entities/projectiles/rail_projectile.h	(revision 9235)
@@ -0,0 +1,46 @@
+/*!
+ * @file rail_projectile.h
+ * @brief a projectile, that is been shooted by a weapon
+*/
+
+#ifndef _RAIL_PROJECTILE_H
+#define _RAIL_PROJECTILE_H
+
+#include "projectile.h"
+
+class Vector;
+class Weapon;
+class SpriteParticles;
+class ParticleEmitter;
+class FastFactory;
+
+class RailProjectile : public Projectile
+{
+  public:
+    RailProjectile ();
+    virtual ~RailProjectile ();
+
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void collidesWith(WorldEntity* entity, const Vector& location);
+
+    virtual void destroy (WorldEntity* killer);
+
+    virtual void tick (float dt);
+    virtual void draw () const;
+
+
+  private:
+    static FastFactory*               fastFactory;
+
+    static SpriteParticles*           explosionParticles;
+
+    ParticleEmitter*                  emitter;
+
+
+    WorldEntity* hitEntity; // FIXME TEMPORARY
+};
+
+#endif /* _RAIL_PROJECTILE_H */
Index: trunk/src/world_entities/projectiles/rocket.cc
===================================================================
--- trunk/src/world_entities/projectiles/rocket.cc	(revision 9110)
+++ trunk/src/world_entities/projectiles/rocket.cc	(revision 9235)
@@ -128,5 +128,5 @@
 {
   if (this->hitEntity != entity)
-    this->destroy();
+    this->destroy( entity );
   this->hitEntity = entity;
 }
@@ -149,7 +149,7 @@
  *  the function gets called, when the projectile is destroyed
 */
-void Rocket::destroy ()
+void Rocket::destroy (WorldEntity* killer)
 {
-  Projectile::destroy();
+  Projectile::destroy( killer );
 
   PRINTF(5)("DESTROY Rocket\n");
Index: trunk/src/world_entities/projectiles/rocket.h
===================================================================
--- trunk/src/world_entities/projectiles/rocket.h	(revision 9110)
+++ trunk/src/world_entities/projectiles/rocket.h	(revision 9235)
@@ -27,5 +27,5 @@
     virtual void collidesWith(WorldEntity* entity, const Vector& location);
 
-    virtual void destroy ();
+    virtual void destroy (WorldEntity* killer);
 
     virtual void tick (float time);
Index: trunk/src/world_entities/projectiles/test_bullet.cc
===================================================================
--- trunk/src/world_entities/projectiles/test_bullet.cc	(revision 9110)
+++ trunk/src/world_entities/projectiles/test_bullet.cc	(revision 9235)
@@ -119,5 +119,5 @@
 {
   if (this->hitEntity != entity && entity->isA(CL_NPC))
-    this->destroy();
+    this->destroy( entity );
   this->hitEntity = entity;
 }
@@ -147,5 +147,5 @@
  *  the function gets called, when the projectile is destroyed
 */
-void TestBullet::destroy ()
+void TestBullet::destroy (WorldEntity* killer)
 {
   PRINTF(5)("DESTROY TestBullet\n");
Index: trunk/src/world_entities/projectiles/test_bullet.h
===================================================================
--- trunk/src/world_entities/projectiles/test_bullet.h	(revision 9110)
+++ trunk/src/world_entities/projectiles/test_bullet.h	(revision 9235)
@@ -27,5 +27,5 @@
     virtual void collidesWith(WorldEntity* entity, const Vector& location);
 
-    virtual void destroy ();
+    virtual void destroy (WorldEntity* killer);
 
     virtual void tick (float time);
Index: trunk/src/world_entities/script_trigger.cc
===================================================================
--- trunk/src/world_entities/script_trigger.cc	(revision 9110)
+++ trunk/src/world_entities/script_trigger.cc	(revision 9235)
@@ -29,4 +29,5 @@
              ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
             //Properties
+             ->addMethod("setName", ExecutorLua1<BaseObject, const std::string&>(&BaseObject::setName))
              ->addMethod("setTarget", ExecutorLua1<ScriptTrigger, const std::string&>(&ScriptTrigger::setTarget))
              ->addMethod("setTriggerParent", ExecutorLua1<ScriptTrigger, const std::string&>(&ScriptTrigger::setTriggerParent))
@@ -51,4 +52,5 @@
   this->toList(OM_COMMON);
 
+  radius = 10;
   returnCount = 1;
   scriptFinished = false;
@@ -71,4 +73,5 @@
   
   }
+  
 }
 
@@ -215,5 +218,4 @@
 void ScriptTrigger::setScript(const std::string& file)
 {
-
   ScriptManager* scriptManager = State::getScriptManager();
   if (scriptManager != NULL)
Index: trunk/src/world_entities/skydome.cc
===================================================================
--- trunk/src/world_entities/skydome.cc	(revision 9110)
+++ trunk/src/world_entities/skydome.cc	(revision 9235)
@@ -1,12 +1,12 @@
 /*
    orxonox - the future of 3D-vertical-scrollers
- 
+
    Copyright (C) 2006 orx
- 
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
    any later version.
- 
+
 ### File Specific:
    main-programmer: hdavid, amaechler
@@ -47,5 +47,8 @@
   this->toList(OM_BACKGROUND);
   this->toReflectionList();
-  
+  this->indices = NULL;
+  this->vertices = NULL;
+  this->planeVertices = NULL;
+  this->shader = NULL;
   activateDome = false;
 
@@ -91,9 +94,10 @@
   if(!activateDome)
     return;
-  
+
   glPushAttrib(GL_ENABLE_BIT);
 
   glDisable(GL_LIGHTING);
   glDisable(GL_BLEND);
+  glDisable(GL_FOG);
 
   glEnable(GL_TEXTURE_3D);
@@ -105,7 +109,5 @@
   glTranslatef(0.0f,pRadius,0.0f);
 
-
   glBegin(GL_TRIANGLES);
-
   for (int i=0; i < numIndices; i++)
   {
@@ -115,7 +117,8 @@
     glVertex3f(planeVertices[indices[i]].x, planeVertices[indices[i]].y, planeVertices[indices[i]].z);
   }
-
   glEnd();
 
+  WorldEntity::draw(); 
+
   glPopMatrix();
 
@@ -128,5 +131,5 @@
 void Skydome::generateSkyPlane(int divisions, float planetRadius, float atmosphereRadius, float hTile, float vTile)
 {
-  PRINTF(0)("Generating a sky plane");
+  PRINTF(0)("Generating a sky plane\n");
 
   // Make sure our vertex array is clear
Index: trunk/src/world_entities/space_ships/cruizer.cc
===================================================================
--- trunk/src/world_entities/space_ships/cruizer.cc	(revision 9110)
+++ trunk/src/world_entities/space_ships/cruizer.cc	(revision 9235)
@@ -78,5 +78,5 @@
   dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
 
-  this->loadModel("models/ships/human_cruizer.obj", 0.05);
+ // this->loadModel("models/ships/human_cruizer.obj", 0.05);
 
 }
Index: trunk/src/world_entities/space_ships/helicopter.cc
===================================================================
--- trunk/src/world_entities/space_ships/helicopter.cc	(revision 9110)
+++ trunk/src/world_entities/space_ships/helicopter.cc	(revision 9235)
@@ -43,5 +43,5 @@
                             ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
                             ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
-                            
+
                        );
 
@@ -124,6 +124,7 @@
 void Helicopter::init()
 {
+  this->chopperBuffer = NULL;
+
   this->setClassID(CL_HELICOPTER, "Helicopter");
-
   PRINTF(4)("HELICOPTER INIT\n");
 
Index: trunk/src/world_entities/space_ships/helicopter.h
===================================================================
--- trunk/src/world_entities/space_ships/helicopter.h	(revision 9110)
+++ trunk/src/world_entities/space_ships/helicopter.h	(revision 9235)
@@ -39,5 +39,5 @@
 
     virtual void process(const Event &event);
-    
+
     virtual void moveUp(bool move){bAscend = move;};
     virtual void moveDown(bool move){bDescend = move;};
@@ -78,6 +78,6 @@
     float                 airViscosity;
 
-    OrxSound::SoundSource soundSource;
-    OrxSound::SoundBuffer*chopperBuffer;
+    OrxSound::SoundSource  soundSource;
+    OrxSound::SoundBuffer* chopperBuffer;
 
 };
Index: trunk/src/world_entities/space_ships/hover.cc
===================================================================
--- trunk/src/world_entities/space_ships/hover.cc	(revision 9110)
+++ trunk/src/world_entities/space_ships/hover.cc	(revision 9235)
@@ -25,4 +25,6 @@
 
 #include "util/loading/factory.h"
+//#include "util/loading/resource_manager.h"
+
 #include "key_mapper.h"
 #include "state.h"
@@ -34,4 +36,14 @@
 CREATE_FACTORY(Hover, CL_HOVER);
 
+#include "script_class.h"
+CREATE_SCRIPTABLE_CLASS(Hover, CL_HOVER,
+                        addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer))
+                        //Coordinates
+                        ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
+                        ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
+                        ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
+                        ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
+                       );
+
 /**
  *  destructs the hover, deletes alocated memory
@@ -40,4 +52,7 @@
 {
   this->setPlayer(NULL);
+
+  //if (this->hoverBuffer != NULL)
+  //  ResourceManager::getInstance()->unload(this->hoverBuffer);
 }
 
@@ -58,4 +73,10 @@
 
   this->loadParams(doc.RootElement());
+
+  //load sound
+  //if (this->hoverBuffer != NULL)
+  //  ResourceManager::getInstance()->unload(this->hoverBuffer);
+  //this->hoverBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/engine/hover.wav", WAV);
+
 }
 
@@ -97,4 +118,8 @@
 void Hover::init()
 {
+
+  //this->hitEntity = NULL;
+  //this->hoverBuffer = NULL;
+
   //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
   this->setClassID(CL_HOVER, "Hover");
@@ -112,5 +137,5 @@
   this->cameraLook = 0.0f;
   this->rotation = 0.0f;
-  this->acceleration = 25.0f;
+  this->acceleration = 15.0f;
   this->airFriction = 3.0f;
 
@@ -206,4 +231,7 @@
   State::getCameraNode()->setRelCoorSoft(-10, 0,0);
   State::getCameraTargetNode()->setParentSoft(&this->cameraNode);
+
+  //this->soundSource.play(this->hoverBuffer, 0.3f, true);
+
 }
 
Index: trunk/src/world_entities/space_ships/hover.h
===================================================================
--- trunk/src/world_entities/space_ships/hover.h	(revision 9110)
+++ trunk/src/world_entities/space_ships/hover.h	(revision 9235)
@@ -7,4 +7,7 @@
 #ifndef _HOVER_H
 #define _HOVER_H
+
+//#include "sound_buffer.h"
+//#include "sound_source.h"
 
 #include "playable.h"
@@ -68,5 +71,8 @@
     float                 airViscosity;
 
-    WorldEntity* hitEntity;
+    WorldEntity*          hitEntity;
+
+    //OrxSound::SoundSource  soundSource;
+    //OrxSound::SoundBuffer* hoverBuffer;
 };
 
Index: trunk/src/world_entities/space_ships/space_ship.cc
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.cc	(revision 9110)
+++ trunk/src/world_entities/space_ships/space_ship.cc	(revision 9235)
@@ -58,4 +58,9 @@
 CREATE_SCRIPTABLE_CLASS(SpaceShip, CL_SPACE_SHIP,
                         addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer))
+                        ->addMethod("fire", ExecutorLua1<Playable, bool>(&Playable::fire))
+                        ->addMethod("loadModel", ExecutorLua2<WorldEntity,const std::string& ,float>(&WorldEntity::loadModel2))
+                        ->addMethod("setName", ExecutorLua1<BaseObject,const std::string&>(&BaseObject::setName))
+                        ->addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide))
+                        ->addMethod("unhide", ExecutorLua0<WorldEntity>(&WorldEntity::unhide))
                        //Coordinates
                         ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
@@ -352,5 +357,5 @@
 //     return;
 
-  // spaceship controlled movement
+  // spaceship controlled movement fire(bool bF){ this->bFire = bF;}
   //if (this->getOwner() == this->getHostID())
     this->calculateVelocity(time);
@@ -404,5 +409,5 @@
   Vector accel(0.0, 0.0, 0.0);
   /*
-  Vector rot(0.0, 0.0, 0.0); // wird benötigt für Helicopter
+  Vector rot(0.0, 0.0, 0.0); // wird ben�igt fr Helicopter
   */
   //float rotVal = 0.0;
@@ -513,5 +518,5 @@
 }
 
-void SpaceShip::destroy( )
+void SpaceShip::destroy( WorldEntity* killer )
 {
   PRINTF(0)("spaceship destroy\n");
Index: trunk/src/world_entities/space_ships/space_ship.h
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.h	(revision 9110)
+++ trunk/src/world_entities/space_ships/space_ship.h	(revision 9235)
@@ -37,5 +37,5 @@
     virtual void leftWorld();
     
-    virtual void destroy();
+    virtual void destroy(WorldEntity* killer);
     virtual void respawn();
 
Index: trunk/src/world_entities/space_ships/spacecraft_2d.cc
===================================================================
--- trunk/src/world_entities/space_ships/spacecraft_2d.cc	(revision 9110)
+++ trunk/src/world_entities/space_ships/spacecraft_2d.cc	(revision 9235)
@@ -35,14 +35,20 @@
 #include "debug.h"
 
+#include "script_class.h"
+
+
 CREATE_FACTORY(Spacecraft2D, CL_SPACECRAFT_2D);
 
-/**
- *  destructs the spacecraft_2d, deletes alocated memory
- */
-Spacecraft2D::~Spacecraft2D ()
-{
-  this->setPlayer(NULL);
-  delete this->toTravelHeight;
-}
+
+CREATE_SCRIPTABLE_CLASS(Spacecraft2D, CL_SPACECRAFT_2D,
+                        addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer))
+                        //Coordinates
+                        ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
+                        ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
+                        ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
+                        ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
+                        ->addMethod("setAirFriction", ExecutorLua1<Spacecraft2D, float>(&Spacecraft2D::setAirFriction))
+                       );
+
 
 /**
@@ -76,10 +82,16 @@
     this->loadParams(root);
 
+
+
   //weapons:
-  Weapon* wpRight = new TestGun(0);
-  wpRight->setName("testGun Right");
-  Weapon* wpLeft = new TestGun(1);
-  wpLeft->setName("testGun Left");
-  //Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_HYPERBLASTER));
+  Weapon* wpRight = dynamic_cast<Weapon*>(Factory::fabricate(CL_LASER_CANNON));
+  wpRight->setName("Cannon_Right");
+  Weapon* wpLeft = dynamic_cast<Weapon*>(Factory::fabricate(CL_LASER_CANNON));
+  wpLeft->setName("Cannon_Left");
+
+  Weapon* turretLeft = dynamic_cast<Weapon*>(Factory::fabricate(CL_BOOMERANG_GUN));
+  wpRight->setName("Turret_Left");
+  Weapon* turretRight = dynamic_cast<Weapon*>(Factory::fabricate(CL_BOOMERANG_GUN));
+  wpLeft->setName("Turret_Right");
 
   //  cannon->setName("BFG");
@@ -87,8 +99,21 @@
   this->addWeapon(wpLeft, 1, 0);
   this->addWeapon(wpRight,1 ,1);
+  this->addWeapon(turretLeft, 1, 2);
+  this->addWeapon(turretRight, 1, 3);
+
   //this->addWeapon(cannon, 0, 2);
 
   this->getWeaponManager().changeWeaponConfig(1);
   dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
+}
+
+
+/**
+ * @brief destructs the spacecraft_2d, deletes alocated memory
+ */
+Spacecraft2D::~Spacecraft2D ()
+{
+  this->setPlayer(NULL);
+  delete this->toTravelHeight;
 }
 
@@ -109,10 +134,12 @@
   this->cameraLook = 0.0f;
   this->rotation = 0.0f;
-  this->acceleration = 10.0f;
-  this->airFriction = 2.0f;
-
-
-  this->setHealthMax(100);
-  this->setHealth(100);
+  this->acceleration = 20.0f;
+  this->airFriction = 0.0f;
+
+
+  this->setHealthMax(1000);
+  this->setHealth(1000);
+  this->setDamage(100.0f);
+
 
 
@@ -122,4 +149,5 @@
   this->travelNode = new PNode();
 
+  this->loadModel("models/ships/mantawing.obj", 5.0f);
 
   // camera - issue
@@ -166,19 +194,16 @@
   this->getWeaponManager().setSlotCount(5);
 
-  this->getWeaponManager().setSlotPosition(0, Vector(-0.28, 1.186, -2.750));
+  this->getWeaponManager().setSlotPosition(0, Vector(1.843, -0.335, 2.029) * 5.0);
   this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
 
-  this->getWeaponManager().setSlotPosition(1, Vector(-0.28, 1.186, 2.750));
+  this->getWeaponManager().setSlotPosition(1, Vector(1.843, -0.335, -2.029) * 5.0);
   this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
 
-  this->getWeaponManager().setSlotPosition(2, Vector(-1.63, .809, -.003));
-  this->getWeaponManager().setSlotCapability(2, WTYPE_HEAVY);
-
   /// TODO: THESE ARE TOO MUCH
-  this->getWeaponManager().setSlotPosition(3, Vector(-1.63, .678, -.652));
-  this->getWeaponManager().setSlotDirection(3, Quaternion(-24/180 * M_PI, Vector(1,0,0)));
-
-  this->getWeaponManager().setSlotPosition(4, Vector(-1.63, .678, .652));
-  this->getWeaponManager().setSlotDirection(4, Quaternion(24/180 * M_PI, Vector(1,0,0)));
+  this->getWeaponManager().setSlotPosition(2, Vector(-0.351, -.238, 1.406) * 5.0);
+  this->getWeaponManager().setSlotDirection(2, Quaternion(-1.7, Vector(0,1,0)));
+
+  this->getWeaponManager().setSlotPosition(3, Vector(-0.351, -.238, -1.406) * 5.0);
+  this->getWeaponManager().setSlotDirection(3, Quaternion(1.7, Vector(0,1,0)));
 
   this->cameraNode.setRelCoor(1,5,0);
@@ -193,4 +218,7 @@
   registerVar( new SynchronizeableFloat( &cameraLook, &cameraLook, "cameraLook", PERMISSION_OWNER ) );
   registerVar( new SynchronizeableFloat( &rotation, &rotation, "rotation", PERMISSION_OWNER ) );
+
+
+
 }
 
@@ -285,7 +313,7 @@
 
         State::getCameraNode()->setParentSoft(this->travelNode);
-        State::getCameraNode()->setRelCoorSoft(-3, 50,0);
+        State::getCameraNode()->setRelCoorSoft(-3, 100,0);
         State::getCameraTargetNode()->setParentSoft(this->travelNode);
-        State::getCameraTargetNode()->setRelCoorSoft(0,0,0);
+        State::getCameraTargetNode()->setRelCoorSoft(5,0,1);
 
 
@@ -406,5 +434,5 @@
         if (this->toTravelHeight != NULL)
         {
-          this->travelNode->shiftCoor(Vector(0, (*toTravelHeight - this->travelNode->getAbsCoor().y) * dt, 0));
+          this->travelNode->shiftCoor(Vector(0, (*toTravelHeight - this->travelNode->getAbsCoor().y) * dt * 10.0, 0));
           if (fabsf(this->travelNode->getAbsCoor().y - *this->toTravelHeight) < .1)
           {
@@ -416,4 +444,5 @@
 
         accel.y = 0.0;
+
         Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration);
         accelerationDir.y = 0.0;
@@ -424,6 +453,21 @@
 
         this->velocity += (accelerationDir - damping)* dt;
+
+        if (this->getRelCoor().z > this->travelDistance.y && velocity.z > 0.0)
+          this->velocity.z = 0.0f;
+        if (this->getRelCoor().z < -this->travelDistance.y && velocity.z < 0.0)
+          this->velocity.z = 0.0f;
+
+        if (this->getRelCoor().x > this->travelDistance.x && velocity.x > 0.0)
+          this->velocity.x = 0.0f;
+        if (this->getRelCoor().x < -this->travelDistance.x && velocity.x < 0.0)
+          this->velocity.x = 0.0f;
+
+
         this->shiftCoor (this->velocity * dt);
-        this->setRelDirSoft(Quaternion(0, Vector(0,0,0)), 1.0f);
+        if (accel.z == 0)
+          this->setRelDirSoft(Quaternion(0, Vector(0,0,0)), 5.0f);
+        else
+          this->setRelDirSoft(Quaternion(this->velocity.z * .004, Vector(1,0,0)), 4.5f);
       }
       break;
@@ -475,5 +519,4 @@
       else if (cameraLook < -M_PI_4)
         cameraLook = -M_PI_4;
-      //this->cameraNode.setRelDirSoft(this->direction,10);
     }
   }
Index: trunk/src/world_entities/space_ships/spacecraft_2d.h
===================================================================
--- trunk/src/world_entities/space_ships/spacecraft_2d.h	(revision 9110)
+++ trunk/src/world_entities/space_ships/spacecraft_2d.h	(revision 9235)
@@ -27,4 +27,6 @@
     void setTravelDistance(const Vector2D& distance);
     void setTravelDistance(float x, float y);
+
+    void setAirFriction(float friction) { this->airFriction = friction; };
 
 
Index: trunk/src/world_entities/spawning_point.cc
===================================================================
--- trunk/src/world_entities/spawning_point.cc	(revision 9110)
+++ trunk/src/world_entities/spawning_point.cc	(revision 9235)
@@ -57,4 +57,6 @@
   
   MessageManager::getInstance()->registerMessageHandler( MSGID_RESPAWN, respawnMessageHandler, NULL );
+  
+  this->setSynchronized( true );
 }
 
@@ -102,4 +104,23 @@
 void SpawningPoint::spawn(Playable* entity)
 {
+  const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE );
+  
+  bool found = false;
+  
+  if ( !list )
+    return;
+    
+  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
+  {
+    if ( *it == entity )
+    {
+      found = true;
+      break;
+    }
+  }
+  
+  if ( !found )
+    return;
+
   PRINTF(0)("Spawningpoint spawns Entity (%s)\n", entity->getClassName());
 
@@ -137,5 +158,21 @@
       this->spawn(it->entity);
       
-      if ( SharedNetworkData::getInstance()->isGameServer() )
+      const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE );
+  
+      bool found = false;
+  
+      if ( !list )
+        return;
+    
+      for ( std::list<BaseObject*>::const_iterator it2 = list->begin(); it2 != list->end(); it2++ )
+      {
+        if ( *it2 == it->entity )
+        {
+          found = true;
+          break;
+        }
+      }
+  
+      if ( found && SharedNetworkData::getInstance()->isGameServer() )
         this->sendRespawnMessage( it->entity->getUniqueID() );
 
@@ -194,4 +231,6 @@
   assert( Converter::byteArrayToInt( data+INTSIZE, &uniqueId ) == INTSIZE );
   
+  PRINTF(0)("SPAWNMESSAGE %d\n", uniqueId);
+  
   SpawningPoint * sp = NULL;
   Playable      * playable = NULL;
@@ -203,5 +242,6 @@
     for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
     {
-      if ( dynamic_cast<SpawningPoint*>(*it)->getUniqueID() == uniqueId )
+      PRINTF(0)("%d:%d\n", dynamic_cast<SpawningPoint*>(*it)->getUniqueID(), spUniqueId);
+      if ( dynamic_cast<SpawningPoint*>(*it)->getUniqueID() == spUniqueId )
       {
         sp = dynamic_cast<SpawningPoint*>(*it);
@@ -213,5 +253,5 @@
   if ( !sp )
   {
-    PRINTF(2)("could not find spawning point\n");
+    PRINTF(0)("could not find spawning point\n");
     return false;
   }
@@ -233,5 +273,5 @@
   if ( !playable )
   {
-    PRINTF(2)("could not find playable\n");
+    PRINTF(0)("could not find playable\n");
     return false;
   }
Index: trunk/src/world_entities/test_entity.cc
===================================================================
--- trunk/src/world_entities/test_entity.cc	(revision 9110)
+++ trunk/src/world_entities/test_entity.cc	(revision 9235)
@@ -116,5 +116,5 @@
   if( this->lastCollided != entity)
   {
-    this->destroy();
+    this->destroy( entity );
     this->lastCollided = entity;
 
@@ -126,5 +126,5 @@
 
 
-void TestEntity::destroy()
+void TestEntity::destroy(WorldEntity* killer)
 {
   if( this->bDeath)
Index: trunk/src/world_entities/test_entity.h
===================================================================
--- trunk/src/world_entities/test_entity.h	(revision 9110)
+++ trunk/src/world_entities/test_entity.h	(revision 9235)
@@ -25,5 +25,5 @@
   void setAnim(int animationIndex, int animPlaybackMode);
 
-  virtual void destroy();
+  virtual void destroy(WorldEntity* killer);
 
   virtual void tick (float time);
Index: trunk/src/world_entities/weapons/aiming_system.cc
===================================================================
--- trunk/src/world_entities/weapons/aiming_system.cc	(revision 9235)
+++ trunk/src/world_entities/weapons/aiming_system.cc	(revision 9235)
@@ -0,0 +1,156 @@
+  /*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "aiming_system.h"
+
+#include "util/loading/load_param.h"
+
+#include "state.h"
+
+#include "aabb.h"
+#include "obb_tree.h"
+
+#include <vector>
+
+
+using namespace std;
+
+
+/**
+ * standart constructor
+ */
+AimingSystem::AimingSystem (WorldEntity* entity)
+  : WorldEntity()
+{
+  this->owner = entity;
+
+  this->init();
+}
+
+
+/**
+ * destroys a AimingSystem
+*/
+AimingSystem::~AimingSystem ()
+{}
+
+
+/**
+ * initializes the AimingSystem
+ */
+void AimingSystem::init()
+{
+  this->setClassID(CL_AIMING_SYSTEM, "AimingSystem");
+  this->setName("AimingSystem");
+
+  //this->loadModel("models/guns/targeting_system_body2.obj");
+//   this->loadModel("models/ships/fighter.obj");
+
+  // registering default reactions:
+  this->unsubscribeReaction(CREngine::CR_OBJECT_DAMAGE);
+  this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY);
+
+  this->range = 1000.0f;
+  this->sideLength = 2.0f;
+
+  // new obb tree
+  this->obbTree = new OBBTree();
+  this->obbTree->createBox(Vector(0.0f, 0.0f, 0.0f), Vector(this->range, this->sideLength, this->sideLength));
+  this->setOBBTree(this->obbTree);
+}
+
+
+
+/**
+ * get back the nearest target
+ * @returns the nerest target
+ */
+WorldEntity* AimingSystem::getNearestTarget()
+{
+  if( this->selectionList.size() == 0)
+    return NULL;
+
+
+  WorldEntity* nearestEntity     = NULL;
+  float        distance          = 0.0f;
+  float        smalestDistance   = this->range * 5.0f;
+
+
+  for( int i = 0; i < this->selectionList.size(); i++)
+  {
+    distance = fabs((this->getAbsCoor() - this->selectionList[i]->getAbsCoor()).len());
+    if( distance < smalestDistance)
+    {
+      nearestEntity = this->selectionList[i];
+      smalestDistance = distance;
+    }
+  }
+
+  PRINTF(0)("entity: %s\n", nearestEntity->getClassName());
+    return nearestEntity;
+}
+
+
+/**
+ * called when an object is "selected"
+ *  @param damage damage to be dealt
+ *  @param killer the entity
+ */
+void AimingSystem::hit(float damage, WorldEntity* killer)
+{
+  if( this->owner != killer)
+  {
+    PRINTF(0)("real hit: %s\n", killer->getClassName());
+    this->selectionList.push_back(killer);
+  }
+}
+
+
+
+/**
+ * ticks the AimingSystem
+ * @param dt the time to ticks
+ */
+void AimingSystem::tick(float dt)
+{
+
+
+}
+
+
+/**
+ * draws the crosshair
+ */
+void AimingSystem::draw() const
+{
+  WorldEntity::draw();
+
+//   glMatrixMode(GL_MODELVIEW);
+//   glPushMatrix();
+//
+//   /* translate */
+//   glTranslatef (this->getAbsCoor ().x,
+//                 this->getAbsCoor ().y,
+//                 this->getAbsCoor ().z);
+//   Vector tmpRot = this->getAbsDir().getSpacialAxis();
+//   glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+//
+//   this->obbTree->drawBV(0, 1);
+//
+//   glPopMatrix();
+
+}
Index: trunk/src/world_entities/weapons/aiming_system.h
===================================================================
--- trunk/src/world_entities/weapons/aiming_system.h	(revision 9235)
+++ trunk/src/world_entities/weapons/aiming_system.h	(revision 9235)
@@ -0,0 +1,53 @@
+/*!
+ * @file aiming_system.h
+ *  Definition of
+ */
+
+#ifndef _AIMING_SYSTEM_H
+#define _AIMING_SYSTEM_H
+
+
+#include "world_entity.h"
+
+
+
+// FORWARD DECLARATION
+class TiXmlElement;
+class BVTree;
+class Model;
+class OBBTree;
+
+
+class AimingSystem : public WorldEntity
+{
+
+ public:
+  AimingSystem(WorldEntity* owner = NULL);
+  virtual ~AimingSystem();
+
+  void init();
+
+  WorldEntity* getNearestTarget();
+  void flushList() { this->selectionList.clear(); }
+
+  void setRange(float range){this->range = range;};
+
+  virtual void hit(float damage, WorldEntity* killer);
+  virtual void destroy(WorldEntity* entity) {}
+
+  virtual void tick(float dt);
+  virtual void draw() const;
+
+
+ private:
+   float                       range;                //!<
+   float                       sideLength;
+   std::vector<WorldEntity*>   selectionList;        //!< the selections
+
+   WorldEntity*                owner;                //!< the owner of the targeting system
+
+   OBBTree*                    obbTree;
+
+};
+
+#endif /* _AIMING_SYSTEM_H */
Index: trunk/src/world_entities/weapons/boomerang_gun.cc
===================================================================
--- trunk/src/world_entities/weapons/boomerang_gun.cc	(revision 9235)
+++ trunk/src/world_entities/weapons/boomerang_gun.cc	(revision 9235)
@@ -0,0 +1,149 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Benjamin Grauer
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "boomerang_gun.h"
+
+#include "weapon_manager.h"
+#include "world_entities/projectiles/projectile.h"
+
+#include "model.h"
+
+#include "state.h"
+#include "animation3d.h"
+
+#include "util/loading/factory.h"
+
+CREATE_FACTORY(BoomerangGun, CL_BOOMERANG_GUN);
+
+
+/**
+ *  standard constructor
+ *
+ * creates a new BoomerangGun
+ */
+BoomerangGun::BoomerangGun ()
+  : Weapon()
+{
+  this->init();
+}
+
+/**
+ * creates a new BoomerangGun from a TiXmlElement
+ */
+BoomerangGun::BoomerangGun(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+BoomerangGun::~BoomerangGun ()
+{
+  // model will be deleted from WorldEntity-destructor
+}
+
+void BoomerangGun::init()
+{
+  this->setClassID(CL_BOOMERANG_GUN, "BoomerangGun");
+
+
+  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
+  Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);
+
+  animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+  animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);
+
+  animation1->setInfinity(ANIM_INF_CONSTANT);
+  animation2->setInfinity(ANIM_INF_CONSTANT);
+
+  this->setStateDuration(WS_SHOOTING, .6);
+  this->setStateDuration(WS_RELOADING, 1.0f);
+  this->setStateDuration(WS_ACTIVATING, .4);
+  this->setStateDuration(WS_DEACTIVATING, .4);
+
+  this->setEnergyMax(100);
+  this->increaseEnergy(100);
+  //this->minCharge = 2;
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
+  this->setProjectileType(CL_BOOMERANG_PROJECTILE);
+
+  this->loadModel("models/guns/turret1.obj", 5.0);
+
+  this->setEmissionPoint(1.684, 0.472, 0);
+  //this->getProjectileFactory()->prepare(100);
+
+  this->setActionSound(WA_SHOOT, "sound/explosions/explosion_3.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
+  this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
+
+}
+
+void BoomerangGun::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+}
+
+void BoomerangGun::activate()
+{
+}
+
+void BoomerangGun::deactivate()
+{
+}
+
+void BoomerangGun::tick(float dt)
+{
+  if (!Weapon::tickW(dt))
+    return;
+
+  Quaternion quat;
+  Vector direction;
+  if (this->getDefaultTarget() == NULL)
+    direction = this->getAbsCoor();
+  else
+    direction = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
+
+  direction.normalize();
+
+  if (likely (this->getParent() != NULL))
+    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+  else
+    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+
+  this->setAbsDirSoft(quat, 5);
+}
+
+void BoomerangGun::fire()
+{
+  Projectile* pj = this->getProjectile();
+  if (pj == NULL)
+    return;
+
+  pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 /*+ VECTOR_RAND(13) */
+            /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
+
+
+  pj->setParent(PNode::getNullParent());
+  pj->setAbsCoor(this->getEmissionPoint());
+  pj->setAbsDir(this->getAbsDir());
+  pj->activate();
+}
Index: trunk/src/world_entities/weapons/boomerang_gun.h
===================================================================
--- trunk/src/world_entities/weapons/boomerang_gun.h	(revision 9235)
+++ trunk/src/world_entities/weapons/boomerang_gun.h	(revision 9235)
@@ -0,0 +1,31 @@
+/*!
+ * @file turret.h
+*/
+
+
+#ifndef _BOOMERANG_GUN_H
+#define _BOOMERANG_GUN_H
+
+#include "weapon.h"
+
+class BoomerangGun : public Weapon
+  {
+  public:
+    BoomerangGun ();
+    BoomerangGun(const TiXmlElement* root);
+    virtual ~BoomerangGun ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick(float dt);
+    virtual void fire();
+
+
+  private:
+  };
+
+#endif /* _BOOMERANG_GUN_H */
Index: trunk/src/world_entities/weapons/fps_sniper_rifle.cc
===================================================================
--- trunk/src/world_entities/weapons/fps_sniper_rifle.cc	(revision 9110)
+++ trunk/src/world_entities/weapons/fps_sniper_rifle.cc	(revision 9235)
@@ -33,4 +33,6 @@
 #include "fps_sniper_rifle.h"
 
+
+#include "effects/explosion.h"
 
 using namespace std;
@@ -145,9 +147,12 @@
     return;
 
-  pj->setParent(PNode::getNullParent());
+//   Explosion::explode(this, Vector(0.1,0.1,0.1));
 
-  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*250 + VECTOR_RAND(5));
+  pj->setParent(this);
+  pj->setParentMode(PNODE_ROTATE_AND_MOVE);
 
-  pj->setAbsCoor(this->getEmissionPoint());
+  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*550 + VECTOR_RAND(5) );
+
+  pj->setAbsCoor(this->getEmissionPoint() + this->getAbsDirX() * 25.0f);
   pj->setAbsDir(this->getAbsDir());
   pj->activate();
Index: trunk/src/world_entities/weapons/laser_cannon.cc
===================================================================
--- trunk/src/world_entities/weapons/laser_cannon.cc	(revision 9235)
+++ trunk/src/world_entities/weapons/laser_cannon.cc	(revision 9235)
@@ -0,0 +1,130 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Patrick Boenzli
+   co-programmer:
+
+
+   @todo: direction in which the projectile flights
+   @todo: a target to set/hit
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "laser_cannon.h"
+#include "world_entities/projectiles/projectile.h"
+
+#include "world_entity.h"
+#include "static_model.h"
+#include "weapon_manager.h"
+#include "util/loading/factory.h"
+
+#include "animation3d.h"
+
+#include "fast_factory.h"
+
+CREATE_FACTORY(LaserCannon, CL_LASER_CANNON);
+
+
+LaserCannon::LaserCannon(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+LaserCannon::~LaserCannon ()
+{
+  // model will be deleted from WorldEntity-destructor
+}
+
+
+void LaserCannon::init()
+{
+  this->setClassID(CL_LASER_CANNON, "LaserCannon");
+
+//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/laser_cannon.obj", OBJ, RP_CAMPAIGN);
+
+  this->loadModel("models/guns/lasercannon.obj", 5.0f);
+
+  this->setStateDuration(WS_SHOOTING, .1);
+  this->setStateDuration(WS_RELOADING, .1);
+  this->setStateDuration(WS_ACTIVATING, .4);
+  this->setStateDuration(WS_DEACTIVATING, .4);
+
+  this->setEnergyMax(10000);
+  this->increaseEnergy(10000);
+  //this->minCharge = 2;
+
+  this->setActionSound(WA_SHOOT, "sound/laser.wav");
+  this->setActionSound(WA_ACTIVATE, "sound/voices/lasers.wav");
+
+
+  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
+  this->setProjectileType(CL_RAIL_PROJECTILE);
+  this->prepareProjectiles(100);
+  this->setEmissionPoint(Vector(2.8,0,0) * 5.0);
+}
+
+
+void LaserCannon::loadParams(const TiXmlElement* root)
+{
+  Weapon::loadParams(root);
+
+}
+
+
+/**
+ *  this activates the weapon
+
+   This is needed, since there can be more than one weapon on a ship. the
+   activation can be connected with an animation. for example the weapon is
+   been armed out.
+*/
+void LaserCannon::activate()
+{
+}
+
+
+/**
+ *  this deactivates the weapon
+
+   This is needed, since there can be more than one weapon on a ship. the
+   activation can be connected with an animation. for example the weapon is
+   been armed out.
+*/
+void LaserCannon::deactivate()
+{
+}
+
+
+/**
+ *  fires the weapon
+
+   this is called from the player.cc, when fire-button is been pushed
+   @todo: the ObjectManager deliveres Projectiles not TestBullets! this should be diffrent
+*/
+void LaserCannon::fire()
+{
+  Projectile* pj =  this->getProjectile();
+  if (pj == NULL)
+    return;
+
+  pj->setParent(PNode::getNullParent());
+
+  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*250 + VECTOR_RAND(5));
+
+  pj->setAbsCoor(this->getEmissionPoint());
+  pj->setAbsDir(this->getAbsDir());
+  pj->activate();
+}
Index: trunk/src/world_entities/weapons/laser_cannon.h
===================================================================
--- trunk/src/world_entities/weapons/laser_cannon.h	(revision 9235)
+++ trunk/src/world_entities/weapons/laser_cannon.h	(revision 9235)
@@ -0,0 +1,47 @@
+/*!
+    @file weapon.h
+  *  a weapon that a player can use
+
+    A Player has a list of weapons, that can be choosen to shoot projectiles
+    (projectiles.{cc,h}) at enemies. These weapons can be shooted sequentially
+    or (if able) combined. Therefore you can choose the weapon mode = choose
+    a weapon.
+
+    A weapon is characterized by:
+     o firing-rate: the initial firing rate of a weapon (1/s = Herz)
+     o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down!
+     o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile
+
+    Furthermore there are some other attributes, that will help to represent a firing
+    weapon in this world:
+     o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented
+     o shooting animation
+
+*/
+
+
+#ifndef _LASER_CANNON_H
+#define _LASER_CANNON_H
+
+#include "weapon.h"
+
+
+class LaserCannon : public Weapon
+  {
+  public:
+    LaserCannon (const TiXmlElement* root = NULL);
+    virtual ~LaserCannon ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void fire();
+
+  private:
+    PNode* objectComponent1;         //<! the gun is made of multiple parts, these PNodes represent their location and orientation
+  };
+
+#endif /* _LASER_CANNON_H */
Index: trunk/src/world_entities/world_entity.cc
===================================================================
--- trunk/src/world_entities/world_entity.cc	(revision 9110)
+++ trunk/src/world_entities/world_entity.cc	(revision 9235)
@@ -85,10 +85,10 @@
 
   this->toList(OM_NULL);
-  
+
   registerVar( new SynchronizeableString( &this->md2TextureFileName, &this->md2TextureFileName, "md2TextureFileName" ) );
   modelFileName_handle = registerVarId( new SynchronizeableString( &modelFileName, &modelFileName, "modelFileName" ) );
   scaling_handle = registerVarId( new SynchronizeableFloat( &scaling, &scaling, "scaling" ) );
   list_handle = registerVarId( new SynchronizeableInt( (int*)&objectListNumber, &list_write, "list" ) );
-  
+
   health_handle = registerVarId( new SynchronizeableFloat( &this->health, &this->health_write, "health" ) );
   healthMax_handle = registerVarId( new SynchronizeableFloat( &this->healthMax, &this->healthMax_write, "maxHealth" ) );
@@ -209,5 +209,5 @@
         this->buildObbTree(obbTreeDepth);
     }
-    else /*if(fileName.find(".md3") != std::string::npos)*/
+    else if(fileName.find(".md3") != std::string::npos)
     {
       PRINTF(4)("fetching MD3 file: %s\n", fileName.c_str());
@@ -414,4 +414,5 @@
 bool WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB)
 {
+  PRINTF(5)("registering collision of type: %s vs %s\n", entityA->getClassName(), entityB->getClassName());
   // is there any handler listening?
   if( !this->bReactive)
@@ -571,5 +572,7 @@
  */
 void WorldEntity::reset()
-{}
+{
+  this->setHealth( this->getHealthMax() );
+}
 
 /**
@@ -742,5 +745,5 @@
   this->decreaseHealth(damage);
 
-  PRINTF(0)("Hit me: %s now only %f/%f health\n", this->getClassName(), this->getHealth(), this->getHealthMax());
+  PRINTF(5)("Hit me: %s now only %f/%f health\n", this->getClassName(), this->getHealth(), this->getHealthMax());
 
   if( this->getHealth() > 0)
@@ -750,8 +753,5 @@
   else
   {
-    this->destroy();
-
-    if( State::getGameRules() != NULL)
-      State::getGameRules()->registerKill(Kill(killer, this));
+    this->destroy( killer );
   }
 }
@@ -761,5 +761,5 @@
  * destoys the world entity
  */
-void WorldEntity::destroy()
+void WorldEntity::destroy(WorldEntity* killer)
 {
   this->toList(OM_DEAD);
@@ -841,10 +841,10 @@
     this->toList( (OM_LIST)list_write );
   }
-  
+
   if ( std::find( id.begin(), id.end(), health_handle ) != id.end() )
   {
     this->setHealth( health_write );
   }
-  
+
   if ( std::find( id.begin(), id.end(), healthMax_handle ) != id.end() )
   {
Index: trunk/src/world_entities/world_entity.h
===================================================================
--- trunk/src/world_entities/world_entity.h	(revision 9110)
+++ trunk/src/world_entities/world_entity.h	(revision 9235)
@@ -47,4 +47,5 @@
 
   void loadModel(const std::string& fileName, float scaling = 1.0f, unsigned int modelNumber = 0, unsigned int obbTreeDepth = 4);
+  void loadModel2(const std::string& fileN, float scal = 1.0f){this->loadModel(fileN,scal,0,4);}
   void setModel(Model* model, unsigned int modelNumber = 0);
   Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
@@ -74,6 +75,7 @@
 /** @returns a reference to the obb tree of this worldentity */
   inline BVTree* getOBBTree() const { return this->obbTree; };
+  inline void setOBBTree(OBBTree* tree) { /*if( this->obbTree != NULL) delete this->obbTree;*/ this->obbTree = (BVTree*)tree; }
   void drawBVTree(int depth, int drawMode) const;
-  inline AABB* getModelAABB() { return (this->aabbNode)?this->aabbNode->getAABB():NULL;}
+  inline AABB* getModelAABB() const { return (this->aabbNode)?this->aabbNode->getAABB():NULL;}
 
   /* --- Collision Reaction Block --- */
@@ -101,5 +103,5 @@
   virtual void hit(float damage, WorldEntity* killer);
 
-  virtual void destroy();
+  virtual void destroy( WorldEntity* killer );
 
 
@@ -198,8 +200,8 @@
   int                     list_write;                      //!< entity's list
   int                     list_handle;                     //!< handle for list changes
-  
+
   float                   health_write;
   int                     health_handle;
-  
+
   float                   healthMax_write;
   int                     healthMax_handle;
