Index: /branches/coll_rect/src/lib/collision_reaction/collision.cc
===================================================================
--- /branches/coll_rect/src/lib/collision_reaction/collision.cc	(revision 9984)
+++ /branches/coll_rect/src/lib/collision_reaction/collision.cc	(revision 9985)
@@ -27,5 +27,5 @@
   Collision::Collision ()
   {
-    this->flushCollisionEvents();
+    this->reset();
   }
 
@@ -39,7 +39,7 @@
 
   /**
-   * flushes the CollisionEvent list
+   * resets all variable states to initial values
    */
-  void Collision::flushCollisionEvents()
+  void Collision::reset()
   {
     this->_entityA = NULL;
Index: /branches/coll_rect/src/lib/collision_reaction/collision.h
===================================================================
--- /branches/coll_rect/src/lib/collision_reaction/collision.h	(revision 9984)
+++ /branches/coll_rect/src/lib/collision_reaction/collision.h	(revision 9985)
@@ -49,5 +49,5 @@
     inline void registerCollisionEvent(CollisionEvent* event) { this->_collisionEvents.push_back(event); this->bDispatched = false;}
 
-    void flushCollisionEvents();
+    void reset();
 
 
Index: /branches/coll_rect/src/lib/collision_reaction/collision_tube.cc
===================================================================
--- /branches/coll_rect/src/lib/collision_reaction/collision_tube.cc	(revision 9984)
+++ /branches/coll_rect/src/lib/collision_reaction/collision_tube.cc	(revision 9985)
@@ -44,21 +44,4 @@
   {
     this->registerObject(this, CollisionTube::_objectList);
-
-
-    // push the collision reaction object on the list in the right order
-    // WARNING: do not mess with the order, it should be the same as in
-
-    // physical reactions
-    this->_reactionList[CREngine::CR_PHYSICS_MOMENTUM]      = NULL;
-    this->_reactionList[CREngine::CR_PHYSICS_STEP_BACK]     = NULL;
-    this->_reactionList[CREngine::CR_PHYSICS_GROUND_WALK]   = new CRPhysicsGroundWalk();
-    this->_reactionList[CREngine::CR_PHYSICS_FULL_WALK]     = new CRPhysicsFullWalk();
-    this->_reactionList[CREngine::CR_PHYSICS_DAMAGE]        = NULL;
-    // object based reactions
-    this->_reactionList[CREngine::CR_OBJECT_DAMAGE]         = new CRObjectDamage();
-    this->_reactionList[CREngine::CR_OBJECT_PICKUP]         = NULL;
-    // misc reactions
-    this->_reactionList[CREngine::CR_VERTEX_TRAFO]          = NULL;
-    this->_reactionList[CREngine::CR_SPECIAL_CALLBACK]      = NULL;
   }
 
@@ -131,30 +114,4 @@
 
 
-  /**
-   * handles all collisions in registered in this tube
-   */
-  void CollisionTube::handleCollisions()
-  {
-    // for all collisions:
-    CollisionIterator ci = this->_collisionList.begin();
-    for(; ci < this->_collisionList.end(); ++ci)
-    {
-      for( int i = CREngine::CR_PHYSICS_MOMENTUM; i < CREngine::CR_NUBER; i++)
-      {
-        // check if entity A or B is subscibed for this event
-        if( (*ci)->getEntityA()->bReactibe((*it)->getEnityB(), i) || (*ci)->getEntityB()->bReactibe((*it)->getEnityA(), i))
-          (*ci)->reactToCollision(*ci);
-
-        (*ci)->flushCollisionEvents();
-      }
-    }
-  }
-
-
-
-
-
-
-
 }// namespace end
 
Index: /branches/coll_rect/src/lib/collision_reaction/collision_tube.h
===================================================================
--- /branches/coll_rect/src/lib/collision_reaction/collision_tube.h	(revision 9984)
+++ /branches/coll_rect/src/lib/collision_reaction/collision_tube.h	(revision 9985)
@@ -68,10 +68,12 @@
                                 const Vector& normal, const Vector& position, bool bInWall = false);
 
-    void handleCollisions();
+    /** @returns an iterator pointing to the beginning of the list */
+    CollisionIterator& begin() const { return this->_collisionList.begin(); }
+    /** @returns an iterator pointing to the end of the list */
+    CollisionIterator& end()   const { return this->_collisionList.end(); }
 
 
   private:
     std::vector<Collision*>         _collisionList;                      //!< the list of collisions since the last processing
-    CollisionReaction*              _reactionList[CREngine::CR_NUMBER];  //!< the collision reaction list containing all reactions types
 
 
Index: /branches/coll_rect/src/lib/collision_reaction/cr_engine.cc
===================================================================
--- /branches/coll_rect/src/lib/collision_reaction/cr_engine.cc	(revision 9984)
+++ /branches/coll_rect/src/lib/collision_reaction/cr_engine.cc	(revision 9985)
@@ -63,9 +63,10 @@
 
     this->reset();
+    this->flushCollisions();
 
-    std::vector<Collision*>::iterator it1 = this->collisionsUnused.begin();
+    CollisionList it1 = this->collisionsUnused.begin();
     for(; it1 < this->collisionsUnused.end(); it1++)
       delete *it1;
-    std::vector<CollisionEvent*>::iterator it2 = this->collisionEventsUnused.begin();
+    CollisionEventList it2 = this->collisionEventsUnused.begin();
     for(; it2 < this->collisionEventsUnused.end(); it2++)
       delete *it2;
@@ -75,4 +76,5 @@
   }
 
+
   /**
    * inits the CREngine to a working state
@@ -80,9 +82,26 @@
   void CREngine::init()
   {
-    // create a list of Collision events (precaching)
+    // precaching:
+    // create a list of Collisions and CollisionEvents for fast object recycling purposes
     for( int i = 0; i < CR_MAX_COLLISIONS; i++)
       this->collisionsUnused.push_back(new Collision());
     for( int i = 0; i < CR_MAX_COLLISION_EVENTS; i++)
       this->collisionEventsUnused.push_back(new CollisionEvent());
+
+
+    // push the collision reaction object on the list in the right order
+
+    // physical reactions
+    this->_reactionList[CREngine::CR_PHYSICS_MOMENTUM]      = NULL;
+    this->_reactionList[CREngine::CR_PHYSICS_STEP_BACK]     = NULL;
+    this->_reactionList[CREngine::CR_PHYSICS_GROUND_WALK]   = new CRPhysicsGroundWalk();
+    this->_reactionList[CREngine::CR_PHYSICS_FULL_WALK]     = new CRPhysicsFullWalk();
+    this->_reactionList[CREngine::CR_PHYSICS_DAMAGE]        = NULL;
+    // object based reactions
+    this->_reactionList[CREngine::CR_OBJECT_DAMAGE]         = new CRObjectDamage();
+    this->_reactionList[CREngine::CR_OBJECT_PICKUP]         = NULL;
+    // misc reactions
+    this->_reactionList[CREngine::CR_VERTEX_TRAFO]          = NULL;
+    this->_reactionList[CREngine::CR_SPECIAL_CALLBACK]      = NULL;
   }
 
@@ -102,4 +121,5 @@
   }
 
+
   /**
    * @return an instanco of a CollisionEvent object. instead of creating a new object this ones can be used and resycled
@@ -118,37 +138,21 @@
 
   /**
-   * flushes the CollisionHandles and restores the CREngine to the initial state
-   */
-  void CREngine::reset()
-  {
-//     // first clear all CollisionHandles
-//     std::vector<CollisionHandle*>::iterator it = this->collisionHandles.begin();
-//     for(; it < this->collisionHandles.end(); it++)
-//     {
-//       (*it)->reset();
-//       delete *it;
-//     }
-//
-//     this->collisionHandles.clear();
-  }
-
-
-
-
-
-  /**
-   * processes the collisions by calling the EventHandlers
+   * handles all collisions in registered in this tube
    */
   void CREngine::handleCollisions()
   {
-//     std::vector<CollisionHandle*>::iterator it;
-//     for( it = this->collisionHandles.begin(); it != this->collisionHandles.end(); it++)
-//     {
-//       if( !(*it)->isDispatched() || (*it)->isContinuousPoll())  //does it have any collisions to report at all
-//       {
-//         (*it)->handleCollisions();
-//       }
-//     }
-//     this->flushCollisions();
+    // for all collisions:
+    CollisionIterator ci = CollisionTube::getInstance()->begin();
+    for(; ci < CollisionTube::getInstance()->end(); ++ci)
+    {
+      for( int i = CREngine::CR_PHYSICS_MOMENTUM; i < CREngine::CR_NUBER; i++)
+      {
+        // check if entity A or B is subscibed for this event
+        if( (*ci)->getEntityA()->bReactibe((*it)->getEnityB(), i) || (*ci)->getEntityB()->bReactibe((*it)->getEnityA(), i))
+          (*ci)->reactToCollision(*ci);
+
+        (*ci)->reset();
+      }
+    }
   }
 
@@ -159,9 +163,9 @@
   void CREngine::flushCollisions()
   {
-    std::vector<Collision*>::iterator it1 = this->collisionsUsed.begin();
+    CollisionIterator it1 = this->collisionsUsed.begin();
     for(; it1 < this->collisionsUsed.end(); it1++)
       this->collisionsUnused.push_back(*it1);
 
-    std::vector<CollisionEvent*>::iterator it2 = this->collisionEventsUsed.begin();
+    CollisionEventIterator it2 = this->collisionEventsUsed.begin();
     for(; it2 < this->collisionEventsUsed.end(); it2++)
       this->collisionEventsUnused.push_back(*it2);
Index: /branches/coll_rect/src/lib/collision_reaction/cr_engine.h
===================================================================
--- /branches/coll_rect/src/lib/collision_reaction/cr_engine.h	(revision 9984)
+++ /branches/coll_rect/src/lib/collision_reaction/cr_engine.h	(revision 9985)
@@ -29,4 +29,6 @@
     ObjectListDeclaration(CREngine);
 
+    typedef std::vector<Collision*>::iterator        CollisionIterator;
+    typedef std::vector<CollisionEvent*>::iterator   CollisionEventIterator;
 
 
@@ -70,5 +72,4 @@
     Collision* popCollisionObject();
     CollisionEvent* popCollisionEventObject();
-    void reset();
 
     void handleCollisions();
@@ -85,5 +86,5 @@
 
   private:
-    //std::vector<CollisionHandle*>       collisionHandles;         //!< list with the collision handles
+    static CREngine*                    singletonRef;             //!< the reference to the CREngine object (singleton)
 
     std::vector<Collision*>             collisionsUsed;           //!< a list of used, cached collisions
@@ -93,5 +94,7 @@
     std::vector<CollisionEvent*>        collisionEventsUnused;    //!< a list of unused, cached collision events
 
-    static CREngine*                    singletonRef;             //!< the reference to the CREngine object (singleton)
+    CollisionReaction*                  _reactionList[CREngine::CR_NUMBER];  //!< the collision reaction list containing all reactions types
+
+
   };
 
