FGTileEntry *dummy_tile;
sgVec3 rway_ols;
// ADA
+// Clip plane settings...
+float cockpit_nearplane = 0.2f;
+float cockpit_farplane = 120000.0f;
+float scene_nearplane = 0.5f;
+float scene_farplane = 120000.0f;
+
#ifndef FG_NEW_ENVIRONMENT
# include <WeatherCM/FGLocalWeatherDatabase.h>
// ssg variables
ssgRoot *scene = NULL;
+ssgRoot *cockpit = NULL;
ssgBranch *terrain_branch = NULL;
ssgBranch *gnd_lights_branch = NULL;
ssgBranch *rwy_lights_branch = NULL;
// return to the desired diffuse color
ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, l->scene_diffuse );
glEnable( GL_DEPTH_TEST );
+ ssgSetNearFar( scene_nearplane, scene_farplane );
ssgCullAndDraw( scene );
+ // if in cockpit view adjust nearfar...
+ if (globals->get_current_view()->getType() == 0 )
+ ssgSetNearFar( cockpit_nearplane, cockpit_farplane );
+ ssgCullAndDraw( cockpit );
+
// draw the lights
glFogf (GL_FOG_DENSITY, fog_exp2_punch_through);
+ ssgSetNearFar( scene_nearplane, scene_farplane );
ssgCullAndDraw( lighting );
thesky->postDraw( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER );
double agl = current_aircraft.fdm_state->get_Altitude() * SG_FEET_TO_METER
- scenery.get_cur_elev();
- if (fgGetBool("/sim/view/internal"))
- ssgSetNearFar( 0.2f, 120000.0f );
- else if ( agl > 10.0)
- ssgSetNearFar( 10.0f, 120000.0f );
- else
- ssgSetNearFar( 0.5f, 120000.0f );
+// if (fgGetBool("/sim/view/internal"))
+// ssgSetNearFar( 0.2f, 120000.0f );
+// else if ( agl > 10.0)
+
+ if ( agl > 10.0 ) {
+ scene_nearplane = 10.0f;
+ scene_farplane = 120000.0f;
+ } else {
+ scene_nearplane = 0.5f;
+ scene_farplane = 120000.0f;
+ }
+
+ ssgSetNearFar( scene_nearplane, scene_farplane );
current_model.update(0); // FIXME: use real delta time
// draw the ssg scene
glEnable( GL_DEPTH_TEST );
+ ssgSetNearFar( scene_nearplane, scene_farplane );
ssgCullAndDraw( scene );
+ // if in cockpit view adjust nearfar...
+ if (globals->get_current_view()->getType() == 0 )
+ ssgSetNearFar( cockpit_nearplane, cockpit_farplane );
+ ssgCullAndDraw( cockpit );
+
// change state for lighting here
// draw lighting
glEnable(GL_BLEND);
#endif
+ ssgSetNearFar( scene_nearplane, scene_farplane );
ssgCullAndDraw( lighting );
#ifdef FG_EXPERIMENTAL_LIGHTING
scene = new ssgRoot;
scene->setName( "Scene" );
+ // Scene graph root for cockpit
+ cockpit = new ssgRoot;
+ cockpit->setName( "Cockpit" );
+
lighting = new ssgRoot;
lighting->setName( "Lighting" );
// $$$ end - added VS Renganathan, 15 Oct 2K
// added Venky , 12 Nov 2K
+