summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/geom2d.cc
Commit message (Collapse)AuthorAgeFilesLines
* Round more vigorously in ray code.Neil Moore2014-06-151-1/+1
| | | | | | | | | | | | | | | Aiming cloud cone from (40,41) or (66,23) would crash because of rounding errors. See for example: http://dobrazupa.org/morgue/Rikonman/crash-Rikonman-20140425-000700.txt Now consider numbers as large as 5e-5 to be zero, rather than requiring 1e-7 (for geom2d code) or 1e-5 (ray_def code). This means rays will be snapped to the diamond grid more frequently, helping to avoid inconsistencies among different ways of deciding what part of the cell a ray falls on. Someone with numerical analysis experience should really look at this code.
* Remove some newly-dead geometry code.Neil Moore2014-01-091-14/+0
| | | | | | | The {get,set}_degrees methods of ray_def were only used by the chaos bouncing code, removed in 0.14-a0-1819-g38ea213. The functions geom::degrees and geom::degree_to_vector were only used by those ray_def methods.
* Drop double newlines where they seem to serve no purpose.Adam Borowski2013-12-211-2/+0
| | | | | Sometimes, they're there to emphasize a break between two sections of code, which is good. In a majority of cases, though, they're just inconsistent.
* More formatting fixes for return (...);Neil Moore2013-11-151-4/+4
|
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-7/+7
|
* Include debug.h earlier.Adam Borowski2013-04-261-1/+0
| | | | | Via externs.h -> bitary.h, it was effectively included by everything anyway, and this way simplifies include chains.
* Inline a trivial function.Adam Borowski2013-04-071-7/+2
|
* Use std namespace.Raphael Langella2012-08-261-2/+2
| | | | | | | | | | | | | I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
* Drop a bunch of parentheses from return statements.Adam Borowski2012-08-081-1/+1
| | | | | This is incomplete, partially because of me getting bored, partially because of doubts about the point of leaving simple addition/etc in parentheses.
* Some more return deparenthesization.Adam Borowski2012-07-051-1/+1
|
* Remove parentheses around return (simple_function_call).Adam Borowski2012-07-051-3/+3
| | | | For way too paranoid and underinclusive values of "simple".
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-5/+5
|
* Make file headers doxygen-friendly, drop useless fields.Adam Borowski2011-03-281-4/+4
| | | | | | | "File:" is shown in your editor's status bar. "Written by:" was used only for the first person who changed a file. We got git for that now, and pre-DCSS history is so woefully inaccurate it doesn't really matter.
* ... and check if it works.Adam Borowski2010-09-301-1/+0
|
* Clean up brace placement.Robert Vollmert2010-06-171-1/+2
|
* Add get_degrees and set_degrees to ray_def; reenable chaos bolt munging.Robert Vollmert2009-11-031-0/+14
|
* Make geom::parallel visible outside geom2d.Robert Vollmert2009-11-031-1/+1
|
* Remove unused function from geom2d.cc.Robert Vollmert2009-11-011-8/+0
|
* Simplify geom2d ray advance code.Robert Vollmert2009-11-011-40/+24
|
* Add a bunch of ASSERTs to ray.cc.Robert Vollmert2009-11-011-0/+8
|
* Some geom2d changes.Robert Vollmert2009-11-011-9/+25
| | | | | 1. Add function to reflect vector at a line. 2. Implement scalar multiplication as external operator.
* Make nextcell and movehalfcell methods of geom::ray.Robert Vollmert2009-11-011-19/+22
| | | | | Seems sensible given they modify the ray, even if it's not really something intrinsic to a ray.
* Change corner handling.Robert Vollmert2009-11-011-2/+21
| | | | | | | | ray_def should now deal with hitting corners gracefully, though the raycasting will still discard such rays. If a ray hits a corner between two diamonds, it will stay there, and calling ray_def::pos will arbitrarily give one of the squares -- this is not optimal, but these rays shouldn't usually show up anyway.
* Simplify geom2d.cc to stop at corners.Robert Vollmert2009-11-011-19/+6
| | | | | Remove the unsure fudging. This does introduce the possiblity of hanging in place.
* Add simple 2d geometry library.Robert Vollmert2009-11-011-0/+149
Its point is to allow intersecting rays with grid lines and advancing rays from one cell to the next.