Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10349 in orxonox.OLD for branches/ai/src/ai/attack_module.cc


Ignore:
Timestamp:
Jan 24, 2007, 6:55:21 PM (17 years ago)
Author:
tfahrni
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ai/src/ai/attack_module.cc

    r10283 r10349  
    6262
    6363        weight=1;
    64         speedMax=1000.0f;
    65 
    6664
    6765        //get information about player
     
    7169        float playerRadius=getRadius( pl->getPlayable() );
    7270
    73 
    7471        //get information about myself
    7572        Vector myPosition = npc->getAbsCoor();
    7673        float myRadius = getRadius(npc);
    77 
     74        //float vMax=1000.0f/myRadius;
     75        float vMax=maxSpeed;
     76        float aMax=1000/myRadius;
    7877
    7978        //anti player collision
     
    117116        Vector vectorToDestination=destination-myPosition;
    118117
    119         Vector correction=              playerCollision*50*3
     118        Vector correction=              playerCollision*50*3 *6/myRadius
    120119                                                                +       npcCollision*50*3 *6/myRadius
    121120                                                                +       destinationMovement*2//-movement
     
    135134        //limit speed
    136135        float movementLen=movement.len();
    137         if(movementLen>speedMax)movement=movement/movementLen*speedMax;
     136        if(movementLen>vMax)movement=movement/movementLen*vMax;
    138137
    139138
     
    150149        view = view.cross( Vector(0,1,0) ).getNormalized();
    151150
    152         npc->setAbsDirSoft( Quaternion( view, Vector(0,1,0)),1);
     151        npc->setAbsDirSoft( Quaternion( view, Vector(0,1,0)),8/myRadius);
    153152
    154153
Note: See TracChangeset for help on using the changeset viewer.