Tinman  1.0
trackloader.h
Go to the documentation of this file.
1 #ifndef TRACKLOADER_H
2 #define TRACKLOADER_H
3 #include "parser.h"
4 #include "meshstrider.h"
5 #include "scene.h"
6 #include "physics.h"
7 
8 struct Section {
10  Type type;
11  Ogre::SceneNode* node;
12  Ogre::Entity* physics_entity;
13  btRigidBody* body;
14  btVector3 position;
15  int id;
16 };
17 
18 class TrackLoader {
20 
23 
24  public:
25  //Fixme: move to race
26  typedef std::shared_ptr<TrackLoader> shared;
27 
29  virtual ~TrackLoader();
30 
31  std::vector<Section> create_circuit(std::string data_file);
32 
33 private:
34  Parser::Results load(std::string data_file);
35  Section create_section(Ogre::Vector3 position, std::string name,
36  std::string mesh, Ogre::Degree angle, std::string direction, int index);
37  Section::Type get_section_type(std::string mesh, std::string direction = "");
38 };
39 #endif
int id
Definition: track.h:41
Physics::shared physics_
Definition: trackloader.h:22
btRigidBody * body
Definition: track.h:39
Section::Type get_section_type(std::string mesh, std::string direction="")
Definition: trackloader.cpp:81
std::shared_ptr< Physics > shared
Definition: physics.h:33
Definition: track.h:34
Ogre::SceneNode * node
Definition: track.h:37
std::shared_ptr< Scene > shared
Definition: scene.h:43
std::vector< Section > create_circuit(std::string data_file)
Definition: trackloader.cpp:17
Definition: track.h:33
Definition: trackloader.h:9
Type type
Definition: track.h:36
Section create_section(Ogre::Vector3 position, std::string name, std::string mesh, Ogre::Degree angle, std::string direction, int index)
Definition: trackloader.cpp:49
Definition: trackloader.h:9
Ogre::Entity * physics_entity
Definition: track.h:38
btVector3 position
Definition: track.h:40
Definition: trackloader.h:18
Scene::shared scene_
Definition: trackloader.h:21
virtual ~TrackLoader()
Definition: trackloader.cpp:13
std::shared_ptr< TrackLoader > shared
Definition: trackloader.h:26
Parser::Results load(std::string data_file)
Definition: trackloader.cpp:43
TrackLoader(Scene::shared scene, Physics::shared physics)
Definition: trackloader.cpp:4
Type
Definition: track.h:34
Parser parser
Definition: trackloader.h:19
Definition: parser.h:10
Definition: trackloader.h:9
std::vector< Match > Results
Definition: parser.h:15