]> git.tdb.fi Git - r2c2.git/blob - source/3d/vehiclepart.h
Don't crash if a train has no router
[r2c2.git] / source / 3d / vehiclepart.h
1 #ifndef R2C2_3D_VEHICLEPART_H_
2 #define R2C2_3D_VEHICLEPART_H_
3
4 #include <msp/gl/objectinstance.h>
5 #include "vehicle.h"
6
7 namespace R2C2 {
8
9 class Vehicle3D;
10
11 class VehiclePart3D: public Msp::GL::ObjectInstance
12 {
13 protected:
14         const Vehicle3D &vehicle;
15         Msp::GL::Matrix matrix;
16
17         VehiclePart3D(const Vehicle3D &, const Msp::GL::Object &);
18
19 public:
20         virtual void update_matrix() = 0;
21
22         virtual void render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
23         virtual void setup_render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
24 };
25
26 } // namespace R2C2
27
28 #endif