FlightGear next
FGStgTerrain Class Reference

#include <terrain_stg.hxx>

Inherits FGTerrain.

Public Member Functions

 FGStgTerrain ()
 
virtual ~FGStgTerrain ()
 
void init (osg::Group *terrain)
 
void reinit ()
 
void shutdown ()
 
void bind ()
 
void unbind ()
 
void update (double dt)
 
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.
 
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.
 
bool schedule_scenery (const SGGeod &position, double range_m, double duration=0.0)
 
void materialLibChanged ()
 
- Public Member Functions inherited from FGTerrain
 FGTerrain ()=default
 
virtual ~FGTerrain ()=default
 

Static Public Member Functions

static const char * staticSubsystemClassId ()
 

Detailed Description

Definition at line 49 of file terrain_stg.hxx.

Constructor & Destructor Documentation

◆ FGStgTerrain()

FGStgTerrain::FGStgTerrain ( )

Definition at line 236 of file terrain_stg.cxx.

◆ ~FGStgTerrain()

FGStgTerrain::~FGStgTerrain ( )
virtual

Definition at line 242 of file terrain_stg.cxx.

Member Function Documentation

◆ bind()

void FGStgTerrain::bind ( )
virtual

Implements FGTerrain.

Definition at line 291 of file terrain_stg.cxx.

◆ get_cart_elevation_m()

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

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.

Implements FGTerrain.

Definition at line 302 of file terrain_stg.cxx.

◆ get_cart_ground_intersection()

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

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.

Implements FGTerrain.

Definition at line 351 of file terrain_stg.cxx.

◆ get_elevation_m()

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

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.

Implements FGTerrain.

Definition at line 321 of file terrain_stg.cxx.

◆ init()

void FGStgTerrain::init ( osg::Group * terrain)
virtual

Implements FGTerrain.

Definition at line 249 of file terrain_stg.cxx.

◆ materialLibChanged()

void FGStgTerrain::materialLibChanged ( )
virtual

Implements FGTerrain.

Definition at line 421 of file terrain_stg.cxx.

◆ reinit()

void FGStgTerrain::reinit ( )
virtual

Implements FGTerrain.

Definition at line 266 of file terrain_stg.cxx.

◆ scenery_available()

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

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.

Implements FGTerrain.

Definition at line 375 of file terrain_stg.cxx.

◆ schedule_scenery()

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

Implements FGTerrain.

Definition at line 414 of file terrain_stg.cxx.

◆ shutdown()

void FGStgTerrain::shutdown ( )
virtual

Implements FGTerrain.

Definition at line 273 of file terrain_stg.cxx.

◆ staticSubsystemClassId()

static const char * FGStgTerrain::staticSubsystemClassId ( )
inlinestatic

Definition at line 112 of file terrain_stg.hxx.

◆ unbind()

void FGStgTerrain::unbind ( )
virtual

Implements FGTerrain.

Definition at line 296 of file terrain_stg.cxx.

◆ update()

void FGStgTerrain::update ( double dt)
virtual

Implements FGTerrain.

Definition at line 286 of file terrain_stg.cxx.


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