Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/campaignHS15/src/orxonox/controllers/FlyingController.h @ 10877

Last change on this file since 10877 was 10877, checked in by gania, 8 years ago

CommonController now has static methods only. Replace with a namespace?

File size: 2.8 KB
Line 
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 _FlyingController_H__
30#define _FlyingController_H__
31
32
33#include "controllers/CommonController.h"
34
35namespace orxonox
36{   
37    namespace FormationMode
38    {
39        enum Value
40        {
41            FINGER4, DIAMOND, WALL
42        };
43    }
44
45    class _OrxonoxExport FlyingController : public CommonController
46    {
47
48        public:
49            static const float SPEED = 0.9f/0.02f;
50            static const float ROTATEFACTOR = 0.6f/0.02f;
51 
52            FlyingController(Context* context);
53            virtual ~FlyingController();
54            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
55
56            void setSpread (int spread)
57                { this->spread_ = spread; }
58            int getSpread ()
59                { return this->spread_; }
60
61            void setFormationModeXML(std::string val);
62            std::string getFormationModeXML();
63
64            void setFormationMode(FormationMode::Value val)
65                { this->formationMode_ = val; }
66            FormationMode::Value getFormationMode() const
67                { return this->formationMode_; }
68
69        protected:
70            void stopMoving();
71
72            void moveToPosition(const Vector3& target, float dt);
73            void moveToTargetPosition(float dt);
74
75            void copyOrientation(const Quaternion& orient, float dt);
76            void copyTargetOrientation(float dt);
77
78            void setTargetPosition(const Vector3& target);
79            void setTargetOrientation(const Quaternion& orient);
80            void setTargetOrientation(ControllableEntity* target);
81            virtual void boostControl();       
82            FormationMode::Value formationMode_;
83         
84 
85            bool bHasTargetPosition_;
86            Vector3 targetPosition_;
87            bool bHasTargetOrientation_;
88            Quaternion targetOrientation_; 
89            int spread_;
90            int tolerance_; 
91    };
92}
93
94#endif /* _FlyingController_H__ */
Note: See TracBrowser for help on using the repository browser.