Orxonox  0.0.5 Codename: Arcturus
RocketController.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  * Gabriel Nadler
24  * Co-authors:
25  * ...
26  *
27  */
28 
34 #ifndef _RocketController_H__
35 #define _RocketController_H__
36 
37 #include "weapons/WeaponsPrereqs.h"
38 
40 #include "controllers/Controller.h"
41 
42 namespace orxonox
43 {
52  {
53  public:
54  RocketController(Context* context);
55  virtual ~RocketController();
56 
57  virtual void tick(float dt) override;
63  { return this->rocket_; };
64 
69  void setTarget(WorldEntity* target)
70  { this->target_ = target; }
71 
72  protected:
73  void updateTargetPosition();
74  void moveToPosition(const Vector3& target);
75 
76  private:
78  Vector3 targetPosition_;
80 
82  };
83 }
84 
85 #endif /* _RocketController_H__ */
WeakPtr< PlayerInfo > player_
The player the rocket belongs to.
Definition: RocketController.h:79
WeakPtr< WorldEntity > target_
The target.
Definition: RocketController.h:81
Declaration of the Tickable interface.
SimpleRocket * getRocket() const
Get the rocket that is controlled by this controller.
Definition: RocketController.h:62
Shared library macros, enums, constants and forward declarations for the weapons module ...
Controller for the SimpleRocket (target seeking)
Definition: RocketController.h:51
SimpleRocket * rocket_
The Rocket it controls.
Definition: RocketController.h:77
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
The WorldEntity represents everything that can be put in a Scene at a certain location.
Definition: WorldEntity.h:72
SimpleRocket is a target seeking, intelligent rocket.
Definition: SimpleRocket.h:59
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Definition: Context.h:45
Definition: Controller.h:38
Vector3 targetPosition_
The position of the target.
Definition: RocketController.h:78
void setTarget(WorldEntity *target)
Set the target of the rocket.
Definition: RocketController.h:69
The Tickable interface provides a tick(dt) function, that gets called every frame.
Definition: Tickable.h:52
#define _WeaponsExport
Definition: WeaponsPrereqs.h:60