+ if(i>=links.size())
+ throw out_of_range("Track::break_link");
+
+ Track *other = links[i];
+ if(!other)
+ return false;
+
+ links[i] = 0;
+ other->break_link(*this);
+ // XXX Creates the blocks twice, because the other track calls this too
+ layout.create_blocks(*this);
+ signal_link_changed.emit(i, 0);
+
+ return true;
+}
+
+bool Track::collide_ray(const Vector &start, const Vector &ray) const
+{
+ Transform trans = Transform::rotation(-rotation, Vector(0, 0, 1));
+ Vector local_start = trans.transform(start-position);
+ Vector local_ray = trans.transform(ray);
+
+ float width = layout.get_catalogue().get_ballast_profile().get_width();
+
+ return type.collide_ray(local_start, local_ray, width);