]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/bogie.cpp
Rename Point to Vector
[r2c2.git] / source / 3d / bogie.cpp
index de7d1bbac2b270d35bbd52a69a38703c365d8fae..03f7dce255c3291192079559b02a13796fabde8c 100644 (file)
@@ -33,12 +33,15 @@ void Bogie3D::setup_render(Msp::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);
 
        matrix.translate(bogie.type->position, 0, 0);
-       matrix.rotate(bogie.direction, 0, 0, 1);
+       float dir = bogie.direction;
+       if(bogie.type->rotate_object)
+               dir += M_PI;
+       matrix.rotate(dir, 0, 0, 1);
 
        renderer.matrix_stack() *= matrix;
 }