Index: branches/ai/src/ai/movement_module.cc
===================================================================
--- branches/ai/src/ai/movement_module.cc	(revision 10074)
+++ branches/ai/src/ai/movement_module.cc	(revision 10075)
@@ -25,7 +25,5 @@
 
 #include "shell_command.h"
-/*SHELL_COMMAND(model, WorldEntity, loadModel)
-->describe("sets the Model of the WorldEntity")
-->defaultValues("models/ships/fighter.obj", 1.0f);*/
+SHELL_COMMAND(aiacc, MovementModule, setAccleration);
 
 
@@ -33,4 +31,6 @@
 
 MovementModule::MovementModule(){
+	//MovementModule::aa=100.0f;
+	//a=100.0f;
 	//std::cout << "MovementModule created...\n";
 }
@@ -40,6 +40,16 @@
 
 
+void MovementModule::setAccleration(float newValue)
+{
+	std::cout << "Setting a to: "<< newValue << "\n";
+	//MovementModule::aa=newValue;
+}
+
+
+
+
 float MovementModule::getSize(WorldEntity* object)
 {
+	//does not work...
 	AABB* aabb = object->getModelAABB();
 	Vector a = aabb->getAxisX();
@@ -80,15 +90,15 @@
 	////////////
 
-	float a=50.0f;
-	float keepDist= this->getSize(owner);//+ this->getSize(pl->getPlayable());
-	std::cout << "Distance: " << keepDist << "\n";
+	//if(aa<0)aa=100.0f;
+	float a=200.0f;
+	float vMax=200.0f;
+	
+	//float keepDist= this->getSize(owner);//+ this->getSize(pl->getPlayable());
+	//std::cout << "Distance: " << keepDist << "\n";
 
 
 	Vector vectorToPlayer = playerAbsPos - myAbsPos;
 	float dist=vectorToPlayer.len();
-	Vector nVectorToPlayer=vectorToPlayer/dist*(dist-keepDist);
-
-
-
+	//Vector nVectorToPlayer=vectorToPlayer/dist*(dist-keepDist);
 
 
@@ -96,7 +106,8 @@
 	// get all npcs
 
-	Vector tempNPCpos;
-	Vector tempCorrectionVect;
-	Vector antiCollision;
+	Vector tmpNPCpos;
+	float tmpDist;
+	Vector tmpCorrectionVect;
+	Vector antiNPCCollision;
 
 	for (ObjectList<NPC2>::const_iterator it = NPC2::objectList().begin();
@@ -105,14 +116,22 @@
 	{
 		if(*it==owner)continue;
-		tempNPCpos=(*it)->getAbsCoor();
-		tempCorrectionVect = myAbsPos-tempNPCpos;
-		tempCorrectionVect=tempCorrectionVect*1/(tempCorrectionVect.len());
-		//PRINTF(0)("class: %s\n", (*it)->getCName());
-		antiCollision=antiCollision+tempCorrectionVect;
+		tmpNPCpos=(*it)->getAbsCoor();
+		tmpCorrectionVect = myAbsPos-tmpNPCpos;
+		
+		tmpDist=tmpCorrectionVect.len()-16;
+		if(tmpDist<0.1)tmpDist=0.1;
+		tmpCorrectionVect=tmpCorrectionVect/(tmpDist*tmpDist);
+		
+		antiNPCCollision=antiNPCCollision+tmpCorrectionVect;
 	}
 
 
 
-	Vector correction=antiCollision+nVectorToPlayer-v;
+	Vector antiPlayerCollision=vectorToPlayer*(-1);
+	tmpDist=antiPlayerCollision.len()-45;
+	if(tmpDist<0.1)tmpDist=0.1;
+	antiPlayerCollision=antiPlayerCollision/(tmpDist*tmpDist);
+	
+	Vector correction=antiPlayerCollision*50+antiNPCCollision*50+vectorToPlayer-v;
 	//Vector nCorrection=
 	correction.y=0;
@@ -121,4 +140,6 @@
 	v+=correction;
 
+	float vLen=v.len();
+	if(vLen>vMax)v/vLen*vMax;
 
 	//Move NPC...
@@ -127,12 +148,12 @@
 	//Rotate NPC
 	Vector view = v+correction;
-	//if(vectorToPlayer.dot(view)<0){
-		//view = v.cross( Vector(0,1,0) ).getNormalized();
+	//if(vectorToPlayer.dot(v)<0){
+	//	view = v.cross( Vector(0,1,0) ).getNormalized();
 	//}else{
 		view = v.cross( Vector(0,-1,0) ).getNormalized();
 	//}
 	//if(dist<keepDist)view=view*-1;
-	owner->setAbsDir( Quaternion( view, Vector(0,1,0)));
-	//owner->setAbsDirSoft( Quaternion( view, Vector(0,1,0)),1.5);
+	//owner->setAbsDir( Quaternion( view, Vector(0,1,0)));
+	owner->setAbsDirSoft( Quaternion( view, Vector(0,1,0)),1.1);
 }
 
Index: branches/ai/src/ai/movement_module.h
===================================================================
--- branches/ai/src/ai/movement_module.h	(revision 10074)
+++ branches/ai/src/ai/movement_module.h	(revision 10075)
@@ -8,11 +8,14 @@
 
 class MovementModule : public AIModule{
+	
  public:
    MovementModule();
    virtual ~MovementModule();
    virtual void process();
+   static void setAccleration(float newValue);
  private:
 	 Vector v;
 	 float getSize(WorldEntity* object);
+	 static float aa;
 };
 
