Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Racingbot/src/modules/gametypes/SpaceRaceController.h @ 9507

Last change on this file since 9507 was 9507, checked in by purgham, 11 years ago

Not working together

File size: 3.1 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 *
23 *  Created on: Oct 8, 2012
24 *      Author: purgham
25 */
26
27#ifndef SPACERACECONTROLLER_H_
28#define SPACERACECONTROLLER_H_
29
30#include "gametypes/GametypesPrereqs.h"
31#include "controllers/ArtificialController.h"
32#include "gametypes/Gametype.h"
33#include "gametypes/RaceCheckPoint.h"
34
35namespace orxonox
36{
37    class _GametypesExport SpaceRaceController: public ArtificialController,
38            public Tickable
39    {
40        private:
41            std::vector<RaceCheckPoint*> staticRacePoints_;
42            RaceCheckPoint* nextRaceCheckpoint_; // checkpoint that should be reached
43            RaceCheckPoint* currentRaceCheckpoint_; // last checkPoint (already reached)
44            std::vector<RaceCheckPoint*> checkpoints_;
45            Vector3 lastPositionSpaceship;
46            int virtualCheckPointIndex;
47
48            int recCalculateDistance(RaceCheckPoint*, Vector3 currentPosition);
49            int distanceSpaceshipToCheckPoint(RaceCheckPoint*);
50            RaceCheckPoint* nextPointFind(RaceCheckPoint*);
51            RaceCheckPoint* adjustNextPoint();
52            std::vector<RaceCheckPoint*> findStaticCheckpoints(std::vector<
53                    RaceCheckPoint*>);
54            std::vector<RaceCheckPoint*> staticCheckpoints();
55            int rekSimulationCheckpointsReached(RaceCheckPoint*, std::map<
56                    RaceCheckPoint*, int>*);
57            // same as SpaceRaceManager, but needed to add virtuell Checkpoints ( Checkpoints which don't exist but needed to avoid collisions with big Objects)
58            RaceCheckPoint* findCheckpoint(int index) const;
59            RaceCheckPoint
60                    * addVirtualCheckPoint(RaceCheckPoint*, int , Vector3);
61            void placeVirtualCheckpoints(RaceCheckPoint*, RaceCheckPoint*);
62            bool vergleicheQuader(Vector3, Vector3);
63            bool directLinePossible(RaceCheckPoint*, RaceCheckPoint*, std::vector<StaticEntity*>);
64            void computeVirtualCheckpoint(RaceCheckPoint*, RaceCheckPoint*, std::vector<StaticEntity*>);
65
66        public:
67            SpaceRaceController(BaseObject* creator);
68            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
69            virtual ~SpaceRaceController();
70            virtual void tick(float dt);
71    };
72
73}
74
75#endif /* SPACERACECONTROLLER_H_ */
Note: See TracBrowser for help on using the repository browser.