mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-20 07:30:26 +00:00
fixed generate_brm in 3D
This commit is contained in:
parent
6cf00a1c3c
commit
0fc8dfde15
@ -757,12 +757,25 @@ EX void generate_brm(cell *c1) {
|
|||||||
q.pop();
|
q.pop();
|
||||||
|
|
||||||
ld mindist = HUGE_VAL, maxdist = 0;
|
ld mindist = HUGE_VAL, maxdist = 0;
|
||||||
|
|
||||||
|
if(WDIM == 2) {
|
||||||
for(int i=0; i<c1->type; i++)
|
for(int i=0; i<c1->type; i++)
|
||||||
for(int j=0; j<c2->type; j++) {
|
for(int j=0; j<c2->type; j++) {
|
||||||
ld d = hdist(get_corner_position(c1, i), T * get_corner_position(c2, j));
|
ld d = hdist(get_corner_position(c1, i), T * get_corner_position(c2, j));
|
||||||
if(d < mindist) mindist = d;
|
if(d < mindist) mindist = d;
|
||||||
if(d > maxdist) maxdist = d;
|
if(d > maxdist) maxdist = d;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
auto& ss1 = currentmap->get_cellshape(c1);
|
||||||
|
auto& ss2 = currentmap->get_cellshape(c2);
|
||||||
|
for(auto v: ss1.vertices_only)
|
||||||
|
for(auto w: ss2.vertices_only) {
|
||||||
|
ld d = hdist(v, T*w);
|
||||||
|
if(d < mindist) mindist = d;
|
||||||
|
if(d > maxdist) maxdist = d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto& cu = cutoff[c2];
|
auto& cu = cutoff[c2];
|
||||||
if(cu == 0 || cu > maxdist)
|
if(cu == 0 || cu > maxdist)
|
||||||
|
Loading…
Reference in New Issue
Block a user