intra:: fixed the mirroring on product ceiling portals

This commit is contained in:
Zeno Rogue 2021-10-02 14:01:22 +02:00
parent 49fcd23397
commit e70e2fc404
2 changed files with 4 additions and 4 deletions

View File

@ -49,7 +49,7 @@ hyperpoint portal_data::to_poco(hyperpoint h) const {
h[1] /= h[2];
h[2] = dec.first - d;
h[3] = 1;
if(d<0) h[2] = -h[2];
if(d<0) h[2] = -h[2], h[0] = -h[0];
return h;
}
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 {
if(prod && kind == 1) {
ld xd = h[2];
if(d<0) xd = -xd;
if(d<0) xd = -xd, h[0] = -h[0];
h[2] = 1;
auto z = product_decompose(h).first;
return h * exp(d+xd-z);

View File

@ -984,7 +984,7 @@ void raygen::emit_intra_portal(int gid1, int gid2) {
" position.z = 0.;\n" // zpos - uPLevel;\n"
" nposition = "+fn+"(nposition);\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";
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";
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"
" zpos = position.z + (pconnection.w - .5) * 16.;\n"
" position = "+fn+"(position);\n"