本文整理汇总了C++中Viewpoint::pitch方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewpoint::pitch方法的具体用法?C++ Viewpoint::pitch怎么用?C++ Viewpoint::pitch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewpoint
的用法示例。
在下文中一共展示了Viewpoint::pitch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getValue
void
KML_Feature::build( xml_node<>* node, KMLContext& cx, osg::Node* working )
{
KML_Object::build(node, cx, working);
// subclass feature is built; now add feature level data if available
if ( working )
{
// parse the visibility to show/hide the item by default:
std::string visibility = getValue(node, "visibility");
if ( !visibility.empty() )
working->setNodeMask( as<int>(visibility, 1) == 1 ? ~0 : 0 );
// parse a "LookAt" element (stores a viewpoint)
AnnotationData* anno = getOrCreateAnnotationData(working);
anno->setName( getValue(node, "name") );
anno->setDescription( getValue(node, "description") );
xml_node<>* lookat = node->first_node("lookat", 0, false);
if ( lookat )
{
Viewpoint vp;
vp.focalPoint() = GeoPoint(
cx._srs.get(),
as<double>(getValue(lookat, "longitude"), 0.0),
as<double>(getValue(lookat, "latitude"), 0.0),
as<double>(getValue(lookat, "altitude"), 0.0),
ALTMODE_ABSOLUTE );
vp.heading() = as<double>(getValue(lookat, "heading"), 0.0);
vp.pitch() = -as<double>(getValue(lookat, "tilt"), 45.0),
vp.range() = as<double>(getValue(lookat, "range"), 10000.0);
anno->setViewpoint( vp );
}
xml_node<>* extdata = node->first_node("extendeddata", 0, false);
if ( extdata )
{
xml_node<>* data = extdata->first_node("data", 0, false);
if ( data )
{
for (xml_node<>* n = data->first_node(); n; n = n->next_sibling())
{
working->setUserValue(getValue(n, "name"), getValue(n, "value"));
}
}
}
}
}
示例2: arguments
int
main(int argc, char** argv)
{
osg::ArgumentParser arguments(&argc,argv);
// help?
if ( arguments.read("--help") )
return usage(argv[0]);
osg::Node* model = 0L;
std::string filename;
if (arguments.read("--model", filename))
{
model = osgDB::readRefNodeFile(filename).release();
Registry::shaderGenerator().run(model);
}
// create a viewer:
osgViewer::Viewer viewer(arguments);
// Tell the database pager to not modify the unref settings
viewer.getDatabasePager()->setUnrefImageDataAfterApplyPolicy( false, false );
// install our default manipulator (do this before calling load)
EarthManipulator* manip = new EarthManipulator();
viewer.setCameraManipulator(manip);
// load an earth file, and support all or our example command-line options
// and earth file <external> tags
osg::Group* node = osgEarth::Util::MapNodeHelper().load(arguments, &viewer, createUI());
if ( node )
{
viewer.getCamera()->setNearFarRatio(0.00002);
viewer.getCamera()->setSmallFeatureCullingPixelSize(-1.0f);
viewer.setSceneData( node );
s_app.map = MapNode::get( node )->getMap();
s_app.addTriton();
s_app.addBuoyancyTest(model);
// Zoom the camera to our area of interest:
Viewpoint vp;
vp.heading() = 25.0f;
vp.pitch() = -25;
vp.range() = 400.0;
vp.focalPoint() = s_app.anchor;
manip->setViewpoint(vp);
while(!viewer.done())
{
viewer.frame();
s_app.updateBuoyancyTest();
}
}
else
{
return usage(argv[0]);
}
}