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


C++ Projection::getStateSet方法代码示例

本文整理汇总了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();
}
开发者ID:johnmangan,项目名称:calvr,代码行数:58,代码来源:ScreenMVCullVisitor.cpp


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