From 0ddf2cdcb915211928f9045791cbba249e96f858 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Sat, 31 Oct 2009 21:38:14 +0100 Subject: 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. --- crawl-ref/source/ray.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crawl-ref/source/ray.h') 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 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(); }; -- cgit v1.2.3-54-g00ecf