本文整理汇总了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);
}
}