Qt3DRender::QDirectionalLight Class

class Qt3DRender::QDirectionalLight

Qt 3D 场景中封装定向光对象。更多

页眉: #include <QDirectionalLight>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML 中: DirectionalLight
继承: Qt3DRender::QAbstractLight
状态:已废弃

属性

公共功能

QDirectionalLight(Qt3DCore::QNode *parent = nullptr)
QVector3D worldDirection() const

公共插槽

void setWorldDirection(const QVector3D &worldDirection)

信号

void worldDirectionChanged(const QVector3D &worldDirection)

详细说明

定向光是一种行为类似于太阳光的光源。定向光以相同的强度从相同的方向照射所有物体,无论它们在场景中的哪个位置。

属性文档

worldDirection : QVector3D

指定定向光的世界方向。

注: 此属性的确切含义和使用取决于材质的实现。

访问功能:

QVector3D worldDirection() const
void setWorldDirection(const QVector3D &worldDirection)

Notifier 信号:

void worldDirectionChanged(const QVector3D &worldDirection)

成员函数 文档

[explicit] QDirectionalLight::QDirectionalLight(Qt3DCore::QNode *parent = nullptr)

使用指定的parent 构建一个新的 QDirectionalLight。

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