1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-04-27 05:03:15 +00:00

ray:: special case for WDIM==2 triangles

This commit is contained in:
Zeno Rogue 2020-06-03 16:43:11 +02:00
parent 449966903e
commit 1ac116909f

View File

@ -1160,6 +1160,17 @@ EX void cast() {
ms[id+j] = hybrid::ray_iadj(c, j);
if(WDIM == 2) for(int a: {0, 1}) {
int z = a ? 1 : -1;
if(c->type == 3) {
hyperpoint h =
project_on_triangle(
hybrid::get_corner(c, a, 0, z),
hybrid::get_corner(c, a, 1, z),
hybrid::get_corner(c, a, 2, z)
);
ms[id+c->type+a] = rspintox(h) * xpush(-2*hdist0(h)) * spintox(h);
}
else {
hyperpoint h = Hypc;
for(int a=0; a<c->type; a++) {
hyperpoint corner = hybrid::get_corner(c, a, 0, z);
@ -1171,6 +1182,7 @@ EX void cast() {
ms[id+c->type+a] = zpush(2*d);
}
}
}
// println(hlog, ms);