本页内容

Qt3DRender::QClipPlane Class

class Qt3DRender::QClipPlane

启用一个额外的 OpenGL 剪裁平面,可在着色器中通过 gl_ClipDistance 进行设置。更多内容...

头文件: #include <qclipplane.h>
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)

© 2026 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.