1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-03-25 05:59:43 +00:00

euc_in_product

This commit is contained in:
Zeno Rogue
2023-01-06 00:09:12 +01:00
parent 28146b13f7
commit 4b3bfb9932
9 changed files with 129 additions and 33 deletions

View File

@@ -596,7 +596,7 @@ void geometry_information::prepare_lta() {
lta[1][1] *= geom3::euclid_embed_scale * geom3::euclid_embed_scale_y;
lta = cspin(0, 1, geom3::euclid_embed_rotate * degree) * lta;
}
if(geom3::euc_in_nil()) lta = cspin90(2, 1) * lta;
if(geom3::euc_vertical()) lta = cspin90(2, 1) * lta;
if(geom3::hyp_in_solnih()) lta = cspin90(0, 1) * cspin90(1, 2) * cspin90(0, 1) * lta;
}
actual_to_logical = inverse(lta);
@@ -1108,7 +1108,10 @@ EX namespace geom3 {
seProduct,
seNil,
seSol, seNIH, seSolN,
seCliffordTorus
seCliffordTorus,
seProductH,
seProductS,
seSL2
};
#endif
@@ -1123,6 +1126,9 @@ EX namespace geom3 {
{"stretched hyperbolic", "Embed into stretched hyperbolic geometry. Works only with Euclidean. You need to set the variation to Pure."},
{"stretched Sol", "Embed into stretched Sol geometry. Works only with Euclidean. You need to set the variation to Pure."},
{"Clifford Torus", "Embed Euclidean torus into S3. You need to set the variation to Pure."},
{"hyperbolic product", "embed Euclidean or hyperbolic plane in the H2xR product space. For E2, set the variation to Pure."},
{"spherical product", "embed Euclidean or spherical plane in the H2xR product space. For E2, set the variation to Pure."},
{"SL(2,R)", "Embed Euclidean plane in twisted product geometry. Set the variation to Pure."}
};
EX eSpatialEmbedding spatial_embedding = seDefault;
@@ -1157,6 +1163,18 @@ EX namespace geom3 {
return ggclass() == gcNil && mgclass() == gcEuclid;
}
EX bool euc_in_product() {
return ggclass() == gcProduct && mgclass() == gcEuclid;
}
EX bool euc_in_sl2() {
return ggclass() == gcSL2 && mgclass() == gcEuclid;
}
EX bool euc_vertical() {
return mgclass() == gcEuclid && among(ggclass(), gcNil, gcProduct, gcSL2);
}
EX bool euc_in_solnih() {
return among(ggclass(), gcSol, gcNIH, gcSolN) && mgclass() == gcEuclid;
}
@@ -1166,7 +1184,7 @@ EX namespace geom3 {
}
EX bool euc_in_noniso() {
return among(ggclass(), gcNil, gcSol, gcNIH, gcSolN, gcSphere) && mgclass() == gcEuclid;
return among(ggclass(), gcNil, gcSol, gcNIH, gcSolN, gcSphere, gcProduct, gcSL2) && mgclass() == gcEuclid;
}
EX bool sph_in_euc() {
@@ -1234,12 +1252,18 @@ EX namespace geom3 {
g.sig[3] = g.sig[2];
g.sig[2] = g.sig[1];
if(spatial_embedding == seProduct && g.kind != gcEuclid) {
if(among(spatial_embedding, seProduct, seProductH, seProductS) && g.kind != gcEuclid) {
g.kind = gcProduct;
g.homogeneous_dimension--;
g.sig[2] = g.sig[3];
}
if(among(spatial_embedding, seProductH, seProductS) && g.kind == gcEuclid) {
g.kind = gcProduct;
g.homogeneous_dimension--;
g.sig[2] = spatial_embedding == seProductH ? -1 : 1;
}
if(spatial_embedding == seLowerCurvature) {
if(g.kind == gcEuclid) g = ginf[gSpace534].g;
if(g.kind == gcSphere) g = ginf[gCubeTiling].g;
@@ -1279,6 +1303,11 @@ EX namespace geom3 {
g = ginf[gSolN].g;
g.gameplay_dimension = 2;
}
if(spatial_embedding == seSL2 && ieuclid) {
g = giSL2;
g.gameplay_dimension = 2;
}
}
}
}