mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
reg3:: new variation, bch_oct
This commit is contained in:
parent
81ea3d75f5
commit
5c21b64060
@ -741,7 +741,7 @@ enum eGeometry {
|
|||||||
|
|
||||||
enum eGeometryClass { gcHyperbolic, gcEuclid, gcSphere, gcSolNIH, gcNil, gcProduct, gcSL2 };
|
enum eGeometryClass { gcHyperbolic, gcEuclid, gcSphere, gcSolNIH, gcNil, gcProduct, gcSL2 };
|
||||||
|
|
||||||
enum class eVariation { bitruncated, pure, goldberg, irregular, dual, untruncated, warped, unrectified, subcubes, coxeter, dual_subcubes, bch };
|
enum class eVariation { bitruncated, pure, goldberg, irregular, dual, untruncated, warped, unrectified, subcubes, coxeter, dual_subcubes, bch, bch_oct };
|
||||||
|
|
||||||
typedef int modecode_t;
|
typedef int modecode_t;
|
||||||
|
|
||||||
|
2
fake.cpp
2
fake.cpp
@ -34,7 +34,7 @@ EX namespace fake {
|
|||||||
if(arcm::in() && PURE) return true;
|
if(arcm::in() && PURE) return true;
|
||||||
if(WDIM == 2) return false;
|
if(WDIM == 2) return false;
|
||||||
if(among(geometry, gBitrunc3)) return false;
|
if(among(geometry, gBitrunc3)) return false;
|
||||||
if(reg3::in() && !among(variation, eVariation::pure, eVariation::subcubes, eVariation::coxeter)) return false;
|
if(reg3::in() && !among(variation, eVariation::pure, eVariation::subcubes, eVariation::coxeter, eVariation::bch_oct)) return false;
|
||||||
return euc::in() || reg3::in();
|
return euc::in() || reg3::in();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1259,6 +1259,11 @@ int read_geom_args() {
|
|||||||
set_variation(eVariation::bch);
|
set_variation(eVariation::bch);
|
||||||
shift(); reg3::subcube_count = argi();
|
shift(); reg3::subcube_count = argi();
|
||||||
}
|
}
|
||||||
|
else if(argis("-bch-oct")) {
|
||||||
|
PHASEFROM(2);
|
||||||
|
set_variation(eVariation::bch_oct);
|
||||||
|
shift(); reg3::subcube_count = argi();
|
||||||
|
}
|
||||||
else if(argis("-coxeter")) {
|
else if(argis("-coxeter")) {
|
||||||
PHASEFROM(2);
|
PHASEFROM(2);
|
||||||
set_variation(eVariation::coxeter);
|
set_variation(eVariation::coxeter);
|
||||||
|
@ -530,7 +530,7 @@ static const ld hcrossf7 = 0.620672, hexf7 = 0.378077, tessf7 = 1.090550, hexhex
|
|||||||
EX bool scale_used() { return (shmup::on && geometry == gNormal && BITRUNCATED) ? (cheater || autocheat) : true; }
|
EX bool scale_used() { return (shmup::on && geometry == gNormal && BITRUNCATED) ? (cheater || autocheat) : true; }
|
||||||
|
|
||||||
EX bool is_subcube_based(eVariation var) {
|
EX bool is_subcube_based(eVariation var) {
|
||||||
return among(var, eVariation::subcubes, eVariation::dual_subcubes, eVariation::bch);
|
return among(var, eVariation::subcubes, eVariation::dual_subcubes, eVariation::bch, eVariation::bch_oct);
|
||||||
}
|
}
|
||||||
|
|
||||||
EX bool is_reg3_variation(eVariation var) {
|
EX bool is_reg3_variation(eVariation var) {
|
||||||
|
@ -3781,7 +3781,7 @@ EX int get_darkval(cell *c, int d) {
|
|||||||
const int darkval_kite[12] = {0, 2, 0, 2, 4, 4, 6, 6, 6, 6, 6, 6};
|
const int darkval_kite[12] = {0, 2, 0, 2, 4, 4, 6, 6, 6, 6, 6, 6};
|
||||||
const int darkval_nil[8] = {6,6,0,3,6,6,0,3};
|
const int darkval_nil[8] = {6,6,0,3,6,6,0,3};
|
||||||
const int darkval_nih[11] = {0,2,0,2,4,6,6,6,6,6,6};
|
const int darkval_nih[11] = {0,2,0,2,4,6,6,6,6,6,6};
|
||||||
if(among(variation, eVariation::dual_subcubes, eVariation::bch)) {
|
if(among(variation, eVariation::dual_subcubes, eVariation::bch, eVariation::bch_oct)) {
|
||||||
int v = reg3::get_face_vertex_count(c, d);
|
int v = reg3::get_face_vertex_count(c, d);
|
||||||
return v-3;
|
return v-3;
|
||||||
}
|
}
|
||||||
|
47
reg3.cpp
47
reg3.cpp
@ -621,6 +621,49 @@ EX namespace reg3 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EX void generate_bch_oct() {
|
||||||
|
if(S7 != 6) throw hr_exception("generate_bch_oct but no cubes");
|
||||||
|
const int sub = subcube_count;
|
||||||
|
if(1) {
|
||||||
|
auto vx = abs(cgi.heptshape->faces[0][0][0]);
|
||||||
|
auto vz = abs(cgi.heptshape->faces[0][0][3]);
|
||||||
|
array<int, 3> co;
|
||||||
|
// vx = 1; vz = 0;
|
||||||
|
for(co[0]=-sub; co[0]<sub; co[0]++)
|
||||||
|
for(co[1]=-sub; co[1]<sub; co[1]++)
|
||||||
|
for(co[2]=-sub; co[2]<sub; co[2]++) {
|
||||||
|
auto co1 = co;
|
||||||
|
array<ld, 3> sgn = {1,1,1};
|
||||||
|
if((co[1] ^ co[0]) & 1) co1[1]++, sgn[1] = -1;
|
||||||
|
if((co[2] ^ co[0]) & 1) co1[2]++, sgn[2] = -1;
|
||||||
|
|
||||||
|
hyperpoint ctr = Hypc;
|
||||||
|
ctr[3] = vz * sub;
|
||||||
|
|
||||||
|
auto pt = [&] (int m, ld x0, ld x1, ld x2) {
|
||||||
|
hyperpoint res = ctr;
|
||||||
|
auto x = make_array(x0, x1, x2);
|
||||||
|
for(int i=0; i<3; i++)
|
||||||
|
res[i] = vx * (co1[i] + x[(m+i)%3] * sgn[i]);
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
|
||||||
|
for(int it=0; it<2; it++) {
|
||||||
|
cgi.subshapes.emplace_back();
|
||||||
|
auto &ss = cgi.subshapes.back();
|
||||||
|
for(int m=0; m<3; m++) {
|
||||||
|
ss.faces.push_back({pt(m,0,0,0), pt(m,1,0,0), pt(m,1,0,.5), pt(m,.5,0,1), pt(m,0,0,1)});
|
||||||
|
ss.faces.push_back({pt(m,1,0,0), pt(m,1,0,.5), pt(m,1,.5,0) });
|
||||||
|
}
|
||||||
|
ss.faces.push_back({pt(0,1,0,.5), pt(0,1,.5,0), pt(0,.5,1,0), pt(0,0,1,.5), pt(0,0,.5,1), pt(0,.5,0,1)});
|
||||||
|
for(int d=0; d<3; d++)
|
||||||
|
co1[d] += sgn[d], sgn[d] *= -1;
|
||||||
|
println(hlog, ss.faces);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EX void generate_subcells() {
|
EX void generate_subcells() {
|
||||||
|
|
||||||
switch(variation) {
|
switch(variation) {
|
||||||
@ -636,6 +679,10 @@ EX namespace reg3 {
|
|||||||
generate_special_subcubes(true);
|
generate_special_subcubes(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case eVariation::bch_oct:
|
||||||
|
generate_bch_oct();
|
||||||
|
break;
|
||||||
|
|
||||||
case eVariation::coxeter:
|
case eVariation::coxeter:
|
||||||
generate_coxeter(coxeter_param);
|
generate_coxeter(coxeter_param);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user