Orxonox  0.0.5 Codename: Arcturus
Drone.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Oli Scheuss
24  * Co-authors:
25  * ...
26  *
27  */
28 
29 #ifndef _Drone_H__
30 #define _Drone_H__
31 
32 #include "OrxonoxPrereqs.h"
35 
36 namespace orxonox
37 {
38 
46  class _OrxonoxExport Drone : public Pawn
47  {
48  public:
49  Drone(Context* context);
50  virtual ~Drone();
51 
52  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
53  virtual void tick(float dt) override;
54 
55 
56  virtual void moveFrontBack(const Vector2& value) override;
57  virtual void moveRightLeft(const Vector2& value) override;
58  virtual void moveUpDown(const Vector2& value) override;
59 
60  virtual void rotateYaw(const Vector2& value) override;
61  virtual void rotatePitch(const Vector2& value) override;
62  virtual void rotateRoll(const Vector2& value) override;
63 
68  inline void moveFrontBack(float value)
69  { this->moveFrontBack(Vector2(value, 0)); }
74  inline void moveRightLeft(float value)
75  { this->moveRightLeft(Vector2(value, 0)); }
80  inline void moveUpDown(float value)
81  { this->moveUpDown(Vector2(value, 0)); }
82 
87  inline void rotateYaw(float value)
88  { this->rotateYaw(Vector2(value, 0)); }
93  inline void rotatePitch(float value)
94  { this->rotatePitch(Vector2(value, 0)); }
99  inline void rotateRoll(float value)
100  { this->rotateRoll(Vector2(value, 0)); }
101 
106  inline void setPrimaryThrust( float thrust )
107  { this->primaryThrust_=thrust; }
108  inline void setAuxilaryThrust( float thrust )
109  { this->auxilaryThrust_=thrust; }
110  inline void setRotationThrust( float thrust )
111  { this->rotationThrust_=thrust; }
112  inline void setMaxDistanceToOwner( float distance)
113  { this->maxDistanceToOwner_=distance; }
114  inline void setMinDistanceToOwner( float distance)
115  { this->minDistanceToOwner_=distance; }
116  inline void setMaxShootingRange( float distance)
117  { this->maxShootingRange_=distance; }
118 
119 
124  inline float getPrimaryThrust()
125  { return this->primaryThrust_; }
126  inline float getAuxilaryThrust()
127  { return this->auxilaryThrust_; }
128  inline float getRotationThrust()
129  { return this->rotationThrust_; }
130  inline float getMaxDistanceToOwner()
131  { return this->maxDistanceToOwner_; }
132  inline float getMinDistanceToOwner()
133  { return this->minDistanceToOwner_; }
134  inline float getMaxShootingRange()
135  { return this->maxShootingRange_; }
136 
137  private:
139 
145  float maxDistanceToOwner_; //Maximum Distance to owner
146  float minDistanceToOwner_; //Minimum Distance to owner
148  };
149 
150 }
151 
152 #endif /* _Drone_H__ */
Everything in Orxonox that has a health attribute is a Pawn.
Definition: Pawn.h:56
Controller for the Drone of the PPS tutorial.
Definition: DroneController.h:49
void rotateRoll(float value)
Rotates the Drone around the z-axis by the specifed amount.
Definition: Drone.h:99
void rotateYaw(float value)
Rotates the Drone around the y-axis by the specifed amount.
Definition: Drone.h:87
float maxDistanceToOwner_
Definition: Drone.h:145
void setMaxShootingRange(float distance)
Definition: Drone.h:116
void setMaxDistanceToOwner(float distance)
Definition: Drone.h:112
void moveFrontBack(float value)
Moves the Drone in the Front/Back-direction by the specifed amount.
Definition: Drone.h:68
float getPrimaryThrust()
Gets the primary thrust to the input amount.
Definition: Drone.h:124
xmlelement
Definition: Super.h:519
void moveUpDown(float value)
Moves the Drone in the Up/Down-direction by the specifed amount.
Definition: Drone.h:80
DroneController * myController_
The controller of the Drone.
Definition: Drone.h:138
float primaryThrust_
The amount of primary thrust. This is just used, when moving forward.
Definition: Drone.h:142
float auxilaryThrust_
The amount of auxilary thrust. Used for all other movements (except for rotations).
Definition: Drone.h:143
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
void setAuxilaryThrust(float thrust)
Definition: Drone.h:108
Shared library macros, enums, constants and forward declarations for the orxonox library ...
float getMaxDistanceToOwner()
Definition: Drone.h:130
Definition: Context.h:45
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
float maxShootingRange_
Definition: Drone.h:147
void setRotationThrust(float thrust)
Definition: Drone.h:110
void setMinDistanceToOwner(float distance)
Definition: Drone.h:114
float getMaxShootingRange()
Definition: Drone.h:134
btVector3 localLinearAcceleration_
The linear acceleration that is used to move the Drone the next tick.
Definition: Drone.h:140
float getAuxilaryThrust()
Definition: Drone.h:126
void moveRightLeft(float value)
Moves the Drone in the Right/Left-direction by the specifed amount.
Definition: Drone.h:74
float getRotationThrust()
Definition: Drone.h:128
void rotatePitch(float value)
Rotates the Drone around the x-axis by the specifed amount.
Definition: Drone.h:93
void setPrimaryThrust(float thrust)
Sets the primary thrust to the input amount.
Definition: Drone.h:106
float getMinDistanceToOwner()
Definition: Drone.h:132
btVector3 localAngularAcceleration_
The linear angular acceleration that is used to move the Drone the next tick.
Definition: Drone.h:141
Drone, that is made to move upon a specified pattern.
Definition: Drone.h:46
float rotationThrust_
The amount of rotation thrust. Used for rotations only.
Definition: Drone.h:144
float minDistanceToOwner_
Definition: Drone.h:146