X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftracktype.cpp;h=b6971ca92175badf5cbddbcf772c9a785bc04140;hb=d15ac13f2e170f155b4bbd124df48400c339b644;hp=35d220821500e1621dbb19bc732587398154507b;hpb=c5f5ec54e81a6a85f911fa1075a0939a7352fbfd;p=r2c2.git diff --git a/source/libr2c2/tracktype.cpp b/source/libr2c2/tracktype.cpp index 35d2208..b6971ca 100644 --- a/source/libr2c2/tracktype.cpp +++ b/source/libr2c2/tracktype.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #include #include "tracktype.h" @@ -120,6 +113,15 @@ TrackPoint TrackType::get_point(unsigned epi, unsigned path, float d) const } } +bool TrackType::collide_ray(const Vector &start, const Vector &dir, float width) const +{ + for(vector::const_iterator i=parts.begin(); i!=parts.end(); ++i) + if(i->collide_ray(start, dir, width)) + return true; + + return false; +} + void TrackType::collect_endpoints() { endpoints.clear();