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


C++ osg::Transform类代码示例

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


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

示例1: pushStateSet

void
CountsVisitor::apply(osg::Transform& node)
{
    pushStateSet(node.getStateSet());

    if (dynamic_cast<osgSim::DOFTransform*>(&node) != NULL)
    {
        _dofTransforms++;
        osg::ref_ptr<osg::Object> rp = (osg::Object*)&node;
        _uDofTransforms.insert(rp);
    }
    else
    {
        _transforms++;
        osg::ref_ptr<osg::Object> rp = (osg::Object*)&node;
        _uTransforms.insert(rp);
    }
    _totalChildren += node.getNumChildren();
    apply(node.getStateSet());

    if (++_depth > _maxDepth)
        _maxDepth = _depth;
    traverse((osg::Node&)node);
    _depth--;

    popStateSet();
}
开发者ID:lemonrong,项目名称:osg3DViewer,代码行数:27,代码来源:CountsVisitor.cpp

示例2: apply

void StatsVisitor::apply(osg::Transform& node)
{
    if (node.getStateSet())
    {
        apply(*node.getStateSet());
    }

    ++_numInstancedTransform;
    _transformSet.insert(&node);

    traverse(node);
}
开发者ID:AndreyIstomin,项目名称:osg,代码行数:12,代码来源:Statistics.cpp

示例3: dontEnterTrans

OSG::Action::ResultE dontEnterTrans(OSG::Node *node)
{   
    SLOG << "entering " << node << OSG::endLog;

    if(node->getCore()->getType().isDerivedFrom(OSG::Transform::getClassType()))
    {
        OSG::Transform *t = dynamic_cast<OSG::Transform *>(node->getCore());
        
        SLOG << "derived from transform, skipping children" << OSG::endLog;
        SLOG << "Matrix: " << OSG::endLog << t->getMatrix();
        return OSG::Action::Skip;
    }   
    return OSG::Action::Continue; 
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:14,代码来源:09traverse.cpp

示例4: apply

void ComputeBoundingBoxVisitor::apply(osg::Transform& node)
{
    if(node.asMatrixTransform() || node.asPositionAttitudeTransform())
    {
        osg::Matrix prevMatrix = m_curMatrix;

        //m_curMatrix.preMult(node.asMatrixTransform()->getMatrix());
	node.computeLocalToWorldMatrix(m_curMatrix,this);

        traverse(node);

        m_curMatrix = prevMatrix;
    }
}
开发者ID:TheNumenorean,项目名称:calvr,代码行数:14,代码来源:ComputeBoundingBoxVisitor.cpp

示例5: apply

void CURRENT_CLASS::apply(osg::Transform &transform)
{
    if(shouldContinueTraversal(transform))
    {
        // Compute transform for current node
        osg::Matrix currMatrix = _viewMatrices.back();
        bool pushMatrix = transform.computeLocalToWorldMatrix(currMatrix,this);

        if(pushMatrix)
        {
            // Store the new modelview matrix and view frustum
            _viewMatrices.push_back(currMatrix);
            pushLocalFrustum();
        }

        ++_currentDepth;
        traverse(transform);
        --_currentDepth;

        if(pushMatrix)
        {
            // Restore the old modelview matrix and view frustum
            _localFrusta.pop_back();
            _bbCorners.pop_back();
            _viewMatrices.pop_back();
        }
    }
}
开发者ID:dacevedofeliz,项目名称:calvr,代码行数:28,代码来源:DistanceAccumulator.cpp

示例6: guard

void
FltExportVisitor::apply( osg::Transform& node )
{
    _firstNode = false;
    ScopedStatePushPop guard( this, node.getStateSet() );

    osgSim::DOFTransform* dof = dynamic_cast<osgSim::DOFTransform*>( &node );

    if (dof)
    {
        writeDegreeOfFreedom( dof);
    }

    writeMatrix( node.getUserData() );
    writeComment( node );
    writePushTraverseWritePop( node );
}
开发者ID:joevandyk,项目名称:osg,代码行数:17,代码来源:FltExportVisitor.cpp

示例7: apply

void ComputeTrianglesVisitor::apply( osg::Transform& node )
{
    osg::Matrix matrix = _matrixStack.back();
    node.computeLocalToWorldMatrix( matrix, this );
    
    _matrixStack.push_back( matrix );
    traverse( node );
    _matrixStack.pop_back();
}
开发者ID:mp3butcher,项目名称:osgPhysics,代码行数:9,代码来源:ComputeTrianglesVisitor.cpp

示例8: traverse

void
BuildTopologyVisitor::apply(osg::Transform& xform)
{
    osg::Matrix matrix;
    if (!_matrixStack.empty()) matrix = _matrixStack.back();
    xform.computeLocalToWorldMatrix(matrix, this);
    _matrixStack.push_back(matrix);
    traverse(xform);
    _matrixStack.pop_back();
}
开发者ID:JD31,项目名称:osgearth,代码行数:10,代码来源:TopologyGraph.cpp

示例9: apply

    void apply(osg::Transform &node)
    {
        osg::MatrixTransform* bone = node.asMatrixTransform();
        if (!bone)
            return;

        mCache[Misc::StringUtils::lowerCase(bone->getName())] = std::make_pair(getNodePath(), bone);

        traverse(node);
    }
开发者ID:Thoronador,项目名称:openmw,代码行数:10,代码来源:skeleton.cpp

示例10: apply

void GeometryDataCollector::apply( osg::Transform& transform )
{
    osg::Matrix matrix;
    if ( !matrixStack.empty() ) matrix = matrixStack.back();
    transform.computeLocalToWorldMatrix( matrix, this );

    pushMatrix( matrix );
    traverse( transform );
    popMatrix();
}
开发者ID:caomw,项目名称:osgPhysX,代码行数:10,代码来源:PhysicsUtil.cpp

示例11: apply

    void apply(osg::Transform &node)
    {
        osg::MatrixTransform* bone = node.asMatrixTransform();
        if (!bone)
            return;

        mCache[bone->getName()] = std::make_pair(getNodePath(), bone);

        traverse(node);
    }
开发者ID:Kafou1,项目名称:openmw,代码行数:10,代码来源:skeleton.cpp

示例12: apply

void CollectOccludersVisitor::apply(osg::Transform &node)
{
    if (isCulled(node))
        return;

    // push the culling mode.
    pushCurrentMask();

    ref_ptr<osg::RefMatrix> matrix = createOrReuseMatrix(*getModelViewMatrix());
    node.computeLocalToWorldMatrix(*matrix, this);
    pushModelViewMatrix(matrix.get(), node.getReferenceFrame());

    handle_cull_callbacks_and_traverse(node);

    popModelViewMatrix();

    // pop the culling mode.
    popCurrentMask();
}
开发者ID:hyyh619,项目名称:OpenSceneGraph-3.4.0,代码行数:19,代码来源:CollectOccludersVisitor.cpp

示例13: createOrReuseMatrix

void 
ProxyCullVisitor::apply(osg::Transform& node)
{
    //OE_INFO << "Transform!" << std::endl;

    if ( isCulledByProxyFrustum(node) )
        return;

    _cv->pushOntoNodePath( &node);

    _cv->pushCurrentMask();
    osg::StateSet* node_state = node.getStateSet();
    if (node_state) _cv->pushStateSet(node_state);

    // push the current proxy data:
    osg::Polytope savedF  = _proxyFrustum;
    osg::Matrix   savedMV = _proxyModelViewMatrix;

    // calculate the new proxy frustum:
    node.computeLocalToWorldMatrix(_proxyModelViewMatrix, this);
    _proxyFrustum.setAndTransformProvidingInverse( _proxyProjFrustum, _proxyModelViewMatrix );

    osg::ref_ptr<osg::RefMatrix> matrix = createOrReuseMatrix(*_cv->getModelViewMatrix());
    node.computeLocalToWorldMatrix(*matrix,this);
    _cv->pushModelViewMatrix(matrix.get(), node.getReferenceFrame());

    // traverse children:
    handle_cull_callbacks_and_traverse(node);

    // restore the previous proxy frustum and MVM
    _proxyFrustum         = savedF;
    _proxyModelViewMatrix = savedMV;

    _cv->popModelViewMatrix();
    if (node_state) _cv->popStateSet();
    _cv->popCurrentMask();

    _cv->popFromNodePath();
}
开发者ID:myemail2235,项目名称:osgearth,代码行数:39,代码来源:CullingUtils.cpp

示例14: apply

    void apply(osg::Transform& transform)
    {
        osg::Matrix matrix;
        if (!_matrixStack.empty()) matrix = _matrixStack.back();

        transform.computeLocalToWorldMatrix(matrix,this);

        pushMatrix(matrix);

        traverse(transform);

        popMatrix();
    }
开发者ID:philipdumont,项目名称:osgearth,代码行数:13,代码来源:osgearth_createtile.cpp

示例15: apply

void CVRCullVisitor::apply(osg::Transform& 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);

    ref_ptr<RefMatrix> matrix = createOrReuseMatrix(*getModelViewMatrix());
    node.computeLocalToWorldMatrix(*matrix,this);
    pushModelViewMatrix(matrix.get(),node.getReferenceFrame());

    handle_cull_callbacks_and_traverse(node);

    popModelViewMatrix();

    // pop the node's state off the render graph stack.    
    if(node_state)
        popStateSet();

    // pop the culling mode.
    popCurrentMask();

    _firstCullStatus = firstStatus;
    _cullingStatus = status;
}
开发者ID:megasha,项目名称:calvr,代码行数:38,代码来源:CVRCullVisitor.cpp


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