mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-06-13 17:06:52 +00:00
intra:: fixed the mirroring on product ceiling portals
This commit is contained in:
parent
49fcd23397
commit
e70e2fc404
|
@ -49,7 +49,7 @@ hyperpoint portal_data::to_poco(hyperpoint h) const {
|
||||||
h[1] /= h[2];
|
h[1] /= h[2];
|
||||||
h[2] = dec.first - d;
|
h[2] = dec.first - d;
|
||||||
h[3] = 1;
|
h[3] = 1;
|
||||||
if(d<0) h[2] = -h[2];
|
if(d<0) h[2] = -h[2], h[0] = -h[0];
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
else if(prod && kind == 0) {
|
else if(prod && kind == 0) {
|
||||||
|
@ -73,7 +73,7 @@ hyperpoint portal_data::to_poco(hyperpoint h) const {
|
||||||
hyperpoint portal_data::from_poco(hyperpoint h) const {
|
hyperpoint portal_data::from_poco(hyperpoint h) const {
|
||||||
if(prod && kind == 1) {
|
if(prod && kind == 1) {
|
||||||
ld xd = h[2];
|
ld xd = h[2];
|
||||||
if(d<0) xd = -xd;
|
if(d<0) xd = -xd, h[0] = -h[0];
|
||||||
h[2] = 1;
|
h[2] = 1;
|
||||||
auto z = product_decompose(h).first;
|
auto z = product_decompose(h).first;
|
||||||
return h * exp(d+xd-z);
|
return h * exp(d+xd-z);
|
||||||
|
|
|
@ -984,7 +984,7 @@ void raygen::emit_intra_portal(int gid1, int gid2) {
|
||||||
" position.z = 0.;\n" // zpos - uPLevel;\n"
|
" position.z = 0.;\n" // zpos - uPLevel;\n"
|
||||||
" nposition = "+fn+"(nposition);\n"
|
" nposition = "+fn+"(nposition);\n"
|
||||||
" nposition.z = zspeed * 1e-3;\n"
|
" nposition.z = zspeed * 1e-3;\n"
|
||||||
" if(pconnection.y < .5) { nposition.z = -nposition.z; }\n";
|
" if(pconnection.y < .5) { nposition.z = -nposition.z; nposition.x = -nposition.x; position.x = -position.x; }\n";
|
||||||
}
|
}
|
||||||
fmain += " } else {\n";
|
fmain += " } else {\n";
|
||||||
if(1) {
|
if(1) {
|
||||||
|
@ -1029,7 +1029,7 @@ void raygen::emit_intra_portal(int gid1, int gid2) {
|
||||||
string fn = in_h2xe() ? "from_poco_h2xr_h" : "from_poco_s2xr_s";
|
string fn = in_h2xe() ? "from_poco_h2xr_h" : "from_poco_s2xr_s";
|
||||||
|
|
||||||
fmain +=
|
fmain +=
|
||||||
" if(pconnection.w < .5) { position.z = -position.z; nposition.z = -nposition.z; }\n"
|
" if(pconnection.w < .5) { position.z = -position.z; nposition.z = -nposition.z; nposition.x = -nposition.x; position.x = -position.x; }\n"
|
||||||
" zspeed = (nposition.z - position.z) * 1e3;\n"
|
" zspeed = (nposition.z - position.z) * 1e3;\n"
|
||||||
" zpos = position.z + (pconnection.w - .5) * 16.;\n"
|
" zpos = position.z + (pconnection.w - .5) * 16.;\n"
|
||||||
" position = "+fn+"(position);\n"
|
" position = "+fn+"(position);\n"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user