Index: /branches/playability/src/world_entities/projectiles/swarm_projectile.cc
===================================================================
--- /branches/playability/src/world_entities/projectiles/swarm_projectile.cc	(revision 10079)
+++ /branches/playability/src/world_entities/projectiles/swarm_projectile.cc	(revision 10080)
@@ -49,5 +49,4 @@
   this->lifeSpan = 4.0;
   this->agility = 3.5;
-  this->maxVelocity = 100;
 
   this->emitter = new DotEmitter(100, 5, M_2_PI);
@@ -55,5 +54,7 @@
   this->emitter->setSpread(M_PI, M_PI);
 
-  this->target = NULL;
+  this->turningSpeed = 30;
+
+  this->physDamage = 200;
 }
 
@@ -151,5 +152,11 @@
     this->destroy( entity );
   this->hitEntity = entity;
-  dynamic_cast<SpaceShip*>(entity)->damage(this->getDamage(),0);
+  dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),0);
+}
+
+
+void SwarmProjectile::setTarget(PNode* target)
+{
+    this->target = target;
 }
 
@@ -167,7 +174,8 @@
   if (unlikely(curDirection.len() == 0))
     return curDirection;
-  printf("recalculating direction\n");
-  float tmp = angleDeg ( curDirection, estTargetDir);
+  //printf("recalculating direction\n");
+  float tmp = angleRad ( curDirection, estTargetDir);
   if ( unlikely(tmp == 0) ) { return curDirection * maxVelocity / curDirection.len(); }
+//   printf("turning angle: %f\ntemp: %f\n", angle, tmp);
 
   if( fabsf(angle) >  fabsf(tmp) ) { angle = tmp; }
@@ -220,24 +228,24 @@
   this->shiftCoor(v);*/
 
-//   float projectileVelocity = this->getVelocity().len();
+  float projectileVelocity = this->getVelocity().len();
 //   if (target != NULL){
-//     float tti;  //Time To Impact
-// //     float targetVelocity = this->target->getVelocity().len();
-// // /*    if (unlikely(projectileVelocity == 0 && targetVelocity == 0)) // TODO calculate this reasonably*/
-//       tti = 1; // we do have a problem....
-// // //     else
-// // //       tti = (this->getAbsCoor() - this->target->getAbsCoor()).len() / sqrt ( projectileVelocity * projectileVelocity + targetVelocity * targetVelocity);
-//     Vector estTargetDir =  this->getAbsCoor() - this->target->getAbsCoor() + this->target->getVelocity() * (0.5);
-// //     this->setVelocity((this->getAbsCoor() - this->target->getAbsCoor()).getNormalized() * this->velocity.len());
-//     this->velocity = this->newDirection(this->velocity, estTargetDir, this->turningSpeed * time ) * this->maxVelocity;
+    float tti;  //Time To Impact
+    float targetVelocity = this->target->getVelocity().len();
+    if (unlikely(projectileVelocity == 0 && targetVelocity == 0)) // TODO calculate this reasonably
+      tti = 1; // we do have a problem....
+    else
+      tti = (this->getAbsCoor() - this->target->getAbsCoor()).len() / sqrt ( projectileVelocity * projectileVelocity + targetVelocity * targetVelocity);
+    Vector estTargetDir = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized() * maxVelocity;
+//     Vector estTargetDir = (this->target->getAbsCoor() - (Vector(2000, 30, 300) + VECTOR_RAND(20))).getNormalized() * projectileVelocity;
+    this->velocity = this->newDirection(this->velocity, estTargetDir, this->turningSpeed * time );
 //   }
 //   else
 //     if (likely(projectileVelocity != 0))
 //       this->velocity *= (this->maxVelocity / projectileVelocity); // set speed to max
-/*
-  Vector v = this->velocity + this->target->getAbsCoor() - this->getAbsCoor();
-  v.normalize();
-  v *= projectileVelocity;*/
-  this->shiftCoor(velocity * (time));
+
+//   printf("position: %f, %f, %f\n", this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z);
+//   printf("target position: %f, %f, %f\n", this->target->getAbsCoor().x, this->target->getAbsCoor().y, this->target->getAbsCoor().z);
+
+  this->shiftCoor(this->velocity * (time));
 
   if(this->tickLifeCycle(time))
@@ -287,3 +295,2 @@
 
 }
-
Index: /branches/playability/src/world_entities/projectiles/swarm_projectile.h
===================================================================
--- /branches/playability/src/world_entities/projectiles/swarm_projectile.h	(revision 10079)
+++ /branches/playability/src/world_entities/projectiles/swarm_projectile.h	(revision 10080)
@@ -32,4 +32,5 @@
     virtual void draw () const;
 
+    void setTarget(PNode* target);
 
   private:
@@ -45,6 +46,4 @@
     Vector                            correctionVector;
 
-    WorldEntity*                      target;
-
     WorldEntity* hitEntity; // FIXME TEMPORARY
 
Index: /branches/playability/src/world_entities/weapons/swarm_launcher.cc
===================================================================
--- /branches/playability/src/world_entities/weapons/swarm_launcher.cc	(revision 10079)
+++ /branches/playability/src/world_entities/weapons/swarm_launcher.cc	(revision 10080)
@@ -19,4 +19,5 @@
 #include "weapon_manager.h"
 #include "world_entities/projectiles/projectile.h"
+#include "world_entities/projectiles/swarm_projectile.h"
 
 #include "model.h"
@@ -158,5 +159,5 @@
       pj->setAbsCoor(this->getEmissionPoint());
       pj->setAbsDir(this->getAbsDir());
-      pj->setTarget( dynamic_cast<WorldEntity*>(*eIterator));
+      dynamic_cast<SwarmProjectile*>(pj)->setTarget( (PNode*)(*eIterator) );
       pj->activate();
 
