1
0
Fork 0

Updates to how we structure runway lighting in the scene graph so we can get

the range selector to work on a per runway (or per lighting group) basis.
This commit is contained in:
curt 2002-10-22 20:47:14 +00:00
parent 95f46806c2
commit 66e8d3fe65
2 changed files with 3 additions and 10 deletions

View file

@ -56,7 +56,6 @@ FGTileEntry::FGTileEntry ( const SGBucket& b )
terra_transform( new ssgTransform ), terra_transform( new ssgTransform ),
rwy_lights_transform( new ssgTransform ), rwy_lights_transform( new ssgTransform ),
terra_range( new ssgRangeSelector ), terra_range( new ssgRangeSelector ),
rwy_lights_range( new ssgRangeSelector ),
loaded(false), loaded(false),
pending_models(0), pending_models(0),
free_tracker(0) free_tracker(0)
@ -813,10 +812,6 @@ void FGTileEntry::prep_ssg_node( const Point3D& p, sgVec3 up, float vis) {
gnd_lights_range->setRange( 0, SG_ZERO ); gnd_lights_range->setRange( 0, SG_ZERO );
gnd_lights_range->setRange( 1, vis * 1.5 + bounding_radius ); gnd_lights_range->setRange( 1, vis * 1.5 + bounding_radius );
} }
if ( rwy_lights_range ) {
rwy_lights_range->setRange( 0, SG_ZERO );
rwy_lights_range->setRange( 1, vis * 1.5 + bounding_radius );
}
sgVec3 sgTrans; sgVec3 sgTrans;
sgSetVec3( sgTrans, offset.x(), offset.y(), offset.z() ); sgSetVec3( sgTrans, offset.x(), offset.y(), offset.z() );
@ -889,7 +884,7 @@ void FGTileEntry::prep_ssg_node( const Point3D& p, sgVec3 up, float vis) {
double dist = sgLengthVec3( to ); double dist = sgLengthVec3( to );
if ( general.get_glDepthBits() > 16 ) { if ( general.get_glDepthBits() > 16 ) {
sgScaleVec3( lift_vec, 0.0 + agl / 100.0 + dist / 10000 ); sgScaleVec3( lift_vec, 0.0 + agl / 500.0 + dist / 10000 );
} else { } else {
sgScaleVec3( lift_vec, 1.0 + agl / 20.0 + dist / 5000 ); sgScaleVec3( lift_vec, 1.0 + agl / 20.0 + dist / 5000 );
} }
@ -1172,7 +1167,7 @@ FGTileEntry::load( const SGPath& base, bool is_base )
delete geometry; delete geometry;
} }
if ( rwy_lights -> getNumKids() > 0 ) { if ( rwy_lights -> getNumKids() > 0 ) {
rwy_lights_range -> addKid( rwy_lights ); rwy_lights_transform -> addKid( rwy_lights );
} else { } else {
delete rwy_lights; delete rwy_lights;
} }
@ -1347,9 +1342,8 @@ FGTileEntry::load( const SGPath& base, bool is_base )
} }
// Add runway lights to scene graph if any exist // Add runway lights to scene graph if any exist
if ( rwy_lights_range->getNumKids() > 0 ) { if ( rwy_lights_transform->getNumKids() > 0 ) {
SG_LOG( SG_TERRAIN, SG_DEBUG, "adding runway lights" ); SG_LOG( SG_TERRAIN, SG_DEBUG, "adding runway lights" );
rwy_lights_transform->addKid( rwy_lights_range );
rwy_lights_transform->setTransform( &sgcoord ); rwy_lights_transform->setTransform( &sgcoord );
} }

View file

@ -149,7 +149,6 @@ private:
// pointer to ssg range selector for this tile // pointer to ssg range selector for this tile
ssgRangeSelector *terra_range; ssgRangeSelector *terra_range;
ssgRangeSelector *rwy_lights_range;
ssgRangeSelector *gnd_lights_range; ssgRangeSelector *gnd_lights_range;
// we create several preset brightness and can choose which one we // we create several preset brightness and can choose which one we