- Timestamp:
- Nov 27, 2015, 10:37:59 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc
r10877 r10880 126 126 Vector3 diffUnit = diffVector/diffLength; 127 127 128 bool bTargetIsLookingAtThis = CommonController::isLooking ( this->target_, getControllableEntity(), math::pi/ 10.0f );128 bool bTargetIsLookingAtThis = CommonController::isLooking ( this->target_, getControllableEntity(), math::pi/20.0f ); 129 129 130 130 //too far? well, come closer then … … 191 191 ); 192 192 Vector3 projection = randVector->dotProduct( diffUnit )* diffUnit; 193 *randVector -= projection; 194 target += *randVector; 193 Vector3 randV = *randVector; 194 delete randVector; 195 randV -= projection; 196 target += randV; 195 197 this->setTargetPosition( thisPosition + target ); 196 198 }
Note: See TracChangeset
for help on using the changeset viewer.