QCullFace Class

( Qt3DRender::QCullFace )

The QCullFace class specifies whether front or back face culling is enabled. 更多...

頭: #include <QCullFace>
qmake: QT += 3drender
Since: Qt 5.7
實例化: CullFace
繼承: Qt3DRender::QRenderState

公共類型

enum CullingMode { NoCulling, Front, Back, FrontAndBack }

特性

公共函數

QCullFace (Qt3DCore::QNode * parent = nullptr)
Qt3DRender::QCullFace::CullingMode mode () const

公共槽

void setMode (Qt3DRender::QCullFace::CullingMode mode )

信號

void modeChanged (Qt3DRender::QCullFace::CullingMode mode )

靜態公共成員

const QMetaObject staticMetaObject

額外繼承成員

詳細描述

The QCullFace class specifies whether front or back face culling is enabled.

QCullFace sets whether the front or back facets are culled. Facets include triangles, quadrilaterals, polygons and rectangles.

It can be added by calling the addRenderState() method on a QRenderPass :

// using namespace Qt3DRender;
QRenderPass *renderPass = new QRenderPass();
// Create a front face culling render state
QCullFace *cullFront = new QCullFace();
cullFront->setMode(QCullFace::Front);
// Add the render state to the render pass
renderPass->addRenderState(cullFront);
					

Or by calling the addRenderState() method on a QRenderStateSet :

// using namespace Qt3DRender;
QRenderStateSet *renderStateSet = new QRenderStateSet();
// Create a front face culling render state
QCullFace *cullFront = new QCullFace();
cullFront->setMode(QCullFace::Front);
// Add the render state to the render pass
renderStateSet->addRenderState(cullFront);
					

另請參閱 QFrontFace .

成員類型文檔編製

enum QCullFace:: CullingMode

This enumeration specifies values for the culling mode.

常量 描述
Qt3DRender::QCullFace::NoCulling 0x0 Culling is disabled
Qt3DRender::QCullFace::Front 0x0404 Culling is enabled for front facing polygons
Qt3DRender::QCullFace::Back 0x0405 Culling is enabled for back facing polygons
Qt3DRender::QCullFace::FrontAndBack 0x0408 Culling is enabled for all polygons, points and lines are drawn

特性文檔編製

mode : CullingMode

Holds the culling mode used by QCullFace . Default is set to QCullFace .Back.

訪問函數:

Qt3DRender::QCullFace::CullingMode mode () const
void setMode (Qt3DRender::QCullFace::CullingMode mode )

通知程序信號:

void modeChanged (Qt3DRender::QCullFace::CullingMode mode )

成員函數文檔編製

QCullFace:: QCullFace ( Qt3DCore::QNode * parent = nullptr)

構造新的 QCullFace::QCullFace 實例與 parent 作為父級。