]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/vehicle.cpp
Add a vehicle property for swapping directions
[r2c2.git] / source / 3d / vehicle.cpp
index 78899fd371d07a25f3f8046c7411974daedcf179..8e3da138cf4388c2a7b556fb5bc09490daa85bff 100644 (file)
@@ -26,9 +26,9 @@ Vehicle3D::Vehicle3D(Layout3D &l, Vehicle &v):
        vehicle(v),
        type(layout.get_catalogue().get_vehicle(vehicle.get_type()))
 {
-       unsigned n_axles = vehicle.get_type().get_axles().size();
+       unsigned n_axles = vehicle.get_type().get_fixed_axles().size();
        for(unsigned i=0; i<n_axles; ++i)
-               if(type.get_axle_object(i))
+               if(type.get_fixed_axle_object(i))
                {
                        Axle3D *a = new Axle3D(*this, i);
                        axles.push_back(a);
@@ -78,10 +78,10 @@ Vehicle3D::~Vehicle3D()
                delete *i;
 }
 
-Point Vehicle3D::get_node() const
+Vector Vehicle3D::get_node() const
 {
-       Point p = vehicle.get_position();
-       return Point(p.x, p.y, p.z+0.01+vehicle.get_type().get_height());
+       Vector p = vehicle.get_position();
+       return Vector(p.x, p.y, p.z+0.01+vehicle.get_type().get_height());
 }
 
 bool Vehicle3D::is_visible() const
@@ -100,7 +100,7 @@ void Vehicle3D::render(GL::Renderer &renderer, const GL::Tag &tag) const
 void Vehicle3D::setup_render(GL::Renderer &renderer, const GL::Tag &) const
 {
        GL::Matrix matrix;
-       const Point &pos = vehicle.get_position();
+       const Vector &pos = vehicle.get_position();
        matrix.translate(pos.x, pos.y, pos.z);
        matrix.rotate(vehicle.get_direction(), 0, 0, 1);
        renderer.matrix_stack() *= matrix;