]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/vehicle.h
Don't crash if a train has no router
[r2c2.git] / source / 3d / vehicle.h
index 4b145536f724f566e4e41d9919f201659c1f2ff6..919845403f6d54fba3117f3e6342ff674e3ad0c2 100644 (file)
@@ -1,15 +1,14 @@
-#ifndef LIBR2C23D_VEHICLE_H_
-#define LIBR2C23D_VEHICLE_H_
+#ifndef R2C2_3D_VEHICLE_H_
+#define R2C2_3D_VEHICLE_H_
 
+#include <msp/gl/objectinstance.h>
 #include <msp/gl/renderable.h>
 #include "libr2c2/vehicle.h"
 #include "object.h"
 
 namespace R2C2 {
 
-class Axle3D;
-class Bogie3D;
-class Rod3D;
+class VehiclePart3D;
 class VehicleType3D;
 
 class Vehicle3D: public Object3D, public Msp::GL::ObjectInstance
@@ -17,9 +16,7 @@ class Vehicle3D: public Object3D, public Msp::GL::ObjectInstance
 private:
        Vehicle &vehicle;
        const VehicleType3D &type;
-       std::vector<Axle3D *> axles;
-       std::vector<Bogie3D *> bogies;
-       std::vector<Rod3D *> rods;
+       std::vector<VehiclePart3D *> children;
 
 public:
        Vehicle3D(Layout3D &, Vehicle &);
@@ -30,7 +27,10 @@ public:
 
        virtual Vector get_node() const;
        virtual bool is_visible() const;
+private:
+       virtual void moved();
 
+public:
        virtual void render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
        virtual void setup_render(Msp::GL::Renderer &, const Msp::GL::Tag &) const;
 };