mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
shift-awareness in rogueviz
This commit is contained in:
parent
e99251e70c
commit
9d0a252d14
@ -197,8 +197,8 @@ void bantar_note(cell *c) {
|
||||
using bantar_config = pair<cell*, cell*>;
|
||||
|
||||
tuple<ld,bool,ld> quality(bantar_config cp) {
|
||||
hyperpoint h1 = tC0(ggmatrix(cp.first));
|
||||
hyperpoint h2 = tC0(ggmatrix(cp.second));
|
||||
shiftpoint h1 = tC0(ggmatrix(cp.first));
|
||||
shiftpoint h2 = tC0(ggmatrix(cp.second));
|
||||
return make_tuple(hdist0(h1) * hdist0(h2), h2[1] > 0, abs(h2[0] / h2[1]));
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ namespace flocking {
|
||||
|
||||
char shape = 'b';
|
||||
|
||||
vector<tuple<hyperpoint, hyperpoint, color_t> > lines;
|
||||
vector<tuple<shiftpoint, shiftpoint, color_t> > lines;
|
||||
|
||||
// parameters of each boid
|
||||
// m->base: the cell it is currently on
|
||||
@ -103,7 +103,7 @@ namespace flocking {
|
||||
for(int i=0; i<isize(cl.lst); i++) {
|
||||
cell *c2 = cl.lst[i];
|
||||
transmatrix T = calc_relative_matrix(c2, c1, C0);
|
||||
if(hypot_d(WDIM, inverse_exp(tC0(T))) <= check_range) {
|
||||
if(hypot_d(WDIM, inverse_exp(shiftless(tC0(T)))) <= check_range) {
|
||||
relmatrices[c1][c2] = T;
|
||||
forCellEx(c3, c2) cl.add(c3);
|
||||
}
|
||||
@ -115,8 +115,8 @@ namespace flocking {
|
||||
vertexdata& vd = vdata[i];
|
||||
// set initial base and at to random cell and random position there
|
||||
createViz(i, v[hrand(isize(v))], Id);
|
||||
rotate_object(vd.m->pat, vd.m->ori, random_spin());
|
||||
apply_parallel_transport(vd.m->pat, vd.m->ori, xtangent(hrand(100) / 200.));
|
||||
rotate_object(vd.m->pat.T, vd.m->ori, random_spin());
|
||||
apply_parallel_transport(vd.m->pat.T, vd.m->ori, xtangent(hrand(100) / 200.));
|
||||
|
||||
vd.name = its(i+1);
|
||||
vd.cp = dftcolor;
|
||||
@ -198,7 +198,7 @@ namespace flocking {
|
||||
// at2 is like m2->at but relative to m->at
|
||||
|
||||
// m2's position relative to m (tC0 means *(0,0,1))
|
||||
hyperpoint ac = inverse_exp(tC0(at2));
|
||||
hyperpoint ac = inverse_exp(shiftless(tC0(at2)));
|
||||
if(use_rot) ac = Rot * ac;
|
||||
|
||||
// distance and azimuth to m2
|
||||
@ -288,8 +288,8 @@ namespace flocking {
|
||||
|
||||
if(follow == 1) {
|
||||
gmatrix.clear();
|
||||
vdata[0].m->pat = View * calc_relative_matrix(vdata[0].m->base, centerover, C0) * vdata[0].m->at;
|
||||
View = inverse(vdata[0].m->pat) * View;
|
||||
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) {
|
||||
NLP = inverse(vdata[0].m->ori);
|
||||
|
||||
@ -318,7 +318,7 @@ namespace flocking {
|
||||
ld lev = 0;
|
||||
for(int i=0; i<N; i++) if(gmatrix.count(vdata[i].m->base)) {
|
||||
vdata[i].m->pat = gmatrix[vdata[i].m->base] * vdata[i].m->at;
|
||||
auto h1 = tC0(vdata[i].m->pat);
|
||||
auto h1 = unshift(tC0(vdata[i].m->pat));
|
||||
cnt++;
|
||||
if(prod) {
|
||||
auto d1 = product_decompose(h1);
|
||||
|
@ -14,13 +14,13 @@ int fullnet_id;
|
||||
void drawExtra() {
|
||||
|
||||
if(vizid == &fullnet_id) {
|
||||
for(map<cell*, transmatrix>::iterator it = gmatrix.begin(); it != gmatrix.end(); it++) {
|
||||
for(map<cell*, shiftmatrix>::iterator it = gmatrix.begin(); it != gmatrix.end(); it++) {
|
||||
cell *c = it->first;
|
||||
c->wall = waChasm;
|
||||
}
|
||||
int index = 0;
|
||||
|
||||
for(map<cell*, transmatrix>::iterator it = gmatrix.begin(); it != gmatrix.end(); it++) {
|
||||
for(map<cell*, shiftmatrix>::iterator it = gmatrix.begin(); it != gmatrix.end(); it++) {
|
||||
cell *c = it->first;
|
||||
bool draw = true;
|
||||
for(int i=0; i<isize(named); i++) if(named[i] == c) draw = false;
|
||||
|
@ -47,19 +47,19 @@ hyperpoint find_point(ld t) {
|
||||
hyperpoint gcurvestart = err;
|
||||
|
||||
void xcurvepoint(hyperpoint h) {
|
||||
curvepoint(cwtV * h);
|
||||
curvepoint(h);
|
||||
if(iserror(gcurvestart))
|
||||
gcurvestart = h;
|
||||
else if(sphere && intval(gcurvestart, h) > .1) {
|
||||
queuecurve(graphcolor, 0, PPR::LINE);
|
||||
curvepoint(cwtV * h);
|
||||
queuecurve(cwtV, graphcolor, 0, PPR::LINE);
|
||||
curvepoint(h);
|
||||
gcurvestart = h;
|
||||
}
|
||||
}
|
||||
|
||||
void finish() {
|
||||
if(!iserror(gcurvestart)) {
|
||||
queuecurve(graphcolor, 0, PPR::LINE);
|
||||
queuecurve(cwtV, graphcolor, 0, PPR::LINE);
|
||||
gcurvestart = err;
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ namespace fundamental {
|
||||
color_t color1, color2;
|
||||
|
||||
map<cell*, int> same;
|
||||
map<cell*, transmatrix> gm;
|
||||
map<cell*, shiftmatrix> gm;
|
||||
|
||||
bool is_connected(cellwalker cw) {
|
||||
return same[cw.at] & (1<<cw.spin);
|
||||
@ -28,8 +28,8 @@ void be_connected(cellwalker cw) {
|
||||
|
||||
int funmode = 0;
|
||||
|
||||
hyperpoint corner(cellwalker cw) {
|
||||
transmatrix T = gm[cw.at];
|
||||
shiftpoint corner(cellwalker cw) {
|
||||
shiftmatrix T = gm[cw.at];
|
||||
if(funmode == 2) {
|
||||
while(cw.at->type != S7) {
|
||||
cw++;
|
||||
@ -47,10 +47,10 @@ transmatrix rel(cellwalker cw) {
|
||||
|
||||
ld label_dist = .3;
|
||||
|
||||
transmatrix labelpos(hyperpoint h1, hyperpoint h2) {
|
||||
hyperpoint h = mid(h1, h2);
|
||||
transmatrix T = rgpushxto0(h);
|
||||
hyperpoint hx = inverse(T) * h2;
|
||||
shiftmatrix labelpos(shiftpoint h1, shiftpoint h2) {
|
||||
shiftpoint h = mid(h1, h2);
|
||||
shiftmatrix T = rgpushxto0(h);
|
||||
hyperpoint hx = inverse_shift(T, h2);
|
||||
ld alpha = atan2(-hx[1], hx[0]);
|
||||
return T * xspinpush(alpha + M_PI/2, label_dist);
|
||||
}
|
||||
@ -136,7 +136,7 @@ void fundamental_marker() {
|
||||
prev_corner[cw] = cw0;
|
||||
}
|
||||
|
||||
vector<transmatrix> nearm;
|
||||
vector<pair<shiftmatrix, shiftmatrix>> nearm;
|
||||
|
||||
for(int ci=0; ci<corners; ci++) {
|
||||
for(int u=0; u<1; u++) {
|
||||
@ -145,9 +145,9 @@ void fundamental_marker() {
|
||||
printf("[%d %d %d] ", is_connected(cw), is_connected(cw+1), is_connected(cw+wstep-1));
|
||||
printf("[%d %d %d] ", is_connected(cw1), is_connected(cw1+1), is_connected(cw1+wstep-1));
|
||||
printf("%d %d;\n", !!next_corner.count(cw1), !!next_corner.count(cw1+wmirror-1)); */
|
||||
transmatrix T_here = gm[cw.at] * rel(cw+u);
|
||||
transmatrix T_there = gm[cw1.at];
|
||||
nearm.push_back(T_here * inverse(T_there));
|
||||
shiftmatrix T_here = gm[cw.at] * rel(cw+u);
|
||||
shiftmatrix T_there = gm[cw1.at];
|
||||
nearm.emplace_back(T_here, T_there);
|
||||
}
|
||||
cw = next_corner[cw];
|
||||
}
|
||||
@ -156,18 +156,18 @@ void fundamental_marker() {
|
||||
|
||||
for(int ci=0; ci<corners; ci++) {
|
||||
|
||||
hyperpoint h = corner(cw);
|
||||
shiftpoint h = corner(cw);
|
||||
cw = next_corner[cw];
|
||||
hyperpoint h2 = corner(cw);
|
||||
shiftpoint h2 = corner(cw);
|
||||
|
||||
for(auto& T: nearm) queueline(T * h, T * h2, color1, 3);
|
||||
for(auto& n: nearm) queueline(n.first * inverse_shift(n.second, h), n.first * inverse_shift(n.second, h2), color1, 3);
|
||||
}
|
||||
|
||||
for(int ci=0; ci<corners; ci++) {
|
||||
|
||||
hyperpoint h = corner(cw);
|
||||
shiftpoint h = corner(cw);
|
||||
cw = next_corner[cw];
|
||||
hyperpoint h2 = corner(cw);
|
||||
shiftpoint h2 = corner(cw);
|
||||
|
||||
queueline(h, h2, color2, 3);
|
||||
}
|
||||
@ -179,7 +179,7 @@ void fundamental_marker() {
|
||||
if(!is_connected(cw0)) continue;
|
||||
int v = 0;
|
||||
for(auto& n: nearm) {
|
||||
queueline(n * gm[cw0.at] * xspinpush0(v, .05), n * gm[cw0.cpeek()] * xspinpush0(v, .05), 0xFF8000FF, 0);
|
||||
queueline(n.first * inverse_shift(n.second, gm[cw0.at]) * xspinpush0(v, .05), n.first * inverse_shift(n.second, gm[cw0.cpeek()]) * xspinpush0(v, .05), 0xFF8000FF, 0);
|
||||
v++;
|
||||
}
|
||||
queueline(gm[cw0.at] * C0, gm[cw0.cpeek()] * C0, 0xFF0000FF, 0);
|
||||
|
@ -214,7 +214,7 @@ void reset() {
|
||||
ir = nullptr;
|
||||
}
|
||||
|
||||
bool draw_ptriangle(cell *c, const transmatrix& V) {
|
||||
bool draw_ptriangle(cell *c, const shiftmatrix& V) {
|
||||
|
||||
if(!on) return false;
|
||||
|
||||
|
@ -280,7 +280,7 @@ void analyze() {
|
||||
coloring();
|
||||
}
|
||||
|
||||
bool coloring_3d(cell *c, const transmatrix& V) {
|
||||
bool coloring_3d(cell *c, const shiftmatrix& V) {
|
||||
if(WDIM == 3 && vizid == &kohonen_id)
|
||||
queuepoly(face_the_player(V), cgi.shRing, darkena(c->landparam_color, 0, 0xFF));
|
||||
return false;
|
||||
@ -813,7 +813,7 @@ namespace levelline {
|
||||
if(!on) return;
|
||||
for(auto& g: gmatrix) {
|
||||
cell *c1 = g.first;
|
||||
transmatrix T = g.second;
|
||||
shiftmatrix T = g.second;
|
||||
neuron *n1 = getNeuron(c1);
|
||||
if(!n1) continue;
|
||||
for(int i=0; i<c1->type; i++) {
|
||||
|
@ -61,7 +61,7 @@ void curveline(hyperpoint a, hyperpoint b, int lev) {
|
||||
curvepoint(b);
|
||||
}
|
||||
|
||||
bool magic_markers(cell *c, const transmatrix& V) {
|
||||
bool magic_markers(cell *c, const shiftmatrix& V) {
|
||||
if(vizid != (void*) &magic) return false;
|
||||
timerghost = false;
|
||||
if(c->landparam == back) {
|
||||
@ -73,15 +73,15 @@ bool magic_markers(cell *c, const transmatrix& V) {
|
||||
for(int i=0; i<S7; i++) {
|
||||
cell *c2 = c->move(i);
|
||||
if(c2->landparam != back) {
|
||||
hyperpoint h1 = V * get_corner_position(c, i, 3/.9);
|
||||
hyperpoint h2 = V * get_corner_position(c, i+1, 3/.9);
|
||||
hyperpoint h1 = get_corner_position(c, i, 3/.9);
|
||||
hyperpoint h2 = get_corner_position(c, i+1, 3/.9);
|
||||
curvepoint(h1);
|
||||
curveline(h1, h2, 3);
|
||||
hyperpoint h3 = V * get_corner_position(c, i, 3/.7);
|
||||
hyperpoint h4 = V * get_corner_position(c, i+1, 3/.7);
|
||||
hyperpoint h3 = get_corner_position(c, i, 3/.7);
|
||||
hyperpoint h4 = get_corner_position(c, i+1, 3/.7);
|
||||
curvepoint(h4);
|
||||
curveline(h4, h3, 3);
|
||||
queuecurve(0xFF, (c2->landparam << 8) | 0xFF, PPR::LINE);
|
||||
queuecurve(V, 0xFF, (c2->landparam << 8) | 0xFF, PPR::LINE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,10 @@ string rfname;
|
||||
|
||||
enum class ptype : char { outside, inside, inside_left_up, inside_left_down, top, bottom, left_inf, right_inf, marked };
|
||||
|
||||
dqi_line& queueline1(const hyperpoint& H1, const hyperpoint& H2, color_t col, int prf = 0, PPR prio = PPR::LINE) {
|
||||
return queueline(shiftless(H1), shiftless(H2), col, prf, prio);
|
||||
}
|
||||
|
||||
void add_border(vector<string>& v, int cy) {
|
||||
int Y = isize(v), X = isize(v[0]);
|
||||
char nx = '6';
|
||||
@ -656,7 +660,7 @@ void draw_ncee() {
|
||||
curvepoint(hpxy(xpos+scax, map_ypos+sca2));
|
||||
nctinf2.tvertices.push_back(glhr::makevertex(0.5+maxx, 1, 0));
|
||||
}
|
||||
auto& q = queuecurve(0, show_mgrid ? 0x404040FF : 0xFFFFFFFF, PPR::LINE);
|
||||
auto& q = queuecurve(shiftless(Id), 0, show_mgrid ? 0x404040FF : 0xFFFFFFFF, PPR::LINE);
|
||||
q.tinf = &nctinf2;
|
||||
q.flags |= POLY_TRIANGLES;
|
||||
q.offset_texture = 0;
|
||||
@ -678,7 +682,7 @@ void draw_ncee() {
|
||||
bool ineq =
|
||||
in_visualization && fmap[y][x] == '1';
|
||||
#endif
|
||||
queuecurve(0,
|
||||
queuecurve(shiftless(Id), 0,
|
||||
#if CAP_NCONF
|
||||
(ineq && nconf::pts[y][x].state == 1) ? 0xFF8000FF :
|
||||
(ineq && nconf::pts[y][x].state == 2) ? 0x00FF00FF :
|
||||
@ -691,7 +695,7 @@ void draw_ncee() {
|
||||
curvepoint(h(x,y+1));
|
||||
curvepoint(h(x+1,y+1));
|
||||
curvepoint(h(x+1,y));
|
||||
queuecurve(0,
|
||||
queuecurve(shiftless(Id), 0,
|
||||
typecols[fmap[y][x] - '0'], PPR::LINE);
|
||||
}
|
||||
|
||||
@ -727,7 +731,7 @@ void draw_ncee() {
|
||||
}
|
||||
}
|
||||
|
||||
auto& q = queuecurve(0, (show_mgrid && show_mapping) ? 0x404040FF : 0xFFFFFFFF, PPR::LINE);
|
||||
auto& q = queuecurve(shiftless(Id), 0, (show_mgrid && show_mapping) ? 0x404040FF : 0xFFFFFFFF, PPR::LINE);
|
||||
q.tinf = &nctinf;
|
||||
q.flags |= POLY_TRIANGLES;
|
||||
q.offset_texture = 0;
|
||||
@ -736,7 +740,7 @@ void draw_ncee() {
|
||||
|
||||
pair<int, int> mpt = {(mousex - xc - cd->xcenter - x0) / siz, (mousey - yc - cd->ycenter - y0) / siz};
|
||||
|
||||
queueline(h(0,0), h(0,-1), 0x1010101);
|
||||
queueline1(h(0,0), h(0,-1), 0x1010101);
|
||||
|
||||
const color_t gridcol = 0xFFFFFFFF;
|
||||
if(inHighQual) ;
|
||||
@ -748,14 +752,14 @@ void draw_ncee() {
|
||||
if(y < Y-2 && fmap[y][x] > '0' && fmap[y+1][x] > '0') {
|
||||
color_t col = (make_pair(x,y) == mpt || make_pair(x,y+1) == mpt) ? 0xFFFF00FF : gridcol;
|
||||
dynamicval<ld> lw(vid.linewidth, vid.linewidth * (col == 0xFFFF00FF ? 4 : 1));
|
||||
queueline(hc(x, y), hc(x, y+1), col, 0, PPR::CIRCLE);
|
||||
queueline(vmap[y][x], vmap[y+1][x], col, 0, PPR::CIRCLE);
|
||||
queueline1(hc(x, y), hc(x, y+1), col, 0, PPR::CIRCLE);
|
||||
queueline1(vmap[y][x], vmap[y+1][x], col, 0, PPR::CIRCLE);
|
||||
}
|
||||
if(x < X-2 && fmap[y][x] > '0' && fmap[y][x+1] > '0') {
|
||||
color_t col = (make_pair(x,y) == mpt || make_pair(x+1,y) == mpt) ? 0xFFFF00FF : gridcol;
|
||||
dynamicval<ld> lw(vid.linewidth, vid.linewidth * (col == 0xFFFF00FF ? 4 : 1));
|
||||
queueline(hc(x, y), hc(x+1, y), col, 0, PPR::CIRCLE);
|
||||
queueline(vmap[y][x], vmap[y][x+1], col, 0, PPR::CIRCLE);
|
||||
queueline1(hc(x, y), hc(x+1, y), col, 0, PPR::CIRCLE);
|
||||
queueline1(vmap[y][x], vmap[y][x+1], col, 0, PPR::CIRCLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -774,17 +778,17 @@ void draw_ncee() {
|
||||
else if(fmap[y][x] == '4' || fmap[y][x] == '5')
|
||||
col = 0xFFFF00FF;
|
||||
}
|
||||
queueline(h(x,y), h(x,y+1), col);
|
||||
queueline(h(x,y), h(x+1,y), col);
|
||||
queueline(h(x+1,y), h(x+1,y+1), col);
|
||||
queueline(h(x,y+1), h(x+1,y+1), col);
|
||||
queueline1(h(x,y), h(x,y+1), col);
|
||||
queueline1(h(x,y), h(x+1,y), col);
|
||||
queueline1(h(x+1,y), h(x+1,y+1), col);
|
||||
queueline1(h(x,y+1), h(x+1,y+1), col);
|
||||
vid.linewidth /= 3;
|
||||
}
|
||||
|
||||
for(int x=0; x<=X; x++) queueline(h(x,0), h(x,Y), 0x80808080);
|
||||
for(int y=0; y<=Y; y++) queueline(h(0,y), h(X,y), 0x80808080);
|
||||
for(int x=0; x<=X; x++) queueline1(h(x,0), h(x,Y), 0x80808080);
|
||||
for(int y=0; y<=Y; y++) queueline1(h(0,y), h(X,y), 0x80808080);
|
||||
|
||||
queueline(h(0,0), h(0,-1), 0x1010101);
|
||||
queueline1(h(0,0), h(0,-1), 0x1010101);
|
||||
|
||||
quickqueue();
|
||||
glflush();
|
||||
|
@ -33,7 +33,7 @@ hyperpoint xts0;
|
||||
array<hyperpoint, 3> mts;
|
||||
|
||||
rug::rugpoint *pt(hyperpoint h, hyperpoint c, int id) {
|
||||
auto r = rug::addRugpoint(C0, -1);
|
||||
auto r = rug::addRugpoint(shiftless(C0), -1);
|
||||
r->native = h;
|
||||
r->x1 = (1 + c[0]) / 16 + (id/8) / 8.;
|
||||
r->y1 = (1 + c[1]) / 16 + (id%8) / 8.;
|
||||
@ -132,7 +132,7 @@ void run_snub(int v, int w) {
|
||||
drawthemap();
|
||||
|
||||
if(euclid || sphere) for(cell *c: currentmap->allcells())
|
||||
gmatrix[c] = arcm::archimedean_gmatrix[c->master].second;
|
||||
gmatrix[c] = shiftless(arcm::archimedean_gmatrix[c->master].second);
|
||||
|
||||
cellwalker cw(currentmap->gamestart(), 0);
|
||||
p0 = cw.at;
|
||||
@ -142,11 +142,11 @@ void run_snub(int v, int w) {
|
||||
// p1 = (cw + wstep + 1 + wstep -1 + wstep).at;
|
||||
cc = (cw - 1 + wstep - 1 + wstep).at;
|
||||
|
||||
transmatrix rel = inverse(gmatrix[p0]);
|
||||
transmatrix rel = inverse(gmatrix[p0].T);
|
||||
|
||||
ts[0] = rel * gmatrix[t0] * ddspin(t0, (cw - 1 + wstep).spin);
|
||||
ts[1] = rel * gmatrix[t1];
|
||||
ts[2] = rel * gmatrix[t2] * ddspin(t2, (cw + wstep + 1 + wstep - 1).spin);
|
||||
ts[0] = rel * gmatrix[t0].T * ddspin(t0, (cw - 1 + wstep).spin);
|
||||
ts[1] = rel * gmatrix[t1].T;
|
||||
ts[2] = rel * gmatrix[t2].T * ddspin(t2, (cw + wstep + 1 + wstep - 1).spin);
|
||||
|
||||
matrix2 = ts[2] * inverse(ts[0]);
|
||||
|
||||
@ -156,7 +156,7 @@ void run_snub(int v, int w) {
|
||||
for(cell *c: currentmap->allcells()) {
|
||||
int id = arcm::id_of(c->master);
|
||||
if(among(id, 0, 1)) for(int d=0; d<v; d++) {
|
||||
transmatrix T = rel * ggmatrix(c) * spin(2*M_PI*d/v);
|
||||
transmatrix T = rel * ggmatrix(c).T * spin(2*M_PI*d/v);
|
||||
array<hyperpoint,3> hts;
|
||||
for(int i=0; i<3; i++)
|
||||
hts[i] = T * ts[i] * C0;
|
||||
@ -179,7 +179,7 @@ void run_snub(int v, int w) {
|
||||
|
||||
println(hlog, "original ", xts0);
|
||||
|
||||
cor = rel * gmatrix[cc] * C0;
|
||||
cor = rel * gmatrix[cc].T * C0;
|
||||
|
||||
rug::reopen();
|
||||
for(auto p: rug::points) p->valid = true;
|
||||
|
@ -104,7 +104,7 @@ void set_cell(cell *c) {
|
||||
|
||||
bool qtm_on;
|
||||
|
||||
bool may_set_cell(cell *c, const transmatrix& T) {
|
||||
bool may_set_cell(cell *c, const shiftmatrix& T) {
|
||||
if(qtm_on) set_cell(c);
|
||||
return false;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ struct hrmap_rewrite : hrmap_hyperbolic {
|
||||
|
||||
};
|
||||
|
||||
bool labeller(cell* c, const transmatrix& V) {
|
||||
bool labeller(cell* c, const shiftmatrix& V) {
|
||||
auto m = dynamic_cast<hrmap_rewrite*> (currentmap);
|
||||
if(m) {
|
||||
string s = m->asg[c->master].second;
|
||||
|
@ -203,7 +203,7 @@ hyperpoint where(int i, cell *base) {
|
||||
}
|
||||
else {
|
||||
// notimpl(); // actually probably that's a buug
|
||||
return inverse(ggmatrix(currentmap->gamestart())) * (ggmatrix(m->base) * tC0(m->at));
|
||||
return inverse_shift(ggmatrix(currentmap->gamestart()), ggmatrix(m->base) * tC0(m->at));
|
||||
}
|
||||
}
|
||||
|
||||
@ -486,7 +486,7 @@ color_t darken_a(color_t c) {
|
||||
#define SVG_LINK(x)
|
||||
#endif
|
||||
|
||||
void queuedisk(const transmatrix& V, const colorpair& cp, bool legend, const string* info, int i) {
|
||||
void queuedisk(const shiftmatrix& V, const colorpair& cp, bool legend, const string* info, int i) {
|
||||
if(legend && (int) cp.color1 == (int) 0x000000FF && backcolor == 0)
|
||||
poly_outline = 0x606060FF;
|
||||
else
|
||||
@ -494,14 +494,14 @@ void queuedisk(const transmatrix& V, const colorpair& cp, bool legend, const str
|
||||
|
||||
if(cp.img) {
|
||||
for(hyperpoint h: cp.img->vertices)
|
||||
curvepoint(V * h);
|
||||
auto& qc = queuecurve(0, 0xFFFFFFFF, PPR::MONSTER_HEAD);
|
||||
curvepoint(h);
|
||||
auto& qc = queuecurve(V, 0, 0xFFFFFFFF, PPR::MONSTER_HEAD);
|
||||
qc.tinf = &cp.img->tinf;
|
||||
qc.flags |= POLY_TRIANGLES;
|
||||
return;
|
||||
}
|
||||
|
||||
transmatrix V1;
|
||||
shiftmatrix V1;
|
||||
|
||||
auto& sh =
|
||||
vertex_shape == 2 ? cgi.shHeptaMarker :
|
||||
@ -557,7 +557,7 @@ transmatrix& memo_relative_matrix(cell *c1, cell *c2) {
|
||||
return p;
|
||||
}
|
||||
|
||||
void queue_prec(const transmatrix& V, edgeinfo*& ei, color_t col) {
|
||||
void queue_prec(const shiftmatrix& V, edgeinfo*& ei, color_t col) {
|
||||
if(!fat_edges)
|
||||
queuetable(V, ei->prec, isize(ei->prec), col, 0, PPR::STRUCT0);
|
||||
#if MAXMDIM >= 4
|
||||
@ -571,7 +571,7 @@ void queue_prec(const transmatrix& V, edgeinfo*& ei, color_t col) {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool drawVertex(const transmatrix &V, cell *c, shmup::monster *m) {
|
||||
bool drawVertex(const shiftmatrix &V, cell *c, shmup::monster *m) {
|
||||
if(m->dead) return true;
|
||||
if(m->type != moRogueviz) return false;
|
||||
int i = m->pid;
|
||||
@ -627,18 +627,18 @@ bool drawVertex(const transmatrix &V, cell *c, shmup::monster *m) {
|
||||
|
||||
alpha >>= darken;
|
||||
|
||||
transmatrix gm1 =
|
||||
shiftmatrix gm1 =
|
||||
(multidraw || elliptic) ? V * memo_relative_matrix(vd1.m->base, c) :
|
||||
ggmatrix(vd1.m->base);
|
||||
transmatrix gm2 =
|
||||
shiftmatrix gm2 =
|
||||
(multidraw || elliptic) ? V * memo_relative_matrix(vd2.m->base, c) :
|
||||
ggmatrix(vd2.m->base);
|
||||
|
||||
hyperpoint h1 = gm1 * vd1.m->at * C0;
|
||||
hyperpoint h2 = gm2 * vd2.m->at * C0;
|
||||
shiftpoint h1 = gm1 * vd1.m->at * C0;
|
||||
shiftpoint h2 = gm2 * vd2.m->at * C0;
|
||||
|
||||
if(elliptic && intval(h1, h2) > intval(h1, centralsym * h2))
|
||||
h2 = centralsym * h2;
|
||||
if(elliptic && hdist(h1, h2) > hdist(h1.h, centralsym * h2.h))
|
||||
h2.h = centralsym * h2.h;
|
||||
|
||||
if(multidraw) {
|
||||
int code = int(h1[0]) + int(h1[1]) * 12789117 + int(h2[0]) * 126081253 + int(h2[1]) * 126891531;
|
||||
@ -677,14 +677,14 @@ bool drawVertex(const transmatrix &V, cell *c, shmup::monster *m) {
|
||||
ei->orig = center; // cwt.at;
|
||||
ei->prec.clear();
|
||||
|
||||
transmatrix T = inverse(ggmatrix(ei->orig));
|
||||
shiftmatrix T = ggmatrix(ei->orig);
|
||||
|
||||
if(callhandlers(false, hooks_alt_edges, ei, true)) ;
|
||||
else if(fat_edges) {
|
||||
ei->tinf.tvertices.clear();
|
||||
transmatrix T1 = inverse(gm1 * vd1.m->at);
|
||||
hyperpoint goal = T1 * h2;
|
||||
transmatrix S = T * gm1 * vd1.m->at * rspintox(goal);
|
||||
shiftmatrix T1 = gm1 * vd1.m->at;
|
||||
hyperpoint goal = inverse_shift(T1, h2);
|
||||
transmatrix S = inverse_shift(T, gm1) * vd1.m->at * rspintox(goal);
|
||||
ld d = hdist0(goal);
|
||||
for(int a=0; a<360; a+=30) {
|
||||
auto store = [&] (ld a, ld b) {
|
||||
@ -700,10 +700,10 @@ bool drawVertex(const transmatrix &V, cell *c, shmup::monster *m) {
|
||||
}
|
||||
}
|
||||
else
|
||||
storeline(ei->prec, T*h1, T*h2);
|
||||
storeline(ei->prec, inverse_shift(T, h1), inverse_shift(T, h2));
|
||||
}
|
||||
queue_prec(multidraw ? V : ggmatrix(ei->orig), ei, col);
|
||||
if(elliptic) queue_prec(centralsym * ggmatrix(ei->orig), ei, col);
|
||||
if(elliptic) queue_prec(ggmatrix(ei->orig) * centralsym, ei, col);
|
||||
}
|
||||
}
|
||||
/*
|
||||
@ -719,12 +719,12 @@ bool drawVertex(const transmatrix &V, cell *c, shmup::monster *m) {
|
||||
bool doshow = true;
|
||||
if((vizflags & RV_COMPRESS_LABELS) && i > 0 && !vd.virt) {
|
||||
vertexdata& vdp = vdata[vd.data];
|
||||
hyperpoint h2 = ggmatrix(vdp.m->base) * vdp.m->at * C0;
|
||||
shiftpoint h2 = ggmatrix(vdp.m->base) * vdp.m->at * C0;
|
||||
if(hdist(h2, V * m->at * C0) < 0.1) doshow = false;
|
||||
}
|
||||
|
||||
hyperpoint h = tC0(V * m->at);
|
||||
transmatrix V2 = GDIM == 3 ? V * m->at : rgpushxto0(h) * ypush(PURE ? .3 : .2); // todo-variation
|
||||
shiftpoint h = tC0(V * m->at);
|
||||
shiftmatrix V2 = GDIM == 3 ? V * m->at : rgpushxto0(h) * ypush(PURE ? .3 : .2); // todo-variation
|
||||
if(doshow && !behindsphere(V2)) {
|
||||
auto info = vd.info;
|
||||
if(info) queueaction(PPR::MONSTER_HEAD, [info] () { SVG_LINK(*info); });
|
||||
@ -783,7 +783,7 @@ bool rogueviz_hud() {
|
||||
transmatrix V = atscreenpos(x, y, current_display->radius/8);
|
||||
|
||||
poly_outline = t->color | 0xFF;
|
||||
queuepolyat(V, cgi.shTriangle, 0, PPR::MONSTER_HEAD);
|
||||
queuepolyat(shiftless(V), cgi.shTriangle, 0, PPR::MONSTER_HEAD);
|
||||
|
||||
poly_outline = OUTLINE_DEFAULT;
|
||||
queuestr(int(x-rad), int(y), 0, rad*(svg::in?5:3)/4, t->name, legend_color, 0, 16);
|
||||
@ -1053,7 +1053,7 @@ void search_marker() {
|
||||
auto& vd = vdata[search_for];
|
||||
auto& m = vd.m;
|
||||
if(!m) return;
|
||||
hyperpoint H = ggmatrix(m->base) * tC0(m->at);
|
||||
shiftpoint H = ggmatrix(m->base) * tC0(m->at);
|
||||
queuestr(H, 2*vid.fsize, "X", 0x10101 * int(128 + 100 * sin(ticks / 150.)));
|
||||
addauraspecial(H, iinf[itOrbYendor].color, 0);
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ function<void(presmode)> roguevizslide_action(char c, const T& t, const U& act)
|
||||
extern string fname;
|
||||
|
||||
colorpair perturb(colorpair cp);
|
||||
void queuedisk(const transmatrix& V, const colorpair& cp, bool legend, const string* info, int i);
|
||||
void queuedisk(const shiftmatrix& V, const colorpair& cp, bool legend, const string* info, int i);
|
||||
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ transmatrix random_snow_matrix(cell *c) {
|
||||
}
|
||||
}
|
||||
|
||||
bool draw_snow(cell *c, const transmatrix& V) {
|
||||
bool draw_snow(cell *c, const shiftmatrix& V) {
|
||||
|
||||
if(!matrices_at.count(c)) {
|
||||
auto& v = matrices_at[c];
|
||||
|
@ -29,7 +29,7 @@ hyperpoint spcoord(hyperpoint h) {
|
||||
}
|
||||
|
||||
rug::rugpoint *pt(hyperpoint h, hyperpoint c) {
|
||||
auto r = rug::addRugpoint(C0, -1);
|
||||
auto r = rug::addRugpoint(shiftless(C0), -1);
|
||||
r->native = spcoord(h);
|
||||
r->x1 = c[0];
|
||||
r->y1 = c[1];
|
||||
|
@ -59,7 +59,7 @@ vector<int> inext, inext2;
|
||||
|
||||
vector<int> fibs = {1, 2};
|
||||
|
||||
bool sunflower_cell(cell *c, transmatrix V) {
|
||||
bool sunflower_cell(cell *c, shiftmatrix V) {
|
||||
if(!on) return false;
|
||||
density = zdensity / 100;
|
||||
|
||||
@ -106,7 +106,7 @@ bool sunflower_cell(cell *c, transmatrix V) {
|
||||
}
|
||||
|
||||
if(c == cwt.at) {
|
||||
for(int i=0; i<iqty; i++) ps[i] = V * p(i);
|
||||
for(int i=0; i<iqty; i++) ps[i] = p(i);
|
||||
|
||||
for(int i=0; i<iqty; i++) {
|
||||
ld ba = 99;
|
||||
@ -129,16 +129,16 @@ bool sunflower_cell(cell *c, transmatrix V) {
|
||||
curvepoint(ps[inext[i]]);
|
||||
curvepoint(ps[inext2[i]]);
|
||||
// queuecurve(0xFFFFFFFF, 0x00C000FF, PPR::LINE);
|
||||
queuecurve(0x000000FF, 0xC04000FF, PPR::LINE);
|
||||
queuecurve(shiftless(Id), 0x000000FF, 0xC04000FF, PPR::LINE);
|
||||
}
|
||||
else {
|
||||
curvepoint(ps[i]);
|
||||
curvepoint(ps[inext[i]]);
|
||||
curvepoint(ps[inext[i] + inext2[i] - i]);
|
||||
curvepoint(ps[inext2[i]]);
|
||||
queuecurve(0x000000FF, 0xFFD500FF, PPR::LINE);
|
||||
queuecurve(V,0x000000FF, 0xFFD500FF, PPR::LINE);
|
||||
}
|
||||
if(nodes) queuepolyat(rgpushxto0(ps[i]), cgi.shSnowball, 0xFF, PPR::SUPERLINE);
|
||||
if(nodes) queuepolyat(V * rgpushxto0(ps[i]), cgi.shSnowball, 0xFF, PPR::SUPERLINE);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -119,9 +119,9 @@ struct trianglemaker {
|
||||
|
||||
// println(hlog, "uds = ", uds);
|
||||
|
||||
for(int a=0; a<3; a++) println(hlog, sqhypot_d(3, inverse_exp(start + ds[a] * ca)));
|
||||
for(int a=0; a<3; a++) println(hlog, sqhypot_d(3, inverse_exp(shiftless(start + ds[a] * ca))));
|
||||
|
||||
for(int a=0; a<3; a++) println(hlog, sqhypot_d(3, inverse_exp(uds[a])));
|
||||
for(int a=0; a<3; a++) println(hlog, sqhypot_d(3, inverse_exp(shiftless(uds[a]))));
|
||||
|
||||
// compute cube vertices
|
||||
|
||||
@ -473,7 +473,7 @@ void growthrate() {
|
||||
color_t tcolors[3] = { 0xFF0000FF, 0x00FF00FF, 0x0000FFFF };
|
||||
|
||||
|
||||
bool draw_ptriangle(cell *c, const transmatrix& V) {
|
||||
bool draw_ptriangle(cell *c, const shiftmatrix& V) {
|
||||
|
||||
if(!on) return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user