adjusted RogueViz to use the new 3D functions

This commit is contained in:
Zeno Rogue 2022-12-11 21:12:51 +01:00
parent aee6285505
commit 0dd29dd7cf
9 changed files with 18 additions and 18 deletions

View File

@ -106,7 +106,7 @@ namespace flocking {
transmatrix I, Rot;
bool use_rot = true;
if(prod) {
if(mproduct) {
I = inverse(m->at);
Rot = inverse(m->ori);
}
@ -204,7 +204,7 @@ namespace flocking {
fixmatrix(pats[i]);
/* RogueViz does not correctly rotate them */
if(prod) {
if(mproduct) {
hyperpoint h = oris[i] * xtangent(1);
pats[i] = pats[i] * spin(-atan2(h[1], h[0]));
oris[i] = spin(+atan2(h[1], h[0])) * oris[i];
@ -234,7 +234,7 @@ namespace flocking {
gmatrix.clear();
vdata[0].m->pat = shiftless(View * calc_relative_matrix(vdata[0].m->base, centerover, C0) * vdata[0].m->at);
View = inverse(vdata[0].m->pat.T) * View;
if(prod) {
if(mproduct) {
NLP = inverse(vdata[0].m->ori);
NLP = hr::cspin90(1, 2) * spin90() * NLP;
@ -265,7 +265,7 @@ namespace flocking {
vdata[i].m->pat = gmatrix[vdata[i].m->base] * vdata[i].m->at;
auto h1 = unshift(tC0(vdata[i].m->pat));
cnt++;
if(prod) {
if(mproduct) {
auto d1 = product_decompose(h1);
lev += d1.first;
h += d1.second;
@ -275,7 +275,7 @@ namespace flocking {
}
if(cnt) {
h = normalize_flat(h);
if(prod) h = zshift(h, lev / cnt);
if(mproduct) h = orthogonal_move(h, lev / cnt);
View = inverse(actual_view_transform) * gpushxto0(h) * actual_view_transform * View;
shift_view(ztangent(follow_dist));
}

View File

@ -124,7 +124,7 @@ void create_sokowalls(cell *c) {
hyperpoint h0 = get_corner_position(c, b);
hyperpoint h1 = get_corner_position(c, b+1);
hyperpoint h2 = normalize(h0 * (qfr-fr) + h1 * fr);
return mscale(h2, 1 / (1 - a / 6.1));
return orthogonal_move_fol(h2, 1 / (1 - a / 6.1));
};
for(int a=0; a<9; a++)

View File

@ -57,7 +57,7 @@ void prepare_tf() {
hx[3] = 1;
if(hyperbolic) hx = spin(45._deg) * hx;
hx = normalize(hx);
hx = zshift(hx, h[2]*(t*(sphere ? 3 : 7)));
hx = orthogonal_move(hx, h[2]*(t*(sphere ? 3 : 7)));
return {0, hx};
}

View File

@ -20,14 +20,14 @@ void set_wall(cell *c, color_t col) {
map<cellwalker, int> plane;
cellwalker flatspin(cellwalker cw, int i) {
if(hybri && cw.spin < cw.at->type - 2)
if(mhybrid && cw.spin < cw.at->type - 2)
cw.spin = gmod(cw.spin + (cw.mirrored ? -i : i), cw.at->type - 2);
return cw;
}
cellwalker gstrafe(cellwalker cw, int i) {
if(reg3::in()) return currentmap->strafe(cw, i);
if(prod) {
if(mproduct) {
if(i == cw.at->type-2 || i == cw.at->type-1)
return cellwalker(cw.at->move(i), cw.spin);
else for(int k: {-1, 1})

View File

@ -30,7 +30,7 @@ color_t rainbow_color_at(hyperpoint h) {
}
void set_cell(cell *c) {
if(hybri) {
if(mhybrid) {
cell *c1 = hybrid::get_where(c).first;
if(c1->land != laHive) hybrid::in_underlying_geometry([&] { set_cell(c1); });
c->land = c1->land;

View File

@ -452,7 +452,7 @@ void queuedisk(const shiftmatrix& V, const colorpair& cp, bool legend, const str
queuepolyat(V, sh, 0x80, PPR::MONSTER_SHADOW);
poly_outline = p;
if(info) queueaction(PPR::MONSTER_HEAD, [info] () { SVG_LINK(*info); });
queuepolyat(V1 = mscale(V, cgi.BODY), sh, darken_a(cp.color1), PPR::MONSTER_HEAD);
queuepolyat(V1 = orthogonal_move_fol(V, cgi.BODY), sh, darken_a(cp.color1), PPR::MONSTER_HEAD);
if(info) queueaction(PPR::MONSTER_HEAD, [] () { SVG_LINK(""); });
}
else {

View File

@ -635,7 +635,7 @@ namespace sag {
ld pdist(hyperpoint hi, hyperpoint hj) {
if(sol) return min(geo_dist(hi, hj), geo_dist(hj, hi));
if(prod && angular) {
if(mproduct && angular) {
auto di = product_decompose(hi);
auto dj = product_decompose(hj);
@ -1146,7 +1146,7 @@ void geo_stats() {
out("nodes", isize(sagcells));
out("maxsagdist", max_sag_dist);
out("dim", (euclid && WDIM == 2 && euc::eu.user_axes[1][1] == 1) ? 1 : WDIM);
out("geometry", S3 >= OINF ? "tree" : hyperbolic ? "hyperbolic" : sphere ? "sphere" : euclid ? "euclid" : nil ? "nil" : sol ? "solv" : prod ? "product" : "other");
out("geometry", S3 >= OINF ? "tree" : hyperbolic ? "hyperbolic" : sphere ? "sphere" : euclid ? "euclid" : nil ? "nil" : sol ? "solv" : mproduct ? "product" : "other");
out("closed", max_sag_dist == isize(sagcells) ? 0 : closed_manifold ? 1 : 0);
out("angular", angular);
for(int p: {1, 10, 50}) { out(format("sagdist%02d", p), sorted_sagdist[(p * sorted_sagdist.size()) / 100]); }

View File

@ -423,7 +423,7 @@ void show() {
}
void prepare_for_interpolation(hyperpoint& h) {
if(prod) {
if(gproduct) {
h[3] = zlevel(h);
ld t = exp(h[3]);
h[0] /= t;
@ -433,7 +433,7 @@ void prepare_for_interpolation(hyperpoint& h) {
}
void after_interpolation(hyperpoint& h) {
if(prod) {
if(gproduct) {
ld v = exp(h[3]) / sqrt(abs(intval(h, Hypc)));
h[0] *= v;
h[1] *= v;

View File

@ -83,11 +83,11 @@ transmatrix random_snow_matrix(cell *c) {
h[2] = -h[2];
return rgpushxto0(h);
}
else if(prod) {
else if(mproduct) {
transmatrix T = PIU(random_snow_matrix(c));
return mscale(T, (randd() - .5) * cgi.plevel);
return orthogonal_move(T, (randd() - .5) * cgi.plevel);
}
else if(hybri && !prod) {
else if(mhybrid && !mproduct) {
return rots::lift_matrix(PIU(random_snow_matrix(c))); // * zpush((randd() - .5) * cgi.plevel);
}
else if(nonisotropic || bt::in()) {