Index: /trunk/src/world_entities/npcs/npc.cc
===================================================================
--- /trunk/src/world_entities/npcs/npc.cc	(revision 10530)
+++ /trunk/src/world_entities/npcs/npc.cc	(revision 10531)
@@ -37,4 +37,7 @@
 #include "track/track.h"
 
+#include "particles/dot_emitter.h"
+#include "particles/emitter_node.h"
+#include "particles/sprite_particles.h"
 
 #include "weapons/test_gun.h"
@@ -67,4 +70,5 @@
                         ->addMethod("setAI", Executor1<NPC, lua_State*, bool>(&NPC::setAI))
                         ->addMethod("setVisibility", Executor1<WorldEntity, lua_State*, bool>(&WorldEntity::setVisibility))
+                        ->addMethod("destroy", Executor0<NPC, lua_State*/*, WorldEntity**/>(&NPC::destroy))
                        );
 
@@ -243,4 +247,57 @@
 }
 
+void NPC::destroy( /*WorldEntity* killer*/ )
+{
+
+  PRINTF(5)("NPC destroy\n");
+
+  EmitterNode* node  = NULL;
+  DotEmitter* emitter = NULL;
+  SpriteParticles*  explosionParticles  = NULL;
+
+  explosionParticles = new SpriteParticles(200);
+  explosionParticles->setName("SpaceShipExplosionParticles");
+  explosionParticles->setLifeSpan(.2, .3);
+  explosionParticles->setRadius(0.0, 10.0);
+  explosionParticles->setRadius(.5, 6.0);
+  explosionParticles->setRadius(1.0, 3.0);
+  explosionParticles->setColor(0.0, 1,1,1,.9);
+  explosionParticles->setColor(0.1,  1,1,0,.9);
+  explosionParticles->setColor(0.5, .8,.4,0,.5);
+  explosionParticles->setColor(1.0, .2,.2,.2,.5);
+
+
+  emitter = new DotEmitter( 2000, 70, 360);
+  //emitter->setSpread( 0, M_2_PI);
+  emitter->setEmissionRate( 200.0);
+  //emitter->setEmissionVelocity( 200.0);
+  //emitter->setSystem( explosionParticles);
+  //emitter->setAbsCoor( this->getAbsCoor());
+
+  node  = new EmitterNode( .1f);
+  node->setupParticle( emitter, explosionParticles);
+  node->setAbsDir( this->getAbsDir());
+  node->setVelocity( this->getVelocity() * .9f);
+  node->setAbsCoor( this->getAbsCoor());
+  if( !node->start())
+    PRINTF(0)("Explosion node not correctly started!");
+/*
+  PNode* node          = new PNode();
+  node->setAbsCoor(this->getAbsCoor());
+  Explosion* explosion = new Explosion();
+  explosion->explode( node, Vector(5,5,5));
+*/
+/*
+  if( this->hasPlayer())
+  {
+	this->setAbsCoor(Vector(-10000,10000,10000));
+	this->hide();
+  }
+  else
+  {*/
+    //this->setAbsCoor( this->getAbsCoor() + Vector(100,0,0) + Vector(1,0,0) * VECTOR_RAND(150).dot(Vector(1,0,0)));
+  //}
+
+}
 
 void NPC::setWeaponConfig(int i)
Index: /trunk/src/world_entities/npcs/npc.h
===================================================================
--- /trunk/src/world_entities/npcs/npc.h	(revision 10530)
+++ /trunk/src/world_entities/npcs/npc.h	(revision 10531)
@@ -35,4 +35,5 @@
   void setAI(bool activate);
   inline void enableAI(int flag) { this->bAIEnabled = (bool)flag; }
+  void destroy( /*WorldEntity* killer*/ );
 
 private:
Index: /trunk/src/world_entities/space_ships/space_ship.cc
===================================================================
--- /trunk/src/world_entities/space_ships/space_ship.cc	(revision 10530)
+++ /trunk/src/world_entities/space_ships/space_ship.cc	(revision 10531)
@@ -93,4 +93,5 @@
                         //->addMethod("setCameraSpeed", Executor1<SpaceShip, lua_State*, float>(&SpaceShip::setCameraSpeed))
                         ->addMethod("pause", Executor1<WorldEntity, lua_State*, bool>(&WorldEntity::pauseTrack))
+                        ->addMethod("setCameraDist", Executor1<SpaceShip, lua_State*, float>(&SpaceShip::setCameraDistance))
                        );
 
@@ -616,8 +617,10 @@
   {
     this->bRight = event.bPressed;
+    printf("ShipCoors: %f , %f, %f \n", this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z);
   }
   else if( event.type == KeyMapper::PEV_FORWARD)
   {
     this->bForward = event.bPressed; //this->shiftCoor(0,.1,0);
+
   }
   else if( event.type == KeyMapper::PEV_BACKWARD)
@@ -1141,10 +1144,22 @@
 void SpaceShip::setCameraDistance(float dist)
 {
-  State::getCamera()->setViewTopDistance(dist);
+     
+  CameraMan* cm = State::getCameraman();
+  Camera* c = cm->getCurrentCam();
+  c->setViewTopDistance(dist);
+  
+  if (this->hasPlayer())
+    this->isTravelDistanceInit = false;
 }
 
 void SpaceShip::setCameraFovy(float fovy)
 {
-  State::getCamera()->setViewTopFovy(fovy);
+     
+  CameraMan* cm = State::getCameraman();
+  Camera* c = cm->getCurrentCam();
+  c->setViewTopFovy(fovy);
+  
+  if (this->hasPlayer())
+    this->isTravelDistanceInit = false;
 }
 
@@ -1153,6 +1168,6 @@
      CameraMan* cm = State::getCameraman();
      Camera* c = cm->getCurrentCam();
-
-
+     
+     
   float x = 1.25 * this->actionWidthPercentage * fabsf(c->getAbsCoor().y) * tan(c->getFovy()*M_PI /360.0);
   float y = x / c->getAspectRatio() / this->actionWidthPercentage;
Index: /trunk/src/world_entities/space_ships/space_ship.h
===================================================================
--- /trunk/src/world_entities/space_ships/space_ship.h	(revision 10530)
+++ /trunk/src/world_entities/space_ships/space_ship.h	(revision 10531)
@@ -92,4 +92,6 @@
 
     virtual void hit(float damage, WorldEntity* killer);
+    
+    void                  setCameraDistance(float dist);
 
   private:
@@ -188,5 +190,5 @@
     float                 cameraSpeed;
 
-    void                  setCameraDistance(float dist);
+
     void                  setCameraFovy(float fovy);
 
