mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 09:50:34 +00:00
asonov:: cgi.cellshape and cgi.vertices_only are now known
This commit is contained in:
parent
6b594b9fc9
commit
a2ed0e9294
22
asonov.cpp
22
asonov.cpp
@ -104,6 +104,28 @@ EX void prepare() {
|
||||
straighten = inverse(build_matrix(asonov::tx/2, asonov::ty/2, asonov::tz/2, C0));
|
||||
}
|
||||
|
||||
EX void prepare_walls() {
|
||||
|
||||
cgi.cellshape.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)});
|
||||
|
||||
reg3::make_vertices_only();
|
||||
}
|
||||
|
||||
transmatrix coord_to_matrix(coord c, coord zero) {
|
||||
transmatrix T = Id;
|
||||
|
||||
|
@ -703,6 +703,11 @@ void geometry_information::prepare_basics() {
|
||||
prepare_compute3();
|
||||
if(hyperbolic && &currfp != &fieldpattern::fp_invalid)
|
||||
currfp.analyze();
|
||||
|
||||
if(asonov::in()) {
|
||||
asonov::prepare();
|
||||
asonov::prepare_walls();
|
||||
}
|
||||
}
|
||||
|
||||
EX transmatrix xspinpush(ld dir, ld dist) {
|
||||
|
19
polygons.cpp
19
polygons.cpp
@ -998,7 +998,7 @@ void geometry_information::create_wall3d() {
|
||||
walloffsets.clear();
|
||||
}
|
||||
|
||||
if(euc::in() || reg3::in()) {
|
||||
if(euc::in() || reg3::in() || asonov::in()) {
|
||||
for(int w=0; w<isize(cgi.cellshape); w++)
|
||||
make_wall(w, cgi.cellshape[w]);
|
||||
}
|
||||
@ -1017,23 +1017,6 @@ void geometry_information::create_wall3d() {
|
||||
make_wall(7, {pt(-1,00,+1), pt(+1,00,+1), pt(+1,-1,+1), pt(-1,-1,+1)});
|
||||
}
|
||||
|
||||
if(geometry == gArnoldCat) {
|
||||
asonov::prepare();
|
||||
auto pt = [&] (int x, int y, int z) { return asonov::tx*x/2 + asonov::ty*y/2 + asonov::tz*z/2 + C0; };
|
||||
make_wall(0, {pt(-1,-1,+1), pt(00,+1,+1), pt(+1,+1,+1)});
|
||||
make_wall(1, {pt(00,-1,+1), pt(+1,+1,+1), pt(+1,-1,+1)});
|
||||
make_wall(2, {pt(-1,+1,+1), pt(00,+1,+1), pt(-1,-1,+1)});
|
||||
make_wall(3, {pt(-1,-1,+1), pt(+1,+1,+1), pt(00,-1,+1)});
|
||||
make_wall(4, {pt(+1,-1,-1), pt(+1,00,-1), pt(+1,+1,-1), pt(+1,+1,+1), pt(+1,-1,+1)});
|
||||
make_wall(5, {pt(-1,+1,-1), pt(-1,+1,+1), pt(00,+1,+1), pt(+1,+1,+1), pt(+1,+1,-1)});
|
||||
make_wall(6, {pt(-1,-1,-1), pt(-1,00,-1), pt(+1,-1,-1)});
|
||||
make_wall(7, {pt(-1,00,-1), pt(-1,+1,-1), pt(+1,-1,-1)});
|
||||
make_wall(8, {pt(-1,+1,-1), pt(+1,00,-1), pt(+1,-1,-1)});
|
||||
make_wall(9, {pt(-1,+1,-1), pt(+1,+1,-1), pt(+1,00,-1)});
|
||||
make_wall(10, {pt(-1,+1,-1), pt(-1,00,-1), pt(-1,-1,-1), pt(-1,-1,+1), pt(-1,+1,+1)});
|
||||
make_wall(11, {pt(+1,-1,-1), pt(+1,-1,+1), pt(00,-1,+1), pt(-1,-1,+1), pt(-1,-1,-1)});
|
||||
}
|
||||
|
||||
if(geometry == gNIH) {
|
||||
ld zstep = .5;
|
||||
ld bwh = vid.binary_width / 6;
|
||||
|
Loading…
Reference in New Issue
Block a user