summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ray.h
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-31 21:38:14 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-01 21:45:26 +0100
commit0ddf2cdcb915211928f9045791cbba249e96f858 (patch)
treebbe7e9c9fd4ac68f72c0f340f8058b134feafdd1 /crawl-ref/source/ray.h
parentbe58c68878c08c4d1373c2f38c9ef11d66010d06 (diff)
downloadcrawl-ref-0ddf2cdcb915211928f9045791cbba249e96f858.tar.gz
crawl-ref-0ddf2cdcb915211928f9045791cbba249e96f858.zip
Implement reflection (except for the diagonal corridor case).
Reflection is modelled on diamond-shaped features, with gaps filled in as far as they don't affect LOS. Working on a case by case analysis: After normalization, a ray leaves cell * through the south-east diamond face. Then determine the line of reflection in each case.
Diffstat (limited to 'crawl-ref/source/ray.h')
-rw-r--r--crawl-ref/source/ray.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/ray.h b/crawl-ref/source/ray.h
index 6748090348..92373eddea 100644
--- a/crawl-ref/source/ray.h
+++ b/crawl-ref/source/ray.h
@@ -10,6 +10,7 @@
#include "geom2d.h"
typedef FixedArray<bool,3,3> reflect_grid;
+const coord_def rg_o = coord_def(1,1);
struct ray_def
{
@@ -23,6 +24,7 @@ struct ray_def
coord_def pos() const;
bool advance();
+ coord_def move_to_side();
void bounce(const reflect_grid &rg);
void regress();
};