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

3d:: fixed pushing directions

This commit is contained in:
? 2019-02-27 16:14:28 +01:00 committed by Zeno Rogue
parent 71ef823c43
commit 42e4342c4a
5 changed files with 24 additions and 5 deletions

View File

@ -497,13 +497,13 @@ namespace euclid3 {
heptagon *build(heptagon *parent, int d, coord at) {
auto h = get_at(at);
h->c.connect(d^1, parent, d, false);
h->c.connect((d+3)%6, parent, d, false);
return h;
}
heptagon *createStep(heptagon *parent, int d) {
int at = ispacemap[parent];
coord shifttable[6] = { +1, -1, +1000, -1000, +1000000, -1000000 };
coord shifttable[6] = { +1, +1000, +1000000, -1, -1000, -1000000 };
return build(parent, d, at + shifttable[d]);
}
};
@ -556,7 +556,7 @@ namespace euclid3 {
drawcell(c, V, 0, false);
for(int i=0; i<6; i++)
dq::enqueue(h->move(i), V * cpush(i>>1, (i&1) ? -1 : 1));
dq::enqueue(h->move(i), V * cpush(i%3, (i>=3) ? -1 : 1));
}
}

View File

@ -4163,6 +4163,16 @@ cell *determinePush(cellwalker who, cell *c2, int subdir, const T& valid, int& p
}
cellwalker push = who;
push += wstep;
if(DIM == 3 && binarytiling) {
for(int a=0; a<4; a++) {
if(push.spin < 4) push.spin = 8;
else if(push.spin >= 8) push.spin = a;
else push.spin ^= 1;
push += wstep;
if(valid(push.at)) return push.at;
}
return c2;
}
int pd = push.at->type/2;
push += pd * -subdir;
push += wstep;

View File

@ -506,6 +506,11 @@ template<class T> struct walker {
}
walker<T>& operator += (rev_t) {
int d = at->degree();
if(DIM == 3 && binarytiling) {
if(spin < 4) spin = 8;
else if(spin >= 8) spin = 0;
else spin ^= 1;
}
return (*this) += d/2 + ((d&1)?hrand(2):0);
}
walker<T>& operator += (revstep_t) {

View File

@ -2516,10 +2516,10 @@ void buildpolys() {
bshape(shBinaryWall[w], PPR::WALL);
for(int a=0; a<=4; a++) {
int t[3];
t[0] = (w&1) ? -1 : 1;
t[0] = (w>=3) ? -1 : 1;
t[1] = among(a, 0, 3, 4) ? -1 : 1;
t[2] = among(a, 2, 3) ? -1 : 1;
int x = w/2;
int x = w%3;
int y = (x+2)%3;
int z = (y+2)%3;
hpcpush(hpxy3(t[x]/2., t[y]/2., t[z]/2.));

View File

@ -277,6 +277,10 @@ void gen600() {
adj0.clear();
for(int i=0; i<120; i++) if(inedge[root][i]) adj0.push_back(i);
using namespace hyperpoint_vec;
for(int i=0; i<6; i++) for(int j=i+1; j<12; j++) if(zero_d(vertices120[adj0[i]] + vertices120[adj0[j]], 3))
swap(adj0[j], adj0[i+6]);
for(int i=0; i<120; i++) for(int j=0; j<120; j++)
if(hdist(vertices120[i], vertices120[j]) > 3)