Qt3DRender::QClipPlane Class

class Qt3DRender::QClipPlane

启用额外的 OpenGL 裁剪平面,可在着色器中使用 gl_ClipDistance。更多

头文件: #include <QClipPlane>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML 中: ClipPlane
继承: Qt3DRender::QRenderState
状态:已废弃

属性

公共功能

float distance() const
QVector3D normal() const
int planeIndex() const

公共插槽

void setDistance(float)
void setNormal(QVector3D)
void setPlaneIndex(int)

信号

void distanceChanged(float distance)
void normalChanged(QVector3D normal)
void planeIndexChanged(int planeIndex)

详细说明

默认情况下,OpenGL 支持多达 8 个额外的剪辑平面。Qt3DCore::QClipPlane 允许启用其中一个附加平面。这些平面可以在着色器中使用 gl_ClipDistance[i](i 在 0 到 7 之间)进行操作。底层实现可能支持 8 个以上的剪辑平面,但并不保证。

属性文档

distance : float

保存平面与世界原点的距离。

访问功能:

float distance() const
void setDistance(float)

通知信号:

void distanceChanged(float distance)

normal : QVector3D

保存平面的法线。

访问功能:

QVector3D normal() const
void setNormal(QVector3D)

通知信号:

void normalChanged(QVector3D normal)

planeIndex : int

保存平面的索引。

注: 通常在 0-7 之间。

访问功能:

int planeIndex() const
void setPlaneIndex(int)

通知信号:

void planeIndexChanged(int planeIndex)

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.