Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 31, 2010, 6:18:50 PM (15 years ago)
Author:
solex
Message:

formationflight final commit before presentation (probably…)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/orxonox/controllers/ArtificialController.h

    r7034 r7066  
    5454            inline int getTeam() const
    5555                { return this->team_; }
     56
    5657            inline void setFormationFlight(bool formation)
    5758                { this->formationFlight_ = formation; }
    5859            inline bool getFormationFlight() const
    5960                { return this->formationFlight_; }
     61
    6062            inline void setFormationSize(int size)
    6163                { this->maxFormationSize_ = size; }
    6264            inline int getFormationSize() const
    6365                { return this->maxFormationSize_; }
     66
    6467            virtual void changedControllableEntity();
    6568
    66             static void formationflight(bool form);
    67             static void masteraction(int action);
     69            static void formationflight(const bool form);
     70            static void masteraction(const int action);
    6871            static void followme();
    69             static void passivebehaviour(bool passive);
    70             static void formationsize(int size);
     72            static void passivebehaviour(const bool passive);
     73            static void formationsize(const int size);
    7174
    7275        protected:
     
    8184            std::vector<ArtificialController*> slaves_;
    8285            ArtificialController *myMaster_;
    83             enum SpecificMasterAction {NONE, HOLD, SPIN, TURN180, FOLLOWHUMAN};
     86            enum SpecificMasterAction {NONE, HOLD, SPIN, TURN180, FOLLOW};
    8487            SpecificMasterAction specificMasterAction_;
    8588            int specificMasterActionHoldCount_;
    86             Pawn* humanToFollow_;
    87 
    88             void targetDied();
     89            float speedCounter_; //for speed adjustment when following
    8990
    9091            void moveToPosition(const Vector3& target);
    9192            void moveToTargetPosition();
    92 
    93             int getState();
    9493
    9594            void unregisterSlave();
     
    109108            void spinInit();
    110109            void spin();
    111             void followHumanInit(Pawn* human, bool always);
     110            void followInit(Pawn* pawn, const bool always = false, const int secondsToFollow = 100);
     111            void followRandomHumanInit();
    112112            void follow();
     113            void followForSlaves(const Vector3& target);
    113114
    114115            void setTargetPosition(const Vector3& target);
     
    122123            bool isCloseAtTarget(float distance) const;
    123124            bool isLookingAtTarget(float angle) const;
     125
     126            void targetDied();
    124127
    125128            static bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype); // hack
Note: See TracChangeset for help on using the changeset viewer.