X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Fbogie.cpp;h=a36fc9b773c8fb9374b164ffc148c5beb3875ab2;hb=e75f12451201fb6540ad2155e8796c2b5aee8d4c;hp=de7d1bbac2b270d35bbd52a69a38703c365d8fae;hpb=4b7008978ce5b67e7e1db14b4a359e4ab1881bbd;p=r2c2.git diff --git a/source/3d/bogie.cpp b/source/3d/bogie.cpp index de7d1bb..a36fc9b 100644 --- a/source/3d/bogie.cpp +++ b/source/3d/bogie.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2011 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #include #include #include "bogie.h" @@ -33,12 +26,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; }