OSG
3.4.0
|
#include <LineOfSight.h>
Classes | |
struct | LOS |
Public Types | |
typedef std::vector< osg::Vec3d > | Intersections |
Public Member Functions | |
LineOfSight () | |
void | clear () |
unsigned int | addLOS (const osg::Vec3d &start, const osg::Vec3d &end) |
unsigned int | getNumLOS () const |
void | setStartPoint (unsigned int i, const osg::Vec3d &start) |
const osg::Vec3d & | getStartPoint (unsigned int i) const |
void | setEndPoint (unsigned int i, const osg::Vec3d &end) |
const osg::Vec3d & | getEndPoint (unsigned int i) const |
const Intersections & | getIntersections (unsigned int i) const |
void | computeIntersections (osg::Node *scene, osg::Node::NodeMask traversalMask=0xffffffff) |
void | clearDatabaseCache () |
void | setDatabaseCacheReadCallback (DatabaseCacheReadCallback *dcrc) |
DatabaseCacheReadCallback * | getDatabaseCacheReadCallback () |
Static Public Member Functions | |
static Intersections | computeIntersections (osg::Node *scene, const osg::Vec3d &start, const osg::Vec3d &end, osg::Node::NodeMask traversalMask=0xffffffff) |
Protected Types | |
typedef std::vector< LOS > | LOSList |
Protected Attributes | |
LOSList | _LOSList |
osg::ref_ptr < DatabaseCacheReadCallback > | _dcrc |
osgUtil::IntersectionVisitor | _intersectionVisitor |
Helper class for setting up and acquiring line of sight intersections with terrain. By default assigns a osgSim::DatabaseCacheReadCallback that enables automatic loading of external PagedLOD tiles to ensure that the highest level of detail is used in intersections. This automatic loading of tiles is done by the intersection traversal that is done within the computeIntersections(..) method, so can result in long intersection times when external tiles have to be loaded. The external loading of tiles can be disabled by removing the read callback, this is done by calling the setDatabaseCacheReadCallback(DatabaseCacheReadCallback*) method with a value of 0.
Definition at line 54 of file LineOfSight.h.
typedef std::vector<osg::Vec3d> osgSim::LineOfSight::Intersections |
Definition at line 81 of file LineOfSight.h.
|
protected |
Definition at line 119 of file LineOfSight.h.
osgSim::LineOfSight::LineOfSight | ( | ) |
unsigned int osgSim::LineOfSight::addLOS | ( | const osg::Vec3d & | start, |
const osg::Vec3d & | end | ||
) |
Add a line of sight test, consisting of start and end point. Returns the index number of the newly adding LOS test.
void osgSim::LineOfSight::clear | ( | ) |
Clear the internal LOS List so it contains no line of sight tests.
|
inline |
Clear the database cache.
Definition at line 95 of file LineOfSight.h.
void osgSim::LineOfSight::computeIntersections | ( | osg::Node * | scene, |
osg::Node::NodeMask | traversalMask = 0xffffffff |
||
) |
|
static |
Compute the intersection between the specified scene graph and a single LOS start,end pair. Returns an IntersectionList, of all the points intersected.
|
inline |
Get the ReadCallback that does the reading of external PagedLOD models, and caching of loaded subgraphs.
Definition at line 103 of file LineOfSight.h.
|
inline |
Get the end point of single line of sight test.
Definition at line 79 of file LineOfSight.h.
|
inline |
Get the intersection points for a single line of sight test.
Definition at line 84 of file LineOfSight.h.
|
inline |
Get the number of line of sight tests.
Definition at line 67 of file LineOfSight.h.
|
inline |
Get the start point of single line of sight test.
Definition at line 73 of file LineOfSight.h.
void osgSim::LineOfSight::setDatabaseCacheReadCallback | ( | DatabaseCacheReadCallback * | dcrc | ) |
Set the ReadCallback that does the reading of external PagedLOD models, and caching of loaded subgraphs. Note, if you have multiple LineOfSight or HeightAboveTerrain objects in use at one time then you should share a single DatabaseCacheReadCallback between all of them.
|
inline |
Set the end point of single line of sight test.
Definition at line 76 of file LineOfSight.h.
|
inline |
Set the start point of single line of sight test.
Definition at line 70 of file LineOfSight.h.
|
protected |
Definition at line 122 of file LineOfSight.h.
|
protected |
Definition at line 123 of file LineOfSight.h.
|
protected |
Definition at line 120 of file LineOfSight.h.