Orxonox  0.0.5 Codename: Arcturus
FpsPlayer.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  * Cyrill Frei
24  * Co-authors:
25  * ...
26  *
27  */
28 
29 #ifndef _FpsPlayer_H__
30 #define _FpsPlayer_H__
31 
32 #include "OrxonoxPrereqs.h"
33 
34 #include <string>
35 #include <LinearMath/btVector3.h>
36 #include "util/Math.h"
37 #include "tools/Mesh.h"
38 #include "Pawn.h"
39 
40 namespace orxonox
41 {
42  class _OrxonoxExport FpsPlayer : public Pawn
43  {
44  public:
45  FpsPlayer(Context* context);
46  virtual ~FpsPlayer();
47 
48  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
49  virtual void tick(float dt) override;
50  void registerVariables();
51  void setConfigValues();
52 
53  virtual void moveFrontBack(const Vector2& value) override;
54  virtual void moveRightLeft(const Vector2& value) override;
55  virtual void moveUpDown(const Vector2& value) override;
56 
57  virtual void rotateYaw(const Vector2& value) override;
58  virtual void rotatePitch(const Vector2& value) override;
59  virtual void rotateRoll(const Vector2& value) override;
60 
61 
62  inline void setMeshSource(const std::string& meshname)
63  { this->meshSrc_ = meshname; this->changedMesh(); }
64  inline const std::string& getMeshSource() const
65  { return this->meshSrc_; }
66 
67  virtual void boost(bool bBoost) override; //actually jump
68 
69  virtual void fire();
70 
71  virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
72 
73  virtual void addedWeaponPack(WeaponPack* wPack) override;
74 
75  protected:
76  virtual void setPlayer(PlayerInfo* player) override;
77  virtual void startLocalHumanControl() override;
79 
80  bool bBoost_;
82  Vector3 steering_;
89 
90  private:
91  virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const override;
92  float speed_;
93 
94  void changedMesh();
97  float yaw_;
98  float pitch_;
99  float roll_;
100  Vector3 localVelocity_;
101  bool isFloor_;
103  Quaternion savedOrientation_;
104  Ogre::SceneNode* weaponNode_;
105  };
106 }
107 
108 #endif /* _FpsPlayer_H__ */
Definition: FpsPlayer.h:42
Everything in Orxonox that has a health attribute is a Pawn.
Definition: Pawn.h:56
btVector3 localAngularAcceleration_
Definition: FpsPlayer.h:88
btVector3 localLinearAcceleration_
Definition: FpsPlayer.h:87
Vector3 steering_
Definition: FpsPlayer.h:82
Definition: CorePrereqs.h:309
float yaw_
Definition: FpsPlayer.h:97
Quaternion savedOrientation_
Definition: FpsPlayer.h:103
const std::string & getMeshSource() const
Definition: FpsPlayer.h:64
bool bInvertYAxis_
Definition: FpsPlayer.h:78
::std::string string
Definition: gtest-port.h:756
std::string meshSrc_
Definition: FpsPlayer.h:96
Vector3 localVelocity_
Definition: FpsPlayer.h:100
std::string weaponMashName_
Definition: FpsPlayer.h:86
The WorldEntity represents everything that can be put in a Scene at a certain location.
Definition: WorldEntity.h:72
xmlelement
Definition: Super.h:519
Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the ...
float auxilaryThrust_
Definition: FpsPlayer.h:84
bool bPermanentBoost_
Definition: FpsPlayer.h:81
float pitch_
Definition: FpsPlayer.h:98
float rotationThrust_
Definition: FpsPlayer.h:85
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
Definition: WeaponPack.h:40
Ogre::SceneNode * weaponNode_
Definition: FpsPlayer.h:104
float primaryThrust_
Definition: FpsPlayer.h:83
CollisionType
Denotes the possible types of physical objects in a Scene.
Definition: WorldEntity.h:265
void setMeshSource(const std::string &meshname)
Definition: FpsPlayer.h:62
Shared library macros, enums, constants and forward declarations for the orxonox library ...
Definition: Context.h:45
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
bool thisTickBoost_
Definition: FpsPlayer.h:102
bool bBoost_
Definition: FpsPlayer.h:80
float speed_
Definition: FpsPlayer.h:92
Mesh mesh_
Definition: FpsPlayer.h:95
Definition: Mesh.h:37
float roll_
Definition: FpsPlayer.h:99
Definition: PlayerInfo.h:39
bool isFloor_
Definition: FpsPlayer.h:101