当前位置: 首页>>代码示例>>C++>>正文


C++ Group::addChild方法代码示例

本文整理汇总了C++中osg::Group::addChild方法的典型用法代码示例。如果您正苦于以下问题:C++ Group::addChild方法的具体用法?C++ Group::addChild怎么用?C++ Group::addChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osg::Group的用法示例。


在下文中一共展示了Group::addChild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

/** Attacca al/ai nodi che corrispondono a nodeName */
void LoadThreadsHandler::AttachNodeToSceneByName::apply(osg::Group& grp)
{
	if (grp.getName() == _nodeName)
	{
		if(!_attached || _multipleattach)
		{
			if(_ranged)
			{
				osg::ref_ptr<osg::LOD> newlod = new osg::LOD;
				newlod->setName("RangedLOD_" + _attachNode->getName());

				newlod->addChild(_attachNode.get(), _min, _max);

				grp.addChild(newlod.get());
			}
			else
			{
				grp.addChild(_attachNode.get());
			}
			
			_attached = true;
		}
	}

	traverse(grp);
}
开发者ID:flyskyosg,项目名称:virtualrome,代码行数:27,代码来源:LoadThreadsHandler.cpp

示例2: while

void
RemoveEmptyGroupsVisitor::apply( osg::Group& group )
{
    bool removed = true;
    while( removed )
    {
        removed = false;
        for( unsigned i = 0; i < group.getNumChildren(); ++i )
        {
            osg::Group* child = group.getChild(i)->asGroup();
            if ( child )
            {
                if (child->className() == std::string("Group") &&
                    child->getStateSet() == 0L            &&
                    child->getCullCallback() == 0L        &&
                    child->getUpdateCallback() == 0L      &&
                    child->getUserData() == 0L            &&
                    child->getName().empty()              &&
                    child->getDescriptions().size() == 0 )
                {
                    for( unsigned j = 0; j < child->getNumChildren(); ++j )
                    {
                        group.addChild( child->getChild( j ) );
                    }

                    group.removeChild( i-- );
                    removed = true;
                }                
            }
        }
    }

    traverse(group);
}
开发者ID:airwzz999,项目名称:osgearth-for-android,代码行数:34,代码来源:NodeUtils.cpp

示例3: readChildren

static bool readChildren( osgDB::InputStream& is, osg::Group& node )
{
    unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
    for ( unsigned int i=0; i<size; ++i )
    {
        osg::Node* child = dynamic_cast<osg::Node*>( is.readObject() );
        if ( child ) node.addChild( child );
    }
    is >> osgDB::END_BRACKET;
    return true;
}
开发者ID:aalex,项目名称:osg,代码行数:11,代码来源:Group.cpp

示例4: nave

	torreta(int x, int y, int z,int tamaño)
	{
	Torreta = new osg::Group();
		material = new osg::Material;
		stateset =new osg::StateSet;
	//Configurar_Material();
	boton=y;
	left=x;
	//top=(8*tamaño)+z;
	//right=(11*tamaño);
	int	tamaño_cubo_grade=tamaño*5;
	nave* cubomio=new nave (x,y,z,tamaño_cubo_grade);
	int puntopunta=tamaño_cubo_grade;
	puntopunta=puntopunta/2;
	puntopunta=puntopunta-(tamaño/2);
	nave* cubomio2=new nave(x+puntopunta,y,tamaño_cubo_grade+z,tamaño);
	Torreta->addChild(cubomio->getNave());
	Torreta->addChild(cubomio2->getNave());
	top=tamaño_cubo_grade+tamaño+y;
	right=tamaño_cubo_grade+x;
	yDisparo=top;
	xDisparo=x+puntopunta;
		 stateset->setAttributeAndModes(material,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF);
	};
开发者ID:gayoxo,项目名称:ProyectoIGr,代码行数:24,代码来源:Torreta.cpp


注:本文中的osg::Group::addChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。