Index: branches/presentation/src/defs/class_id.h
===================================================================
--- branches/presentation/src/defs/class_id.h	(revision 9216)
+++ branches/presentation/src/defs/class_id.h	(revision 9217)
@@ -222,4 +222,5 @@
   CL_FPS_SNIPER_RIFLE           =    0x000003a7,
   CL_FPS_LASER_RIFLE            =    0x000003a8,
+  CL_BOOMERANG_GUN              =    0x00000309,
 
   // Projectiles
@@ -233,4 +234,5 @@
   CL_GUIDED_MISSILE             =    0x000003e7,
   CL_HYPERBLAST                 =    0x000003e8,
+  CL_BOOMERANG_PROJECTILE       =    0x00000309,
 
   // NPC's
Index: branches/presentation/src/world_entities/WorldEntities.am
===================================================================
--- branches/presentation/src/world_entities/WorldEntities.am	(revision 9216)
+++ branches/presentation/src/world_entities/WorldEntities.am	(revision 9217)
@@ -33,4 +33,5 @@
                 world_entities/weapons/aiming_system.cc \
                 world_entities/weapons/fps_sniper_rifle.cc \
+                world_entities/weapons/boomerang_gun.cc \
                 \
                 world_entities/projectiles/bomb.cc \
@@ -40,4 +41,5 @@
                 world_entities/projectiles/rocket.cc \
                 world_entities/projectiles/guided_missile.cc \
+                world_entities/projectiles/boomerang_projectile.cc \
                 world_entities/projectiles/hyperblast.cc \
                 \
@@ -100,4 +102,5 @@
                 weapons/aiming_turret.h \
                 weapons/targeting_turret.h \
+                weapons/boomerang_gun.h \
                 weapons/aim.h \
                 weapons/aiming_system.h \
@@ -110,4 +113,5 @@
                 projectiles/rocket.h \
                 projectiles/guided_missile.h \
+                projectiles/boomerang_projectile.h \
                 projectiles/hyperblast.h \
                 \
Index: branches/presentation/src/world_entities/projectiles/boomerang_projectile.cc
===================================================================
--- branches/presentation/src/world_entities/projectiles/boomerang_projectile.cc	(revision 9217)
+++ branches/presentation/src/world_entities/projectiles/boomerang_projectile.cc	(revision 9217)
@@ -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 = 4.0;
+  this->agility = 3.5;
+  this->maxVelocity = 75;
+
+  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: branches/presentation/src/world_entities/projectiles/boomerang_projectile.h
===================================================================
--- branches/presentation/src/world_entities/projectiles/boomerang_projectile.h	(revision 9217)
+++ branches/presentation/src/world_entities/projectiles/boomerang_projectile.h	(revision 9217)
@@ -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: branches/presentation/src/world_entities/weapons/boomerang_gun.cc
===================================================================
--- branches/presentation/src/world_entities/weapons/boomerang_gun.cc	(revision 9217)
+++ branches/presentation/src/world_entities/weapons/boomerang_gun.cc	(revision 9217)
@@ -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_BOMMERANG_GUN);
+  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: branches/presentation/src/world_entities/weapons/boomerang_gun.h
===================================================================
--- branches/presentation/src/world_entities/weapons/boomerang_gun.h	(revision 9217)
+++ branches/presentation/src/world_entities/weapons/boomerang_gun.h	(revision 9217)
@@ -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 */
