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


C++ Rectangle::Clipped方法代码示例

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


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

示例1: transformAndRender

void Entity::transformAndRender() {
    if(!renderer || !enabled)
        return;

    if(matrixDirty) {
        rebuildTransformMatrix();
    }

    if(depthOnly) {
        renderer->drawToColorBuffer(false);
    }

    bool isScissorEnabled;
    Polycode::Rectangle oldScissorBox;

    if(enableScissor) {
        isScissorEnabled = renderer->isScissorEnabled();
        oldScissorBox = renderer->getScissorBox();
        renderer->enableScissor(true);

        Rectangle finalScissorBox = scissorBox;

        // make sure that our scissor box is constrained to the parent one if it exists
        if(isScissorEnabled) {
            finalScissorBox = finalScissorBox.Clipped(renderer->getScissorBox());
        }

        renderer->setScissorBox(finalScissorBox);
    }

    renderer->pushMatrix();
    if(ignoreParentMatrix && parentEntity) {
        renderer->multModelviewMatrix(parentEntity->getConcatenatedMatrix().Inverse());
    }

    renderer->multModelviewMatrix(transformMatrix);

    if(billboardMode) {
        if(billboardIgnoreScale) {
            renderer->billboardMatrix();
        } else {
            renderer->billboardMatrixWithScale(getCompoundScale());
        }
        if(billboardRoll) {
            renderer->multModelviewMatrix(getConcatenatedRollMatrix());
        }
    }

    if(!depthWrite)
        renderer->enableDepthWrite(false);
    else
        renderer->enableDepthWrite(true);

    if(!depthTest)
        renderer->enableDepthTest(false);
    else
        renderer->enableDepthTest(true);

    renderer->pushVertexColor();
    renderer->multiplyVertexColor(color);

    renderer->setBlendingMode(blendingMode);

    if(visible && rendererVis) {
        renderer->pushMatrix();
        renderer->translate3D(-anchorPoint.x * bBox.x * 0.5, -anchorPoint.y * bBox.y * 0.5 * yAdjust, -anchorPoint.z * bBox.z * 0.5);
        Render();
        renderer->popMatrix();
    }

    if(!colorAffectsChildren) {
        renderer->pushVertexColor();
        renderer->loadVertexColorIdentity();
        if(visible || (!visible && !visibilityAffectsChildren)) {
            renderChildren();
        }
        renderer->popVertexColor();
    } else {
        if(visible || (!visible && !visibilityAffectsChildren)) {
            renderChildren();
        }
    }

    renderer->popVertexColor();

    renderer->popMatrix();

    if(!depthWrite)
        renderer->enableDepthWrite(true);


    if(depthOnly) {
        renderer->drawToColorBuffer(true);
    }

    if(enableScissor) {
        renderer->enableScissor(isScissorEnabled);
        renderer->setScissorBox(oldScissorBox);
    }
}
开发者ID:hsandt,项目名称:Polycode,代码行数:100,代码来源:PolyEntity.cpp


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