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 {
flatresult findflat(shiftpoint h) {
cross_result findflat(shiftpoint 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);
auto c = g.first;
flatresult center;
vector<flatresult> hlist;
cross_result center;
vector<cross_result> hlist;
hybrid::in_actual([&]{
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) {
hybrid::in_actual([&]{
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);
});
}
@ -131,7 +131,7 @@ bool view_ads_game() {
gen_budget = 5;
displayed.clear();
flatresult base;
cross_result base;
if(1) {
// todo rebase
base = findflat(ads_point(C0, 0));

View File

@ -11,8 +11,8 @@ struct ads_object {
color_t col;
ld life_start, life_end;
flatresult pt_main;
vector<flatresult> pts;
cross_result pt_main;
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) {
life_start = -HUGE_VAL;

View File

@ -104,7 +104,7 @@ ads_matrix ads_inverse(const ads_matrix& T) {
return res;
}
struct flatresult {
struct cross_result {
hyperpoint h;
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.
**/
flatresult cross0(ads_matrix hz) {
cross_result cross0(ads_matrix hz) {
transmatrix deg90 = chg_shift(90*degree);
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]);
t += get_shift_cycles(-hz.shift-t);
return flatresult{uhzt, t};
return cross_result{uhzt, t};
}
/** sample from Poisson distribution */