1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-25 22:53:19 +00:00

rogueviz:: draw a rolling ball along impossible ring

This commit is contained in:
Zeno Rogue 2020-05-25 02:27:54 +02:00
parent b785a0a7cc
commit b5084d91d5

View File

@ -16,6 +16,8 @@ bool on;
ld cscale = .2;
ld cylball;
struct iring {
geometry_information *icgi;
@ -32,6 +34,8 @@ struct iring {
vector<transmatrix> path;
hpcshape ball;
void init() {
icgi = &cgi;
@ -192,6 +196,13 @@ struct iring {
cgi.finishshape();
cgi.extra_vertices();
}
if(cylball) {
ball.prio = PPR::WALL;
cgi.make_ball(ball, cylball, 2);
cgi.finishshape();
cgi.extra_vertices();
}
}
};
@ -223,6 +234,13 @@ bool draw_ptriangle(cell *c, const transmatrix& V) {
/* auto& s1 = queuepoly(V * nisot::translate(td.at), ir->pcube[side], gradient(tcolors[td.tcolor], magiccolors[side], 0, .2, 1));
ensure_vertex_number(*s1.tinf, s1.cnt); */
}
if(cylball) {
long long isp = isize(ir->path);
transmatrix T = ir->path[isp-1 - (ticks * isp / int(anims::period)) % isp];
T = nisot::parallel_transport(inverse(T), -point3(0, cscale + cylball, 0));
queuepoly(V * T, ir->ball, 0xFFFFFFFF);
}
}
return false;
@ -253,6 +271,9 @@ auto hchook = addHook(hooks_drawcell, 100, draw_ptriangle)
else if(argis("-cylanim")) {
cylanim = !cylanim;
}
else if(argis("-cylball")) {
shift_arg_formula(cylball);
}
else return 1;
return 0;
})