1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 13:07:16 +00:00

made -twisted-product work with pure hex

This commit is contained in:
Zeno Rogue 2024-06-16 19:17:33 +02:00
parent 3d9c4c838e
commit 6b04db89d2
3 changed files with 17 additions and 3 deletions

View File

@ -825,6 +825,11 @@ void geometry_information::prepare_basics() {
}
DEBB(DF_GEOM | DF_POLY, ("steps = ", psl_steps, " / ", single_step));
plevel = M_PI * single_step / psl_steps;
if(hybrid::underlying == gEuclid && PURE) {
cgi.plevel = sqrt(3)/4.;
single_step = 1;
}
}
set_sibling_limit();

View File

@ -321,7 +321,7 @@ void virtualRebase_cell(cell*& base, T& at, const U& check) {
template<class T, class U>
void virtualRebase(cell*& base, T& at, const U& check) {
if(nil && WDIM == 3 && nilv::nil_structure_index != 2) {
if(nil && WDIM == 3 && nilv::nil_structure_index != 2 && !mhybrid) {
/** todo: implement for hex nil too */
hyperpoint h = check(at);
auto step = [&] (int i) {

View File

@ -1602,7 +1602,8 @@ EX namespace hybrid {
tf = hdist0(hm)/2;
alpha = atan2(hm[1], hm[0]);
});
return spin(alpha) * rots::uxpush(tf) * rots::uypush(he) * rots::uzpush(lev) * C0;
if(nil) return spin(alpha) * xpush(tf*2) * ypush(he*2) * zpush(lev) * C0;
return spin(alpha) * twist::uxpush(tf) * twist::uypush(he) * twist::uzpush(lev) * C0;
#else
throw hr_exception();
#endif
@ -2341,6 +2342,10 @@ EX namespace twist {
}
EX transmatrix lift_matrix(const transmatrix& T) {
if(nil) {
hyperpoint h(T[0][2], T[1][2], 0, 0); /* todo take rotate into account */
return nisot::translate(h);
}
hyperpoint d;
ld alpha, beta, distance;
transmatrix Spin;
@ -2362,7 +2367,9 @@ EX namespace twist {
std::map<int, transmatrix> saved_matrices;
transmatrix adj(cell *c1, int i) override {
transmatrix adj(cell *c1, int i) override {
if(nil && i == c1->type-2) return zpush(-cgi.plevel);
if(nil && i == c1->type-1) return zpush(+cgi.plevel);
if(i == c1->type-2) return uzpush(-cgi.plevel) * spin(-2*cgi.plevel);
if(i == c1->type-1) return uzpush(+cgi.plevel) * spin(+2*cgi.plevel);
cell *c2 = c1->cmove(i);
@ -2391,6 +2398,8 @@ EX namespace twist {
}
transmatrix ray_iadj(cell *c1, int i) override {
if(nil && i == c1->type-2) return zpush(-cgi.plevel);
if(nil && i == c1->type-1) return zpush(+cgi.plevel);
if(i == c1->type-1) return uzpush(-cgi.plevel) * spin(-2*cgi.plevel);
if(i == c1->type-2) return uzpush(+cgi.plevel) * spin(+2*cgi.plevel);
cell *c2 = c1->cmove(i);