Orxonox  0.0.5 Codename: Arcturus
ScriptableControllerDrone.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 _ScriptableControllerDrone_H__
30 #define _ScriptableControllerDrone_H__
31 
32 #include "OrxonoxPrereqs.h"
33 
34 #include "core/XMLPort.h"
35 //#include "controllers/AutonomousDroneController.h"
36 
37 #include "Pawn.h"
38 
39 namespace orxonox {
40 
49  {
50  public:
52  virtual ~ScriptableControllerDrone();
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:
198  //AutonomousDroneController *myController_; //!< The controller of the AutonomousDrone.
199 
205  float mass_;
208  };
209 
210 }
211 
212 #endif // _AutonomousDrone_H__
Everything in Orxonox that has a health attribute is a Pawn.
Definition: Pawn.h:56
float getAngularDamping()
Gets the primary thrust to the input amount.
Definition: ScriptableControllerDrone.h:192
btVector3 localLinearAcceleration_
The linear acceleration that is used to move the AutonomousDrone the next tick.
Definition: ScriptableControllerDrone.h:200
void setLinearDamping(float damping)
Sets the rotation thrust to the input amount.
Definition: ScriptableControllerDrone.h:140
void setMass(float mass)
Sets the rotation thrust to the input amount.
Definition: ScriptableControllerDrone.h:133
float mass_
Definition: ScriptableControllerDrone.h:205
float getRotationThrust()
Gets the primary thrust to the input amount.
Definition: ScriptableControllerDrone.h:171
Declaration of the XMLPort helper classes and macros.
float getLinearDamping()
Gets the primary thrust to the input amount.
Definition: ScriptableControllerDrone.h:185
void rotateYaw(float value)
Rotates the Drone around the y-axis by the specifed amount.
Definition: ScriptableControllerDrone.h:90
float getAuxiliaryThrust()
Gets the primary thrust to the input amount.
Definition: ScriptableControllerDrone.h:164
float primaryThrust_
The amount of primary thrust. This is just used, when moving forward.
Definition: ScriptableControllerDrone.h:202
xmlelement
Definition: Super.h:519
float auxiliaryThrust_
The amount of auxiliary thrust. Used for all other movements (except for rotations).
Definition: ScriptableControllerDrone.h:203
void rotateRoll(float value)
Rotates the Drone around the z-axis by the specifed amount.
Definition: ScriptableControllerDrone.h:102
float angularDamping_
Definition: ScriptableControllerDrone.h:207
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
float getPrimaryThrust()
Gets the primary thrust to the input amount.
Definition: ScriptableControllerDrone.h:156
Shared library macros, enums, constants and forward declarations for the orxonox library ...
Definition: Context.h:45
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
float linearDamping_
Definition: ScriptableControllerDrone.h:206
void setPrimaryThrust(float thrust)
Sets the primary thrust to the input amount.
Definition: ScriptableControllerDrone.h:109
float getMass()
Gets the primary thrust to the input amount.
Definition: ScriptableControllerDrone.h:178
void setAuxiliaryThrust(float thrust)
Sets the auxiliary thrust to the input amount.
Definition: ScriptableControllerDrone.h:119
void setRotationThrust(float thrust)
Sets the rotation thrust to the input amount.
Definition: ScriptableControllerDrone.h:126
btVector3 localAngularAcceleration_
The linear angular acceleration that is used to move the AutonomousDrone the next tick...
Definition: ScriptableControllerDrone.h:201
Drone, that is made to move upon a specified pattern.
Definition: ScriptableControllerDrone.h:48
float rotationThrust_
The amount of rotation thrust. Used for rotations only.s.
Definition: ScriptableControllerDrone.h:204
void moveRightLeft(float value)
Moves the Drone in the Right/Left-direction by the specifed amount.
Definition: ScriptableControllerDrone.h:77
void setAngularDamping(float damping)
Sets the rotation thrust to the input amount.
Definition: ScriptableControllerDrone.h:147
void rotatePitch(float value)
Rotates the Drone around the x-axis by the specifed amount.
Definition: ScriptableControllerDrone.h:96
void moveUpDown(float value)
Moves the Drone in the Up/Down-direction by the specifed amount.
Definition: ScriptableControllerDrone.h:83
void moveFrontBack(float value)
Moves the Drone in the Front/Back-direction by the specifed amount.
Definition: ScriptableControllerDrone.h:71