diff --git a/floorshapes.cpp b/floorshapes.cpp index 43332a1f..d4147d63 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -288,20 +288,23 @@ void geometry_information::bshape_regular(floorshape &fsh, int id, int sides, ld if(bt::in()) { const int STEP = vid.texture_step; - + for(int t=0; t<2; t++) { if(t == 0) bshape(fsh.b[id], fsh.prio); if(t == 1) bshape(fsh.shadow[id], fsh.prio); + + int STEP1 = STEP; + if((embedded_plane || geom3::flipped) && t == 0) STEP1 = 1; for(int i=0; itinf = &floor_texture_vertices[fsh.id]; last->texture_offset = 0; - #if CAP_BT - if(bt::in()) - for(int t=0; ttype; t++) - texture_order([&] (ld x, ld y) { - hyperpoint left = bt::get_corner_horo_coordinates(c, t); - hyperpoint right = bt::get_corner_horo_coordinates(c, t+1); - hpcpush(orthogonal_move(bt::get_horopoint(left * x + right * y), dfloor_table[k])); - }); - else - #endif if(1) { int s = fsh.b[id].s; int e = fsh.b[id].e-1; - hyperpoint ctr = Hypc; - for(int t=0; torthogonal_move(hpc[s+t], dfloor_table[k])); + ctr = normalize(ctr); + + for(int t=0; torthogonal_move(hpc[s+t], dfloor_table[k])) - ctr; + hyperpoint v2 = kleinize(cgi.emb->orthogonal_move(hpc[s+t+1], dfloor_table[k])) - ctr; + texture_order([&] (ld x, ld y) { + hpcpush(normalize(ctr + v1 * x + v2 * y)); + }); + } } if(!vid.pseudohedral) for(int t=0; tactual_to_logical(hpc[s+t]); + hyperpoint v2 = cgi.emb->actual_to_logical(hpc[s+t+1]); + texture_order([&] (ld x, ld y) { - hyperpoint a = fctr + v1 * x + v2 * y; - hyperpoint b = cgi.emb->normalize_flat(a); - hyperpoint c = orthogonal_move(b, dfloor_table[k]); + hyperpoint a = v1 * x + v2 * y; + a[2] = dfloor_table[k]; + auto c = cgi.emb->logical_to_actual(a); cgi.hpcpush(c); }); } @@ -728,24 +725,16 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i last->texture_offset = 0; ld h = (FLOOR - WALL) / (co+1); ld top = co ? (FLOOR + WALL) / 2 : WALL; - #if CAP_BT - if(bt::in()) - for(int t=0; ttype; t++) - texture_order([&] (ld x, ld y) { - hyperpoint left = bt::get_corner_horo_coordinates(c, t); - hyperpoint right = bt::get_corner_horo_coordinates(c, t+1); - hpcpush(orthogonal_move(bt::get_horopoint(left * x + right * y), top + h * (x+y))); - }); - else - #endif if(1) { int s = fsh.b[id].s; int e = fsh.b[id].e-1; for(int t=0; tnormalize_flat(TC0 + v1 * x + v2 * y), top + h * (x+y))); }); + hyperpoint v1 = cgi.emb->actual_to_logical(hpc[s+t]); + hyperpoint v2 = cgi.emb->actual_to_logical(hpc[s+t+1]); + texture_order([&] (ld x, ld y) { + hyperpoint a = v1 * x + v2 * y; a[2] = top + h * (x+y); + hpcpush(cgi.emb->logical_to_actual(a)); + }); } }