mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-15 15:42:49 +00:00
3d:: fixed pushing directions
This commit is contained in:
parent
71ef823c43
commit
42e4342c4a
@ -497,13 +497,13 @@ namespace euclid3 {
|
|||||||
|
|
||||||
heptagon *build(heptagon *parent, int d, coord at) {
|
heptagon *build(heptagon *parent, int d, coord at) {
|
||||||
auto h = get_at(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;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
heptagon *createStep(heptagon *parent, int d) {
|
heptagon *createStep(heptagon *parent, int d) {
|
||||||
int at = ispacemap[parent];
|
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]);
|
return build(parent, d, at + shifttable[d]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -556,7 +556,7 @@ namespace euclid3 {
|
|||||||
drawcell(c, V, 0, false);
|
drawcell(c, V, 0, false);
|
||||||
|
|
||||||
for(int i=0; i<6; i++)
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
game.cpp
10
game.cpp
@ -4163,6 +4163,16 @@ cell *determinePush(cellwalker who, cell *c2, int subdir, const T& valid, int& p
|
|||||||
}
|
}
|
||||||
cellwalker push = who;
|
cellwalker push = who;
|
||||||
push += wstep;
|
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;
|
int pd = push.at->type/2;
|
||||||
push += pd * -subdir;
|
push += pd * -subdir;
|
||||||
push += wstep;
|
push += wstep;
|
||||||
|
5
hyper.h
5
hyper.h
@ -506,6 +506,11 @@ template<class T> struct walker {
|
|||||||
}
|
}
|
||||||
walker<T>& operator += (rev_t) {
|
walker<T>& operator += (rev_t) {
|
||||||
int d = at->degree();
|
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);
|
return (*this) += d/2 + ((d&1)?hrand(2):0);
|
||||||
}
|
}
|
||||||
walker<T>& operator += (revstep_t) {
|
walker<T>& operator += (revstep_t) {
|
||||||
|
@ -2516,10 +2516,10 @@ void buildpolys() {
|
|||||||
bshape(shBinaryWall[w], PPR::WALL);
|
bshape(shBinaryWall[w], PPR::WALL);
|
||||||
for(int a=0; a<=4; a++) {
|
for(int a=0; a<=4; a++) {
|
||||||
int t[3];
|
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[1] = among(a, 0, 3, 4) ? -1 : 1;
|
||||||
t[2] = among(a, 2, 3) ? -1 : 1;
|
t[2] = among(a, 2, 3) ? -1 : 1;
|
||||||
int x = w/2;
|
int x = w%3;
|
||||||
int y = (x+2)%3;
|
int y = (x+2)%3;
|
||||||
int z = (y+2)%3;
|
int z = (y+2)%3;
|
||||||
hpcpush(hpxy3(t[x]/2., t[y]/2., t[z]/2.));
|
hpcpush(hpxy3(t[x]/2., t[y]/2., t[z]/2.));
|
||||||
|
@ -278,6 +278,10 @@ void gen600() {
|
|||||||
adj0.clear();
|
adj0.clear();
|
||||||
for(int i=0; i<120; i++) if(inedge[root][i]) adj0.push_back(i);
|
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++)
|
for(int i=0; i<120; i++) for(int j=0; j<120; j++)
|
||||||
if(hdist(vertices120[i], vertices120[j]) > 3)
|
if(hdist(vertices120[i], vertices120[j]) > 3)
|
||||||
opposite[i] = j;
|
opposite[i] = j;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user