1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-11 23:06:00 +00:00

the main (heptagon) cellshape now also uses subcellshape; removed dirdist and get_vertices and introduced get_cellshape instead

This commit is contained in:
Zeno Rogue
2021-07-12 11:07:22 +02:00
parent 2d962c324d
commit 6e6d0a7839
14 changed files with 182 additions and 206 deletions

View File

@@ -110,24 +110,27 @@ EX void prepare() {
EX void prepare_walls() {
cgi.cellshape.clear();
auto& hsh = cgi.heptshape;
hsh = unique_ptr<subcellshape>(new subcellshape);
auto& cs = hsh->faces;
cs.clear();
auto pt = [&] (int x, int y, int z) { return asonov::tx*x/2 + asonov::ty*y/2 + asonov::tz*z/2 + C0; };
cgi.cellshape.push_back({pt(-1,-1,+1), pt(00,+1,+1), pt(+1,+1,+1)});
cgi.cellshape.push_back({pt(00,-1,+1), pt(+1,+1,+1), pt(+1,-1,+1)});
cgi.cellshape.push_back({pt(-1,+1,+1), pt(00,+1,+1), pt(-1,-1,+1)});
cgi.cellshape.push_back({pt(-1,-1,+1), pt(+1,+1,+1), pt(00,-1,+1)});
cgi.cellshape.push_back({pt(+1,-1,-1), pt(+1,00,-1), pt(+1,+1,-1), pt(+1,+1,+1), pt(+1,-1,+1)});
cgi.cellshape.push_back({pt(-1,+1,-1), pt(-1,+1,+1), pt(00,+1,+1), pt(+1,+1,+1), pt(+1,+1,-1)});
cgi.cellshape.push_back({pt(-1,-1,-1), pt(-1,00,-1), pt(+1,-1,-1)});
cgi.cellshape.push_back({pt(-1,00,-1), pt(-1,+1,-1), pt(+1,-1,-1)});
cgi.cellshape.push_back({pt(-1,+1,-1), pt(+1,00,-1), pt(+1,-1,-1)});
cgi.cellshape.push_back({pt(-1,+1,-1), pt(+1,+1,-1), pt(+1,00,-1)});
cgi.cellshape.push_back({pt(-1,+1,-1), pt(-1,00,-1), pt(-1,-1,-1), pt(-1,-1,+1), pt(-1,+1,+1)});
cgi.cellshape.push_back({pt(+1,-1,-1), pt(+1,-1,+1), pt(00,-1,+1), pt(-1,-1,+1), pt(-1,-1,-1)});
cs.push_back({pt(-1,-1,+1), pt(00,+1,+1), pt(+1,+1,+1)});
cs.push_back({pt(00,-1,+1), pt(+1,+1,+1), pt(+1,-1,+1)});
cs.push_back({pt(-1,+1,+1), pt(00,+1,+1), pt(-1,-1,+1)});
cs.push_back({pt(-1,-1,+1), pt(+1,+1,+1), pt(00,-1,+1)});
cs.push_back({pt(+1,-1,-1), pt(+1,00,-1), pt(+1,+1,-1), pt(+1,+1,+1), pt(+1,-1,+1)});
cs.push_back({pt(-1,+1,-1), pt(-1,+1,+1), pt(00,+1,+1), pt(+1,+1,+1), pt(+1,+1,-1)});
cs.push_back({pt(-1,-1,-1), pt(-1,00,-1), pt(+1,-1,-1)});
cs.push_back({pt(-1,00,-1), pt(-1,+1,-1), pt(+1,-1,-1)});
cs.push_back({pt(-1,+1,-1), pt(+1,00,-1), pt(+1,-1,-1)});
cs.push_back({pt(-1,+1,-1), pt(+1,+1,-1), pt(+1,00,-1)});
cs.push_back({pt(-1,+1,-1), pt(-1,00,-1), pt(-1,-1,-1), pt(-1,-1,+1), pt(-1,+1,+1)});
cs.push_back({pt(+1,-1,-1), pt(+1,-1,+1), pt(00,-1,+1), pt(-1,-1,+1), pt(-1,-1,-1)});
reg3::make_vertices_only();
hsh->compute_hept();
}
transmatrix coord_to_matrix(coord c, coord zero) {