-bool Signal::collide_ray(const Vector &start, const Vector &ray) const
-{
- // XXX Totally hardcoded stuff, should be replaced with a geometry system
- Vector center = position+rotated_vector(Vector(0, -0.035, 0), rotation);
- Vector span = center-start;
- float x = (span.x*ray.x+span.y*ray.y)/(ray.x*ray.x+ray.y*ray.y);
- Vector nearest = start+ray*x-center;
- if(nearest.z<0 || nearest.z>0.12)
- return false;
- nearest.z = 0;
- return dot(nearest, nearest)<0.0001;
-}
-