]> git.tdb.fi Git - r2c2.git/blob - source/3d/vehicle.h
36853c95a944786649a933a03961eb4fe90e4ff0
[r2c2.git] / source / 3d / vehicle.h
1 /* $Id$
2
3 This file is part of R²C²
4 Copyright © 2010-2011  Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef LIBR2C23D_VEHICLE_H_
9 #define LIBR2C23D_VEHICLE_H_
10
11 #include <msp/gl/renderable.h>
12 #include "libr2c2/vehicle.h"
13 #include "object.h"
14
15 namespace R2C2 {
16
17 class Axle3D;
18 class Bogie3D;
19 class Layout3D;
20 class Rod3D;
21 class VehicleType3D;
22
23 class Vehicle3D: public Object3D, public Msp::GL::ObjectInstance
24 {
25 private:
26         Layout3D &layout;
27         Vehicle &vehicle;
28         const VehicleType3D &type;
29         std::vector<Axle3D *> axles;
30         std::vector<Bogie3D *> bogies;
31         std::vector<Rod3D *> rods;
32
33 public:
34         Vehicle3D(Layout3D &, Vehicle &);
35         ~Vehicle3D();
36
37         Vehicle &get_vehicle() const { return vehicle; }
38         const VehicleType3D &get_type() const { return type; }
39
40         virtual Vector get_node() const;
41         virtual bool is_visible() const;
42
43         virtual void render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
44         virtual void setup_render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
45 };
46
47 } // namespace R2C2
48
49 #endif