Changeset 10049 for code/branches/turretFS14/src/modules/objects/Turret.h
- Timestamp:
- May 8, 2014, 4:04:53 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/turretFS14/src/modules/objects/Turret.h
r10044 r10049 21 21 * 22 22 * Author: 23 * Marian Runo 23 * Marian Runo, Martin Mueller 24 24 * Co-authors: 25 25 * ... … … 28 28 29 29 /** 30 @file Turret.h31 30 @brief Definition of the Turret class. 32 31 @ingroup Objects … … 41 40 namespace orxonox 42 41 { 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 */ 43 51 class _ObjectsExport Turret : public Pawn 44 52 { … … 56 64 virtual void tick(float dt); 57 65 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; } 60 69 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)*/ 61 75 inline void setMaxPitch(float pitch) 62 76 { this->maxPitch_ = pitch; } 63 77 78 /** @brief Sets the maximum yaw the turret can have (in both directions). @param yaw The yaw (in one direction)*/ 64 79 inline void setMaxYaw(float yaw) 65 80 { this->maxYaw_ = yaw; } 66 81 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_; } 69 85 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 */ 70 91 inline float getMaxPitch() const 71 92 { return this->maxPitch_; } 72 93 94 /** @brief Returns the maximum yaw the turret can have. @return The yaw */ 73 95 inline float getMaxYaw() const 74 96 { return this->maxYaw_; } 75 97 76 98 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. 84 104 85 105 private: 86 bool once_; 106 bool once_; //!< Flag for executing code in the tick function only once. 87 107 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. 92 116 93 Quaternion rotation_;94 117 }; 95 118 }
Note: See TracChangeset
for help on using the changeset viewer.