Temporarily undo photon reflection fix (causes inaccuracies).
This commit is contained in:
parent
42d7b56602
commit
c7213127e5
21
src/powder.c
21
src/powder.c
@ -261,12 +261,12 @@ int try_move(int i, int x, int y, int nx, int ny)
|
|||||||
static unsigned direction_to_map(float dx, float dy, int t)
|
static unsigned direction_to_map(float dx, float dy, int t)
|
||||||
{
|
{
|
||||||
// TODO:
|
// TODO:
|
||||||
// adding extra directions causes some inaccuracies
|
// Adding extra directions causes some inaccuracies.
|
||||||
// not adding them causes problems with some diagonal surfaces
|
// Not adding them causes problems with some diagonal surfaces (photons absorbed instead of reflected).
|
||||||
// solution may involve more intelligent setting of initial i0 value in find_next_boundary?
|
// For now, don't add them.
|
||||||
|
// Solution may involve more intelligent setting of initial i0 value in find_next_boundary?
|
||||||
// or rewriting normal/boundary finding code
|
// or rewriting normal/boundary finding code
|
||||||
if (t & REFRACT) {
|
|
||||||
// extra directions cause noticeable inaccuracy for refraction (potentially breaking existing saves), so don't add them here
|
|
||||||
return (dx >= 0) |
|
return (dx >= 0) |
|
||||||
(((dx + dy) >= 0) << 1) | /* 567 */
|
(((dx + dy) >= 0) << 1) | /* 567 */
|
||||||
((dy >= 0) << 2) | /* 4+0 */
|
((dy >= 0) << 2) | /* 4+0 */
|
||||||
@ -275,17 +275,16 @@ static unsigned direction_to_map(float dx, float dy, int t)
|
|||||||
(((dx + dy) <= 0) << 5) |
|
(((dx + dy) <= 0) << 5) |
|
||||||
((dy <= 0) << 6) |
|
((dy <= 0) << 6) |
|
||||||
(((dy - dx) <= 0) << 7);
|
(((dy - dx) <= 0) << 7);
|
||||||
} else {
|
/*
|
||||||
// TODO: reflection still not perfect. See TODO note above.
|
|
||||||
return (dx >= -0.001) |
|
return (dx >= -0.001) |
|
||||||
(((dx + dy) >= -0.001) << 1) | /* 567 */
|
(((dx + dy) >= -0.001) << 1) | // 567
|
||||||
((dy >= -0.001) << 2) | /* 4+0 */
|
((dy >= -0.001) << 2) | // 4+0
|
||||||
(((dy - dx) >= -0.001) << 3) | /* 321 */
|
(((dy - dx) >= -0.001) << 3) | // 321
|
||||||
((dx <= 0.001) << 4) |
|
((dx <= 0.001) << 4) |
|
||||||
(((dx + dy) <= 0.001) << 5) |
|
(((dx + dy) <= 0.001) << 5) |
|
||||||
((dy <= 0.001) << 6) |
|
((dy <= 0.001) << 6) |
|
||||||
(((dy - dx) <= 0.001) << 7);
|
(((dy - dx) <= 0.001) << 7);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static int is_blocking(int t, int x, int y)
|
static int is_blocking(int t, int x, int y)
|
||||||
|
Loading…
Reference in New Issue
Block a user