Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 31, 2015, 4:07:29 PM (9 years ago)
Author:
gania
Message:

added a little bit of firing functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/AI_HS15/src/orxonox/controllers/CommonController.h

    r10729 r10731  
    3333#include "controllers/Controller.h"
    3434#include "worldentities/ControllableEntity.h"
     35#include "worldentities/pawns/Pawn.h"
     36
    3537
    3638namespace orxonox
     
    3941    {
    4042        public:
     43
    4144            static const float ACTION_INTERVAL = 1.0f;
    4245
    43             enum FormationMode {VEE,FINGER4,DIAMOND, WALL};
     46
     47            CommonController(Context* context);
     48            virtual ~CommonController();
     49
     50
     51
     52            enum FormationMode { VEE, FINGER4, DIAMOND, WALL };
    4453            virtual void setFormationMode(FormationMode val)
    4554                { this->formationMode_ = val; }
     
    4756                { return this->formationMode_; }
    4857
    49             CommonController(Context* context);
    50             virtual ~CommonController();
    51             virtual bool isLeader();
     58            enum Rank { NONE, SECTIONLEADER, DIVISIONLEADER, WINGMAN };
     59            virtual void setRank(Rank val)
     60                { this->rank_ = val; }
     61            inline Rank getRank() const
     62                { return this->rank_; }
     63
     64
     65
     66
    5267            virtual bool setWingman(CommonController* wingman);
    5368            virtual bool hasWingman();
     
    5873            void setTargetPosition(const Vector3& target);
    5974
     75            /*void spin();
     76            void turn180();*/
     77
     78
    6079        protected:
     80
    6181            void moveToPosition(const Vector3& target);
    62             virtual void positionReached() {}
     82            void moveToTargetPosition();
    6383
    64        
    65             void moveToTargetPosition();
     84
    6685            void copyOrientation(const Quaternion& orient);
    6786            void copyTargetOrientation();
    6887
     88            void doFire();
     89            void aimAtTarget();
     90            bool isLookingAtTarget(float angle) const;
    6991
    7092            bool bHasTargetPosition_;
     
    7395            Quaternion targetOrientation_;
    7496
     97
    7598            WeakPtr<ControllableEntity> target_;
    7699            bool bShooting_;
    77100
     101
    78102            FormationMode formationMode_;
    79 
     103            Rank rank_;
    80104
    81105
Note: See TracChangeset for help on using the changeset viewer.