mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
correct get_coord in Goldberg
This commit is contained in:
parent
fef0405d0b
commit
c4fae9dfef
@ -346,11 +346,17 @@ struct hrmap_crystal : hrmap {
|
|||||||
auto b = sgc.emplace(c, ldc0);
|
auto b = sgc.emplace(c, ldc0);
|
||||||
ldcoord& res = b.first->second;
|
ldcoord& res = b.first->second;
|
||||||
if(b.second) {
|
if(b.second) {
|
||||||
if(c->master->c7 != c) {
|
if(BITRUNCATED && c->master->c7 != c) {
|
||||||
for(int i=0; i<c->type; i+=2)
|
for(int i=0; i<c->type; i+=2)
|
||||||
res = res + told(hcoords[c->cmove(i)->master]);
|
res = res + told(hcoords[c->cmove(i)->master]);
|
||||||
res = res * 2 / c->type;
|
res = res * 2 / c->type;
|
||||||
}
|
}
|
||||||
|
else if(GOLDBERG && c->master->c7 != c) {
|
||||||
|
auto m = gp::get_masters(c);
|
||||||
|
auto H = gp::get_master_coordinates(c);
|
||||||
|
for(int i=0; i<cs.dim; i++)
|
||||||
|
res = res + told(hcoords[m[i]]) * H[i];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
res = told(hcoords[c->master]);
|
res = told(hcoords[c->master]);
|
||||||
}
|
}
|
||||||
|
@ -850,6 +850,12 @@ namespace hr { namespace gp {
|
|||||||
return dmain + length(centerloc-at) - length(centerloc);
|
return dmain + length(centerloc-at) - length(centerloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hyperpoint get_master_coordinates(cell *c) {
|
||||||
|
auto li = get_local_info(c);
|
||||||
|
be_in_triangle(li);
|
||||||
|
return corners * loctoh_ort(li.relative);
|
||||||
|
}
|
||||||
|
|
||||||
array<heptagon*, 3> get_masters(cell *c) {
|
array<heptagon*, 3> get_masters(cell *c) {
|
||||||
if(GOLDBERG) {
|
if(GOLDBERG) {
|
||||||
auto li = get_local_info(c);
|
auto li = get_local_info(c);
|
||||||
|
1
hyper.h
1
hyper.h
@ -3515,6 +3515,7 @@ namespace gp {
|
|||||||
int solve_triangle(int dmain, int d0, int d1, loc at);
|
int solve_triangle(int dmain, int d0, int d1, loc at);
|
||||||
|
|
||||||
array<heptagon*, 3> get_masters(cell *c);
|
array<heptagon*, 3> get_masters(cell *c);
|
||||||
|
hyperpoint get_master_coordinates(cell *c);
|
||||||
loc univ_param();
|
loc univ_param();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user