Changeset 10349 in orxonox.OLD for branches/ai/src/ai/attack_module.cc
- Timestamp:
- Jan 24, 2007, 6:55:21 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ai/src/ai/attack_module.cc
r10283 r10349 62 62 63 63 weight=1; 64 speedMax=1000.0f;65 66 64 67 65 //get information about player … … 71 69 float playerRadius=getRadius( pl->getPlayable() ); 72 70 73 74 71 //get information about myself 75 72 Vector myPosition = npc->getAbsCoor(); 76 73 float myRadius = getRadius(npc); 77 74 //float vMax=1000.0f/myRadius; 75 float vMax=maxSpeed; 76 float aMax=1000/myRadius; 78 77 79 78 //anti player collision … … 117 116 Vector vectorToDestination=destination-myPosition; 118 117 119 Vector correction= playerCollision*50*3 118 Vector correction= playerCollision*50*3 *6/myRadius 120 119 + npcCollision*50*3 *6/myRadius 121 120 + destinationMovement*2//-movement … … 135 134 //limit speed 136 135 float movementLen=movement.len(); 137 if(movementLen> speedMax)movement=movement/movementLen*speedMax;136 if(movementLen>vMax)movement=movement/movementLen*vMax; 138 137 139 138 … … 150 149 view = view.cross( Vector(0,1,0) ).getNormalized(); 151 150 152 npc->setAbsDirSoft( Quaternion( view, Vector(0,1,0)), 1);151 npc->setAbsDirSoft( Quaternion( view, Vector(0,1,0)),8/myRadius); 153 152 154 153
Note: See TracChangeset
for help on using the changeset viewer.