]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/vehicle.cpp
Report the closest object when picking
[r2c2.git] / source / libr2c2 / vehicle.cpp
index 099644a1301ca8360101d894fec8c9d5c74a4fc3..cb776f413daacb20f82889076aeab17e451cc842 100644 (file)
@@ -175,7 +175,8 @@ void Vehicle::update_position(int sign)
 {
        OrientedPoint p = placement.get_point();
        position = p.position;
-       position.z += layout.get_catalogue().get_rail_elevation();
+       // TODO Move the z adjustment to VehiclePlacement
+       position.z += placement.get_position(VehiclePlacement::FRONT_AXLE)->get_type().get_appearance().get_rail_elevation();
        rotation = p.rotation;
        tilt = p.tilt;
 
@@ -355,10 +356,10 @@ int Vehicle::get_link_slot(const Object &other) const
                return -1;
 }
 
-bool Vehicle::collide_ray(const Ray &ray) const
+bool Vehicle::collide_ray(const Ray &ray, float *d) const
 {
        if(is_placed())
-               return Object::collide_ray(ray);
+               return Object::collide_ray(ray, d);
        else
                return false;
 }