Changeset 708 for code/branches/FICN/src/orxonox/AIClass.h
- Timestamp:
- Dec 28, 2007, 10:30:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/AIClass.h
r673 r708 2 2 #define _AIClass_H__ 3 3 4 #include <Ogre.h> 5 #include <OgreVector3.h> 6 #include <OgreMath.h> 4 #include "misc/Vector3.h" 7 5 8 #include <iostream> 9 10 // FIXME: using namespace xy; in header files is a very bad idea.. 11 using namespace std; 12 using namespace Ogre; 13 14 class AIPilot { 6 namespace orxonox 7 { 8 class AIPilot 9 { 15 10 16 11 17 /*18 TASKS: Requirements:12 /* 13 TASKS: Requirements: 19 14 20 15 - Change actual Speed to required Speed - Speed as Vector3 , spaceship(?) -> pilot attached to it or vice versa (?) … … 25 20 26 21 27 */22 */ 28 23 29 24 public: … … 32 27 33 28 34 //default constructor35 AIPilot() {36 speed = (1,0,0);37 }29 //default constructor 30 AIPilot() { 31 speed = (1,0,0); 32 } 38 33 39 Vector3 steer(Vector3 reqSpeed) {40 Quaternion sRotation = speed.getRotationTo(reqSpeed);41 Radian rollarc = sRotation.getRoll();42 Radian pitcharc = sRotation.getPitch();43 Radian yawarc = sRotation.getYaw();44 return Vector3((float)rollarc.valueRadians(), (float)pitcharc.valueRadians(), (float)yawarc.valueRadians());45 }34 Vector3 steer(Vector3 reqSpeed) { 35 Quaternion sRotation = speed.getRotationTo(reqSpeed); 36 Radian rollarc = sRotation.getRoll(); 37 Radian pitcharc = sRotation.getPitch(); 38 Radian yawarc = sRotation.getYaw(); 39 return Vector3((float)rollarc.valueRadians(), (float)pitcharc.valueRadians(), (float)yawarc.valueRadians()); 40 } 46 41 47 42 43 }; 48 44 49 }; 50 51 class AIFleetCommander : public AIPilot { 45 class AIFleetCommander : public AIPilot { 52 46 53 47 54 /*55 TASKS: Requirements:48 /* 49 TASKS: Requirements: 56 50 57 51 - Same tasks as AI_Pilot (only if shipcontrol) - Same as AI_Pilot … … 61 55 62 56 63 */57 */ 64 58 65 59 public: 66 60 67 61 68 //default constructor69 AIFleetCommander() {62 //default constructor 63 AIFleetCommander() { 70 64 71 }65 } 72 66 73 67 74 68 75 };69 }; 76 70 77 class AICommander : public AIFleetCommander { 71 class AICommander : public AIFleetCommander 72 { 78 73 79 74 80 /*81 TASKS: Requirements:75 /* 76 TASKS: Requirements: 82 77 83 78 - Decide on general tactics - List of general fleet status + all possible information on enemies … … 86 81 87 82 88 */83 */ 89 84 90 //default constructor91 AICommander() {85 //default constructor 86 AICommander() { 92 87 93 }88 } 94 89 95 90 91 }; 96 92 97 } ;93 } 98 94 99 95 #endif /* _AIClass_H__ */
Note: See TracChangeset
for help on using the changeset viewer.