本文整理汇总了C++中Projection::getStateSet方法的典型用法代码示例。如果您正苦于以下问题:C++ Projection::getStateSet方法的具体用法?C++ Projection::getStateSet怎么用?C++ Projection::getStateSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Projection
的用法示例。
在下文中一共展示了Projection::getStateSet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void ScreenMVCullVisitor::apply(Projection& node)
{
// push the culling mode.
pushCurrentMask();
// push the node's state.
StateSet* node_state = node.getStateSet();
if(node_state)
pushStateSet(node_state);
// record previous near and far values.
float previous_znear = _computed_znear;
float previous_zfar = _computed_zfar;
// take a copy of the current near plane candidates
DistanceMatrixDrawableMap previousNearPlaneCandidateMap;
previousNearPlaneCandidateMap.swap(_nearPlaneCandidateMap);
_computed_znear = FLT_MAX;
_computed_zfar = -FLT_MAX;
ref_ptr < RefMatrix > matrix = createOrReuseMatrix(node.getMatrix());
pushProjectionMatrix(matrix.get());
//OSG_NOTIFY(osg::INFO)<<"Push projection "<<*matrix<<std::endl;
// note do culling check after the frustum has been updated to ensure
// that the node is not culled prematurely.
bool status = _cullingStatus;
bool firstStatus = _firstCullStatus;
if(!isCulled(node))
{
handle_cull_callbacks_and_traverse(node);
}
_firstCullStatus = firstStatus;
_cullingStatus = status;
popProjectionMatrix();
//OSG_NOTIFY(osg::INFO)<<"Pop projection "<<*matrix<<std::endl;
_computed_znear = previous_znear;
_computed_zfar = previous_zfar;
// swap back the near plane candidates
previousNearPlaneCandidateMap.swap(_nearPlaneCandidateMap);
// pop the node's state off the render graph stack.
if(node_state)
popStateSet();
// pop the culling mode.
popCurrentMask();
}