]> git.tdb.fi Git - r2c2.git/blob - source/3d/vehicle.h
Don't save an allocated but pending block
[r2c2.git] / source / 3d / vehicle.h
1 #ifndef R2C2_3D_VEHICLE_H_
2 #define R2C2_3D_VEHICLE_H_
3
4 #include <msp/gl/objectinstance.h>
5 #include <msp/gl/renderable.h>
6 #include "libr2c2/vehicle.h"
7 #include "object.h"
8
9 namespace R2C2 {
10
11 class VehiclePart3D;
12 class VehicleType3D;
13
14 class Vehicle3D: public Object3D, public Msp::GL::ObjectInstance
15 {
16 private:
17         Vehicle &vehicle;
18         const VehicleType3D &type;
19         std::vector<VehiclePart3D *> children;
20
21 public:
22         Vehicle3D(Layout3D &, Vehicle &);
23         ~Vehicle3D();
24
25         Vehicle &get_vehicle() const { return vehicle; }
26         const VehicleType3D &get_type() const { return type; }
27
28         virtual Vector get_node() const;
29         virtual bool is_visible() const;
30 private:
31         virtual void moved();
32
33 public:
34         virtual void render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
35         virtual void setup_render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
36 };
37
38 } // namespace R2C2
39
40 #endif