]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/bogie.cpp
Make use of the mspmath library
[r2c2.git] / source / 3d / bogie.cpp
index 8e99ceb0d9a6bd7fa5350382d8be75a65083eb7d..e00e373b57f575c249b8af810d39eee635a16579 100644 (file)
@@ -26,14 +26,13 @@ void Bogie3D::setup_render(Msp::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.translate(vehicle.get_position());
        matrix.rotate(vehicle.get_rotation(), 0, 0, 1);
 
        matrix.translate(bogie.type->position, 0, 0);
-       float dir = bogie.direction;
+       Angle dir = bogie.direction;
        if(bogie.type->rotate_object)
-               dir += M_PI;
+               dir += Angle::half_turn();
        matrix.rotate(dir, 0, 0, 1);
 
        renderer.matrix_stack() *= matrix;