- Timestamp:
- Dec 16, 2011, 8:36:41 PM (13 years ago)
- Location:
- code/branches/presentation2011
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2011
- Property svn:mergeinfo changed
/code/branches/formation (added) merged: 8885,8908,8939,8943,8948,8953,8957,8965,8967,8978,8985,8989-8991
- Property svn:mergeinfo changed
-
code/branches/presentation2011/src/orxonox/controllers/FormationController.cc
r8991 r8992 40 40 #include "gametypes/TeamDeathmatch.h" 41 41 #include "gametypes/Dynamicmatch.h" 42 //#include "gametypes/Mission.h" TODO: include mission after merging42 #include "gametypes/Mission.h" TODO: include mission after merging 43 43 #include "gametypes/Gametype.h" 44 44 #include "controllers/WaypointPatrolController.h" … … 962 962 } 963 963 964 /*Mission* miss = orxonox_cast<Mission*>(gametype); //NEW964 Mission* miss = orxonox_cast<Mission*>(gametype); 965 965 if (miss) 966 966 { … … 970 970 if (entity2->getPlayer()) 971 971 team2 = miss->getTeam(entity2->getPlayer()); 972 } */972 } 973 973 974 974 TeamBaseMatchBase* base = 0; … … 1039 1039 } 1040 1040 1041 void FormationController::absoluteMoveToPosition(const Vector3& target) 1042 { 1043 float minDistance = 40.0f; 1044 if (!this->getControllableEntity()) 1045 return; 1046 1047 Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target); 1048 float distance = (target - this->getControllableEntity()->getPosition()).length(); 1049 1050 if (this->target_ || distance > minDistance) 1051 { 1052 // Multiply with ROTATEFACTOR_FREE to make them a bit slower 1053 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x); 1054 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y); 1055 this->getControllableEntity()->moveFrontBack(SPEED_FREE); 1056 } 1057 1058 1059 if (distance < minDistance) 1060 { 1061 this->positionReached(); 1062 } 1063 } 1064 1041 1065 }
Note: See TracChangeset
for help on using the changeset viewer.