sgVec3 rway_ols;
// ADA
// Clip plane settings...
-float cockpit_nearplane = 0.01f;
-float cockpit_farplane = 5000.0f;
float scene_nearplane = 0.5f;
float scene_farplane = 120000.0f;
// ssg variables
ssgRoot *scene = NULL;
-ssgRoot *cockpit = NULL;
ssgBranch *terrain_branch = NULL;
ssgBranch *gnd_lights_branch = NULL;
ssgBranch *rwy_lights_branch = NULL;
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 );
+ globals->get_aircraft_model()->update(0);
// draw the lights
glFogf (GL_FOG_DENSITY, fog_exp2_punch_through);
ssgSetNearFar( scene_nearplane, scene_farplane );
- globals->get_aircraft_model()->update(dt_ms);
-
// $$$ begin - added VS Renganthan 17 Oct 2K
if(objc)
fgUpdateDCS();
ssgSetNearFar( scene_nearplane, scene_farplane );
ssgCullAndDraw( scene );
+ globals->get_aircraft_model()->update(dt_ms);
+
// change state for lighting here
// draw lighting
thesky->postDraw( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER );
}
- // if in cockpit view adjust nearfar...
- if (current__view->getType() == 0 ) {
- glClearDepth(1);
- glClear(GL_DEPTH_BUFFER_BIT);
- ssgSetNearFar( cockpit_nearplane, cockpit_farplane );
- ssgCullAndDraw( cockpit );
- } else {
- ssgCullAndDraw( cockpit );
- }
-
// display HUD && Panel
glDisable( GL_FOG );
glDisable( GL_DEPTH_TEST );
scene = new ssgRoot;
scene->setName( "Scene" );
- // Scene graph root for cockpit
- cockpit = new ssgRoot;
- cockpit->setName( "Cockpit" );
-
lighting = new ssgRoot;
lighting->setName( "Lighting" );
#include <Main/viewmgr.hxx>
#include "acmodel.hxx"
-extern ssgRoot * cockpit; // FIXME: from main.cxx
-
\f
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
FGAircraftModel::FGAircraftModel ()
- : _aircraft(0)
+ : _aircraft(0),
+ _scene(new ssgRoot),
+ _nearplane(0.01f),
+ _farplane(5000.0f)
{
}
FGAircraftModel::~FGAircraftModel ()
{
delete _aircraft;
+ delete _scene;
}
void
{
_aircraft = new FG3DModel;
_aircraft->init(fgGetString("/sim/model/path", "Models/Geometry/glider.ac"));
- cockpit->addKid(_aircraft->getSceneGraph());
+ _scene->addKid(_aircraft->getSceneGraph());
}
void
fgGetDouble("/orientation/pitch-deg"),
fgGetDouble("/orientation/heading-deg"));
_aircraft->update(dt);
+
+ // OK, now adjust the clip planes and draw
+ // FIXME: view number shouldn't be
+ // hard-coded.
+ if (globals->get_current_view()->getType() == 0) {
+ glClearDepth(1);
+ glClear(GL_DEPTH_BUFFER_BIT);
+ ssgSetNearFar(_nearplane, _farplane);
+ }
+ ssgCullAndDraw(_scene);
}