X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_gate.c;h=a61bc162811e9462572201cef0488a396240934c;hb=51e0c2823b3847211eeedd8ce377c79d7642923d;hp=876007d901fe61fa4c1736511aed5115f3ec897c;hpb=73adac381b2c72f08293416a960942dc40db3c7f;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_gate.c b/world_gate.c index 876007d..a61bc16 100644 --- a/world_gate.c +++ b/world_gate.c @@ -105,29 +105,29 @@ VG_STATIC int render_gate( world_instance *world_inside, } /* update gate camera */ - gate_camera.fov = cam->fov; - gate_camera.nearz = 0.1f; - gate_camera.farz = 2000.0f; + world_gates.cam.fov = cam->fov; + world_gates.cam.nearz = 0.1f; + world_gates.cam.farz = 2000.0f; - m4x3_mul( gate->transport, cam->transform, gate_camera.transform ); - camera_update_view( &gate_camera ); - camera_update_projection( &gate_camera ); + m4x3_mul( gate->transport, cam->transform, world_gates.cam.transform ); + camera_update_view( &world_gates.cam ); + camera_update_projection( &world_gates.cam ); /* Add special clipping plane to projection */ v4f surface; q_mulv( gate->q[1], (v3f){0.0f,0.0f,-1.0f}, surface ); surface[3] = v3_dot( surface, gate->co[1] ); - m4x3_mulp( gate_camera.transform_inverse, surface, surface ); + m4x3_mulp( world_gates.cam.transform_inverse, surface, surface ); surface[3] = -fabsf(surface[3]); if( dist < -0.5f ) - m4x4_clip_projection( gate_camera.mtx.p, surface ); + m4x4_clip_projection( world_gates.cam.mtx.p, surface ); /* Ready to draw with new camrea */ - camera_finalize( &gate_camera ); + camera_finalize( &world_gates.cam ); - vg_line_point( gate_camera.transform[3], 0.3f, 0xff00ff00 ); + vg_line_point( world_gates.cam.transform[3], 0.3f, 0xff00ff00 ); { shader_model_gate_use(); shader_model_gate_uPv( cam->mtx.pv ); @@ -152,17 +152,17 @@ VG_STATIC int render_gate( world_instance *world_inside, glStencilMask( 0x00 ); } - render_world( world_inside, &gate_camera, layer_depth ); + render_world( world_inside, &world_gates.cam, layer_depth ); { glDisable( GL_STENCIL_TEST ); - render_water_texture( world_inside, &gate_camera, layer_depth ); + render_water_texture( world_inside, &world_gates.cam, layer_depth ); render_fb_bind( gpipeline.fb_main, 1 ); glEnable( GL_STENCIL_TEST ); - render_water_surface( world_inside, &gate_camera ); + render_water_surface( world_inside, &world_gates.cam ); glStencilMask( 0xFF ); glStencilFunc( GL_ALWAYS, 1, 0xFF );