Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2015, 4:06:37 PM (8 years ago)
Author:
gania
Message:

fix for sigsegv?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/campaignHS15/src/orxonox/controllers/FlyingController.h

    r10923 r10946  
    3939        FlyingController stores all the flying methods and member variables of AI.
    4040    */
     41
     42    //Formation mode for the divisions
    4143    namespace FormationMode
    4244    {
     
    5153
    5254        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
    5557 
    5658            FlyingController(Context* context);
     
    5860            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    5961
    60             void setSpread (int spread)
     62            void setSpread (int spread)                         //<! spread is a multiplier for formation flight, should be bigger than 100
    6163                { this->spread_ = spread; }
    62             int getSpread () const
     64            int getSpread () const                             
    6365                { return this->spread_; }
    6466
     
    7274
    7375        protected:
    74             void stopMoving();
     76            void stopMoving();                                  //<! don't call moveToTargetPosition() in tick, call lookAtTarget() from FightingController instead
    7577
    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!
    7880
    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
    8183
    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     
    8790           
    8891            FormationMode::Value formationMode_;
    8992         
    90             float rotationProgress_;    //<! for slerp
     93            float rotationProgress_;    //<! for slerping
    9194            bool bHasTargetPosition_;
    92             Vector3 targetPosition_;
     95            Vector3 targetPosition_;    //<! vector to fly to
    9396            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
    97100    };
    98101}
Note: See TracChangeset for help on using the changeset viewer.