1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-19 03:34:49 +00:00

fixed eyes on sphere

This commit is contained in:
Zeno Rogue 2022-12-09 02:25:02 +01:00
parent 9b3324b7eb
commit 1bb8056e0d
2 changed files with 7 additions and 1 deletions

View File

@ -754,7 +754,7 @@ void geometry_information::adjust_eye(hpcshape& eye, hpcshape head, ld shift_eye
vector<hyperpoint> pss;
for(int i=head.s; i<head.e; i++) pss.push_back(psmin(lzpush(shift_head) * hpc[i]));
for(int i=head.s; i<head.e; i++) pss.push_back(psmin(lzpush(shift_head - (moved_center() ? 1 : 0)) * hpc[i]));
ld zmid = 0;
for(hyperpoint& h: pss) zmid += h[2];

View File

@ -1428,6 +1428,12 @@ EX hyperpoint scale_point(const hyperpoint& h, ld scale_factor) {
return res;
}
EX bool moved_center() {
if(geom3::sph_in_euc()) return true;
if(geom3::sph_in_hyp()) return true;
return false;
}
/** Returns the intended center of the tile, relative to its local matrix. Usually C0 but may be different, e.g. when embedding a sphere in E3 or H3. */
EX hyperpoint tile_center() {
if(geom3::sph_in_euc()) return C02 + C03;