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 | * Fabian 'x3n' Landau |
---|
24 | * Co-authors: |
---|
25 | * ... |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef _Engine_H__ |
---|
30 | #define _Engine_H__ |
---|
31 | |
---|
32 | #include "OrxonoxPrereqs.h" |
---|
33 | |
---|
34 | #include "interfaces/Tickable.h" |
---|
35 | #include "Item.h" |
---|
36 | |
---|
37 | namespace orxonox |
---|
38 | { |
---|
39 | class _OrxonoxExport Engine : public Item, public Tickable |
---|
40 | { |
---|
41 | public: |
---|
42 | Engine(BaseObject* creator); |
---|
43 | virtual ~Engine(); |
---|
44 | |
---|
45 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
46 | void registerVariables(); |
---|
47 | void setConfigValues(); |
---|
48 | |
---|
49 | virtual void tick(float dt); |
---|
50 | virtual void changedActivity(); |
---|
51 | |
---|
52 | virtual void addToSpaceShip(SpaceShip* ship); |
---|
53 | inline SpaceShip* getShip() const |
---|
54 | { return this->ship_; } |
---|
55 | |
---|
56 | inline void setBoostFactor(float factor) |
---|
57 | { this->boostFactor_ = factor; } |
---|
58 | inline float getBoostFactor() const |
---|
59 | { return this->boostFactor_; } |
---|
60 | |
---|
61 | inline void setSpeedFactor(float factor) |
---|
62 | { this->speedFactor_ = factor; } |
---|
63 | inline float getSpeedFactor() const |
---|
64 | { return this->speedFactor_; } |
---|
65 | |
---|
66 | inline void setMaxSpeedFront(float speed) |
---|
67 | { this->maxSpeedFront_ = speed; } |
---|
68 | inline void setMaxSpeedBack(float speed) |
---|
69 | { this->maxSpeedBack_ = speed; } |
---|
70 | inline void setMaxSpeedLeftRight(float speed) |
---|
71 | { this->maxSpeedLeftRight_ = speed; } |
---|
72 | inline void setMaxSpeedUpDown(float speed) |
---|
73 | { this->maxSpeedUpDown_ = speed; } |
---|
74 | |
---|
75 | inline float getMaxSpeedFront() const |
---|
76 | { return this->maxSpeedFront_; } |
---|
77 | inline float getMaxSpeedBack() const |
---|
78 | { return this->maxSpeedBack_; } |
---|
79 | inline float getMaxSpeedLeftRight() const |
---|
80 | { return this->maxSpeedLeftRight_; } |
---|
81 | inline float getMaxSpeedUpDown() const |
---|
82 | { return this->maxSpeedUpDown_; } |
---|
83 | |
---|
84 | inline void setAccelerationFront(float acceleration) |
---|
85 | { this->accelerationFront_ = acceleration; } |
---|
86 | inline void setAccelerationBrake(float acceleration) |
---|
87 | { this->accelerationBrake_ = acceleration; } |
---|
88 | inline void setAccelerationBack(float acceleration) |
---|
89 | { this->accelerationBack_ = acceleration; } |
---|
90 | inline void setAccelerationLeftRight(float acceleration) |
---|
91 | { this->accelerationLeftRight_ = acceleration; } |
---|
92 | inline void setAccelerationUpDown(float acceleration) |
---|
93 | { this->accelerationUpDown_ = acceleration; } |
---|
94 | |
---|
95 | inline float getAccelerationFront() const |
---|
96 | { return this->accelerationFront_; } |
---|
97 | inline float getAccelerationBrake() const |
---|
98 | { return this->accelerationBrake_; } |
---|
99 | inline float getAccelerationBack() const |
---|
100 | { return this->accelerationBack_; } |
---|
101 | inline float getAccelerationLeftRight() const |
---|
102 | { return this->accelerationLeftRight_; } |
---|
103 | inline float getAccelerationUpDown() const |
---|
104 | { return this->accelerationUpDown_; } |
---|
105 | |
---|
106 | virtual const Vector3& getDirection() const; |
---|
107 | |
---|
108 | void loadSound(const std::string filename); |
---|
109 | |
---|
110 | private: |
---|
111 | void networkcallback_shipID(); |
---|
112 | |
---|
113 | SpaceShip* ship_; |
---|
114 | unsigned int shipID_; |
---|
115 | |
---|
116 | float boostFactor_; |
---|
117 | float speedFactor_; |
---|
118 | |
---|
119 | float maxSpeedFront_; |
---|
120 | float maxSpeedBack_; |
---|
121 | float maxSpeedLeftRight_; |
---|
122 | float maxSpeedUpDown_; |
---|
123 | |
---|
124 | float accelerationFront_; |
---|
125 | float accelerationBrake_; |
---|
126 | float accelerationBack_; |
---|
127 | float accelerationLeftRight_; |
---|
128 | float accelerationUpDown_; |
---|
129 | |
---|
130 | Shader* boostBlur_; |
---|
131 | float blurStrength_; |
---|
132 | |
---|
133 | SoundBase* sound_; |
---|
134 | }; |
---|
135 | } |
---|
136 | |
---|
137 | #endif /* _Engine_H__ */ |
---|