FlightGear next
FGScenery Class Reference

#include <scenery.hxx>

Inherits SGSubsystem.

Classes

class  ElevationMeshListener
 
class  ScenerySwitchListener
 
class  TextureCacheListener
 

Public Member Functions

 FGScenery ()
 
 ~FGScenery ()
 
void bind () override
 
void init () override
 
void reinit () override
 
void shutdown () override
 
void unbind () override
 
void update (double dt) override
 
bool get_elevation_m (const SGGeod &geod, double &alt, const simgear::BVHMaterial **material, const osg::Node *butNotFrom=0)
 Compute the elevation of the scenery at geodetic latitude lat, geodetic longitude lon and not higher than max_alt.
 
bool get_cart_elevation_m (const SGVec3d &pos, double max_altoff, double &elevation, const simgear::BVHMaterial **material, const osg::Node *butNotFrom=0)
 Compute the elevation of the scenery below the cartesian point pos.
 
bool get_cart_ground_intersection (const SGVec3d &start, const SGVec3d &dir, SGVec3d &nearestHit, const osg::Node *butNotFrom=0)
 Compute the nearest intersection point of the line starting from start going in direction dir with the terrain.
 
osg::Group * get_scene_graph () const
 
osg::Group * get_terrain_branch () const
 
osg::Group * get_models_branch () const
 
osg::Group * get_aircraft_branch () const
 
osg::Group * get_interior_branch () const
 
osg::Group * get_particles_branch () const
 
osg::Group * get_precipitation_branch () const
 
bool scenery_available (const SGGeod &position, double range_m)
 Returns true if scenery is available for the given lat, lon position within a range of range_m.
 
flightgear::SceneryPagergetPager ()
 
bool schedule_scenery (const SGGeod &position, double range_m, double duration=0.0)
 
void materialLibChanged ()
 

Static Public Member Functions

static const char * staticSubsystemClassId ()
 
static flightgear::SceneryPagergetPagerSingleton ()
 
static void resetPagerSingleton ()
 

Friends

class ScenerySwitchListener
 
class TextureCacheListener
 
class ElevationMeshListener
 

Detailed Description

Definition at line 50 of file scenery.hxx.

Constructor & Destructor Documentation

◆ FGScenery()

FGScenery::FGScenery ( )

Definition at line 388 of file scenery.cxx.

◆ ~FGScenery()

FGScenery::~FGScenery ( )

Definition at line 398 of file scenery.cxx.

Member Function Documentation

◆ bind()

void FGScenery::bind ( )
override

Definition at line 510 of file scenery.cxx.

◆ get_aircraft_branch()

osg::Group * FGScenery::get_aircraft_branch ( ) const
inline

Definition at line 132 of file scenery.hxx.

◆ get_cart_elevation_m()

bool FGScenery::get_cart_elevation_m ( const SGVec3d & pos,
double max_altoff,
double & elevation,
const simgear::BVHMaterial ** material,
const osg::Node * butNotFrom = 0 )

Compute the elevation of the scenery below the cartesian point pos.

you the returned scenery altitude is not higher than the position pos plus an offset given with max_altoff. If the exact flag is set to true, the scenery center is moved to gain a higher accuracy of that query. The center is restored past that to the original value. The altitude hit is returned in the alt argument. The method returns true if the scenery is available for the given lat/lon pair. If there is no scenery for that point, the altitude value is undefined. All values are meant to be in meters.

Definition at line 517 of file scenery.cxx.

◆ get_cart_ground_intersection()

bool FGScenery::get_cart_ground_intersection ( const SGVec3d & start,
const SGVec3d & dir,
SGVec3d & nearestHit,
const osg::Node * butNotFrom = 0 )

Compute the nearest intersection point of the line starting from start going in direction dir with the terrain.

The input and output values should be in cartesian coordinates in the usual earth centered wgs84 coordinate system. Units are meters. On success, true is returned.

Definition at line 536 of file scenery.cxx.

◆ get_elevation_m()

bool FGScenery::get_elevation_m ( const SGGeod & geod,
double & alt,
const simgear::BVHMaterial ** material,
const osg::Node * butNotFrom = 0 )

Compute the elevation of the scenery at geodetic latitude lat, geodetic longitude lon and not higher than max_alt.

If the exact flag is set to true, the scenery center is moved to gain a higher accuracy of that query. The center is restored past that to the original value. The altitude hit is returned in the alt argument. The method returns true if the scenery is available for the given lat/lon pair. If there is no scenery for that point, the altitude value is undefined. All values are meant to be in meters or degrees.

Definition at line 527 of file scenery.cxx.

◆ get_interior_branch()

osg::Group * FGScenery::get_interior_branch ( ) const
inline

Definition at line 133 of file scenery.hxx.

◆ get_models_branch()

osg::Group * FGScenery::get_models_branch ( ) const
inline

Definition at line 131 of file scenery.hxx.

◆ get_particles_branch()

osg::Group * FGScenery::get_particles_branch ( ) const
inline

Definition at line 134 of file scenery.hxx.

◆ get_precipitation_branch()

osg::Group * FGScenery::get_precipitation_branch ( ) const
inline

Definition at line 135 of file scenery.hxx.

◆ get_scene_graph()

osg::Group * FGScenery::get_scene_graph ( ) const
inline

Definition at line 129 of file scenery.hxx.

◆ get_terrain_branch()

osg::Group * FGScenery::get_terrain_branch ( ) const
inline

Definition at line 130 of file scenery.hxx.

◆ getPager()

flightgear::SceneryPager * FGScenery::getPager ( )
inline

Definition at line 147 of file scenery.hxx.

◆ getPagerSingleton()

SceneryPager * FGScenery::getPagerSingleton ( )
static

Definition at line 560 of file scenery.cxx.

◆ init()

void FGScenery::init ( )
override

Definition at line 406 of file scenery.cxx.

◆ materialLibChanged()

void FGScenery::materialLibChanged ( )

Definition at line 553 of file scenery.cxx.

◆ reinit()

void FGScenery::reinit ( )
override

Definition at line 478 of file scenery.cxx.

◆ resetPagerSingleton()

void FGScenery::resetPagerSingleton ( )
static

Definition at line 567 of file scenery.cxx.

◆ scenery_available()

bool FGScenery::scenery_available ( const SGGeod & position,
double range_m )

Returns true if scenery is available for the given lat, lon position within a range of range_m.

lat and lon are expected to be in degrees.

Definition at line 543 of file scenery.cxx.

◆ schedule_scenery()

bool FGScenery::schedule_scenery ( const SGGeod & position,
double range_m,
double duration = 0.0 )

Definition at line 548 of file scenery.cxx.

◆ shutdown()

void FGScenery::shutdown ( )
override

Definition at line 485 of file scenery.cxx.

◆ staticSubsystemClassId()

static const char * FGScenery::staticSubsystemClassId ( )
inlinestatic

Definition at line 88 of file scenery.hxx.

◆ unbind()

void FGScenery::unbind ( )
override

Definition at line 513 of file scenery.cxx.

◆ update()

void FGScenery::update ( double dt)
override

Definition at line 505 of file scenery.cxx.

Friends And Related Symbol Documentation

◆ ElevationMeshListener

friend class ElevationMeshListener
friend

Definition at line 72 of file scenery.hxx.

◆ ScenerySwitchListener

friend class ScenerySwitchListener
friend

Definition at line 53 of file scenery.hxx.

◆ TextureCacheListener

friend class TextureCacheListener
friend

Definition at line 68 of file scenery.hxx.


The documentation for this class was generated from the following files: