]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/vehicle.cpp
Perform check_slope automatically with certain operations
[r2c2.git] / source / 3d / vehicle.cpp
index 8e3da138cf4388c2a7b556fb5bc09490daa85bff..d1e5657a0a9095c277cef53a95255ae7e27afddf 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2010-2011  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
 #include <cmath>
 #include <msp/gl/matrix.h>
 #include <msp/gl/renderer.h>
@@ -102,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 rot = vehicle.get_rotation();
+       if(vehicle.get_type().get_rotate_object())
+               rot += M_PI;
+       matrix.rotate(rot, 0, 0, 1);
        renderer.matrix_stack() *= matrix;
 }