Index: trunk/src/lib/collision_reaction/Makefile.am
===================================================================
--- trunk/src/lib/collision_reaction/Makefile.am	(revision 9110)
+++ trunk/src/lib/collision_reaction/Makefile.am	(revision 9235)
@@ -10,5 +10,6 @@
                      collision_reaction.cc \
                      cr_object_damage.cc \
-                     cr_physics_ground_walk.cc
+                     cr_physics_ground_walk.cc \
+                     cr_physics_full_walk.cc
 
 
@@ -21,4 +22,5 @@
                      collision_reaction.h \
                      cr_object_damage.h \
-                     cr_physics_ground_walk.h
+                     cr_physics_ground_walk.h \
+                     cr_physics_full_walk.h
 
Index: trunk/src/lib/collision_reaction/collision_handle.cc
===================================================================
--- trunk/src/lib/collision_reaction/collision_handle.cc	(revision 9110)
+++ trunk/src/lib/collision_reaction/collision_handle.cc	(revision 9235)
@@ -25,4 +25,5 @@
 #include "cr_object_damage.h"
 #include "cr_physics_ground_walk.h"
+#include "cr_physics_full_walk.h"
 
 #include "debug.h"
@@ -52,6 +53,6 @@
   switch( type)
   {
-    case CREngine::CR_PHYSICS_STEP_BACK:
-//       this->collisionReaction = new CRPhysicsGroundWalk();
+    case CREngine::CR_PHYSICS_FULL_WALK:
+      this->collisionReaction = new CRPhysicsFullWalk();
       this->bContinuousPoll = true;
       break;
@@ -229,4 +230,26 @@
   for(; it < this->targetList.end(); it++)
   {
+//     if(collisionEvent->getEntityB()->isA(CL_AIMING_SYSTEM) || collisionEvent->getEntityA()->isA(CL_AIMING_SYSTEM))
+//     {
+//        PRINTF(0)("I am: %s colliding with: %s\n", owner->getClassName(), collisionEvent->getEntityB()->getClassName(), *it);
+//        if( collisionEvent->getEntityA() == this->owner) {
+//          PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassName(),
+//          collisionEvent->getEntityB()->getClassName(), *it);
+//          if( collisionEvent->getEntityB()->isA((ClassID)(*it))) {
+//            PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassName(),
+//            collisionEvent->getEntityB()->getClassName(), *it);
+//             }
+//        }
+//        else {
+//          PRINTF(0)("I am not owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassName(),
+//          collisionEvent->getEntityB()->getClassName(), *it);
+//          if( collisionEvent->getEntityA()->isA((ClassID)(*it))) {
+//            PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassName(),
+//            collisionEvent->getEntityA()->getClassName(), *it);
+//             }
+//        }
+//
+//     }
+
     if( collisionEvent->getEntityA() == this->owner) {
       if( collisionEvent->getEntityB()->isA((ClassID)(*it))) {
@@ -256,4 +279,26 @@
   for(; it < this->targetList.end(); it++)
   {
+
+//     if(collision->getEntityB()->isA(CL_AIMING_SYSTEM) || collision->getEntityA()->isA(CL_AIMING_SYSTEM))
+//     {
+//       PRINTF(0)("Shared!!! I am: %s colliding with: %s\n", owner->getClassName(), collision->getEntityB()->getClassName(), *it);
+//       if( collision->getEntityA() == this->owner) {
+//         PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassName(),
+//         collision->getEntityB()->getClassName(), *it);
+//         if( collision->getEntityB()->isA((ClassID)(*it))) {
+//           PRINTF(0)("I am owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassName(),
+//           collision->getEntityB()->getClassName(), *it);
+//         }
+//       }
+//       else {
+//         PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter?\n", owner->getClassName(),
+//         collision->getEntityB()->getClassName(), *it);
+//         if( collision->getEntityA()->isA((ClassID)(*it))) {
+//           PRINTF(0)("I'm not owner -> I am: %s colliding with: %s is a %i filter ok\n", owner->getClassName(),
+//           collision->getEntityA()->getClassName(), *it);
+//         }
+//       }
+//     }
+
     if( collision->getEntityA() == this->owner) {
       if( collision->getEntityA()->isA((ClassID)(*it)))
Index: trunk/src/lib/collision_reaction/cr_engine.h
===================================================================
--- trunk/src/lib/collision_reaction/cr_engine.h	(revision 9110)
+++ trunk/src/lib/collision_reaction/cr_engine.h	(revision 9235)
@@ -30,6 +30,6 @@
     CR_PHYSICS_MOMENTUM   = 0,    //!< physical reaction: conservervation of momentum
     CR_PHYSICS_STEP_BACK,         //!< physical reaction: just go to the last position without collisions
-    CR_PHYSICS_GROUND,            //!< physical reaction: stand on the ground, no movement: simulating simple normal force away from the gravity force
-    CR_PHYSICS_GROUND_WALK,       //!< physical reaction: walking on the ground (inkl. hills etc)
+    CR_PHYSICS_GROUND_WALK,       //!< physical reaction: stand on the ground, no movement: simulating simple normal force away from the gravity force
+    CR_PHYSICS_FULL_WALK,         //!< physical reaction: walking on the ground (inkl. hills etc)
     CR_PHYSICS_DAMAGE,            //!< physical reaction: daling damage according to the object energy and their structural stability
 
Index: trunk/src/lib/collision_reaction/cr_object_damage.cc
===================================================================
--- trunk/src/lib/collision_reaction/cr_object_damage.cc	(revision 9110)
+++ trunk/src/lib/collision_reaction/cr_object_damage.cc	(revision 9235)
@@ -56,5 +56,5 @@
   float damage = 0.0f;
 
-  PRINTF(0)("Dealing damage - Handling collision: %s vs %s\n",
+  PRINTF(4)("Dealing damage - Handling collision: %s vs %s\n",
             collision->getEntityA()->getClassName(),
             collision->getEntityB()->getClassName());
Index: trunk/src/lib/collision_reaction/cr_physics_full_walk.cc
===================================================================
--- trunk/src/lib/collision_reaction/cr_physics_full_walk.cc	(revision 9235)
+++ trunk/src/lib/collision_reaction/cr_physics_full_walk.cc	(revision 9235)
@@ -0,0 +1,228 @@
+/*
+   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_COLLISION_REACTION
+
+#include "collision.h"
+#include "collision_event.h"
+
+#include "physics_interface.h"
+
+#include "world_entity.h"
+#include "cr_physics_full_walk.h"
+#include "collision_reaction.h"
+
+#include <vector>
+
+#include "debug.h"
+
+#include "aabb.h"
+
+#include "cr_defs.h"
+
+using namespace std;
+
+
+/**
+ *  standard constructor
+ */
+CRPhysicsFullWalk::CRPhysicsFullWalk ()
+    : CollisionReaction()
+{
+  this->setClassID(CL_CR_PHYSICS_FULL_WALK, "CRPhysicsFullWalk");
+}
+
+
+/**
+ *  standard deconstructor
+ */
+CRPhysicsFullWalk::~CRPhysicsFullWalk ()
+{}
+
+
+/**
+ * caluculates and applys the reaction to a specific collision
+ *  @param collision the collision
+ */
+void CRPhysicsFullWalk::reactToCollision(Collision* collision)
+{
+
+  AABB* box = collision->getEntityB()->getModelAABB();
+  WorldEntity* entity = collision->getEntityB();
+
+  if( box == NULL)
+  {
+    PRINTF(2)("this model has no aabb box so there is no correct collision reaction implemented. skipping\n");
+    return;
+  }
+
+
+  float CR_MAX_WALK_HEIGHT = 15.0f;
+  float CR_THRESHOLD = 0.2f;
+
+  float height = 0.0f;
+  float front = 0.0f;
+  float back = 0.0f;
+  float right = 0.0f;
+  float left = 0.0f;
+
+
+  const std::vector<CollisionEvent*>* collisionEvents = &(collision->getCollisionEvents());
+  std::vector<CollisionEvent*>::const_iterator it = collisionEvents->begin();
+  for(; it != collisionEvents->end(); it++)
+  {
+
+    CollisionEvent* ce = (*it);
+    Vector normal = ce->getGroundNormal();
+
+    // calculate the collision position
+    Vector collPos =  collision->getEntityB()->getAbsCoor()  + box->center - ce->getCollisionPosition();
+
+    // test the 3 axis differently
+    switch( ce->getType())
+    {
+        /* collision in the X-AXIS */
+      case COLLISION_TYPE_AXIS_X:
+        front = collPos.len() - box->halfLength[0];
+
+        // object is beneath the plane (ground)
+        if( front <= 0.0f )
+        {
+          Vector dirX = entity->getAbsDirX();
+          dirX.y = 0.0f;
+          dirX.normalize();
+          Vector backoff = dirX * front;
+
+          entity->shiftCoor(backoff);
+        }
+        else if( ce->isInWall())
+        {
+          // object is already in the wall
+          entity->setAbsCoor(entity->getLastAbsCoor());
+        }
+        break;
+
+      case COLLISION_TYPE_AXIS_X_NEG:
+        back = collPos.len() - box->halfLength[0];
+
+        // object is beneath the plane (ground)
+        if( back <= 0.0f)
+        {
+          Vector dirX = entity->getAbsDirX();
+          dirX.y = 0.0f;
+          dirX.normalize();
+          Vector backoff = dirX * back * -1.0f;
+
+          entity->shiftCoor(backoff);
+        }
+        else if( ce->isInWall())
+        {
+          // object is already in the wall
+          entity->setAbsCoor(entity->getLastAbsCoor());
+        }
+        break;
+
+
+        /* collision in the Y-AXIS */
+      case COLLISION_TYPE_AXIS_Y_NEG:
+        // calulate the height above ground
+        height = collPos.len() - box->halfLength[1];
+
+
+        // object is beneath the plane (ground)
+        //         if(height >= 0.0f && height <= 0.0001f) break ;// Do nothing
+        if( height < 0.0f && -height < CR_MAX_WALK_HEIGHT)
+        {
+          entity->shiftCoor(Vector(0.0f, -height + 0.00001, 0.0f));
+          entity->setOnGround(true);
+        }
+        // object is already in the wall
+        else if( ce->isInWall())
+        {
+          entity->setAbsCoor(entity->getLastAbsCoor());
+          PRINTF(0)("ground collision: reset pos\n");
+        }
+        else
+        {
+          // entity is not on ground
+          entity->setOnGround(false);
+        }
+        break;
+
+
+        /* collision in the Z-AXIS */
+      case COLLISION_TYPE_AXIS_Z:
+
+        right = collPos.len()  - box->halfLength[2];
+
+        // object is beneath the plane (ground)
+        if( right <= 0.0f )
+        {
+          Vector dirZ = entity->getAbsDirZ();
+          dirZ.y = 0.0f;
+          dirZ.normalize();
+          Vector backoff = dirZ * right;
+          entity->shiftCoor(backoff);
+        }
+        else if( ce->isInWall())
+        {
+          // object is already in the wall
+          entity->setAbsCoor(entity->getLastAbsCoor());
+        }
+        break;
+
+
+        // collision in the z-axis
+      case COLLISION_TYPE_AXIS_Z_NEG:
+
+        left = collPos.len()  - box->halfLength[2];
+
+        // object is beneath the plane (ground)
+        if( left <= 0.0f )
+        {
+          Vector dirZ = entity->getAbsDirZ();
+          dirZ.y = 0.0f;
+          dirZ.normalize();
+          Vector backoff = dirZ * left*-1.0f;
+          entity->shiftCoor(backoff);
+        }
+        // object is already in the wall
+        else if( ce->isInWall())
+        {
+          entity->setAbsCoor(entity->getLastAbsCoor());
+        }
+        break;
+    }
+  }
+  //PRINTF(0)("collision distances: x: %f, y: %f, z: %f\n", front, height, side);
+
+
+
+
+
+
+
+}
+
+
+
+
+/**
+ * use this to do some collision offline calculations, only called for bContinuousPoll == true
+ */
+void CRPhysicsFullWalk::update(WorldEntity* owner)
+{}
+
+
Index: trunk/src/lib/collision_reaction/cr_physics_full_walk.h
===================================================================
--- trunk/src/lib/collision_reaction/cr_physics_full_walk.h	(revision 9235)
+++ trunk/src/lib/collision_reaction/cr_physics_full_walk.h	(revision 9235)
@@ -0,0 +1,30 @@
+/*!
+ * @file cr_object_damage.h
+ *  Definition of a collision reaction: dealing damage to an object
+ */
+
+#ifndef _CR_PHYSICS_FULL_WALK_H
+#define _CR_PHYSICS_FULL_WALK_H
+
+#include "collision_reaction.h"
+
+
+class Collision;
+
+//! A class representing a reaction to a collision: dealing damage to an object
+class CRPhysicsFullWalk : public CollisionReaction
+{
+  public:
+    CRPhysicsFullWalk();
+    virtual ~CRPhysicsFullWalk();
+
+    virtual void reactToCollision(Collision* collision);
+
+    virtual void update(WorldEntity* entity);
+
+
+  private:
+    float        downspeed;
+};
+
+#endif /* _CR_PHYSICS_FULL_WALK_H */
Index: trunk/src/lib/collision_reaction/cr_physics_ground_walk.cc
===================================================================
--- trunk/src/lib/collision_reaction/cr_physics_ground_walk.cc	(revision 9110)
+++ trunk/src/lib/collision_reaction/cr_physics_ground_walk.cc	(revision 9235)
@@ -71,11 +71,6 @@
 
   float CR_MAX_WALK_HEIGHT = 15.0f;
-  float CR_THRESHOLD = 0.2f;
 
   float height = 0.0f;
-  float front = 0.0f;
-  float back = 0.0f;
-  float right = 0.0f;
-  float left = 0.0f;
 
 
@@ -94,46 +89,4 @@
     switch( ce->getType())
     {
-        /* collision in the X-AXIS */
-      case COLLISION_TYPE_AXIS_X:
-        front = collPos.len() - box->halfLength[0];
-
-        // object is beneath the plane (ground)
-        if( front <= 0.0f )
-        {
-          Vector dirX = entity->getAbsDirX();
-          dirX.y = 0.0f;
-          dirX.normalize();
-          Vector backoff = dirX * front;
-
-          entity->shiftCoor(backoff);
-        }
-        else if( ce->isInWall())
-        {
-          // object is already in the wall
-          entity->setAbsCoor(entity->getLastAbsCoor());
-        }
-        break;
-
-      case COLLISION_TYPE_AXIS_X_NEG:
-        back = collPos.len() - box->halfLength[0];
-
-        // object is beneath the plane (ground)
-        if( back <= 0.0f)
-        {
-          Vector dirX = entity->getAbsDirX();
-          dirX.y = 0.0f;
-          dirX.normalize();
-          Vector backoff = dirX * back * -1.0f;
-
-          entity->shiftCoor(backoff);
-        }
-        else if( ce->isInWall())
-        {
-          // object is already in the wall
-          entity->setAbsCoor(entity->getLastAbsCoor());
-        }
-        break;
-
-
         /* collision in the Y-AXIS */
       case COLLISION_TYPE_AXIS_Y_NEG:
@@ -153,5 +106,4 @@
         {
           entity->setAbsCoor(entity->getLastAbsCoor());
-          PRINTF(0)("ground collision: reset pos\n");
         }
         else
@@ -163,55 +115,7 @@
 
 
-        /* collision in the Z-AXIS */
-      case COLLISION_TYPE_AXIS_Z:
-
-        right = collPos.len()  - box->halfLength[2];
-
-        // object is beneath the plane (ground)
-        if( right <= 0.0f )
-        {
-          Vector dirZ = entity->getAbsDirZ();
-          dirZ.y = 0.0f;
-          dirZ.normalize();
-          Vector backoff = dirZ * right;
-          entity->shiftCoor(backoff);
-        }
-        else if( ce->isInWall())
-        {
-          // object is already in the wall
-          entity->setAbsCoor(entity->getLastAbsCoor());
-        }
-        break;
-
-
-        // collision in the z-axis
-      case COLLISION_TYPE_AXIS_Z_NEG:
-
-        left = collPos.len()  - box->halfLength[2];
-
-        // object is beneath the plane (ground)
-        if( left <= 0.0f )
-        {
-          Vector dirZ = entity->getAbsDirZ();
-          dirZ.y = 0.0f;
-          dirZ.normalize();
-          Vector backoff = dirZ * left*-1.0f;
-          entity->shiftCoor(backoff);
-        }
-        // object is already in the wall
-        else if( ce->isInWall())
-        {
-          entity->setAbsCoor(entity->getLastAbsCoor());
-        }
-        break;
     }
   }
   //PRINTF(0)("collision distances: x: %f, y: %f, z: %f\n", front, height, side);
-
-
-
-
-
-
 
 }
