]> git.tdb.fi Git - r2c2.git/blob - source/3d/tracktype.h
Render tracks through GL::Objects
[r2c2.git] / source / 3d / tracktype.h
1 /* $Id$
2
3 This file is part of R²C²
4 Copyright © 2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef R2C2_3D_TRACKTYPE_H_
9 #define R2C2_3D_TRACKTYPE_H_
10
11 #include <msp/gl/mesh.h>
12 #include <msp/gl/meshbuilder.h>
13 #include <msp/gl/object.h>
14 #include "libr2c2/profile.h"
15 #include "libr2c2/tracktype.h"
16
17 namespace R2C2 {
18
19 class Catalogue3D;
20
21 class TrackType3D
22 {
23 private:
24         Catalogue3D &catalogue;
25         Msp::GL::Mesh mesh;
26         Msp::GL::Object object;
27         std::vector<Msp::GL::Mesh *> path_meshes;
28         std::vector<Point> border;
29         float min_z;
30         float max_z;
31
32 public:
33         TrackType3D(Catalogue3D &, const TrackType &);
34         ~TrackType3D();
35
36         void get_bounds(float, Point &, Point &) const;
37         const Msp::GL::Object &get_object() const { return object; }
38         const Msp::GL::Mesh &get_path_mesh(unsigned) const;
39
40 private:
41         void build_part(const TrackPart &, const Profile &, const Point &, Msp::GL::MeshBuilder &, unsigned &);
42 };
43
44 } // namespace R2C2
45
46 #endif