Qt3DRender::QCameraLens Class
class Qt3DRender::QCameraLensQt3DRender::QCameraLens Legt die Projektionsmatrix fest, die zur Definition einer Kamera für eine 3D-Szene verwendet wird. Mehr...
| Header: | #include <Qt3DRender/QCameraLens> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
| qmake: | QT += 3drender |
| In QML: | CameraLens |
| Erbt von: | Qt3DCore::QComponent |
| Status: | Veraltet |
Diese Klasse ist veraltet. Wir raten dringend davon ab, sie in neuem Code zu verwenden.
Öffentliche Typen
| enum | ProjectionType { OrthographicProjection, PerspectiveProjection, FrustumProjection, CustomProjection } |
Eigenschaften
|
|
Öffentliche Funktionen
| QCameraLens(Qt3DCore::QNode *parent = nullptr) | |
| float | aspectRatio() const |
| float | bottom() const |
| float | exposure() const |
| float | farPlane() const |
| float | fieldOfView() const |
| float | left() const |
| float | nearPlane() const |
| QMatrix4x4 | projectionMatrix() const |
| Qt3DRender::QCameraLens::ProjectionType | projectionType() const |
| float | right() const |
| void | setFrustumProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane) |
| void | setOrthographicProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane) |
| void | setPerspectiveProjection(float fieldOfView, float aspectRatio, float nearPlane, float farPlane) |
| float | top() const |
Öffentliche Slots
| void | setAspectRatio(float aspectRatio) |
| void | setBottom(float bottom) |
| void | setExposure(float exposure) |
| void | setFarPlane(float farPlane) |
| void | setFieldOfView(float fieldOfView) |
| void | setLeft(float left) |
| void | setNearPlane(float nearPlane) |
| void | setProjectionMatrix(const QMatrix4x4 &projectionMatrix) |
| void | setProjectionType(Qt3DRender::QCameraLens::ProjectionType projectionType) |
| void | setRight(float right) |
| void | setTop(float top) |
Signale
| void | aspectRatioChanged(float aspectRatio) |
| void | bottomChanged(float bottom) |
| void | exposureChanged(float exposure) |
| void | farPlaneChanged(float farPlane) |
| void | fieldOfViewChanged(float fieldOfView) |
| void | leftChanged(float left) |
| void | nearPlaneChanged(float nearPlane) |
| void | projectionMatrixChanged(const QMatrix4x4 &projectionMatrix) |
| void | projectionTypeChanged(Qt3DRender::QCameraLens::ProjectionType projectionType) |
| void | rightChanged(float right) |
| void | topChanged(float top) |
Dokumentation zu Mitgliedstypen
enum QCameraLens::ProjectionType
Legt fest, welche Parameter von „ Qt3DRender::QCameraLens “ zur Berechnung der Projektionsmatrix verwendet werden.
| Konstante | Wert | Beschreibung |
|---|---|---|
Qt3DRender::QCameraLens::OrthographicProjection | 0 | Orthogonale Projektion |
Qt3DRender::QCameraLens::PerspectiveProjection | 1 | Perspektivische Projektion |
Qt3DRender::QCameraLens::FrustumProjection | 2 | Kegelstumpfprojektion |
Qt3DRender::QCameraLens::CustomProjection | 3 | Benutzerdefinierte Projektion |
Dokumentation zu den Eigenschaften
aspectRatio : float
Enthält das aktuelle Seitenverhältnis des Kameraobjektivs.
Hinweis: Der Rückgabewert ist möglicherweise undefiniert, wenn der Projektionstyp nicht „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Zugriffsfunktionen:
| float | aspectRatio() const |
| void | setAspectRatio(float aspectRatio) |
Benachrichtigungssignal:
| void | aspectRatioChanged(float aspectRatio) |
bottom : float
Enthält die aktuelle untere Ebene des Kameraobjektivs.
Hinweis: Der Rückgabewert ist möglicherweise undefiniert, wenn der Projektionstyp „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Zugriffsfunktionen:
| float | bottom() const |
| void | setBottom(float bottom) |
Benachrichtigungssignal:
| void | bottomChanged(float bottom) |
exposure : float
Speichert die aktuelle Belichtung des Kameraobjektivs.
Zugriffsfunktionen:
| float | exposure() const |
| void | setExposure(float exposure) |
Benachrichtigungssignal:
| void | exposureChanged(float exposure) |
farPlane : float
Enthält die aktuelle Nahebene des Kameraobjektivs.
Zugriffsfunktionen:
| float | farPlane() const |
| void | setFarPlane(float farPlane) |
Benachrichtigungssignal:
| void | farPlaneChanged(float farPlane) |
fieldOfView : float
Enthält das aktuelle Sichtfeld des Kameraobjektivs.
Hinweis: Der Rückgabewert ist möglicherweise undefiniert, wenn der Projektionstyp nicht „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Zugriffsfunktionen:
| float | fieldOfView() const |
| void | setFieldOfView(float fieldOfView) |
Benachrichtigungssignal:
| void | fieldOfViewChanged(float fieldOfView) |
left : float
Enthält die aktuelle linke Ebene des Kameraobjektivs.
Hinweis: Der Rückgabewert ist möglicherweise undefiniert, wenn der Projektionstyp „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Zugriffsfunktionen:
| float | left() const |
| void | setLeft(float left) |
Benachrichtigungssignal:
| void | leftChanged(float left) |
nearPlane : float
Enthält die aktuelle Nahebene des Kameraobjektivs.
Zugriffsfunktionen:
| float | nearPlane() const |
| void | setNearPlane(float nearPlane) |
Benachrichtigungssignal:
| void | nearPlaneChanged(float nearPlane) |
projectionMatrix : QMatrix4x4
Enthält die aktuelle Projektionsmatrix des Kameraobjektivs.
Zugriffsfunktionen:
| QMatrix4x4 | projectionMatrix() const |
| void | setProjectionMatrix(const QMatrix4x4 &projectionMatrix) |
Benachrichtigungssignal:
| void | projectionMatrixChanged(const QMatrix4x4 &projectionMatrix) |
projectionType : ProjectionType
Enthält den Typ der Kameraprojektion.
Zugriffsfunktionen:
| Qt3DRender::QCameraLens::ProjectionType | projectionType() const |
| void | setProjectionType(Qt3DRender::QCameraLens::ProjectionType projectionType) |
Benachrichtigungssignal:
| void | projectionTypeChanged(Qt3DRender::QCameraLens::ProjectionType projectionType) |
Siehe auch „ Qt3DRender::QCameraLens::ProjectionType “.
right : float
Enthält die aktuelle rechte Ebene des Kameraobjektivs.
Hinweis: Der Rückgabewert ist möglicherweise undefiniert, wenn der Projektionstyp „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Zugriffsfunktionen:
| float | right() const |
| void | setRight(float right) |
Benachrichtigungssignal:
| void | rightChanged(float right) |
top : float
Enthält die aktuelle oberste Ebene des Kameraobjektivs.
Hinweis: Der Rückgabewert kann undefiniert sein, wenn der Projektionstyp „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Zugriffsfunktionen:
| float | top() const |
| void | setTop(float top) |
Benachrichtigungssignal:
| void | topChanged(float top) |
Dokumentation der Mitgliedsfunktionen
[explicit] QCameraLens::QCameraLens(Qt3DCore::QNode *parent = nullptr)
Erstellt ein QCameraLens-Objekt mit den angegebenen parent
[slot] void QCameraLens::setAspectRatio(float aspectRatio)
Stellt das Seitenverhältnis der Projektion auf „ aspectRatio “ ein. Dies löst eine Aktualisierung der Projektionsmatrix aus.
Hinweis: Dies hat keine Auswirkung, wenn der Projektionstyp nicht „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Hinweis: Setter -Funktion für die Eigenschaft „ aspectRatio “.
Siehe auch „ aspectRatio()“.
[slot] void QCameraLens::setBottom(float bottom)
Setzt die untere Fensterkoordinate der Projektion auf „ bottom “. Dies löst eine Aktualisierung der Projektionsmatrix aus.
Hinweis: Dies hat keine Auswirkung, wenn der Projektionstyp „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Hinweis: Setter -Funktion für die Eigenschaft „ bottom “.
Siehe auch „ bottom()“.
[slot] void QCameraLens::setExposure(float exposure)
Legt das Kameraobjektiv fest exposure
Hinweis: Setter -Funktion für die Eigenschaft „ exposure “.
Siehe auch ` exposure()`.
[slot] void QCameraLens::setFarPlane(float farPlane)
Setzt die hintere Begrenzungsebene der Projektion auf farPlane. Dies löst eine Aktualisierung der Projektionsmatrix aus.
Hinweis: Setter -Funktion für die Eigenschaft ` farPlane`.
Siehe auch ` farPlane()`.
[slot] void QCameraLens::setFieldOfView(float fieldOfView)
Stellt das Sichtfeld der Projektion auf fieldOfView Grad ein. Dies löst eine Aktualisierung der Projektionsmatrix aus.
Hinweis: Dies hat keine Auswirkung, wenn der Projektionstyp nicht „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Hinweis: Setter -Funktion für die Eigenschaft ` fieldOfView`.
Siehe auch ` fieldOfView()`.
void QCameraLens::setFrustumProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)
Definiert eine orthogonale Projektion auf der Grundlage von left, right, bottom, top, nearPlane und farPlane.
[slot] void QCameraLens::setLeft(float left)
Setzt die Koordinate der unteren linken Ecke des Fensters der Projektion auf left. Dies löst eine Aktualisierung der Projektionsmatrix aus.
Hinweis: Dies hat keine Auswirkung, wenn der Projektionstyp „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Hinweis: Setter -Funktion für die Eigenschaft „ left “.
Siehe auch left().
[slot] void QCameraLens::setNearPlane(float nearPlane)
Setzt die Nahebene der Projektion auf „ nearPlane “. Dies löst eine Aktualisierung der Projektionsmatrix aus.
Hinweis: Setter -Funktion für die Eigenschaft ` nearPlane`.
Siehe auch ` nearPlane()`.
void QCameraLens::setOrthographicProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)
Definiert eine orthogonale Projektion auf der Grundlage von left, right, bottom, top, nearPlane und farPlane.
void QCameraLens::setPerspectiveProjection(float fieldOfView, float aspectRatio, float nearPlane, float farPlane)
Definiert eine perspektivische Projektion auf der Grundlage von fieldOfView, aspectRatio, nearPlane und farPlane.
[slot] void QCameraLens::setProjectionMatrix(const QMatrix4x4 &projectionMatrix)
Setzt die Projektmatrix auf „ projectionMatrix “.
Hinweis: Dadurch wird der Projektionstyp auf „ Qt3DRender::QCameraLens::CustomProjection “ gesetzt, wodurch alle anderen möglicherweise angegebenen Kameraparameter ignoriert werden.
Hinweis: Setter -Funktion für die Eigenschaft „ projectionMatrix “.
Siehe auch ` projectionMatrix()`.
[slot] void QCameraLens::setProjectionType(Qt3DRender::QCameraLens::ProjectionType projectionType)
Legt den Projektionstyp der Linse fest: projectionType.
Hinweis: Qt3DRender ::QCameraLens::Frustum und Qt3DRender::QCameraLens::PerspectiveProjection sind zwei verschiedene Möglichkeiten, dieselbe Projektion anzugeben.
Hinweis: Setter -Funktion für die Eigenschaft projectionType.
Siehe auch projectionType().
[slot] void QCameraLens::setRight(float right)
Setzt die Koordinate der oberen rechten Ecke des Fensters der Projektion auf „ right “. Dies löst eine Aktualisierung der Projektionsmatrix aus.
Hinweis: Dies hat keine Auswirkung, wenn der Projektionstyp „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Hinweis: Setter -Funktion für die Eigenschaft „ right “.
Siehe auch right().
[slot] void QCameraLens::setTop(float top)
Setzt die obere Fensterkoordinate der Projektion auf „ top “. Dies löst eine Aktualisierung der Projektionsmatrix aus.
Hinweis: Dies hat keine Auswirkungen, wenn der Projektionstyp „ Qt3DRender::QCameraLens::PerspectiveProjection “ ist.
Hinweis: Setter -Funktion für die Eigenschaft „ top “.
Siehe auch „ top()“.
© 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.