Index: /branches/world_entities/src/Makefile.am
===================================================================
--- /branches/world_entities/src/Makefile.am	(revision 5681)
+++ /branches/world_entities/src/Makefile.am	(revision 5682)
@@ -49,5 +49,6 @@
                   world_entities/player.cc \
                   world_entities/npc.cc \
-                  world_entities/npc2.cc \
+                  world_entities/npc_test1.cc \
+                  world_entities/npc_test.cc \
                   world_entities/environment.cc \
                   world_entities/skysphere.cc \
@@ -87,5 +88,5 @@
                  world_entities/player.h \
                  world_entities/npc.h \
-                 world_entities/npc2.h \
+                 world_entities/npc_test1.h \
                  world_entities/environment.h \
                  world_entities/skysphere.h \
Index: /branches/world_entities/src/Makefile.in
===================================================================
--- /branches/world_entities/src/Makefile.in	(revision 5681)
+++ /branches/world_entities/src/Makefile.in	(revision 5682)
@@ -57,8 +57,8 @@
 	orxonox-world.$(OBJEXT) orxonox-world_entity.$(OBJEXT) \
 	orxonox-camera.$(OBJEXT) orxonox-player.$(OBJEXT) \
-	orxonox-npc.$(OBJEXT) orxonox-npc2.$(OBJEXT) \
-	orxonox-environment.$(OBJEXT) orxonox-skysphere.$(OBJEXT) \
-	orxonox-skybox.$(OBJEXT) orxonox-terrain.$(OBJEXT) \
-	orxonox-satellite.$(OBJEXT) \
+	orxonox-npc.$(OBJEXT) orxonox-npc_test1.$(OBJEXT) \
+	orxonox-npc_test.$(OBJEXT) orxonox-environment.$(OBJEXT) \
+	orxonox-skysphere.$(OBJEXT) orxonox-skybox.$(OBJEXT) \
+	orxonox-terrain.$(OBJEXT) orxonox-satellite.$(OBJEXT) \
 	orxonox-character_attributes.$(OBJEXT) \
 	orxonox-test_entity.$(OBJEXT) orxonox-weapon_manager.$(OBJEXT) \
@@ -246,5 +246,6 @@
                   world_entities/player.cc \
                   world_entities/npc.cc \
-                  world_entities/npc2.cc \
+                  world_entities/npc_test1.cc \
+                  world_entities/npc_test.cc \
                   world_entities/environment.cc \
                   world_entities/skysphere.cc \
@@ -284,5 +285,5 @@
                  world_entities/player.h \
                  world_entities/npc.h \
-                 world_entities/npc2.h \
+                 world_entities/npc_test1.h \
                  world_entities/environment.h \
                  world_entities/skysphere.h \
@@ -418,5 +419,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-laser_power_up.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-npc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-npc2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-npc_test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-npc_test1.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-orxonox.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-player.Po@am__quote@
@@ -565,17 +567,31 @@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-npc.obj `if test -f 'world_entities/npc.cc'; then $(CYGPATH_W) 'world_entities/npc.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/npc.cc'; fi`
 
-orxonox-npc2.o: world_entities/npc2.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-npc2.o -MD -MP -MF "$(DEPDIR)/orxonox-npc2.Tpo" -c -o orxonox-npc2.o `test -f 'world_entities/npc2.cc' || echo '$(srcdir)/'`world_entities/npc2.cc; \
-@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-npc2.Tpo" "$(DEPDIR)/orxonox-npc2.Po"; else rm -f "$(DEPDIR)/orxonox-npc2.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/npc2.cc' object='orxonox-npc2.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-npc2.o `test -f 'world_entities/npc2.cc' || echo '$(srcdir)/'`world_entities/npc2.cc
-
-orxonox-npc2.obj: world_entities/npc2.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-npc2.obj -MD -MP -MF "$(DEPDIR)/orxonox-npc2.Tpo" -c -o orxonox-npc2.obj `if test -f 'world_entities/npc2.cc'; then $(CYGPATH_W) 'world_entities/npc2.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/npc2.cc'; fi`; \
-@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-npc2.Tpo" "$(DEPDIR)/orxonox-npc2.Po"; else rm -f "$(DEPDIR)/orxonox-npc2.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/npc2.cc' object='orxonox-npc2.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-npc2.obj `if test -f 'world_entities/npc2.cc'; then $(CYGPATH_W) 'world_entities/npc2.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/npc2.cc'; fi`
+orxonox-npc_test1.o: world_entities/npc_test1.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-npc_test1.o -MD -MP -MF "$(DEPDIR)/orxonox-npc_test1.Tpo" -c -o orxonox-npc_test1.o `test -f 'world_entities/npc_test1.cc' || echo '$(srcdir)/'`world_entities/npc_test1.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-npc_test1.Tpo" "$(DEPDIR)/orxonox-npc_test1.Po"; else rm -f "$(DEPDIR)/orxonox-npc_test1.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/npc_test1.cc' object='orxonox-npc_test1.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-npc_test1.o `test -f 'world_entities/npc_test1.cc' || echo '$(srcdir)/'`world_entities/npc_test1.cc
+
+orxonox-npc_test1.obj: world_entities/npc_test1.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-npc_test1.obj -MD -MP -MF "$(DEPDIR)/orxonox-npc_test1.Tpo" -c -o orxonox-npc_test1.obj `if test -f 'world_entities/npc_test1.cc'; then $(CYGPATH_W) 'world_entities/npc_test1.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/npc_test1.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-npc_test1.Tpo" "$(DEPDIR)/orxonox-npc_test1.Po"; else rm -f "$(DEPDIR)/orxonox-npc_test1.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/npc_test1.cc' object='orxonox-npc_test1.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-npc_test1.obj `if test -f 'world_entities/npc_test1.cc'; then $(CYGPATH_W) 'world_entities/npc_test1.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/npc_test1.cc'; fi`
+
+orxonox-npc_test.o: world_entities/npc_test.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-npc_test.o -MD -MP -MF "$(DEPDIR)/orxonox-npc_test.Tpo" -c -o orxonox-npc_test.o `test -f 'world_entities/npc_test.cc' || echo '$(srcdir)/'`world_entities/npc_test.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-npc_test.Tpo" "$(DEPDIR)/orxonox-npc_test.Po"; else rm -f "$(DEPDIR)/orxonox-npc_test.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/npc_test.cc' object='orxonox-npc_test.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-npc_test.o `test -f 'world_entities/npc_test.cc' || echo '$(srcdir)/'`world_entities/npc_test.cc
+
+orxonox-npc_test.obj: world_entities/npc_test.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-npc_test.obj -MD -MP -MF "$(DEPDIR)/orxonox-npc_test.Tpo" -c -o orxonox-npc_test.obj `if test -f 'world_entities/npc_test.cc'; then $(CYGPATH_W) 'world_entities/npc_test.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/npc_test.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-npc_test.Tpo" "$(DEPDIR)/orxonox-npc_test.Po"; else rm -f "$(DEPDIR)/orxonox-npc_test.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/npc_test.cc' object='orxonox-npc_test.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-npc_test.obj `if test -f 'world_entities/npc_test.cc'; then $(CYGPATH_W) 'world_entities/npc_test.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/npc_test.cc'; fi`
 
 orxonox-environment.o: world_entities/environment.cc
Index: /branches/world_entities/src/story_entities/world.cc
===================================================================
--- /branches/world_entities/src/story_entities/world.cc	(revision 5681)
+++ /branches/world_entities/src/story_entities/world.cc	(revision 5682)
@@ -70,6 +70,5 @@
 
 #include "cd_engine.h"
-#include "npc.h"
-#include "npc2.h"
+#include "npc_test1.h"
 #include "shader.h"
 
@@ -469,5 +468,5 @@
   for(int i = 0; i < 100; i++)
   {
-    WorldEntity* tmp = new NPC();
+    WorldEntity* tmp = new NPCTest1();
     char npcChar[10];
     sprintf (npcChar, "NPC_%d", i);
Index: /branches/world_entities/src/util/object_manager.h
===================================================================
--- /branches/world_entities/src/util/object_manager.h	(revision 5681)
+++ /branches/world_entities/src/util/object_manager.h	(revision 5682)
@@ -8,6 +8,16 @@
 
 #include "base_object.h"
+#include <list>
 
 // FORWARD DECLARATION
+
+
+class ObjectGroupList
+{
+
+
+
+};
+
 
 //! A default singleton class.
@@ -19,7 +29,14 @@
   inline static ObjectManager* getInstance(void) { if (!ObjectManager::singletonRef) ObjectManager::singletonRef = new ObjectManager();  return ObjectManager::singletonRef; };
 
+
+  ObjectGroupList* getGroupList( );
+
  private:
   ObjectManager(void);
   static ObjectManager* singletonRef;
+
+  std::list<ObjectGroupList>           groupList;
+
+
 };
 
Index: anches/world_entities/src/world_entities/npc2.cc
===================================================================
--- /branches/world_entities/src/world_entities/npc2.cc	(revision 5681)
+++ 	(revision )
@@ -1,120 +1,0 @@
-
-
-/*
-   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 "npc2.h"
-#include "obb_tree.h"
-
-#include "shader.h"
-#include "state.h"
-#include "list.h"
-#include "stdlibincl.h"
-#include "debug.h"
-
-
-using namespace std;
-
-
-NPC2::NPC2()
-{
-  this->setClassID(CL_NPC, "NPC");
-
-  if ((float)rand()/RAND_MAX > .5f)
-    this->loadModel("models/ships/bolido.obj", 3);
-  else
-    this->loadModel("models/ships/gobblin.obj", 3);
-
-  this->shader = NULL;
-  if (likely(Shader::checkShaderAbility()))
-    this->shader = Shader::getShader("shaders/toon.vert", "shaders/toon.frag");
-
-  this->obj = gluNewQuadric();
-
-  this->randomRotAxis = VECTOR_RAND(1);
-}
-
-
-NPC2::~NPC2 ()
-{
-  if (this->shader)
-    Shader::unload(this->shader);
-  gluDeleteQuadric(this->obj);
-}
-
-
-void NPC2::collidesWith(WorldEntity* entity, const Vector& location)
-{
-  if (entity->isA(CL_PROJECTILE))
-  {
-    PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);
-    this->applyForce(Vector(0,0,0)-location*1000);
-  }
-  else if (entity->isA(CL_PLAYER))
-    this->applyForce(Vector(0,0,0)-location*100);
-  else
-  {
-    this->setVisibiliy(false);
-   State::getWorldEntityList()->remove(this);
-  }
-}
-
-
-/**
- *  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 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);
-
-  if (this->shader != NULL && this->shader != Shader::getActiveShader())
-    shader->activateShader();
-  gluSphere(this->obj, 3, 10, 10);
-  shader->deactivateShader();
-
-
-/*  if (this->model)
-    this->model->draw();*/
-  glPopMatrix();
-}
-
-
-void NPC2::tick(float 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(dt, this->randomRotAxis));
-
-}
-
-
-
Index: anches/world_entities/src/world_entities/npc2.h
===================================================================
--- /branches/world_entities/src/world_entities/npc2.h	(revision 5681)
+++ 	(revision )
@@ -1,35 +1,0 @@
-
-#ifndef _NPC22_H
-#define _NPC2_H
-
-#include "world_entity.h"
-#include "physics_interface.h"
-
-#include "glincl.h"
-
-class AI;
-class Shader;
-
-class NPC2 : public WorldEntity, public PhysicsInterface {
-
- public:
-  NPC2 ();
-  ~NPC2 ();
-
-
-  void addAI(AI* ai);
-
-  virtual void tick(float dt);
-  virtual void draw() const;
-
-  virtual void collidesWith (WorldEntity* entity, const Vector& location);
-
-
- private:
-   Vector   randomRotAxis;
-   Shader*  shader;
-   GLUquadricObj* obj;
-
-};
-
-#endif /* _NPC2_H */
Index: /branches/world_entities/src/world_entities/npc_test.cc
===================================================================
--- /branches/world_entities/src/world_entities/npc_test.cc	(revision 5682)
+++ /branches/world_entities/src/world_entities/npc_test.cc	(revision 5682)
@@ -0,0 +1,120 @@
+
+
+/*
+   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 "npc_test.h"
+#include "obb_tree.h"
+
+#include "shader.h"
+#include "state.h"
+#include "list.h"
+#include "stdlibincl.h"
+#include "debug.h"
+
+
+using namespace std;
+
+
+NPC2::NPC2()
+{
+  this->setClassID(CL_NPC, "NPC");
+
+  if ((float)rand()/RAND_MAX > .5f)
+    this->loadModel("models/ships/bolido.obj", 3);
+  else
+    this->loadModel("models/ships/gobblin.obj", 3);
+
+  this->shader = NULL;
+  if (likely(Shader::checkShaderAbility()))
+    this->shader = Shader::getShader("shaders/toon.vert", "shaders/toon.frag");
+
+  this->obj = gluNewQuadric();
+
+  this->randomRotAxis = VECTOR_RAND(1);
+}
+
+
+NPC2::~NPC2 ()
+{
+  if (this->shader)
+    Shader::unload(this->shader);
+  gluDeleteQuadric(this->obj);
+}
+
+
+void NPC2::collidesWith(WorldEntity* entity, const Vector& location)
+{
+  if (entity->isA(CL_PROJECTILE))
+  {
+    PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);
+    this->applyForce(Vector(0,0,0)-location*1000);
+  }
+  else if (entity->isA(CL_PLAYER))
+    this->applyForce(Vector(0,0,0)-location*100);
+  else
+  {
+    this->setVisibiliy(false);
+   State::getWorldEntityList()->remove(this);
+  }
+}
+
+
+/**
+ *  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 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);
+
+  if (this->shader != NULL && this->shader != Shader::getActiveShader())
+    shader->activateShader();
+  gluSphere(this->obj, 3, 10, 10);
+  shader->deactivateShader();
+
+
+/*  if (this->model)
+    this->model->draw();*/
+  glPopMatrix();
+}
+
+
+void NPC2::tick(float 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(dt, this->randomRotAxis));
+
+}
+
+
+
Index: /branches/world_entities/src/world_entities/npc_test.h
===================================================================
--- /branches/world_entities/src/world_entities/npc_test.h	(revision 5682)
+++ /branches/world_entities/src/world_entities/npc_test.h	(revision 5682)
@@ -0,0 +1,35 @@
+
+#ifndef _NPC22_H
+#define _NPC2_H
+
+#include "world_entity.h"
+#include "physics_interface.h"
+
+#include "glincl.h"
+
+class AI;
+class Shader;
+
+class NPC2 : public WorldEntity, public PhysicsInterface {
+
+ public:
+  NPC2 ();
+  ~NPC2 ();
+
+
+  void addAI(AI* ai);
+
+  virtual void tick(float dt);
+  virtual void draw() const;
+
+  virtual void collidesWith (WorldEntity* entity, const Vector& location);
+
+
+ private:
+   Vector   randomRotAxis;
+   Shader*  shader;
+   GLUquadricObj* obj;
+
+};
+
+#endif /* _NPC2_H */
Index: /branches/world_entities/src/world_entities/npc_test1.cc
===================================================================
--- /branches/world_entities/src/world_entities/npc_test1.cc	(revision 5682)
+++ /branches/world_entities/src/world_entities/npc_test1.cc	(revision 5682)
@@ -0,0 +1,91 @@
+
+
+/*
+   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 "npc_test1.h"
+#include "obb_tree.h"
+
+#include "state.h"
+#include "list.h"
+#include "stdlibincl.h"
+#include "power_ups/turret_power_up.h"
+#include "power_ups/laser_power_up.h"
+
+using namespace std;
+
+
+NPCTest1::NPCTest1()
+{
+  this->setClassID(CL_NPC, "NPCTest1");
+
+  if ((float)rand()/RAND_MAX > .5f)
+    this->loadModel("models/ships/bolido.obj", 2);
+  else
+    this->loadModel("models/ships/gobblin.obj", 2);
+
+  this->randomRotAxis =  VECTOR_RAND(1);
+}
+
+
+NPCTest1::~NPCTest1 () {}
+
+
+void NPCTest1::collidesWith(WorldEntity* entity, const Vector& location)
+{
+  if (entity->isA(CL_PROJECTILE) && entity != this->collider)
+  {
+//    PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getName(), entity->getName(), location.x, location.y, location.z);
+//    this->applyForce(Vector(0,0,0)-location*1000);
+    if ((float)rand()/RAND_MAX < .3)
+    {
+      WorldEntity* powerUp = new TurretPowerUp();
+      powerUp->setAbsCoor(this->getAbsCoor());
+      State::getWorldEntityList()->add(powerUp);
+    }
+    else if ((float)rand()/RAND_MAX < .3)
+    {
+      WorldEntity* powerUp = new LaserPowerUp();
+      powerUp->setAbsCoor(this->getAbsCoor());
+      State::getWorldEntityList()->add(powerUp);
+    }
+    State::getWorldEntityList()->remove(this);
+
+      this->collider = entity;
+  }
+  else if (entity->isA(CL_PLAYER))
+    this->applyForce(Vector(0,0,0)-location*100);
+  else if (entity->isA(CL_NPC))
+  {
+    this->setVisibiliy(false);
+    State::getWorldEntityList()->remove(this);
+  }
+}
+
+
+void NPCTest1::tick(float 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(dt, this->randomRotAxis));
+
+}
+
+
+
