Nesta página

Qt3DRender::QCameraLens Class

class Qt3DRender::QCameraLens

Qt3DRender::QCameraLens especifica a matriz de projeção que será usada para definir uma câmera para uma cena 3D. Mais...

Cabeçalho: #include <Qt3DRender/QCameraLens>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
No QML: CameraLens
Herdado de: Qt3DCore::QComponent
Status: Obsoleta

Esta classe está obsoleta. Recomendamos enfaticamente que não seja utilizada em código novo.

Tipos públicos

enum ProjectionType { OrthographicProjection, PerspectiveProjection, FrustumProjection, CustomProjection }

Propriedades

Funções públicas

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

Slots públicos

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)

Sinais

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)

Descrição detalhada

Documentação sobre tipos de membros

enum QCameraLens::ProjectionType

Especifica quais parâmetros de ` Qt3DRender::QCameraLens ` são usados para calcular a matriz de projeção.

ConstanteValorDescrição
Qt3DRender::QCameraLens::OrthographicProjection0Projeção ortogonal
Qt3DRender::QCameraLens::PerspectiveProjection1Projeção em perspectiva
Qt3DRender::QCameraLens::FrustumProjection2Projeção troncada
Qt3DRender::QCameraLens::CustomProjection3Projeção personalizada definida pelo usuário

Documentação de propriedades

aspectRatio : float

Armazena a proporção atual da lente da câmera.

Observação: O valor de retorno pode ser indefinido se o tipo de projeção não for ` Qt3DRender::QCameraLens::PerspectiveProjection`.

Funções de acesso:

float aspectRatio() const
void setAspectRatio(float aspectRatio)

Sinal de notificação:

void aspectRatioChanged(float aspectRatio)

bottom : float

Armazena o plano inferior atual da lente da câmera.

Observação: O valor de retorno pode ser indefinido se o tipo de projeção for ` Qt3DRender::QCameraLens::PerspectiveProjection`.

Funções de acesso:

float bottom() const
void setBottom(float bottom)

Sinal de notificação:

void bottomChanged(float bottom)

exposure : float

Mantém a exposição atual da lente da câmera.

Funções de acesso:

float exposure() const
void setExposure(float exposure)

Sinal de notificação:

void exposureChanged(float exposure)

farPlane : float

Representa o plano próximo atual da lente da câmera.

Funções de acesso:

float farPlane() const
void setFarPlane(float farPlane)

Sinal de notificação:

void farPlaneChanged(float farPlane)

fieldOfView : float

Armazena o campo de visão atual da lente da câmera.

Observação: O valor de retorno pode ser indefinido se o tipo de projeção não for ` Qt3DRender::QCameraLens::PerspectiveProjection`.

Funções de acesso:

float fieldOfView() const
void setFieldOfView(float fieldOfView)

Sinal de notificação:

void fieldOfViewChanged(float fieldOfView)

left : float

Armazena o plano esquerdo atual da lente da câmera.

Observação: O valor de retorno pode ser indefinido se o tipo de projeção for “ Qt3DRender::QCameraLens::PerspectiveProjection ”.

Funções de acesso:

float left() const
void setLeft(float left)

Sinal notificador:

void leftChanged(float left)

nearPlane : float

Representa o plano próximo atual da lente da câmera.

Funções de acesso:

float nearPlane() const
void setNearPlane(float nearPlane)

Sinal de notificação:

void nearPlaneChanged(float nearPlane)

projectionMatrix : QMatrix4x4

Armazena a matriz de projeção atual da lente da câmera.

Funções de acesso:

QMatrix4x4 projectionMatrix() const
void setProjectionMatrix(const QMatrix4x4 &projectionMatrix)

Sinal de notificação:

void projectionMatrixChanged(const QMatrix4x4 &projectionMatrix)

projectionType : ProjectionType

Armazena o tipo da projeção da câmera.

Funções de acesso:

Qt3DRender::QCameraLens::ProjectionType projectionType() const
void setProjectionType(Qt3DRender::QCameraLens::ProjectionType projectionType)

Sinal do Notifier:

void projectionTypeChanged(Qt3DRender::QCameraLens::ProjectionType projectionType)

Veja também Qt3DRender::QCameraLens::ProjectionType.

right : float

Armazena o plano direito atual da lente da câmera.

Observação: O valor de retorno pode ser indefinido se o tipo de projeção for ` Qt3DRender::QCameraLens::PerspectiveProjection`.

Funções de acesso:

float right() const
void setRight(float right)

Sinal de notificação:

void rightChanged(float right)

top : float

Armazena o plano superior atual da lente da câmera.

Observação: O valor de retorno pode ser indefinido se o tipo de projeção for ` Qt3DRender::QCameraLens::PerspectiveProjection`.

Funções de acesso:

float top() const
void setTop(float top)

Sinal do notificador:

void topChanged(float top)

Documentação das funções de membro

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

Cria uma instância de QCameraLens com os parâmetros fornecidos parent

[slot] void QCameraLens::setAspectRatio(float aspectRatio)

Define a proporção da projeção como “ aspectRatio ”. Isso aciona uma atualização da matriz de projeção.

Observação: isso não tem efeito se o tipo de projeção não for “ Qt3DRender::QCameraLens::PerspectiveProjection ”.

Observação: funçãosetter para a propriedade ` aspectRatio`.

Veja também ` aspectRatio()`.

[slot] void QCameraLens::setBottom(float bottom)

Define a coordenada inferior da janela da projeção como bottom. Isso aciona uma atualização da matriz de projeção.

Observação: isso não tem efeito se o tipo de projeção for ` Qt3DRender::QCameraLens::PerspectiveProjection`.

Observação: funçãosetter para a propriedade ` bottom`.

Veja também ` bottom()`.

[slot] void QCameraLens::setExposure(float exposure)

Define a lente da câmera exposure

Observação: Funçãode definição para a propriedade exposure.

Veja também exposure().

[slot] void QCameraLens::setFarPlane(float farPlane)

Define o plano distante da projeção como farPlane. Isso aciona uma atualização da matriz de projeção.

Observação: Funçãode definição para a propriedade farPlane.

Veja também ` farPlane()`.

[slot] void QCameraLens::setFieldOfView(float fieldOfView)

Define o campo de visão da projeção como fieldOfView graus. Isso aciona uma atualização da matriz de projeção.

Observação: isso não tem efeito se o tipo de projeção não for ` Qt3DRender::QCameraLens::PerspectiveProjection`.

Observação: funçãode definição para a propriedade ` fieldOfView`.

Veja também ` fieldOfView()`.

void QCameraLens::setFrustumProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)

Define uma projeção ortográfica com base em left, right, bottom, top, nearPlane e farPlane.

[slot] void QCameraLens::setLeft(float left)

Define a coordenada do canto inferior esquerdo da janela da projeção como left. Isso aciona uma atualização da matriz de projeção.

Observação: isso não tem efeito se o tipo de projeção for ` Qt3DRender::QCameraLens::PerspectiveProjection`.

Observação: funçãosetter para a propriedade ` left`.

Veja também ` left()`.

[slot] void QCameraLens::setNearPlane(float nearPlane)

Define o plano próximo da projeção como nearPlane. Isso aciona uma atualização da matriz de projeção.

Observação: Funçãode definição para a propriedade nearPlane.

Veja também ` nearPlane()`.

void QCameraLens::setOrthographicProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)

Define uma projeção ortográfica com base em left, right, bottom, top, nearPlane e farPlane.

void QCameraLens::setPerspectiveProjection(float fieldOfView, float aspectRatio, float nearPlane, float farPlane)

Define uma projeção em perspectiva com base em fieldOfView, aspectRatio, nearPlane e farPlane.

[slot] void QCameraLens::setProjectionMatrix(const QMatrix4x4 &projectionMatrix)

Define a matriz do projeto como “ projectionMatrix ”.

Observação: Isso definirá o tipo de projeção como ` Qt3DRender::QCameraLens::CustomProjection ` e, portanto, ignorará todos os outros parâmetros da câmera que possam ter sido especificados.

Observação: Funçãosetter para a propriedade projectionMatrix.

Veja também ` projectionMatrix()`.

[slot] void QCameraLens::setProjectionType(Qt3DRender::QCameraLens::ProjectionType projectionType)

Define o tipo de projeção da lente projectionType.

Observação: Qt3DRender ::QCameraLens::Frustum e Qt3DRender::QCameraLens::PerspectiveProjection são duas maneiras diferentes de especificar a mesma projeção.

Observação: Funçãosetter para a propriedade ` projectionType`.

Veja também projectionType().

[slot] void QCameraLens::setRight(float right)

Define a coordenada do canto superior direito da janela da projeção como right. Isso aciona uma atualização da matriz de projeção.

Observação: isso não tem efeito se o tipo de projeção for ` Qt3DRender::QCameraLens::PerspectiveProjection`.

Observação: funçãosetter para a propriedade ` right`.

Veja também ` right()`.

[slot] void QCameraLens::setTop(float top)

Define a coordenada superior da janela da projeção como top. Isso aciona uma atualização da matriz de projeção.

Observação: isso não tem efeito se o tipo de projeção for ` Qt3DRender::QCameraLens::PerspectiveProjection`.

Observação: funçãode definição para a propriedade ` top`.

Veja também ` 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.