29 #ifndef _ControllableEntity_H__ 30 #define _ControllableEntity_H__ 57 virtual void tick(
float dt)
override;
58 void setConfigValues();
63 {
return this->player_; }
69 {
return this->formerPlayer_; }
72 { this->bDestroyWhenPlayerLeft_ = bDestroy; }
74 {
return this->bDestroyWhenPlayerLeft_; }
80 virtual void rotateYaw(
const Vector2& value);
81 virtual void rotatePitch(
const Vector2& value);
82 virtual void rotateRoll(
const Vector2& value);
85 { this->moveFrontBack(Vector2(value, 0)); }
87 { this->moveRightLeft(Vector2(value, 0)); }
89 { this->moveUpDown(Vector2(value, 0)); }
92 { this->rotateYaw(Vector2(value, 0)); }
94 { this->rotatePitch(Vector2(value, 0)); }
96 { this->rotateRoll(Vector2(value, 0)); }
98 void fire(
unsigned int firemode);
99 virtual void fired(
unsigned int firemode) {}
110 virtual void switchCamera();
111 virtual void mouseLook();
114 {
return this->hudtemplate_; }
117 {
return this->camera_; }
119 {
return this->hud_; }
124 {
return this->cameraPositions_; }
125 unsigned int getCurrentCameraIndex()
const;
126 bool setCameraPosition(
unsigned int index);
129 { this->cameraPositionTemplate_ = name; }
131 {
return this->cameraPositionTemplate_; }
134 { this->reverseCamera_ = camera; }
136 {
return this->reverseCamera_; }
143 virtual void setPosition(
const Vector3& position)
override;
144 virtual void setOrientation(
const Quaternion& orientation)
override;
145 virtual void setVelocity(
const Vector3& velocity)
override;
146 virtual void setAngularVelocity(
const Vector3& velocity)
override;
149 {
return this->bHasLocalController_; }
151 {
return this->bHasHumanController_; }
154 {
return this->bMouseLook_; }
156 {
return this->mouseLookSpeed_; }
158 {
return this->currentCameraPosition_; }
161 {
return this->xmlcontroller_; }
164 {
return this->controller_; }
170 {
return this->target_; }
171 void setTargetInternal( uint32_t targetID );
174 { this->team_ = team; }
176 {
return this->team_; }
180 virtual void preDestroy()
override;
183 virtual void removePlayer();
185 virtual void startLocalHumanControl();
186 virtual void stopLocalHumanControl();
187 virtual void parentChanged()
override;
190 { this->hudtemplate_ = name; }
192 void createHud(
void);
193 void destroyHud(
void);
198 void registerVariables();
199 void setXMLController(
Controller* controller);
202 void processOverwrite();
204 void processServerPosition();
205 void processServerLinearVelocity();
206 void processServerOrientation();
207 void processServerAngularVelocity();
209 void processClientPosition();
210 void processClientLinearVelocity();
211 void processClientOrientation();
212 void processClientAngularVelocity();
214 void networkcallback_changedplayerID();
217 virtual void setWorldTransform(
const btTransform& worldTrans)
override;
void rotatePitch(float value)
Definition: ControllableEntity.h:93
virtual void setOrientation(const Quaternion &orientation)=0
Controller * getXMLController() const
Definition: ControllableEntity.h:160
unsigned int server_overwrite_
Definition: ControllableEntity.h:219
Vector3 server_angular_velocity_
Definition: ControllableEntity.h:232
bool hasLocalController() const
Definition: ControllableEntity.h:148
void setHudTemplate(const std::string &name)
Definition: ControllableEntity.h:189
CameraPosition * getReverseCamera() const
Definition: ControllableEntity.h:135
Ogre::SceneNode * cameraPositionRootNode_
Definition: ControllableEntity.h:195
Vector3 server_position_
Definition: ControllableEntity.h:226
float mouseLookSpeed_
Definition: ControllableEntity.h:244
Controller * getController() const
Definition: ControllableEntity.h:163
OverlayGroup * hud_
Definition: ControllableEntity.h:240
std::string cameraPositionTemplate_
Definition: ControllableEntity.h:247
::std::string string
Definition: gtest-port.h:756
Definition: CameraPosition.h:37
Camera * camera_
Definition: ControllableEntity.h:242
WeakPtr< Controller > controller_
Definition: ControllableEntity.h:249
bool bHasLocalController_
Definition: ControllableEntity.h:222
bool getDestroyWhenPlayerLeft() const
Definition: ControllableEntity.h:73
void rotateRoll(float value)
Definition: ControllableEntity.h:95
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
std::list< StrongPtr< CameraPosition > > cameraPositions_
Definition: ControllableEntity.h:245
CameraPosition * getCurrentCameraPosition()
Definition: ControllableEntity.h:157
const std::string & getHudTemplate() const
Definition: ControllableEntity.h:113
Quaternion server_orientation_
Definition: ControllableEntity.h:230
unsigned int client_overwrite_
Definition: ControllableEntity.h:220
std::string hudtemplate_
Definition: ControllableEntity.h:239
bool hasHumanController() const
Definition: ControllableEntity.h:150
The WorldEntity represents everything that can be put in a Scene at a certain location.
Definition: WorldEntity.h:72
PlayerInfo * getPlayer() const
Definition: ControllableEntity.h:62
xmlelement
Definition: Super.h:519
Controller * xmlcontroller_
Definition: ControllableEntity.h:248
void moveFrontBack(float value)
Definition: ControllableEntity.h:84
WeakPtr< WorldEntity > target_
Definition: ControllableEntity.h:251
Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the ...
The MobileEntity is a derived class from orxonox::WorldEntity and orxonox::Tickable.
Definition: MobileEntity.h:53
void setCameraPositionTemplate(const std::string &name)
Definition: ControllableEntity.h:128
virtual WorldEntity * getTarget()
Definition: ControllableEntity.h:169
const std::list< StrongPtr< CameraPosition > > & getCameraPositions() const
Definition: ControllableEntity.h:123
CameraPosition * reverseCamera_
Definition: ControllableEntity.h:250
int team_
Definition: ControllableEntity.h:253
virtual void greet()
Definition: ControllableEntity.h:109
void setReverseCamera(CameraPosition *camera)
Definition: ControllableEntity.h:133
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
CameraPosition * currentCameraPosition_
Definition: ControllableEntity.h:246
virtual void moveUpDown(const Vector2 &value)
Definition: ControllableEntity.h:78
unsigned int playerID_
Definition: ControllableEntity.h:237
Mode
Definition: CorePrereqs.h:102
bool bDestroyWhenPlayerLeft_
Definition: ControllableEntity.h:224
Shared library macros, enums, constants and forward declarations for the orxonox library ...
Vector3 server_linear_velocity_
Definition: ControllableEntity.h:228
bool isInMouseLook() const
Definition: ControllableEntity.h:153
void rotateYaw(float value)
Definition: ControllableEntity.h:91
Vector3 client_position_
Definition: ControllableEntity.h:227
PlayerInfo * formerPlayer_
Definition: ControllableEntity.h:236
PlayerInfo * player_
Definition: ControllableEntity.h:235
virtual void reload()
Definition: ControllableEntity.h:100
virtual void fired(unsigned int firemode)
Definition: ControllableEntity.h:99
int getTeam() const
Definition: ControllableEntity.h:175
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
Definition: Controller.h:38
void moveUpDown(float value)
Definition: ControllableEntity.h:88
OverlayGroup does almost exactly what it says: It groups OrxonoxOverlays together.
Definition: OverlayGroup.h:53
virtual void boost(bool bBoost)
Tells the ControllableEntity to either start or stop boosting.
Definition: ControllableEntity.h:107
Vector3 client_angular_velocity_
Definition: ControllableEntity.h:233
void setDestroyWhenPlayerLeft(bool bDestroy)
Definition: ControllableEntity.h:71
virtual void changedPlayer()
Definition: ControllableEntity.h:60
virtual void setVelocity(const Vector3 &velocity)
Definition: MobileEntity.cc:134
Camera * getCamera() const
Definition: ControllableEntity.h:116
float getMouseLookSpeed() const
Definition: ControllableEntity.h:155
Definition: PlayerInfo.h:39
void moveRightLeft(float value)
Definition: ControllableEntity.h:86
virtual void setAngularVelocity(const Vector3 &velocity)
Definition: MobileEntity.cc:142
PlayerInfo * getFormerPlayer() const
Get the player even after the ControllableEntity has stopped being the players ControllableEntity.
Definition: ControllableEntity.h:68
void setTeam(int team)
Definition: ControllableEntity.h:173
Vector3 client_linear_velocity_
Definition: ControllableEntity.h:229
virtual void setPosition(const Vector3 &position)=0
virtual void moveFrontBack(const Vector2 &value)
Definition: ControllableEntity.h:76
The ControllableEntity is derived from the orxonox::MobileEntity.
Definition: ControllableEntity.h:48
Quaternion client_orientation_
Definition: ControllableEntity.h:231
virtual void moveRightLeft(const Vector2 &value)
Definition: ControllableEntity.h:77
const std::string & getCameraPositionTemplate() const
Definition: ControllableEntity.h:130
bool bHasHumanController_
Definition: ControllableEntity.h:223
OverlayGroup * getHUD() const
Definition: ControllableEntity.h:118
bool bMouseLook_
Definition: ControllableEntity.h:243