summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/geom2d.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/geom2d.cc')
-rw-r--r--crawl-ref/source/geom2d.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/geom2d.cc b/crawl-ref/source/geom2d.cc
index de8d86724b..35ec5138ae 100644
--- a/crawl-ref/source/geom2d.cc
+++ b/crawl-ref/source/geom2d.cc
@@ -44,6 +44,11 @@ double intersect(const ray &r, const line &l)
return (t);
}
+double lineseq::index(const vector &v) const
+{
+ return ((f(v) - offset) / dist);
+}
+
// Find the next intersection of r with a line in ls.
double nextintersect(const ray &r, const lineseq &ls)
{
@@ -129,6 +134,9 @@ vector reflect(const vector &v, const form &f)
return (v - 2 * f(v)/f(n) * n);
}
+
+
+//////////////////////////////////////////////////
// vector space implementation
const vector& vector::operator+=(const vector &v)