QCullFace Class▲
-
Header: QCullFace
-
Since: Qt 5.7
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
-
qmake: QT += 3drender
-
Inherited By:
-
Instantiated By: qml-qt3d-render-cullface.xml
-
Inherits: Qt3DRender::QRenderState
-
Group: QCullFace is part of renderstates
Detailed Description▲
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-&
gt;setMode(QCullFace::
Front);
// Add the render state to the render pass
renderPass-&
gt;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-&
gt;setMode(QCullFace::
Front);
// Add the render state to the render pass
renderStateSet-&
gt;addRenderState(cullFront);
See Also▲
See also QFrontFace
Member Type Documentation▲
enum QCullFace::CullingMode▲
This enumeration specifies values for the culling mode.
Constant |
Value |
Description |
---|---|---|
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 |
Property Documentation▲
mode : CullingMode▲
Member Function Documentation▲
[explicit] QCullFace::QCullFace(Qt3DCore::QNode *parent = nullptr)▲
Constructs a new QCullFace::QCullFace instance with parent as parent.