]> git.tdb.fi Git - r2c2.git/commitdiff
Use the rotate_object flag of Bogie when rendering
authorMikko Rasa <tdb@tdb.fi>
Sun, 13 Feb 2011 20:51:28 +0000 (20:51 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sun, 13 Feb 2011 20:51:28 +0000 (20:51 +0000)
source/3d/bogie.cpp

index de7d1bbac2b270d35bbd52a69a38703c365d8fae..234bd88a403559b795db56f86ae655064ef31296 100644 (file)
@@ -38,7 +38,10 @@ void Bogie3D::setup_render(Msp::GL::Renderer &renderer, const GL::Tag &) const
        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;
 }