1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 22:39:53 +00:00

renamed flatresult to cross_result

This commit is contained in:
Zeno Rogue 2022-09-11 13:44:28 +02:00
parent a221244cab
commit 2522b16e55
3 changed files with 10 additions and 10 deletions

View File

@ -2,7 +2,7 @@ namespace hr {
namespace ads_game { namespace ads_game {
flatresult findflat(shiftpoint h) { cross_result findflat(shiftpoint h) {
return cross0(current * rgpushxto0(h)); return cross0(current * rgpushxto0(h));
} }
@ -11,8 +11,8 @@ void draw_game_cell(cell *cs, ads_matrix V, ld plev) {
adjust_to_zero(V, g, plev); adjust_to_zero(V, g, plev);
auto c = g.first; auto c = g.first;
flatresult center; cross_result center;
vector<flatresult> hlist; vector<cross_result> hlist;
hybrid::in_actual([&]{ hybrid::in_actual([&]{
for(int i=0; i<=c->type; i++) { for(int i=0; i<=c->type; i++) {
@ -106,7 +106,7 @@ void draw_game_cell(cell *cs, ads_matrix V, ld plev) {
for(int i=0; i<isize(shape); i += 2) { for(int i=0; i<isize(shape); i += 2) {
hybrid::in_actual([&]{ hybrid::in_actual([&]{
auto h = V * rock.at * rots::uxpush(shape[i]) * rots::uypush(shape[i+1]); auto h = V * rock.at * rots::uxpush(shape[i]) * rots::uypush(shape[i+1]);
flatresult f = cross0(current * h); cross_result f = cross0(current * h);
rock.pts.push_back(f); rock.pts.push_back(f);
}); });
} }
@ -131,7 +131,7 @@ bool view_ads_game() {
gen_budget = 5; gen_budget = 5;
displayed.clear(); displayed.clear();
flatresult base; cross_result base;
if(1) { if(1) {
// todo rebase // todo rebase
base = findflat(ads_point(C0, 0)); base = findflat(ads_point(C0, 0));

View File

@ -11,8 +11,8 @@ struct ads_object {
color_t col; color_t col;
ld life_start, life_end; ld life_start, life_end;
flatresult pt_main; cross_result pt_main;
vector<flatresult> pts; vector<cross_result> pts;
ads_object(eObjType t, cell *_owner, const ads_matrix& T, color_t _col) : type(t), owner(_owner), at(T), col(_col) { ads_object(eObjType t, cell *_owner, const ads_matrix& T, color_t _col) : type(t), owner(_owner), at(T), col(_col) {
life_start = -HUGE_VAL; life_start = -HUGE_VAL;

View File

@ -104,7 +104,7 @@ ads_matrix ads_inverse(const ads_matrix& T) {
return res; return res;
} }
struct flatresult { struct cross_result {
hyperpoint h; hyperpoint h;
ld shift; ld shift;
}; };
@ -115,7 +115,7 @@ extern ads_matrix current;
* shift is T's proper time at the point of crossing, and h=(x,y,z) is the Minkowski hyperboloid point where it crosses. * shift is T's proper time at the point of crossing, and h=(x,y,z) is the Minkowski hyperboloid point where it crosses.
**/ **/
flatresult cross0(ads_matrix hz) { cross_result cross0(ads_matrix hz) {
transmatrix deg90 = chg_shift(90*degree); transmatrix deg90 = chg_shift(90*degree);
hyperpoint uhz = unshift(hz * C0); hyperpoint uhz = unshift(hz * C0);
@ -142,7 +142,7 @@ flatresult cross0(ads_matrix hz) {
tie(uhzt[2], uhzt[3]) = make_pair(uhzt[3], -uhzt[2]); tie(uhzt[2], uhzt[3]) = make_pair(uhzt[3], -uhzt[2]);
t += get_shift_cycles(-hz.shift-t); t += get_shift_cycles(-hz.shift-t);
return flatresult{uhzt, t}; return cross_result{uhzt, t};
} }
/** sample from Poisson distribution */ /** sample from Poisson distribution */