X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Fvehicle.cpp;h=38e2fb5ffc902223d1a022bf7ae91fac98d58cae;hb=54392d65e2053d1eacb4cfcc435f1013993f2973;hp=8e3da138cf4388c2a7b556fb5bc09490daa85bff;hpb=d18d5c1c3cf417e20840238eec4f3caa431fa2b5;p=r2c2.git diff --git a/source/3d/vehicle.cpp b/source/3d/vehicle.cpp index 8e3da13..38e2fb5 100644 --- a/source/3d/vehicle.cpp +++ b/source/3d/vehicle.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2010-2011 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #include #include #include @@ -100,9 +93,11 @@ void Vehicle3D::render(GL::Renderer &renderer, const GL::Tag &tag) const 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); + matrix.translate(vehicle.get_position()); + Angle rot = vehicle.get_rotation(); + if(vehicle.get_type().get_rotate_object()) + rot += Angle::half_turn(); + matrix.rotate(rot, 0, 0, 1); renderer.matrix_stack() *= matrix; }