]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/vehicle.cpp
Allow rotating the body object of a vehicle
[r2c2.git] / source / 3d / vehicle.cpp
index 4e5965b2de44860d90881f21c3c18918d3786d60..0bd57e95da2b80d276fdf82cef0015649dc1d53d 100644 (file)
@@ -95,7 +95,10 @@ void Vehicle3D::setup_render(GL::Renderer &renderer, const GL::Tag &) const
        GL::Matrix matrix;
        const Vector &pos = vehicle.get_position();
        matrix.translate(pos.x, pos.y, pos.z);
-       matrix.rotate(vehicle.get_direction(), 0, 0, 1);
+       float dir = vehicle.get_direction();
+       if(vehicle.get_type().get_rotate_object())
+               dir += M_PI;
+       matrix.rotate(dir, 0, 0, 1);
        renderer.matrix_stack() *= matrix;
 }