Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- osg::Vec3d getHOT(const osg::Vec3d& position, osgViewer::CompositeViewer& viewer, osg::Vec3& normal)
- {
- osg::Vec3d result;
- osg::Vec3d s = position + osg::Vec3d(0, 0, 1000);
- osg::Vec3d e = position - osg::Vec3d(0, 0, 1000);
- if (viewer.getView(0)->getSceneData())
- {
- const osgSim::LineOfSight::Intersections& intersections = osgSim::LineOfSight::computeIntersections(viewer.getView(0)->getSceneData(), s, e);
- osgSim::LineOfSight::Intersections::const_iterator itr = intersections.begin();
- for (; itr != intersections.end(); ++itr)
- {
- result = *itr;
- std::cout << "Intersection: " << result << std::endl;
- }
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment