本文整理汇总了C++中osg::NodeUnrecPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeUnrecPtr::get方法的具体用法?C++ NodeUnrecPtr::get怎么用?C++ NodeUnrecPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::NodeUnrecPtr
的用法示例。
在下文中一共展示了NodeUnrecPtr::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doMain
int doMain (int argc, char **argv)
{
OSG::osgInit(argc,argv);
// GLUT init
glutInit(&argc, argv);
glutInitDisplayMode( GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
glutInitWindowSize(800, 800);
int winid = glutCreateWindow("OpenSG");
glutKeyboardFunc(key);
glutVisibilityFunc(vis);
glutReshapeFunc(reshape);
glutDisplayFunc(display);
glutMouseFunc(mouse);
glutMotionFunc(motion);
glutIdleFunc(display);
// OSG
OSG::SceneFileHandler::the()->print();
// create the graph
// beacon for camera and light
OSG::NodeUnrecPtr b1n = OSG::Node::create();
OSG::GroupUnrecPtr b1 = OSG::Group::create();
fprintf(stderr, "Create b1n %p %d %d \n",
b1n.get(),
b1n->getRefCount(),
b1n->getWeakRefCount());
b1n->setCore( b1 );
// transformation
OSG::NodeUnrecPtr t1n = OSG::Node::create();
OSG::TransformUnrecPtr t1 = OSG::Transform::create();
t1n->setCore (t1 );
t1n->addChild(b1n);
fprintf(stderr, "Create t1n %p %d %d \n",
t1n.get(),
t1n->getRefCount(),
t1n->getWeakRefCount());
cam_trans = t1;
// light
OSG::NodeUnrecPtr dlight = OSG::Node::create();
OSG::DirectionalLightUnrecPtr dl = OSG::DirectionalLight::create();
{
dlight->setCore(dl);
dl->setAmbient( .3f, .3f, .3f, 1 );
dl->setDiffuse( .8f, .8f, .8f, .8f );
dl->setDirection(0,0,1);
dl->setBeacon( b1n);
}
fprintf(stderr, "Create dlight %p %d %d \n",
dlight.get(),
dlight->getRefCount(),
dlight->getWeakRefCount());
hdrroot = OSG::Node::create();
hdrroot->editVolume().setInfinite();
hdrroot->editVolume().setStatic ();
hdrroot->setCore(OSG::Group::create());
// root
root = OSG::Node:: create();
OSG::GroupUnrecPtr gr1 = OSG::Group::create();
root->setCore(gr1);
hdrroot->addChild(root);
root->addChild(t1n );
root->addChild(dlight);
fprintf(stderr, "Create root %p %d %d \n",
root.get(),
root->getRefCount(),
root->getWeakRefCount());
// Load the file
OSG::NodeUnrecPtr file = NULL;
//.........这里部分代码省略.........