X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_gate.h;h=9d1287711782d7570fb0c26505647beb2b9c5978;hb=c52e639cdcf6d21f69caa9625238afded7513ca4;hp=3e35081e2b1c72639bfa510a9196eb4da04fc706;hpb=a1adba47558099cab82aa6d10abdc1dca11d3342;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_gate.h b/world_gate.h index 3e35081..9d12877 100644 --- a/world_gate.h +++ b/world_gate.h @@ -52,7 +52,11 @@ VG_STATIC int render_gate( teleport_gate *gate, camera *cam ) v3f v0; v3_sub( cam->pos, gate->co[0], v0 ); - if( v3_dot(v0, gatedir) >= 0.0f ) + + float dist = v3_dot(v0, gatedir); + + /* Hard cutoff */ + if( dist > 3.0f ) return 0; if( v3_dist( cam->pos, gate->co[0] ) > 100.0f ) @@ -80,7 +84,7 @@ VG_STATIC int render_gate( teleport_gate *gate, camera *cam ) static camera gate_view; gate_view.fov = cam->fov; gate_view.nearz = 0.1f; - gate_view.farz = 900.0f; + gate_view.farz = 2000.0f; m4x3_mul( gate->transport, cam->transform, gate_view.transform ); camera_update_view( &gate_view ); @@ -93,7 +97,9 @@ VG_STATIC int render_gate( teleport_gate *gate, camera *cam ) m4x3_mulp( gate_view.transform_inverse, surface, surface ); surface[3] = -fabsf(surface[3]); - m4x4_clip_projection( gate_view.mtx.p, surface ); + + if( dist < -0.5f ) + m4x4_clip_projection( gate_view.mtx.p, surface ); /* Ready to draw with new camrea */ camera_finalize( &gate_view );