Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 8, 2014, 4:04:53 PM (11 years ago)
Author:
muemart
Message:

Delete the old turret templates and make new ones. Adjust the weapon positions for the turret. Add a proxy controller for teams and targets. Add comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/turretFS14/src/modules/objects/Turret.h

    r10044 r10049  
    2121 *
    2222 *   Author:
    23  *      Marian Runo
     23 *      Marian Runo, Martin Mueller
    2424 *   Co-authors:
    2525 *      ...
     
    2828
    2929/**
    30     @file Turret.h
    3130    @brief Definition of the Turret class.
    3231    @ingroup Objects
     
    4140namespace orxonox
    4241{
     42    /**
     43    @brief
     44        Creates a turret with limited rotation. The point of this class is to be able to attach
     45        a turret to a spaceship or a spacestation which is more or less completely autonomous in
     46        it's behaviour.
     47
     48    @note
     49        The rotation isn't limited "physically". You have to call isInRange to find out if the turret is allowed to shoot at a target.
     50    */
    4351    class _ObjectsExport Turret : public Pawn
    4452    {
     
    5664            virtual void tick(float dt);
    5765
    58             inline void setAttackRadius(float radius)
    59                 { this->attackRadius_ = radius; }
     66            /** @brief Sets the maximum distance the turret is allowed to shoot. @param radius The distance*/
     67            inline void setMaxAttackRadius(float radius)
     68                { this->maxAttackRadius_ = radius; }
    6069
     70            /** @brief Sets the minimum distance the turret is allowed to shoot. @param radius The distance*/
     71            inline void setMinAttackRadius(float radius)
     72                { this->minAttackRadius_ = radius; }
     73
     74            /** @brief Sets the maximum pitch the turret can have (in both directions). @param pitch The pitch (in one direction)*/
    6175            inline void setMaxPitch(float pitch)
    6276                { this->maxPitch_ = pitch; }
    6377
     78            /** @brief Sets the maximum yaw the turret can have (in both directions). @param yaw The yaw (in one direction)*/
    6479            inline void setMaxYaw(float yaw)
    6580                { this->maxYaw_ = yaw; }
    6681
    67             inline float getAttackRadius() const
    68                 { return this->attackRadius_; }               
     82            /** @brief Returns the maximum distance the turret is allowed to shoot. @return The distance */
     83            inline float getMaxAttackRadius() const
     84                { return this->maxAttackRadius_; }               
    6985
     86            /** @brief Returns the minimum distance the turret is allowed to shoot. @return The distance */
     87            inline float getMinAttackRadius() const
     88                { return this->minAttackRadius_; }   
     89
     90            /** @brief Returns the maximum pitch the turret can have. @return The pitch */
    7091            inline float getMaxPitch() const
    7192                { return this->maxPitch_; }
    7293
     94            /** @brief Returns the maximum yaw the turret can have. @return The yaw */
    7395            inline float getMaxYaw() const
    7496                { return this->maxYaw_; }
    7597
    7698        protected:
    77             Vector3 startDir_;
    78             Vector3 localZ_;
    79             Vector3 localZStart_;
    80             Vector3 localY_;
    81             Vector3 localYStart_;
    82             Vector3 localX_;
    83             Vector3 localXStart_;           
     99            Vector3 startDir_; //!< The initial facing direction, in local coordinates.
     100            Vector3 localZ_; //!< The local z-axis, includes for the parent's rotation and rotations done in xml.
     101            Vector3 localY_; //!< The local y-axis, includes for the parent's rotation and rotations done in xml.
     102            Vector3 localX_; //!< The local x-axis, includes for the parent's rotation and rotations done in xml.     
     103            Quaternion rotation_; //!< The rotation to be done by the turret.
    84104
    85105        private:
    86             bool once_;
     106            bool once_; //!< Flag for executing code in the tick function only once.
    87107
    88             float attackRadius_;
    89             Ogre::Real maxPitch_;
    90             Ogre::Real maxYaw_;
    91             float rotationThrust_;
     108            Vector3 localZStart_; //!< The local z-axis, without the parent's rotation.
     109            Vector3 localYStart_; //!< The local y-axis, without the parent's rotation.
     110            Vector3 localXStart_; //!< The local x-axis, without the parent's rotation.
     111            float maxAttackRadius_; //!< The maximum distance the turret is allowed to shoot.
     112            float minAttackRadius_; //!< The minimum distance the turret is allowed to shoot.
     113            Ogre::Real maxPitch_; //!< The maxmium pitch the turret can have (on one side).
     114            Ogre::Real maxYaw_; //!< The maxmium yaw the turret can have (on one side).
     115            float rotationThrust_;  //!< The velocity the turret rotates with.
    92116
    93             Quaternion rotation_;
    94117    };
    95118}
Note: See TracChangeset for help on using the changeset viewer.