本文整理汇总了C++中osg::LOD::getStateSet方法的典型用法代码示例。如果您正苦于以下问题:C++ LOD::getStateSet方法的具体用法?C++ LOD::getStateSet怎么用?C++ LOD::getStateSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::LOD
的用法示例。
在下文中一共展示了LOD::getStateSet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void StatsVisitor::apply(osg::LOD& node)
{
if (node.getStateSet())
{
apply(*node.getStateSet());
}
++_numInstancedLOD;
_lodSet.insert(&node);
traverse(node);
}
示例2: apply
void CVRCullVisitor::apply(osg::LOD& node)
{
bool status = _cullingStatus;
bool firstStatus = _firstCullStatus;
if(isCulled(node))
{
_firstCullStatus = firstStatus;
_cullingStatus = status;
return;
}
// push the culling mode.
pushCurrentMask();
// push the node's state.
StateSet* node_state = node.getStateSet();
if(node_state)
pushStateSet(node_state);
handle_cull_callbacks_and_traverse(node);
// pop the node's state off the render graph stack.
if(node_state)
popStateSet();
// pop the culling mode.
popCurrentMask();
_firstCullStatus = firstStatus;
_cullingStatus = status;
}
示例3: guard
void
FltExportVisitor::apply( osg::LOD& lodNode )
{
_firstNode = false;
ScopedStatePushPop guard( this, lodNode.getStateSet() );
// LOD center - same for all children
osg::Vec3d center = lodNode.getCenter();
// Iterate children of the LOD and write a separate LOD record for each,
// with that child's individual switchIn and switchOut properties
for ( size_t i = 0; i < lodNode.getNumChildren(); ++i )
{
osg::Node* lodChild = lodNode.getChild(i);
// Switch-in/switch-out distances may vary per child
double switchInDist = lodNode.getMaxRange(i);
double switchOutDist = lodNode.getMinRange(i);
writeLevelOfDetail( lodNode, center, switchInDist, switchOutDist);
writeMatrix( lodNode.getUserData() );
writeComment( lodNode );
// Traverse each child of the LOD
writePushTraverseWritePop( *lodChild );
}
}
示例4: pushStateSet
void
CountsVisitor::apply(osg::LOD& node)
{
pushStateSet(node.getStateSet());
_lods++;
osg::ref_ptr<osg::Object> rp = (osg::Object*)&node;
_uLods.insert(rp);
_totalChildren += node.getNumChildren();
apply(node.getStateSet());
if (++_depth > _maxDepth)
_maxDepth = _depth;
traverse((osg::Node&)node);
_depth--;
popStateSet();
}