]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/signal.cpp
Make use of the geometry part of libmspmath
[r2c2.git] / source / libr2c2 / signal.cpp
index 3494467d84daf3c166ccbf851742712987b72d8d..a25f8eca4697fde499b993348a32a4de7f20e752 100644 (file)
@@ -122,19 +122,6 @@ SnapType Signal::get_default_snap_type_to(const Object &other) const
        return NO_SNAP;
 }
 
-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;
-}
-
 void Signal::tick(const Time::TimeDelta &)
 {
        if(check_allocated_blocks)