|
Revision 12292, 2.2 kB
(checked in by robert, 2 years ago)
|
|
Ran svn propset -R svn:eol-style native . on the OpenSceneGraph
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | #include <osgDB/ReadFile> |
|---|
| 21 | |
|---|
| 22 | #include <osg/ArgumentParser> |
|---|
| 23 | #include <osg/ApplicationUsage> |
|---|
| 24 | #include <osg/Timer> |
|---|
| 25 | #include <osg/CoordinateSystemNode> |
|---|
| 26 | #include <osg/Notify> |
|---|
| 27 | #include <osg/io_utils> |
|---|
| 28 | #include <osg/Geometry> |
|---|
| 29 | #include <osg/TriangleIndexFunctor> |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | #include <osgUtil/IntersectionVisitor> |
|---|
| 33 | #include <osgUtil/LineSegmentIntersector> |
|---|
| 34 | #include <osgUtil/UpdateVisitor> |
|---|
| 35 | |
|---|
| 36 | #include <osgSim/LineOfSight> |
|---|
| 37 | #include <osgSim/HeightAboveTerrain> |
|---|
| 38 | #include <osgSim/ElevationSlice> |
|---|
| 39 | |
|---|
| 40 | #include <osgViewer/Viewer> |
|---|
| 41 | |
|---|
| 42 | #include <osg/KdTree> |
|---|
| 43 | |
|---|
| 44 | #include <iostream> |
|---|
| 45 | |
|---|
| 46 | int main(int argc, char **argv) |
|---|
| 47 | { |
|---|
| 48 | |
|---|
| 49 | osg::ArgumentParser arguments(&argc,argv); |
|---|
| 50 | |
|---|
| 51 | int maxNumLevels = 16; |
|---|
| 52 | int targetNumIndicesPerLeaf = 16; |
|---|
| 53 | |
|---|
| 54 | while (arguments.read("--max", maxNumLevels)) {} |
|---|
| 55 | while (arguments.read("--leaf", targetNumIndicesPerLeaf)) {} |
|---|
| 56 | |
|---|
| 57 | osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::ReaderWriter::Options::BUILD_KDTREES); |
|---|
| 58 | |
|---|
| 59 | osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); |
|---|
| 60 | |
|---|
| 61 | if (!scene) |
|---|
| 62 | { |
|---|
| 63 | std::cout<<"No model loaded, please specify a valid model on the command line."<<std::endl; |
|---|
| 64 | return 0; |
|---|
| 65 | } |
|---|
| 66 | |
|---|
| 67 | osgViewer::Viewer viewer; |
|---|
| 68 | viewer.setSceneData(scene.get()); |
|---|
| 69 | return viewer.run(); |
|---|
| 70 | } |
|---|