X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Fvehicle.cpp;h=7e4814b008b03a64b588479792959329d7254cf9;hb=f4ffb776aa0d4f51c058d27fb0f51449c05302c3;hp=37619ebd339461f104dc0bf54aeb6fcfe71e7a67;hpb=dc3b2bce73df40ea885a1960a825e5cd3a33c045;p=r2c2.git diff --git a/source/3d/vehicle.cpp b/source/3d/vehicle.cpp index 37619eb..7e4814b 100644 --- a/source/3d/vehicle.cpp +++ b/source/3d/vehicle.cpp @@ -52,11 +52,20 @@ void Vehicle3D::render(const GL::Tag &tag) const GL::PushMatrix push_mat; const Point &pos = vehicle.get_position(); - GL::translate(pos.x, pos.y, pos.z+0.01); + GL::translate(pos.x, pos.y, pos.z); GL::rotate(vehicle.get_direction()*180/M_PI, 0, 0, 1); - if(type.get_body_object()) - type.get_body_object()->render(tag); + if(const GL::Object *obj = type.get_body_object()) + obj->render(tag); + + const vector &axles = vehicle.get_type().get_axles(); + for(unsigned i=0; irender(tag); + } const vector &bogies = vehicle.get_type().get_bogies(); for(unsigned i=0; irender(tag); + + for(unsigned j=0; jrender(tag); + } + + if(bogies[i].rotate_object) + GL::rotate(180, 0, 0, 1); + if(const GL::Object *obj = type.get_bogie_object(i)) + obj->render(tag); } } }