/* $Id$
This file is part of R²C²
-Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
+Copyright © 2006-2011 Mikkosoft Productions, Mikko Rasa
Distributed under the GPL
*/
return get_point(epi, active_path, d);
}
+bool Track::collide_ray(const Vector &start, const Vector &ray)
+{
+ Vector local_start(start.x-pos.x, start.y-pos.y, start.z-pos.z);
+ float c = cos(rot);
+ float s = sin(rot);
+ local_start = Vector(c*local_start.x+s*local_start.y, c*local_start.y-s*local_start.x, local_start.z);
+ Vector local_ray(c*ray.x+s*ray.y, c*ray.y-s*ray.x, ray.z);
+
+ float width = layout.get_catalogue().get_ballast_profile().get_width();
+
+ return type.collide_ray(local_start, local_ray, width);
+}
+
void Track::save(list<DataFile::Statement> &st) const
{
st.push_back((DataFile::Statement("position"), pos.x, pos.y, pos.z));