- Timestamp:
- Dec 7, 2015, 4:06:37 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/FlyingController.h
r10923 r10946 39 39 FlyingController stores all the flying methods and member variables of AI. 40 40 */ 41 42 //Formation mode for the divisions 41 43 namespace FormationMode 42 44 { … … 51 53 52 54 public: 53 static const float SPEED = 0.9f/0.02f; 54 static const float ROTATEFACTOR = 0.6f/0.02f; 55 static const float SPEED = 0.9f/0.02f; //<! ship's speed 56 static const float ROTATEFACTOR = 0.6f/0.02f; //<! ship's rotation factor 55 57 56 58 FlyingController(Context* context); … … 58 60 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 59 61 60 void setSpread (int spread) 62 void setSpread (int spread) //<! spread is a multiplier for formation flight, should be bigger than 100 61 63 { this->spread_ = spread; } 62 int getSpread () const 64 int getSpread () const 63 65 { return this->spread_; } 64 66 … … 72 74 73 75 protected: 74 void stopMoving(); 76 void stopMoving(); //<! don't call moveToTargetPosition() in tick, call lookAtTarget() from FightingController instead 75 77 76 void moveToPosition(const Vector3& target, float dt); 77 void moveToTargetPosition(float dt); 78 void moveToPosition(const Vector3& target, float dt); //<! move towards a vector 79 void moveToTargetPosition(float dt); //<! move to the preset position. Don't mix with positionOfTarget! 78 80 79 void copyOrientation(const Quaternion& orient, float dt); 80 void copyTargetOrientation(float dt); 81 void copyOrientation(const Quaternion& orient, float dt); //<! roll to have same roll as orient 82 void copyTargetOrientation(float dt); //<! roll to have a preset orient 81 83 82 void setTargetPosition(const Vector3& target); 83 void setTargetOrientation(const Quaternion& orient); 84 void setTargetOrientation(ControllableEntity* target); 85 virtual void boostControl(); 86 void keepFormation (const ControllableEntity* leaderEntity, Vector3& targetRelativePosition); 84 void setTargetPosition(const Vector3& target); //<! preset a Vector to fly to 85 void setTargetOrientation(const Quaternion& orient); //<! preset a desired orientation 86 void setTargetOrientation(ControllableEntity* target); //<! preset a desired orientation 87 virtual void boostControl(); //<! boost if you can 88 void keepFormation (const ControllableEntity* leaderEntity, Vector3& targetRelativePosition); //<! preset targetPosition, so that 89 //<! this stays in a certain position relative to leader 87 90 88 91 FormationMode::Value formationMode_; 89 92 90 float rotationProgress_; //<! for slerp 93 float rotationProgress_; //<! for slerping 91 94 bool bHasTargetPosition_; 92 Vector3 targetPosition_; 95 Vector3 targetPosition_; //<! vector to fly to 93 96 bool bHasTargetOrientation_; 94 Quaternion targetOrientation_; 95 int spread_; 96 int tolerance_; 97 Quaternion targetOrientation_; //<! orientation to take 98 int spread_; //<! spread is a multiplier for formation flight, should be bigger than 100 99 int tolerance_; //<! if this ship is tolerance_ away from targetPosition_, ship decides that it finished moving 97 100 }; 98 101 }
Note: See TracChangeset
for help on using the changeset viewer.