Orxonox  0.0.5 Codename: Arcturus
AutonomousDrone.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  * Damian 'Mozork' Frick
26  *
27  */
28 
29 #ifndef _AutonomousDrone_H__
30 #define _AutonomousDrone_H__
31 
32 #include "OrxonoxPrereqs.h"
33 
34 #include "core/XMLPort.h"
36 
37 #include "ControllableEntity.h"
38 
39 namespace orxonox {
40 
49  {
50  public:
51  AutonomousDrone(Context* context);
52  virtual ~AutonomousDrone();
53 
54  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
55  virtual void tick(float dt);
56 
57  virtual void moveFrontBack(const Vector2& value);
58  virtual void moveRightLeft(const Vector2& value);
59  virtual void moveUpDown(const Vector2& value);
60 
61  virtual void rotateYaw(const Vector2& value);
62  virtual void rotatePitch(const Vector2& value);
63  virtual void rotateRoll(const Vector2& value);
64 
71  inline void moveFrontBack(float value)
72  { this->moveFrontBack(Vector2(value, 0)); }
77  inline void moveRightLeft(float value)
78  { this->moveRightLeft(Vector2(value, 0)); }
83  inline void moveUpDown(float value)
84  { this->moveUpDown(Vector2(value, 0)); }
85 
90  inline void rotateYaw(float value)
91  { this->rotateYaw(Vector2(value, 0)); }
96  inline void rotatePitch(float value)
97  { this->rotatePitch(Vector2(value, 0)); }
102  inline void rotateRoll(float value)
103  { this->rotateRoll(Vector2(value, 0)); }
104 
109  inline void setPrimaryThrust( float thrust )
110  { this->primaryThrust_ = thrust; }
111  //TODO: Place your set-functions here.
112  // Hint: auxiliary thrust, rotation thrust.
113 
114 
119  inline void setAuxiliaryThrust( float thrust )
120  { this->auxiliaryThrust_ = thrust; }
121 
126  inline void setRotationThrust( float thrust )
127  { this->rotationThrust_ = thrust; }
128 
133  inline void setMass( float mass )
134  { this->mass_ = mass; }
135 
140  inline void setLinearDamping( float damping )
141  { this->linearDamping_ = damping; }
142 
147  inline void setAngularDamping( float damping )
148  { this->angularDamping_ = damping; }
149 
150 
151 
156  inline float getPrimaryThrust()
157  { return this->primaryThrust_; }
158  //TODO: Place your get-functions here.
159 
164  inline float getAuxiliaryThrust()
165  { return this->auxiliaryThrust_; }
166 
171  inline float getRotationThrust()
172  { return this->rotationThrust_; }
173 
178  inline float getMass()
179  { return this->mass_; }
180 
185  inline float getLinearDamping()
186  { return this->linearDamping_; }
187 
192  inline float getAngularDamping()
193  { return this->angularDamping_; }
194 
195 
196 
197  private:
199 
205  float mass_;
208  };
209 
210 }
211 
212 #endif // _AutonomousDrone_H__
float getAuxiliaryThrust()
Gets the primary thrust to the input amount.
Definition: AutonomousDrone.h:164
void rotateRoll(float value)
Rotates the Drone around the z-axis by the specifed amount.
Definition: AutonomousDrone.h:102
float mass_
Definition: AutonomousDrone.h:205
float getMass()
Gets the primary thrust to the input amount.
Definition: AutonomousDrone.h:178
Drone, that is made to move upon a specified pattern.
Definition: AutonomousDrone.h:48
AutonomousDroneController * myController_
The controller of the AutonomousDrone.
Definition: AutonomousDrone.h:198
float getAngularDamping()
Gets the primary thrust to the input amount.
Definition: AutonomousDrone.h:192
void setMass(float mass)
Sets the rotation thrust to the input amount.
Definition: AutonomousDrone.h:133
float getLinearDamping()
Gets the primary thrust to the input amount.
Definition: AutonomousDrone.h:185
float getRotationThrust()
Gets the primary thrust to the input amount.
Definition: AutonomousDrone.h:171
Declaration of the XMLPort helper classes and macros.
float angularDamping_
Definition: AutonomousDrone.h:207
xmlelement
Definition: Super.h:519
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
Shared library macros, enums, constants and forward declarations for the orxonox library ...
void setPrimaryThrust(float thrust)
Sets the primary thrust to the input amount.
Definition: AutonomousDrone.h:109
void moveFrontBack(float value)
Moves the Drone in the Front/Back-direction by the specifed amount.
Definition: AutonomousDrone.h:71
btVector3 localAngularAcceleration_
The linear angular acceleration that is used to move the AutonomousDrone the next tick...
Definition: AutonomousDrone.h:201
Definition: Context.h:45
void setAuxiliaryThrust(float thrust)
Sets the auxiliary thrust to the input amount.
Definition: AutonomousDrone.h:119
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
float auxiliaryThrust_
The amount of auxiliary thrust. Used for all other movements (except for rotations).
Definition: AutonomousDrone.h:203
float primaryThrust_
The amount of primary thrust. This is just used, when moving forward.
Definition: AutonomousDrone.h:202
float rotationThrust_
The amount of rotation thrust. Used for rotations only.s.
Definition: AutonomousDrone.h:204
void moveRightLeft(float value)
Moves the Drone in the Right/Left-direction by the specifed amount.
Definition: AutonomousDrone.h:77
btVector3 localLinearAcceleration_
The linear acceleration that is used to move the AutonomousDrone the next tick.
Definition: AutonomousDrone.h:200
void rotatePitch(float value)
Rotates the Drone around the x-axis by the specifed amount.
Definition: AutonomousDrone.h:96
void setRotationThrust(float thrust)
Sets the rotation thrust to the input amount.
Definition: AutonomousDrone.h:126
void rotateYaw(float value)
Rotates the Drone around the y-axis by the specifed amount.
Definition: AutonomousDrone.h:90
float linearDamping_
Definition: AutonomousDrone.h:206
The ControllableEntity is derived from the orxonox::MobileEntity.
Definition: ControllableEntity.h:48
Controller for the AutonomousDrone of the PPS tutorial.
Definition: AutonomousDroneController.h:45
void moveUpDown(float value)
Moves the Drone in the Up/Down-direction by the specifed amount.
Definition: AutonomousDrone.h:83
void setLinearDamping(float damping)
Sets the rotation thrust to the input amount.
Definition: AutonomousDrone.h:140
void setAngularDamping(float damping)
Sets the rotation thrust to the input amount.
Definition: AutonomousDrone.h:147
float getPrimaryThrust()
Gets the primary thrust to the input amount.
Definition: AutonomousDrone.h:156