Index: trunk/src/world_entities/projectiles/hyperblast.cc
===================================================================
--- trunk/src/world_entities/projectiles/hyperblast.cc	(revision 6810)
+++ trunk/src/world_entities/projectiles/hyperblast.cc	(revision 6810)
@@ -0,0 +1,176 @@
+/*
+   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 "hyperblast.h"
+
+#include "fast_factory.h"
+
+#include "state.h"
+#include "class_list.h"
+
+#include "particle_emitter.h"
+#include "sprite_particles.h"
+#include "spark_particles.h"
+
+
+using namespace std;
+
+CREATE_FAST_FACTORY_STATIC(Hyperblast, CL_HYPERBLAST);
+
+/**
+ *  standard constructor
+*/
+Hyperblast::Hyperblast () : Projectile()
+{
+  this->setClassID(CL_HYPERBLAST, "Hyperblast");
+
+  float modelSize = .3;
+  this->loadModel("models/projectiles/orx-hyperblast.obj", .3);
+
+  this->setMinEnergy(1);
+  this->setHealthMax(10);
+  this->lifeSpan = 5;
+
+  this->emitter = new ParticleEmitter(Vector(0,1,0), M_2_PI, 100, 5);
+  this->emitter->setParent(this);
+  this->emitter->setSpread(M_PI, M_PI);
+}
+
+
+/**
+ *  standard deconstructor
+*/
+Hyperblast::~Hyperblast ()
+{
+  /* this is normaly done by World.cc by deleting the ParticleEngine */
+  if (Hyperblast::extParticles != NULL && ClassList::getList(CL_HYPERBLAST)->size() <= 1)
+  {
+    Hyperblast::extParticles = NULL;
+  }
+  if (Hyperblast::explosionParticles != NULL && ClassList::getList(CL_HYPERBLAST)->size() <= 1)
+  {
+    Hyperblast::explosionParticles = NULL;
+  }
+
+}
+
+SpriteParticles* Hyperblast::extParticles = NULL;
+SparkParticles* Hyperblast::explosionParticles = NULL;
+
+void Hyperblast::activate()
+{
+  if (unlikely(Hyperblast::extParticles == NULL))
+  {
+    Hyperblast::extParticles = new SpriteParticles(2000);
+    Hyperblast::extParticles->setName("HyperblastTrailParticles");
+    Hyperblast::extParticles->setMaterialTexture("maps/radial-trans-noise.png");
+    Hyperblast::extParticles->setLifeSpan(1.0, .3);
+    Hyperblast::extParticles->setRadius(0.0, .5);
+    Hyperblast::extParticles->setRadius(0.2, 2.0);
+    Hyperblast::extParticles->setRadius(.5, .8);
+    Hyperblast::extParticles->setRadius(1.0, .8);
+    Hyperblast::extParticles->setColor(0.0, 1,0,0,.7);
+    Hyperblast::extParticles->setColor(0.2, .8,.8,0,.5);
+    Hyperblast::extParticles->setColor(0.5, .8,.8,.8,.8);
+    Hyperblast::extParticles->setColor(1.0, .8,.8,.8,.0);
+  }
+  if (unlikely(Hyperblast::explosionParticles == NULL))
+  {
+    Hyperblast::explosionParticles = new SparkParticles(200);
+    Hyperblast::explosionParticles->setName("HyperblastExplosionParticles");
+    Hyperblast::explosionParticles->setLifeSpan(.5, .3);
+    Hyperblast::explosionParticles->setRadius(0.0, 10);
+    Hyperblast::explosionParticles->setRadius(.5, 15.0);
+    Hyperblast::explosionParticles->setRadius(1.0, 10.0);
+    Hyperblast::explosionParticles->setColor(0.0, 0,1,0,1);
+    Hyperblast::explosionParticles->setColor(0.5, .8,.8,0,.8);
+    Hyperblast::explosionParticles->setColor(0.8, .8,.8,.3,.8);
+    Hyperblast::explosionParticles->setColor(1.0, 1,1,1,.0);
+  }
+
+  this->emitter->setSystem(Hyperblast::extParticles);
+
+  this->updateNode(0);
+  this->emitter->setEmissionRate(45.0);
+  this->emitter->setEmissionVelocity(0.0);
+}
+
+
+void Hyperblast::deactivate()
+{
+  this->emitter->setSystem(NULL);
+  this->lifeCycle = 0.0;
+  this->toList(OM_NULL);
+
+//  GarbageCollector::getInstance()->collect(this);
+  this->toList(OM_DEAD);
+  Hyperblast::fastFactory->kill(this);
+}
+
+
+void Hyperblast::collidesWith(WorldEntity* entity, const Vector& location)
+{
+  if (this->hitEntity != entity)
+    this->destroy();
+  this->hitEntity = entity;
+}
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param time since last tick
+*/
+void Hyperblast::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 Hyperblast::destroy ()
+{
+  PRINTF(5)("DESTROY Hyperblast\n");
+  this->lifeCycle = .95; //!< @todo calculate this usefully.
+  this->emitter->setSystem(Hyperblast::explosionParticles);
+
+  this->emitter->setEmissionRate(1000.0);
+  this->emitter->setEmissionVelocity(50.0);
+//  this->deactivate();
+
+}
+
+
+void Hyperblast::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/hyperblast.h
===================================================================
--- trunk/src/world_entities/projectiles/hyperblast.h	(revision 6810)
+++ trunk/src/world_entities/projectiles/hyperblast.h	(revision 6810)
@@ -0,0 +1,46 @@
+/*!
+ * @file hyperblast.h
+ * @brief a Hyperblast Projectile
+*/
+
+#ifndef _HYPERBLAST_H
+#define _HYPERBLAST_H
+
+#include "projectile.h"
+
+class Vector;
+class Weapon;
+class SpriteParticles;
+class SparkParticles;
+class ParticleEmitter;
+class FastFactory;
+
+class Hyperblast : public Projectile
+{
+  public:
+    Hyperblast ();
+    virtual ~Hyperblast ();
+
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void collidesWith(WorldEntity* entity, const Vector& location);
+
+    virtual void destroy ();
+
+    virtual void tick (float time);
+    virtual void draw () const;
+
+
+  private:
+    static FastFactory*               fastFactory;
+    static SpriteParticles*           extParticles;
+    static SparkParticles*            explosionParticles;
+
+    ParticleEmitter*                  emitter;
+
+    WorldEntity* hitEntity; // FIXME TEMPORARY
+};
+
+#endif /* _HYPERBLAST_H */
