Added new osg::ApplicationUsage and osg::ArgumentParser to help streamline
application/example developement.
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
|
||||
#include <osgUtil/UpdateVisitor>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
|
||||
#include <osgGA/AnimationPathManipulator>
|
||||
#include <osgGA/TrackballManipulator>
|
||||
#include <osgGA/FlightManipulator>
|
||||
#include <osgGA/DriveManipulator>
|
||||
@@ -13,6 +16,7 @@
|
||||
|
||||
using namespace osgProducer;
|
||||
|
||||
|
||||
Viewer::Viewer():
|
||||
_done(0),
|
||||
_frameNumber(0),
|
||||
@@ -36,6 +40,27 @@ Viewer::Viewer(const std::string& configFile):
|
||||
{
|
||||
}
|
||||
|
||||
Viewer::Viewer(osg::ArgumentParser& arguments):
|
||||
CameraGroup(arguments),
|
||||
_done(false),
|
||||
_frameNumber(0),
|
||||
_kbmcb(0)
|
||||
{
|
||||
osg::DisplaySettings::instance()->readCommandLine(arguments);
|
||||
|
||||
std::string pathfile;
|
||||
while (arguments.read("-p",pathfile))
|
||||
{
|
||||
osg::ref_ptr<osgGA::AnimationPathManipulator> apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||
if( apm.valid() && apm->valid() )
|
||||
{
|
||||
unsigned int num = addCameraManipulator(apm.get());
|
||||
selectCameraManipulator(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Viewer::setUpViewer(unsigned int options)
|
||||
{
|
||||
|
||||
@@ -108,7 +133,7 @@ void Viewer::setUpViewer(unsigned int options)
|
||||
if (options&STATS_MANIPULATOR)
|
||||
{
|
||||
// register the drawing of stats to pipe 0.
|
||||
Producer::FrameStatsHandler* fsh = new Producer::FrameStatsHandler;
|
||||
FrameStatsHandler* fsh = new FrameStatsHandler;
|
||||
setStatsHandler(fsh);
|
||||
getCamera(0)->addPostDrawCallback(fsh);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user