Orxonox  0.0.5 Codename: Arcturus
SpaceRaceController.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  *
23  * Created on: Oct 8, 2012
24  * Author: purgham
25  */
26 
27 #ifndef SPACERACECONTROLLER_H_
28 #define SPACERACECONTROLLER_H_
29 
32 #include "gametypes/Gametype.h"
34 #include "util/Math.h"
35 
36 namespace orxonox
37 {
46  public Tickable
47  {
48  public:
49  SpaceRaceController(Context* context);//, SpaceRace* parentRace);
50  virtual ~SpaceRaceController();
51  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
52  virtual void tick(float dt) override;
53 
54 
55  private:
56  float recCalculateDistance(RaceCheckPoint*, const Vector3& currentPosition);
57  float distanceSpaceshipToCheckPoint(RaceCheckPoint*);
58  RaceCheckPoint* nextPointFind(RaceCheckPoint*);
59  RaceCheckPoint* adjustNextPoint();
60  void endtheGame() const;
61 
62  std::vector<RaceCheckPoint*> findStaticCheckpoints(RaceCheckPoint*, const std::vector<RaceCheckPoint*>&);
63  std::vector<RaceCheckPoint*> staticCheckpoints();
64  int rekSimulationCheckpointsReached(RaceCheckPoint*, std::map<RaceCheckPoint*, int>&);
65  // same as SpaceRaceManager, but needed to add virtuell Checkpoints ( Checkpoints which don't exist but needed to avoid collisions with big Objects)
66  RaceCheckPoint* findCheckpoint(int index) const;
67  //RaceCheckPoint * addVirtualCheckPoint(RaceCheckPoint*, int , const Vector3&);
68  //void placeVirtualCheckpoints(RaceCheckPoint*, RaceCheckPoint*);
69  bool vergleicheQuader(const Vector3&, const Vector3&);
70  bool directLinePossible(RaceCheckPoint*, RaceCheckPoint*, const std::vector<StaticEntity*>&);
71  //void computeVirtualCheckpoint(RaceCheckPoint*, RaceCheckPoint*, const std::vector<StaticEntity*>&);
72 
73  std::vector<RaceCheckPoint*> staticRacePoints_;
74  RaceCheckPoint* nextRaceCheckpoint_; // checkpoint that should be reached
75  RaceCheckPoint* currentRaceCheckpoint_; // last checkPoint (already reached)
76  std::vector<RaceCheckPoint*> checkpoints_;
79  //SpaceRace* parentRace;
80  };
81 
82 }
83 
84 #endif /* SPACERACECONTROLLER_H_ */
std::vector< RaceCheckPoint * > staticRacePoints_
Definition: SpaceRaceController.h:73
int virtualCheckPointIndex
Definition: SpaceRaceController.h:78
#define _GametypesExport
Definition: GametypesPrereqs.h:58
std::vector< RaceCheckPoint * > checkpoints_
Definition: SpaceRaceController.h:76
RaceCheckPoint * currentRaceCheckpoint_
Definition: SpaceRaceController.h:75
The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level...
Definition: RaceCheckPoint.h:43
xmlelement
Definition: Super.h:519
Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the ...
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
Definition: Context.h:45
RaceCheckPoint * nextRaceCheckpoint_
Definition: SpaceRaceController.h:74
Shared library macros, enums, constants and forward declarations for the questsystem module ...
Conventions: -first Checkpoint has index 0 -staticCheckPoint= static Point (see def over = constructo...
Definition: SpaceRaceController.h:45
The Tickable interface provides a tick(dt) function, that gets called every frame.
Definition: Tickable.h:52
Vector3 lastPositionSpaceship
Definition: SpaceRaceController.h:77
Definition: ArtificialController.h:38