-/* $Id$
-
-This file is part of R²C²
-Copyright © 2010-2011 Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
-#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 Layout3D;
-class Rod3D;
+class VehiclePart3D;
class VehicleType3D;
class Vehicle3D: public Object3D, public Msp::GL::ObjectInstance
{
private:
- Layout3D &layout;
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 &);
Vehicle &get_vehicle() const { return vehicle; }
const VehicleType3D &get_type() const { return type; }
- virtual Point get_node() const;
+ 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;
};