1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-20 23:50:27 +00:00

2d3d:: precise halfmirrors

This commit is contained in:
Zeno Rogue 2019-05-09 23:11:01 +02:00
parent 01207a0e87
commit ef4d673196

View File

@ -2764,12 +2764,28 @@ void buildpolys() {
bshape(shHalfMirror[2], PPR::WALL, scalefactor, 332); bshape(shHalfMirror[2], PPR::WALL, scalefactor, 332);
} }
else { else {
dynamicval<int> d(vid.texture_step, max(vid.texture_step, 4));
ld len6 = hdist0(mid(xpush0(hexvdist), spin(M_PI/S3) * xpush0(hexvdist)));
ld len7 = hdist0(mid(xpush0(hexf), spin(M_PI*2/S7) * xpush0(hexf)));
ld hlen7 = hdist0(mid(xpush0(hcrossf), spin(M_PI*2/S7) * xpush0(hcrossf)));
ld lenx = hdist(xpush0(hexvdist), spin(M_PI/S3) * xpush0(hexvdist));
ld hlenx = hdist(xpush0(hcrossf), spin(2*M_PI/S7) * xpush0(hcrossf));
println(hlog, "len6 = ", len6, " len7 = ", len7, " lenx = ", lenx);
bshape(shHalfMirror[2], PPR::WALL); bshape(shHalfMirror[2], PPR::WALL);
hpcpush(hpxy(-0.016778,0)); hpcpush(hpxy(-0.261607,0)); chasmifyPoly(geom3::FLOOR, geom3::WALL, 0); hpcpush(C0); hpcpush(xpush0(-len6*scalefactor)); chasmifyPoly(geom3::FLOOR, geom3::WALL, 0);
bshape(shHalfMirror[1], PPR::WALL); bshape(shHalfMirror[1], PPR::WALL);
hpcpush(hpxy(-0.315398,0)); hpcpush(hpxy(+0.568278,0)); chasmifyPoly(geom3::FLOOR, geom3::WALL, 0); if(PURE) {
hpcpush(xpush0(-hlen7)); hpcpush(xpush0(hcrossf+hlenx/2)); chasmifyPoly(geom3::FLOOR, geom3::WALL, 0);
}
else {
hpcpush(xpush0(-len7*scalefactor)); hpcpush(xpush0((hexf+lenx/2)*scalefactor)); chasmifyPoly(geom3::FLOOR, geom3::WALL, 0);
}
bshape(shHalfMirror[0], PPR::WALL); bshape(shHalfMirror[0], PPR::WALL);
hpcpush(hpxy(+0.262597,0)); hpcpush(hpxy(-0.261563,0)); chasmifyPoly(geom3::FLOOR, geom3::WALL, 0); hpcpush(xpush0(len6)); hpcpush(xpush0(-len6)); chasmifyPoly(geom3::FLOOR, geom3::WALL, 0);
} }
bshape(shAsymmetric, PPR::TEXT, scalefactor, 374); bshape(shAsymmetric, PPR::TEXT, scalefactor, 374);