Index: trunk/src/world_entities/creatures/fps_player.cc
===================================================================
--- trunk/src/world_entities/creatures/fps_player.cc	(revision 9928)
+++ trunk/src/world_entities/creatures/fps_player.cc	(revision 10013)
@@ -167,5 +167,5 @@
 
     //subscribe to collision reaction
-  this->subscribeReaction(CREngine::CR_PHYSICS_FULL_WALK, BspEntity::staticClassID());
+  this->subscribeReaction(CoRe::CREngine::CR_PHYSICS_FULL_WALK, BspEntity::staticClassID());
 
   this->initWeapon = false;
Index: trunk/src/world_entities/npcs/attractor_mine.cc
===================================================================
--- trunk/src/world_entities/npcs/attractor_mine.cc	(revision 9928)
+++ trunk/src/world_entities/npcs/attractor_mine.cc	(revision 10013)
@@ -62,4 +62,5 @@
 
   this->setDamage(30.0f);
+  this->subscribeReaction(CoRe::CREngine::CR_OBJECT_DAMAGE, Playable::staticClassID());
 
 
Index: trunk/src/world_entities/npcs/generic_npc.cc
===================================================================
--- trunk/src/world_entities/npcs/generic_npc.cc	(revision 9928)
+++ trunk/src/world_entities/npcs/generic_npc.cc	(revision 10013)
@@ -96,5 +96,5 @@
 
   // collision reaction registration
-  this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, BspEntity::staticClassID());
+  this->subscribeReaction(CoRe::CREngine::CR_PHYSICS_GROUND_WALK, BspEntity::staticClassID());
 }
 
Index: trunk/src/world_entities/projectiles/projectile.cc
===================================================================
--- trunk/src/world_entities/projectiles/projectile.cc	(revision 9928)
+++ trunk/src/world_entities/projectiles/projectile.cc	(revision 10013)
@@ -23,4 +23,5 @@
 #include "model.h"
 #include "sound/resource_sound_buffer.h"
+#include "playable.h"
 
 #include "debug.h"
@@ -43,4 +44,5 @@
   this->setHealth(1.0f);
   this->setDamage(1.0f); // default damage of a projectile set to 100.0 damage points
+  this->subscribeReaction( CoRe::CREngine::CR_PHYSICS_FULL_WALK, Playable::staticClassID());
 
   //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
Index: trunk/src/world_entities/space_ships/spacecraft_2d.cc
===================================================================
--- trunk/src/world_entities/space_ships/spacecraft_2d.cc	(revision 9928)
+++ trunk/src/world_entities/space_ships/spacecraft_2d.cc	(revision 10013)
@@ -221,5 +221,6 @@
   registerVar( new SynchronizeableFloat( &rotation, &rotation, "rotation", PERMISSION_OWNER ) );
 
-
+  this->setDamage( 1000.0f);
+  this->subscribeReaction(CoRe::CREngine::CR_OBJECT_DAMAGE, WorldEntity::staticClassID());
 
 }
Index: trunk/src/world_entities/weapons/aiming_system.cc
===================================================================
--- trunk/src/world_entities/weapons/aiming_system.cc	(revision 9928)
+++ trunk/src/world_entities/weapons/aiming_system.cc	(revision 10013)
@@ -61,6 +61,6 @@
 
   // registering default reactions:
-  this->unsubscribeReaction(CREngine::CR_OBJECT_DAMAGE);
-  this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, WorldEntity::staticClassID());
+  this->unsubscribeReaction(CoRe::CREngine::CR_OBJECT_DAMAGE);
+  this->subscribeReaction(CoRe::CREngine::CR_OBJECT_DAMAGE, WorldEntity::staticClassID());
 
   this->range = 1000.0f;
Index: trunk/src/world_entities/world_entity.cc
===================================================================
--- trunk/src/world_entities/world_entity.cc	(revision 9928)
+++ trunk/src/world_entities/world_entity.cc	(revision 10013)
@@ -35,5 +35,5 @@
 #include "camera.h"
 
-#include "collision_handle.h"
+#include "collision_filter.h"
 #include "collision_event.h"
 #include "game_rules.h"
@@ -58,5 +58,5 @@
  */
 WorldEntity::WorldEntity()
-    : Synchronizeable()
+  : Synchronizeable(), _collisionFilter(this)
 {
   this->registerObject(this, WorldEntity::_objectList);
@@ -77,22 +77,18 @@
   this->lastObjectListNumber = OM_INIT;
 
-  // reset all collision handles to NULL == unsubscribed state
-  for(int i = 0; i < CREngine::CR_NUMBER; ++i)
-    this->collisionHandles[i] = NULL;
-  this->bReactive = false;
-  this->bOnGround = false;
+  this->_bOnGround = false;
 
   // registering default reactions:
-  this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, /* WorldEntity::staticClassID(), */ Projectile::staticClassID());
+  this->subscribeReaction(CoRe::CREngine::CR_OBJECT_DAMAGE, Projectile::staticClassID());
 
   this->toList(OM_NULL);
 
-  registerVar( new SynchronizeableString( &this->md2TextureFileName, &this->md2TextureFileName, "md2TextureFileName", PERMISSION_MASTER_SERVER ) );
-  modelFileName_handle = registerVarId( new SynchronizeableString( &modelFileName, &modelFileName, "modelFileName", PERMISSION_MASTER_SERVER ) );
-  scaling_handle = registerVarId( new SynchronizeableFloat( &scaling, &scaling, "scaling", PERMISSION_MASTER_SERVER ) );
-  list_handle = registerVarId( new SynchronizeableInt( (int*)&objectListNumber, &list_write, "list", PERMISSION_MASTER_SERVER ) );
-
-  health_handle = registerVarId( new SynchronizeableFloat( &this->health, &this->health_write, "health", PERMISSION_MASTER_SERVER ) );
-  healthMax_handle = registerVarId( new SynchronizeableFloat( &this->healthMax, &this->healthMax_write, "maxHealth", PERMISSION_MASTER_SERVER ) );
+  this->registerVar( new SynchronizeableString( &this->md2TextureFileName, &this->md2TextureFileName, "md2TextureFileName", PERMISSION_MASTER_SERVER ) );
+  this->modelFileName_handle = registerVarId( new SynchronizeableString( &modelFileName, &modelFileName, "modelFileName", PERMISSION_MASTER_SERVER ) );
+  this->scaling_handle = registerVarId( new SynchronizeableFloat( &scaling, &scaling, "scaling", PERMISSION_MASTER_SERVER ) );
+  this->list_handle = registerVarId( new SynchronizeableInt( (int*)&objectListNumber, &list_write, "list", PERMISSION_MASTER_SERVER ) );
+
+  this->health_handle = registerVarId( new SynchronizeableFloat( &this->health, &this->health_write, "health", PERMISSION_MASTER_SERVER ) );
+  this->healthMax_handle = registerVarId( new SynchronizeableFloat( &this->healthMax, &this->healthMax_write, "maxHealth", PERMISSION_MASTER_SERVER ) );
 }
 
@@ -115,5 +111,5 @@
     delete this->healthWidget;
 
-  this->unsubscribeReaction();
+  this->unsubscribeReactions();
 }
 
@@ -302,10 +298,7 @@
  *  @param target1 a filter target (classID)
  */
-void WorldEntity::subscribeReaction(CREngine::CRType type, const ClassID& target1)
-{
-  this->subscribeReaction(type);
-
-  // add the target filter
-  this->collisionHandles[type]->addTarget(target1);
+void WorldEntity::subscribeReaction(CoRe::CREngine::ReactionType type, const ClassID& target1)
+{
+  this->_collisionFilter.subscribeReaction(type, target1);
 }
 
@@ -316,11 +309,7 @@
  *  @param target1 a filter target (classID)
  */
-void WorldEntity::subscribeReaction(CREngine::CRType type, const ClassID& target1, const ClassID& target2)
-{
-  this->subscribeReaction(type);
-
-  // add the target filter
-  this->collisionHandles[type]->addTarget(target1);
-  this->collisionHandles[type]->addTarget(target2);
+void WorldEntity::subscribeReaction(CoRe::CREngine::ReactionType type, const ClassID& target1, const ClassID& target2)
+{
+  this->_collisionFilter.subscribeReaction(type, target1, target2);
 }
 
@@ -331,50 +320,7 @@
  *  @param target1 a filter target (classID)
  */
-void WorldEntity::subscribeReaction(CREngine::CRType type, const ClassID& target1, const ClassID& target2, const ClassID& target3)
-{
-  this->subscribeReaction(type);
-
-  // add the target filter
-  this->collisionHandles[type]->addTarget(target1);
-  this->collisionHandles[type]->addTarget(target2);
-  this->collisionHandles[type]->addTarget(target3);
-}
-
-
-/**
- * subscribes this world entity to a collision reaction
- *  @param type the type of reaction to subscribe to
- *  @param target1 a filter target (classID)
- */
-void WorldEntity::subscribeReaction(CREngine::CRType type, const ClassID& target1, const ClassID& target2, const ClassID& target3, const ClassID& target4)
-{
-  this->subscribeReaction(type);
-
-  // add the target filter
-  this->collisionHandles[type]->addTarget(target1);
-  this->collisionHandles[type]->addTarget(target2);
-  this->collisionHandles[type]->addTarget(target3);
-  this->collisionHandles[type]->addTarget(target4);
-}
-
-
-/**
- * subscribes this world entity to a collision reaction
- *  @param type the type of reaction to subscribe to
- *  @param nrOfTargets number of target filters
- *  @param ... the targets as classIDs
- */
-void WorldEntity::subscribeReaction(CREngine::CRType type)
-{
-  if( this->collisionHandles[type] != NULL)
-  {
-    PRINTF(2)("Registering for a CollisionReaction already subscribed to! Skipping\n");
-    return;
-  }
-
-  this->collisionHandles[type] = CREngine::getInstance()->subscribeReaction(this, type);
-
-  // now there is at least one collision reaction subscribed
-  this->bReactive = true;
+void WorldEntity::subscribeReaction(CoRe::CREngine::ReactionType type, const ClassID& target1, const ClassID& target2, const ClassID& target3)
+{
+  this->_collisionFilter.subscribeReaction(type, target1, target2, target3);
 }
 
@@ -384,22 +330,7 @@
  *  @param type the reaction to unsubscribe
  */
-void WorldEntity::unsubscribeReaction(CREngine::CRType type)
-{
-  if( this->collisionHandles[type] == NULL)
-    return;
-
-  CREngine::getInstance()->unsubscribeReaction(this->collisionHandles[type]);
-  this->collisionHandles[type] = NULL;
-
-  // check if there is still any handler registered
-  for(int i = 0; i < CREngine::CR_NUMBER; ++i)
-  {
-    if( this->collisionHandles[i] != NULL)
-    {
-      this->bReactive = true;
-      return;
-    }
-  }
-  this->bReactive = false;
+void WorldEntity::unsubscribeReaction(CoRe::CREngine::ReactionType type)
+{
+  this->_collisionFilter.unsubscribeReaction(type);
 }
 
@@ -408,61 +339,7 @@
  * unsubscribes all collision reactions
  */
-void WorldEntity::unsubscribeReaction()
-{
-  for( int i = 0; i < CREngine::CR_NUMBER; i++)
-    this->unsubscribeReaction((CREngine::CRType)i);
-
-  // there are no reactions subscribed from now on
-  this->bReactive = false;
-}
-
-
-/**
- * registers a new collision event to this world entity
- *  @param entityA entity of the collision
- *  @param entityB entity of the collision
- *  @param bvA colliding bounding volume of entityA
- *  @param bvB colliding bounding volume of entityA
- */
-bool WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB)
-{
-  PRINTF(5)("registering collision of type: %s vs %s\n", entityA->getClassCName(), entityB->getClassCName());
-  // is there any handler listening?
-  if( !this->bReactive)
-    return false;
-
-  // get a collision event
-  CollisionEvent* c = CREngine::getInstance()->popCollisionEventObject();
-  assert(c != NULL); // if this should fail: we got not enough precached CollisionEvents: alter value in cr_defs.h
-  c->collide(COLLISION_TYPE_OBB, entityA, entityB, bvA, bvB);
-
-  for( int i = 0; i < CREngine::CR_NUMBER; ++i)
-    if( this->collisionHandles[i] != NULL)
-      this->collisionHandles[i]->registerCollisionEvent(c);
-  return true;
-}
-
-
-/**
- * registers a new collision event to this woeld entity
- *  @param entity the entity that collides
- *  @param plane it stands on
- *  @param position it collides on the plane
- */
-bool WorldEntity::registerCollision(int type, WorldEntity* entity, WorldEntity* groundEntity, Vector normal, Vector position, bool bInWall)
-{
-  // is there any handler listening?
-  if( !this->bReactive)
-    return false;
-
-  // get a collision event
-  CollisionEvent* c = CREngine::getInstance()->popCollisionEventObject();
-  assert(c != NULL); // if this should fail: we got not enough precached CollisionEvents: alter value in cr_defs.h
-  c->collide(type, entity, groundEntity, normal, position, bInWall);
-
-  for( int i = 0; i < CREngine::CR_NUMBER; ++i)
-    if( this->collisionHandles[i] != NULL)
-      this->collisionHandles[i]->registerCollisionEvent(c);
-  return true;
+void WorldEntity::unsubscribeReactions()
+{
+  this->_collisionFilter.unsubscribeReactions();
 }
 
Index: trunk/src/world_entities/world_entity.h
===================================================================
--- trunk/src/world_entities/world_entity.h	(revision 9928)
+++ trunk/src/world_entities/world_entity.h	(revision 10013)
@@ -12,4 +12,5 @@
 
 #include "cr_engine.h"
+#include "collision_filter.h"
 #include "object_manager.h"
 #include "glincl.h"
@@ -25,4 +26,5 @@
 namespace OrxSound { class SoundBuffer; class SoundSource; }
 namespace OrxGui { class GLGuiWidget; class GLGuiBar; class GLGuiEnergyWidget; };
+namespace CoRe { class Collision; }
 
 class BVTree;
@@ -30,10 +32,4 @@
 class AABBTreeNode;
 class Model;
-class CollisionHandle;
-class Collision;
-
-
-//class CharacterAttributes;
-
 
 
@@ -42,4 +38,5 @@
 {
   ObjectListDeclaration(WorldEntity);
+
 public:
   WorldEntity();
@@ -51,5 +48,5 @@
   void loadModel2(const std::string& fileN, float scal = 1.0f){this->loadModel(fileN,scal,0,4);}
   void setModel(Model* model, unsigned int modelNumber = 0);
-Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
+  Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
 
   inline void loadMD2Texture(const std::string& fileName) { this->md2TextureFileName = fileName; }
@@ -74,5 +71,4 @@
   virtual void collidesWithGround(const Vector& feet, const Vector& ray_1, const Vector& ray_2);
 
-
   /** @returns a reference to the obb tree of this worldentity */
   inline BVTree* getOBBTree() const { return this->obbTree; };
@@ -81,27 +77,31 @@
   inline AABB* getModelAABB() const { return (this->aabbNode)?this->aabbNode->getAABB():NULL;}
 
+  virtual void hit(float damage, WorldEntity* killer);
+
+
   /* --- Collision Reaction Block --- */
-  void subscribeReaction(CREngine::CRType type);
-  void subscribeReaction(CREngine::CRType type, const ClassID& target1);
-  void subscribeReaction(CREngine::CRType type, const ClassID& target1, const ClassID& target2);
-  void subscribeReaction(CREngine::CRType type, const ClassID& target1, const ClassID& target2, const ClassID& target3);
-  void subscribeReaction(CREngine::CRType type, const ClassID& target1, const ClassID& target2, const ClassID& target3, const ClassID& target4);
-
-  void unsubscribeReaction(CREngine::CRType type);
-  void unsubscribeReaction();
-
-  bool registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB);
-  bool registerCollision(int type, WorldEntity* entity, WorldEntity* groundEntity, Vector normal, Vector position, bool bInWall = false);
+  void subscribeReaction(CoRe::CREngine::ReactionType type, const ClassID& target1);
+  void subscribeReaction(CoRe::CREngine::ReactionType type, const ClassID& target1, const ClassID& target2);
+  void subscribeReaction(CoRe::CREngine::ReactionType type, const ClassID& target1, const ClassID& target2, const ClassID& target3);
+
+  void unsubscribeReaction(CoRe::CREngine::ReactionType type);
+  void unsubscribeReactions();
+
   /** @return true if there is at least on collision reaction subscribed */
-  inline bool isReactive() const { return this->bReactive; }
-
-  CollisionHandle* getCollisionHandle(CREngine::CRType type) const { return this->collisionHandles[type]; }
+  inline bool isReactive() const { return this->_collisionFilter.isReactive(); }
+
+  /** @param worldEntity the world entity to be checked @returns true if there is a collisionreaction registered for the worldEntity */
+  inline bool isReactive( const WorldEntity& worldEntity) const { return this->_collisionFilter(worldEntity); }
+  /** @param worldEntity the world entity to be checked @param type special reaction type @returns true if collision reaction reg. */
+  inline bool isReactive( const WorldEntity& worldEntity, const CoRe::CREngine::ReactionType& type) const
+  { return this->_collisionFilter(worldEntity, type); }
+
+
+  const CoRe::CollisionFilter& getCollisionFilter(CoRe::CREngine::ReactionType type) const { return this->_collisionFilter; }
 
   /** @returns true if this entity is standing on ground (BSP model) */
-  bool isOnGround() const { return this->bOnGround; }
+  bool isOnGround() const { return this->_bOnGround; }
   /** @param flag: marks if this entity is standing on ground */
-  void setOnGround(bool flag) { this->bOnGround = flag; }
-
-  virtual void hit(float damage, WorldEntity* killer);
+  void setOnGround(bool flag) { this->_bOnGround = flag; }
 
   virtual void destroy( WorldEntity* killer );
@@ -128,10 +128,10 @@
 
   void hide() { if( this->objectListNumber != OM_DEAD) this->lastObjectListNumber = this->objectListNumber; this->toList(OM_DEAD); }
-void unhide() { if( this->objectListNumber != this->lastObjectListNumber) this->toList(this->lastObjectListNumber); }
+  void unhide() { if( this->objectListNumber != this->lastObjectListNumber) this->toList(this->lastObjectListNumber); }
 
 
   /* --- Character Attribute Block --- */
   /** @returns the scaling of the model */
-float getScaling(){return this->scaling;}
+  float getScaling(){return this->scaling;}
   /** @returns the damage dealt by this world entity */
   float getDamage() const { return this->damage; }
@@ -170,8 +170,10 @@
   void setHealthMax(float healthMax);
   void createHealthWidget();
-
-  //  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
+    //  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
+
+
 private:
   void updateHealthWidget();
+
 
 private:
@@ -195,6 +197,11 @@
   OM_LIST                 lastObjectListNumber;            //!< the last ObjectList from the ObjectManager this Entity was is in
 
-
-
+  /* collision reaction stuff */
+  CoRe::CollisionFilter   _collisionFilter;                //!< filter for collision event filtering (not every entity listens to all collisions)
+  bool                    _bOnGround;                      //!< flag true if the object is on the ground
+
+  PhysicsInterface        physicsInterface;                //!< the physics object of the WorldEntity
+
+  /* network help structures */
   float                   scaling;                         //!< model's scaling factor
   int                     scaling_handle;                  //!< handle for syncing var
@@ -212,9 +219,5 @@
   int                     healthMax_handle;
 
-  CollisionHandle*        collisionHandles[CREngine::CR_NUMBER];  //!< the list of the collision reactions
-  bool                    bReactive;                              //!< true if there is at least one collision reaction subscibed
-
-  PhysicsInterface        physicsInterface;                //!< the physics object of the WorldEntity
-  bool                    bOnGround;                       //!< true if this entity is standing on the ground
+
 
 protected:
