PySide6.Qt3DRender.Qt3DRender.QCameraLens

class QCameraLens

QCameraLens 指定了将用于定义3D场景中相机的投影矩阵。更多

PySide6.Qt3DRender.Qt3DRender.QCameraLens 的继承图

概要

属性

方法

插槽

信号

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

class ProjectionType

指定用于计算投影矩阵的QCameraLens参数。

常量

描述

Qt3DRender.QCameraLens.OrthographicProjection

正交投影

Qt3DRender.QCameraLens.PerspectiveProjection

透视投影

Qt3DRender.QCameraLens.FrustumProjection

视锥投影

Qt3DRender.QCameraLens.CustomProjection

自定义用户定义的投影

注意

当使用from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。

property aspectRatioᅟ: float

保持相机镜头的当前宽高比。

注意

: 如果投影类型不是PerspectiveProjection,返回值可能未定义。

Access functions:
property bottomᅟ: float

保持相机镜头的当前底部平面。

注意

如果投影类型是PerspectiveProjection,返回值可能未定义。

Access functions:
property exposureᅟ: float

保持相机镜头的当前曝光。

Access functions:
property farPlaneᅟ: float

保存相机镜头的当前近平面。

Access functions:
property fieldOfViewᅟ: float

保存相机镜头的当前视野。

注意

: 如果投影类型不是PerspectiveProjection,返回值可能未定义。

Access functions:
property leftᅟ: float

保存相机镜头的当前左平面。

注意

如果投影类型是PerspectiveProjection,返回值可能未定义。

Access functions:
property nearPlaneᅟ: float

保存相机镜头的当前近平面。

Access functions:
property projectionMatrixᅟ: QMatrix4x4

保存相机镜头的当前投影矩阵。

Access functions:
property projectionTypeᅟ: Qt3DRender.QCameraLens.ProjectionType

保存相机投影的类型。

另请参阅

ProjectionType

Access functions:
property rightᅟ: float

保存相机镜头的当前右平面。

注意

如果投影类型是PerspectiveProjection,返回值可能未定义。

Access functions:
property topᅟ: float

保持相机镜头的当前顶部平面。

注意

如果投影类型是PerspectiveProjection,返回值可能未定义。

Access functions:
__init__([parent=None])
Parameters:

parentQNode

使用给定的parent构造一个QCameraLens

aspectRatio()
Return type:

浮点数

另请参阅

setAspectRatio()

属性 aspectRatioᅟ 的获取器。

aspectRatioChanged(aspectRatio)
Parameters:

aspectRatio – 浮点数

属性 aspectRatioᅟ 的通知信号。

bottom()
Return type:

浮点数

另请参阅

setBottom()

属性 bottomᅟ 的获取器。

bottomChanged(bottom)
Parameters:

底部 – 浮点数

属性 bottomᅟ 的通知信号。

exposure()
Return type:

浮点数

另请参阅

setExposure()

属性 exposureᅟ 的获取器。

exposureChanged(exposure)
Parameters:

曝光 – float

属性 exposureᅟ 的通知信号。

farPlane()
Return type:

浮点数

另请参阅

setFarPlane()

属性 farPlaneᅟ 的获取器。

farPlaneChanged(farPlane)
Parameters:

farPlane – 浮点数

属性 farPlaneᅟ 的通知信号。

fieldOfView()
Return type:

浮点数

另请参阅

setFieldOfView()

属性 fieldOfViewᅟ 的获取器。

fieldOfViewChanged(fieldOfView)
Parameters:

fieldOfView – 浮点数

属性 fieldOfViewᅟ 的通知信号。

left()
Return type:

浮点数

另请参阅

setLeft()

属性 leftᅟ 的获取器。

leftChanged(left)
Parameters:

left – 浮点数

属性 leftᅟ 的通知信号。

nearPlane()
Return type:

浮点数

另请参阅

setNearPlane()

属性 nearPlaneᅟ 的获取器。

nearPlaneChanged(nearPlane)
Parameters:

nearPlane – 浮点数

属性 nearPlaneᅟ 的通知信号。

projectionMatrix()
Return type:

QMatrix4x4

另请参阅

setProjectionMatrix()

属性 projectionMatrixᅟ 的获取器。

projectionMatrixChanged(projectionMatrix)
Parameters:

projectionMatrixQMatrix4x4

属性 projectionMatrixᅟ 的通知信号。

projectionType()
Return type:

ProjectionType

另请参阅

setProjectionType()

属性 projectionTypeᅟ 的获取器。

projectionTypeChanged(projectionType)
Parameters:

projectionTypeProjectionType

属性 projectionTypeᅟ 的通知信号。

right()
Return type:

浮点数

另请参阅

setRight()

属性 rightᅟ 的获取器。

rightChanged(right)
Parameters:

right – 浮点数

属性 rightᅟ 的通知信号。

setAspectRatio(aspectRatio)
Parameters:

aspectRatio – 浮点数

将投影的宽高比设置为aspectRatio。这将触发投影矩阵的更新。

注意

如果投影类型不是PerspectiveProjection,则此操作无效。

另请参阅

aspectRatio()

属性 aspectRatioᅟ 的设置器。

setBottom(bottom)
Parameters:

底部 – 浮点数

将投影的底部窗口坐标设置为bottom。这将触发投影矩阵的更新。

注意

如果投影类型是PerspectiveProjection,则此操作无效。

另请参阅

bottom()

属性 bottomᅟ 的设置器。

setExposure(exposure)
Parameters:

曝光 – float

设置相机镜头的曝光

另请参阅

exposure()

属性 exposureᅟ 的设置器。

setFarPlane(farPlane)
Parameters:

farPlane – 浮点数

将投影的远平面设置为farPlane。这将触发投影矩阵的更新。

另请参阅

farPlane()

属性 farPlaneᅟ 的设置器。

setFieldOfView(fieldOfView)
Parameters:

fieldOfView – 浮点数

将投影的视野设置为fieldOfView度。这将触发投影矩阵的更新。

注意

如果投影类型不是PerspectiveProjection,则此操作无效。

另请参阅

fieldOfView()

属性 fieldOfViewᅟ 的设置器。

setFrustumProjection(left, right, bottom, top, nearPlane, farPlane)
Parameters:
  • left – 浮点数

  • right – 浮点数

  • bottom – 浮点数

  • top – 浮点数

  • nearPlane – 浮点数

  • farPlane – float

基于leftrightbottomtopnearPlanefarPlane定义一个正交投影。

setLeft(left)
Parameters:

left – 浮点数

将投影的左下窗口坐标设置为left。这将触发投影矩阵的更新。

注意

如果投影类型是PerspectiveProjection,则此操作无效。

另请参阅

left()

属性 leftᅟ 的设置器。

setNearPlane(nearPlane)
Parameters:

nearPlane – 浮点数

将投影的近平面设置为 nearPlane。这会触发投影矩阵的更新。

另请参阅

nearPlane()

属性 nearPlaneᅟ 的设置器。

setOrthographicProjection(left, right, bottom, top, nearPlane, farPlane)
Parameters:
  • left – 浮点数

  • right – 浮点数

  • bottom – 浮点数

  • top – 浮点数

  • nearPlane – 浮点数

  • farPlane – float

基于leftrightbottomtopnearPlanefarPlane定义一个正交投影。

setPerspectiveProjection(fieldOfView, aspect, nearPlane, farPlane)
Parameters:
  • fieldOfView – 浮点数

  • aspect – 浮点数

  • nearPlane – 浮点数

  • farPlane – float

基于fieldOfViewaspectRationearPlanefarPlane定义一个透视投影。

setProjectionMatrix(projectionMatrix)
Parameters:

projectionMatrixQMatrix4x4

将项目矩阵设置为 projectionMatrix

注意

这将把投影类型设置为CustomProjection,从而忽略所有可能已指定的其他相机参数。

另请参阅

projectionMatrix()

属性 projectionMatrixᅟ 的设置器。

setProjectionType(projectionType)
Parameters:

projectionTypeProjectionType

设置镜头的投影类型 projectionType

注意

Qt3DRender::QCameraLens::Frustum 和 PerspectiveProjection 是指定相同投影的两种不同方式。

另请参阅

projectionType()

属性 projectionTypeᅟ 的设置器。

setRight(right)
Parameters:

right – 浮点数

将投影的右上窗口坐标设置为 right。这将触发投影矩阵的更新。

注意

如果投影类型是PerspectiveProjection,则此操作无效。

另请参阅

right()

属性 rightᅟ 的设置器。

setTop(top)
Parameters:

顶部 – 浮点数

将投影的顶部窗口坐标设置为top。这将触发投影矩阵的更新。

注意

如果投影类型是PerspectiveProjection,则此操作无效。

另请参阅

top()

属性 topᅟ 的设置器。

top()
Return type:

浮点数

另请参阅

setTop()

属性 topᅟ 的获取器。

topChanged(top)
Parameters:

顶部 – 浮点数

属性 topᅟ 的通知信号。

viewAll(cameraId)
Parameters:

cameraIdQNodeId

viewEntity(entityId, cameraId)
Parameters:
  • entityIdQNodeId

  • cameraIdQNodeId

viewSphere(center, radius)
Parameters: