Shadowcasting |
Precise Permissive |
..................... ...........#......... ...?.....#........... #....*........#.....# ....#.*.............. .......*............. ........**........... .......#..@#......... ......#..#........... |
..................... ...........#......... ...*.....#........... #...*#........#.....# ....#**.............. .......*............. ........**........... .......#..@#......... ......#..#........... |
An example where
Shadowcasting did not find an LOS while Precise Permissive did. Note
projection tries to go as far as it can.
|
.#.........#.........
.#........@.....#....
......#.**#..........
#.....**.............
.....*...#......#....
.........#..#........ |
.#.........#.........
.#........@.....#....
......#.**#..........
#.....**.............
.....*...#......#....
.........#..#........ |
A case where both found LOS
and could calculate a projection. |
|
|
The fast and simple
Bresenham LOS is also implemented. It can work in 3 ways.
There
can be two possible Bresenham lines from point A to point B.
........
.1......
.21.....
..1.....
..21....
...1....
...21...
....1...
....21..
.....1..
If both
are not
checked, it may happen that A cannot see B but B can see A. The 3
Bresenham algorithms can handle line of sight in all 3 ways.
Bresenhan
Path |
Bresenham
Path Blocked |
Alternate
Bresenham Path |
Both
Bresenham Paths blocked |
Opportunistic
Bresenham finds a path |
|
......
.@....
.*....
.*....
..*...
...... |
......
.@....
.#....
......
..?...
...... |
......
.@....
.#*...
..*...
..*...
...... |
......
.@....
.#*...
..#...
..?...
...... |
......
.@....
.#*...
.*#...
..*...
...... |
|
Normal
Bresenham will only check one Bresenham path. If symmetry is turned on,
both paths are checked.
If
Opportunistic Bresenham is used, it tries to "snake" its way through
both paths to find a solution. |