Public Member Functions | |
HeightAboveTerrain () | |
void | clear () |
Clear the internal HAT List so it contains no height above terrain tests. | |
unsigned int | addPoint (const osg::Vec3d &point) |
Add a height above terrain test point in the CoordinateFrame. | |
unsigned int | getNumPoints () const |
Get the number of height above terrain tests. | |
void | setPoint (unsigned int i, const osg::Vec3d &point) |
Set the source point of single height above terrain test. | |
const osg::Vec3d & | getPoint (unsigned int i) const |
Get the source point of single height above terrain test. | |
double | getHeightAboveTerrain (unsigned int i) const |
Get the intersection height for a single height above terrain test. | |
void | setLowestHeight (double lowestHeight) |
Set the lowest height that the should be tested for. | |
double | getLowestHeight () const |
Get the lowest height that the should be tested for. | |
void | computeIntersections (osg::Node *scene, osg::Node::NodeMask traversalMask=0xffffffff) |
Compute the HAT intersections with the specified scene graph. | |
void | clearDatabaseCache () |
Clear the database cache. | |
void | setDatabaseCacheReadCallback (DatabaseCacheReadCallback *dcrc) |
Set the ReadCallback that does the reading of external PagedLOD models, and caching of loaded subgraphs. | |
DatabaseCacheReadCallback * | getDatabaseCacheReadCallback () |
Get the ReadCallback that does the reading of external PagedLOD models, and caching of loaded subgraphs. | |
Static Public Member Functions | |
static double | computeHeightAboveTerrain (osg::Node *scene, const osg::Vec3d &point, osg::Node::NodeMask traversalMask=0xffffffff) |
Compute the vertical distance between the specified scene graph and a single HAT point. | |
Protected Types | |
typedef std::vector < HAT > | HATList |
Protected Attributes | |
double | _lowestHeight |
HATList | _HATList |
osg::ref_ptr < DatabaseCacheReadCallback > | _dcrc |
osgUtil::IntersectionVisitor | _intersectionVisitor |
Classes | |
struct | HAT |
typedef std::vector<HAT> osgSim::HeightAboveTerrain::HATList [protected] |
osgSim::HeightAboveTerrain::HeightAboveTerrain | ( | ) |
void osgSim::HeightAboveTerrain::clear | ( | ) |
Clear the internal HAT List so it contains no height above terrain tests.
unsigned int osgSim::HeightAboveTerrain::addPoint | ( | const osg::Vec3d & | point | ) |
Add a height above terrain test point in the CoordinateFrame.
unsigned int osgSim::HeightAboveTerrain::getNumPoints | ( | ) | const [inline] |
Get the number of height above terrain tests.
void osgSim::HeightAboveTerrain::setPoint | ( | unsigned int | i, | |
const osg::Vec3d & | point | |||
) | [inline] |
Set the source point of single height above terrain test.
const osg::Vec3d& osgSim::HeightAboveTerrain::getPoint | ( | unsigned int | i | ) | const [inline] |
Get the source point of single height above terrain test.
double osgSim::HeightAboveTerrain::getHeightAboveTerrain | ( | unsigned int | i | ) | const [inline] |
Get the intersection height for a single height above terrain test.
Note, you must call computeIntersections(..) before you can querry the HeightAboveTerrain. If no intersections are found then height returned will be the height above mean sea level.
void osgSim::HeightAboveTerrain::setLowestHeight | ( | double | lowestHeight | ) | [inline] |
Set the lowest height that the should be tested for.
Defaults to -1000, i.e. 1000m below mean sea level.
double osgSim::HeightAboveTerrain::getLowestHeight | ( | ) | const [inline] |
Get the lowest height that the should be tested for.
void osgSim::HeightAboveTerrain::computeIntersections | ( | osg::Node * | scene, | |
osg::Node::NodeMask | traversalMask = 0xffffffff | |||
) |
Compute the HAT intersections with the specified scene graph.
The results are all stored in the form of a single height above terrain value per HAT test. Note, if the topmost node is a CoordinateSystemNode then the input points are assumed to be geocentric, with the up vector defined by the EllipsoidModel attached to the CoordinateSystemNode. If the topmost node is not a CoordinateSystemNode then a local coordinates frame is assumed, with a local up vector.
static double osgSim::HeightAboveTerrain::computeHeightAboveTerrain | ( | osg::Node * | scene, | |
const osg::Vec3d & | point, | |||
osg::Node::NodeMask | traversalMask = 0xffffffff | |||
) | [static] |
Compute the vertical distance between the specified scene graph and a single HAT point.
void osgSim::HeightAboveTerrain::clearDatabaseCache | ( | ) | [inline] |
Clear the database cache.
void osgSim::HeightAboveTerrain::setDatabaseCacheReadCallback | ( | DatabaseCacheReadCallback * | dcrc | ) |
Set the ReadCallback that does the reading of external PagedLOD models, and caching of loaded subgraphs.
Note, if you have mulitple LineOfSight or HeightAboveTerrain objects in use at one time then you should share a single DatabaseCacheReadCallback between all of them.
DatabaseCacheReadCallback* osgSim::HeightAboveTerrain::getDatabaseCacheReadCallback | ( | ) | [inline] |
Get the ReadCallback that does the reading of external PagedLOD models, and caching of loaded subgraphs.
double osgSim::HeightAboveTerrain::_lowestHeight [protected] |
HATList osgSim::HeightAboveTerrain::_HATList [protected] |