X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fsignal.cpp;h=a25f8eca4697fde499b993348a32a4de7f20e752;hb=bde934f7d5ba07a9442a305192e10024820d13ed;hp=3494467d84daf3c166ccbf851742712987b72d8d;hpb=7a36d396eded897c421424905b2c938d770df341;p=r2c2.git diff --git a/source/libr2c2/signal.cpp b/source/libr2c2/signal.cpp index 3494467..a25f8ec 100644 --- a/source/libr2c2/signal.cpp +++ b/source/libr2c2/signal.cpp @@ -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)