1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-30 15:39:54 +00:00

better centering

This commit is contained in:
Zeno Rogue 2020-06-08 01:54:55 +02:00
parent f74e2f1ae8
commit 89aa64d52b

View File

@ -43,7 +43,7 @@ void make() {
vertices[3][0] = 2 * xx - vertices[3][0]; vertices[3][0] = 2 * xx - vertices[3][0];
vertices[4][0] = 2 * xx - vertices[4][0]; vertices[4][0] = 2 * xx - vertices[4][0];
heps.emplace_back(gpushxto0(vertices[2]), 0xFFFFFFFF); heps.emplace_back(Id, 0xFFFFFFFF);
switch(magmashape) { switch(magmashape) {
@ -93,6 +93,14 @@ void make() {
} }
break; break;
} }
hyperpoint center = Hypc;
for(auto& h: heps) for(int i=0; i<7; i++)
center += h.first * vertices[i];
center = normalize(center);
for(auto& h: heps) h.first = gpushxto0(center) * h.first;
if(1) { if(1) {