Changeset 305 for osgVisual/trunk/src/util
- Timestamp:
- Jul 19, 2011, 9:47:13 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/src/util/terrainQuery.cpp
r302 r305 21 21 #include <osgUtil/LineSegmentIntersector> 22 22 23 using namespace osgVisual; 23 24 using namespace osgSim; 24 25 25 HeightAboveTerrain::HeightAboveTerrain(bool loadHighestLOD)26 terrainQuery::terrainQuery() 26 27 { 27 28 _lowestHeight = -1000.0; 28 29 29 if(loadHighestLOD) 30 setDatabaseCacheReadCallback(new DatabaseCacheReadCallback); 30 setDatabaseCacheReadCallback(new DatabaseCacheReadCallback); 31 31 } 32 32 33 void HeightAboveTerrain::clear()33 void terrainQuery::clear() 34 34 { 35 35 _HATList.clear(); 36 36 } 37 37 38 unsigned int HeightAboveTerrain::addPoint(const osg::Vec3d& point)38 unsigned int terrainQuery::addPoint(const osg::Vec3d& point) 39 39 { 40 40 unsigned int index = _HATList.size(); … … 43 43 } 44 44 45 void HeightAboveTerrain::computeIntersections(osg::Node* scene, osg::Node::NodeMask traversalMask)45 void terrainQuery::computeIntersections(osg::Node* scene, osg::Node::NodeMask traversalMask) 46 46 { 47 47 osg::CoordinateSystemNode* csn = dynamic_cast<osg::CoordinateSystemNode*>(scene); … … 128 128 } 129 129 130 double HeightAboveTerrain::computeHeightAboveTerrain(osg::Node* scene, const osg::Vec3d& point, bool loadHighestLOD, osg::Node::NodeMask traversalMask)130 double terrainQuery::computeHeightAboveTerrain(osg::Node* scene, const osg::Vec3d& point, DataSource pagingBehaviour, osg::Node::NodeMask traversalMask) 131 131 { 132 HeightAboveTerrain hat(loadHighestLOD); 133 unsigned int index = hat.addPoint(point); 134 hat.computeIntersections(scene, traversalMask); 135 return hat.getHeightAboveTerrain(index); 132 terrainQuery qt; 133 /*if(!loadHighestLOD) 134 qt.setDatabaseCacheReadCallback(0);*/ 135 unsigned int index = qt.addPoint(point); 136 qt.computeIntersections(scene, traversalMask); 137 return qt.getHeightAboveTerrain(index); 136 138 } 137 139 138 double HeightAboveTerrain::computeHeightOfTerrain(osg::Node* scene, const osg::Vec3d& point, bool loadHighestLOD, osg::Node::NodeMask traversalMask)140 double terrainQuery::computeHeightOfTerrain(osg::Node* scene, const osg::Vec3d& point, DataSource pagingBehaviour, osg::Node::NodeMask traversalMask) 139 141 { 140 HeightAboveTerrain hat(loadHighestLOD);141 unsigned int index = hat.addPoint(point);142 hat.computeIntersections(scene, traversalMask);143 return hat.getHeightOfTerrain(index);142 terrainQuery qt; 143 unsigned int index = qt.addPoint(point); 144 qt.computeIntersections(scene, traversalMask); 145 return qt.getHeightOfTerrain(index); 144 146 } 145 147 146 void HeightAboveTerrain::setDatabaseCacheReadCallback(DatabaseCacheReadCallback* dcrc)148 void terrainQuery::setDatabaseCacheReadCallback(DatabaseCacheReadCallback* dcrc) 147 149 { 148 150 _dcrc = dcrc;
Note: See TracChangeset
for help on using the changeset viewer.