X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=gate.h;h=175a8c68572faa1e63fa2927bec186a1f7f36b45;hb=cedb92d590f4578a246a09a96c0fa0eda109d3c7;hp=270f9d74b36c9993debb141001e97477296c44b3;hpb=3ee65e6e24bfc39db7c7dd8c1f4cec3d5c42d0f8;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/gate.h b/gate.h index 270f9d7..175a8c6 100644 --- a/gate.h +++ b/gate.h @@ -71,10 +71,9 @@ static void gate_fb_resize(void) fb_resize( &grender.fb ); } -static int render_gate( teleport_gate *gate, m4x3f camera ) +static int render_gate( teleport_gate *gate, v3f viewpos, m4x3f camera ) { - v3f viewpos, viewdir, gatedir; - v3_copy( camera[3], viewpos ); + v3f viewdir, gatedir; m3x3_mulv( camera, (v3f){0.0f,0.0f,-1.0f}, viewdir ); m3x3_mulv( gate->to_world, (v3f){0.0f,0.0f,-1.0f}, gatedir ); @@ -233,7 +232,7 @@ static int gate_intersect( teleport_gate *gate, v3f pos, v3f last ) float d = v3_dot(surface, v0); - if( fabsf(d) > 0.00001f ) + if( d > 0.00001f ) { float t = v3_dot(delta, surface) / d; if( t >= 0.0f && t <= l )