Changeset 8855 for code/trunk/src/modules/weapons/projectiles/Rocket.h
- Timestamp:
- Aug 22, 2011, 3:05:26 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/weapons/projectiles/Rocket.h
r8738 r8855 27 27 */ 28 28 29 /** 30 @file Rocket.h 31 @brief Definition of the Rocket class. 32 */ 33 29 34 #ifndef _Rocket_H__ 30 35 #define _Rocket_H__ … … 33 38 34 39 #include "tools/Timer.h" 40 41 #include "interfaces/RadarViewable.h" 35 42 #include "worldentities/ControllableEntity.h" 36 #include "interfaces/RadarViewable.h"37 43 38 44 #include "BasicProjectile.h" … … 44 50 /** 45 51 @brief 46 Rocket , that is made to move upon a specified pattern.47 This class was constructed for the PPS tutorial. 52 Rocket that can be steered by the player. 53 48 54 @author 49 55 Oli Scheuss 56 @ingroup WeaponsProjectiles 50 57 */ 51 58 class _WeaponsExport Rocket : public ControllableEntity, public BasicProjectile, public RadarViewable … … 55 62 virtual ~Rocket(); 56 63 57 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Rocket through XML.58 64 virtual void tick(float dt); //!< Defines which actions the Rocket has to take in each tick. 59 65 60 66 virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint); 61 v oid destroyObject();67 virtual void destroyObject(void); 62 68 void destructionEffect(); 63 69 64 virtual void moveFrontBack(const Vector2& value) {}65 virtual void moveRightLeft(const Vector2& value) {}66 virtual void moveUpDown(const Vector2& value) {}70 virtual void moveFrontBack(const Vector2& value) {} 71 virtual void moveRightLeft(const Vector2& value) {} 72 virtual void moveUpDown(const Vector2& value) {} 67 73 68 74 virtual void rotateYaw(const Vector2& value); … … 75 81 */ 76 82 inline void moveFrontBack(float value) 77 { this->moveFrontBack(Vector2(value, 0)); }83 { this->moveFrontBack(Vector2(value, 0)); } 78 84 /** 79 85 @brief Moves the Rocket in the Right/Left-direction by the specifed amount. … … 81 87 */ 82 88 inline void moveRightLeft(float value) 83 { this->moveRightLeft(Vector2(value, 0)); }89 { this->moveRightLeft(Vector2(value, 0)); } 84 90 /** 85 91 @brief Moves the Rocket in the Up/Down-direction by the specifed amount. … … 87 93 */ 88 94 inline void moveUpDown(float value) 89 { this->moveUpDown(Vector2(value, 0)); }95 { this->moveUpDown(Vector2(value, 0)); } 90 96 91 97 /** … … 94 100 */ 95 101 inline void rotateYaw(float value) 96 { this->rotateYaw(Vector2(value, 0)); }102 { this->rotateYaw(Vector2(value, 0)); } 97 103 /** 98 104 @brief Rotates the Rocket around the x-axis by the specifed amount. … … 100 106 */ 101 107 inline void rotatePitch(float value) 102 { this->rotatePitch(Vector2(value, 0)); }108 { this->rotatePitch(Vector2(value, 0)); } 103 109 /** 104 110 @brief Rotates the Rocket around the z-axis by the specifed amount. … … 106 112 */ 107 113 inline void rotateRoll(float value) 108 { this->rotateRoll(Vector2(value, 0)); }114 { this->rotateRoll(Vector2(value, 0)); } 109 115 110 void setOwner(Pawn* owner); 111 inline Pawn* getOwner() const 112 { return this->owner_; } 116 virtual void setShooter(Pawn* shooter); 113 117 114 118 virtual void fired(unsigned int firemode); 115 119 116 120 private: 117 WeakPtr<Pawn> owner_; 118 Vector3 localAngularVelocity_; 121 Vector3 localAngularVelocity_; //!< Variable to temporarily store accumulated steering command input. 119 122 120 WeakPtr<PlayerInfo> player_; 121 Timer destroyTimer_; 122 float lifetime_; 123 WeakPtr<PlayerInfo> player_; //!< The player that controls the Rocket. 124 Timer destroyTimer_; //!< Timer to destroy the projectile after its lifetime has run out. 125 float lifetime_; //!< The time the projectile exists. 123 126 124 WorldSound* defSndWpnEngine_; 125 WorldSound* defSndWpnLaunch_; 127 WorldSound* defSndWpnEngine_; //!< Engine sound. 128 WorldSound* defSndWpnLaunch_; //!< Launch sound. 126 129 }; 127 130
Note: See TracChangeset
for help on using the changeset viewer.