Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 30, 2015, 4:04:16 PM (9 years ago)
Author:
gania
Message:

commented some stuff

File:
1 edited

Legend:

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

    r10888 r10898  
    3535namespace orxonox
    3636{
     37    /**
     38    @brief
     39        FightingController stores all the fighting methods and member variables of AI.
     40        Main methods here are maneuver() and dodge().
     41    */
    3742    class _OrxonoxExport FightingController : public FlyingController
    3843    {
     
    4954            ControllableEntity* getTarget() const
    5055                { return this->target_; }
    51             bool bKeepFormation_;
     56            bool bKeepFormation_;   //even if action_ == FIGHT, you might still want to keep formation if far enough form the target
    5257           
    5358        protected:
    54             void setTarget(ControllableEntity* target);
     59            void setTarget(ControllableEntity* target); //set a target to shoot at
    5560
    56             void setPositionOfTarget(const Vector3& target);
    57             void setOrientationOfTarget(const Quaternion& orient);
    58             void stopLookingAtTarget();
    59             void startLookingAtTarget();
    60             void lookAtTarget(float dt);
     61            void setPositionOfTarget(const Vector3& target);    //good to know where target is
     62            void setOrientationOfTarget(const Quaternion& orient);  //I don't really use that
     63            void stopLookingAtTarget();     //<! target dead -> you need to be able to fly
     64            void startLookingAtTarget();    //<! if close to target, no need to fly, just rotate yourself
     65            void lookAtTarget(float dt);    //<! rotate yourself towards target
    6166
    62             void maneuver();
    63             void dodge(const Vector3& thisPosition, Vector3& diffUnit);
    64             void dodgeTowards (Vector3& position);
    65             bool canFire();
    66             void doFire();
     67            void maneuver(); //<! sets this->targetPosition_, which is a Vector3 of where this ship flies. Decision is made based on
     68                             //<! the distance to enemy, if being attacked, dodge() is called, otherwise ship just flies towards this->target_.
     69            void dodge(const Vector3& thisPosition, Vector3& diffUnit); //<! choose a random Vector3 perpendicular to the difference vector between
     70                                                                        //<! this and target_ plus or minus some amount in difference vector direction,
     71                                                                        //<! depending on whether it is better to close up or survive.
     72            void dodgeTowards (Vector3& position);  //fly towards position and awoid being hit
     73            bool canFire(); //<! check if target_ is in radius and if this is looking at target_
     74            void doFire();  //<! choose weapon, set aim at target_ and fire
    6775            WeakPtr<ControllableEntity> target_;
    6876            void setClosestTarget();
Note: See TracChangeset for help on using the changeset viewer.