QSpotLight Class
class Qt3DRender::QSpotLightVerkapselt ein Spot Light Objekt in einer Qt 3D Szene. Mehr...
Kopfzeile: | #include <QSpotLight> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
qmake: | QT += 3drender |
In QML: | SpotLight |
Vererbt: | Qt3DRender::QAbstractLight |
Status: | Veraltet |
Eigenschaften
|
|
Öffentliche Funktionen
QSpotLight(Qt3DCore::QNode *parent = nullptr) | |
float | constantAttenuation() const |
float | cutOffAngle() const |
float | linearAttenuation() const |
QVector3D | localDirection() const |
float | quadraticAttenuation() const |
Öffentliche Slots
void | setConstantAttenuation(float value) |
void | setCutOffAngle(float cutOffAngle) |
void | setLinearAttenuation(float value) |
void | setLocalDirection(const QVector3D &localDirection) |
void | setQuadraticAttenuation(float value) |
Signale
void | constantAttenuationChanged(float constantAttenuation) |
void | cutOffAngleChanged(float cutOffAngle) |
void | linearAttenuationChanged(float linearAttenuation) |
void | localDirectionChanged(const QVector3D &localDirection) |
void | quadraticAttenuationChanged(float quadraticAttenuation) |
Detaillierte Beschreibung
Ein Scheinwerfer ist eine Lichtquelle, die einen Lichtkegel in eine bestimmte Richtung ausstrahlt.
Ein Scheinwerfer verwendet drei Dämpfungsfaktoren, um zu beschreiben, wie die Intensität des Lichts über die Entfernung abnimmt. Diese Faktoren sind so konzipiert, dass sie bei der Berechnung der Gesamtdämpfung zusammen verwendet werden können. Für die Materialien in Qt3D Extras wird die folgende Formel verwendet, wobei Abstand der Abstand zwischen dem Licht und der gerenderten Oberfläche ist:
totalAttenuation = 1.0 / (constantAttenuation + (linearAttenuation * distance) + (quadraticAttenuation * distance * distance));
Benutzerdefinierte Materialien können diese Faktoren anders interpretieren.
Dokumentation der Eigenschaft
constantAttenuation : float
Gibt die konstante Abschwächung des Spotlichts an.
Hinweis: Die genaue Bedeutung und Verwendung dieser Eigenschaft hängt von der Materialimplementierung ab.
Zugriffsfunktionen:
float | constantAttenuation() const |
void | setConstantAttenuation(float value) |
Melder-Signal:
void | constantAttenuationChanged(float constantAttenuation) |
cutOffAngle : float
Gibt den Abblendwinkel des Spotlichts an.
Hinweis: Die genaue Bedeutung und Verwendung dieser Eigenschaft hängt von der Materialimplementierung ab.
Zugriffsfunktionen:
float | cutOffAngle() const |
void | setCutOffAngle(float cutOffAngle) |
Melder-Signal:
void | cutOffAngleChanged(float cutOffAngle) |
linearAttenuation : float
Gibt die lineare Abschwächung des Spotlichts an.
Hinweis: Die genaue Bedeutung und Verwendung dieser Eigenschaft hängt von der Materialimplementierung ab.
Zugriffsfunktionen:
float | linearAttenuation() const |
void | setLinearAttenuation(float value) |
Melder-Signal:
void | linearAttenuationChanged(float linearAttenuation) |
localDirection : QVector3D
Gibt die lokale Richtung des Spotlichts an.
Hinweis: Die genaue Bedeutung und Verwendung dieser Eigenschaft hängt von der Materialimplementierung ab.
Zugriffsfunktionen:
QVector3D | localDirection() const |
void | setLocalDirection(const QVector3D &localDirection) |
Melder-Signal:
void | localDirectionChanged(const QVector3D &localDirection) |
quadraticAttenuation : float
Gibt die quadratische Abschwächung des Spotlichts an.
Hinweis: Die genaue Bedeutung und Verwendung dieser Eigenschaft hängt von der Materialimplementierung ab.
Zugriffsfunktionen:
float | quadraticAttenuation() const |
void | setQuadraticAttenuation(float value) |
Melder-Signal:
void | quadraticAttenuationChanged(float quadraticAttenuation) |
Member Function Dokumentation
[explicit]
QSpotLight::QSpotLight(Qt3DCore::QNode *parent = nullptr)
Konstruiert ein neues QSpotLight mit dem angegebenen parent.
© 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.