PySide6.Qt3DCore.Qt3DCore.QTransform¶
- class QTransform¶
用于对网格执行变换。更多…
概要¶
属性¶
方法¶
def
__init__()def
matrix()def
rotation()def
rotationX()def
rotationY()def
rotationZ()def
scale()def
scale3D()def
translation()def
worldMatrix()
插槽¶
def
setMatrix()def
setRotation()def
setRotationX()def
setRotationY()def
setRotationZ()def
setScale()def
setScale3D()def
setTranslation()
信号¶
def
matrixChanged()def
scale3DChanged()def
scaleChanged()
静态函数¶
def
fromAxes()def
rotateAround()def
rotateFromAxes()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
QTransform组件不能在多个QEntity之间共享。变换以 QVector3D 缩放、QQuaternion 旋转和 QVector3D 平移组件的形式保存。变换按此顺序应用于网格。当设置matrix属性时,它会被分解为这些变换组件,并发出相应的信号。提供了几个辅助函数来设置
QTransform;fromAxisAndAngle和fromAxesAndAngles可用于设置围绕特定轴的旋转,fromEulerAngles可用于基于欧拉角设置旋转,rotateAround可用于围绕相对于局部原点的特定点旋转对象。注意
当使用
from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。- property matrixᅟ: QMatrix4x4¶
保存变换的QMatrix4x4。
注意
当矩阵属性被设置时,它被分解为平移、旋转和缩放组件。
- Access functions:
- property rotationᅟ: QQuaternion¶
将变换的旋转保持为QQuaternion。
- Access functions:
- property rotationXᅟ: float¶
保持变换的x旋转作为欧拉角。
- Access functions:
- property rotationYᅟ: float¶
保持变换的y旋转作为欧拉角。
- Access functions:
- property rotationZᅟ: float¶
保持变换的z旋转作为欧拉角。
- Access functions:
- property scaleᅟ: float¶
保持变换的统一比例。如果比例已使用
setScale3D设置,则仅保持x值。- Access functions:
保存变换的比例为QVector3D。
- Access functions:
保存变换的翻译为QVector3D。
- Access functions:
- property worldMatrixᅟ: QMatrix4x4¶
保存变换的世界变换矩阵。这假设
QTransform组件被QEntity引用。这使得即使其局部变换可能没有改变,也能更方便地识别子树中的QEntity部分是否在世界中进行了变换。- Access functions:
- __init__([parent=None])¶
- Parameters:
parent –
QNode
使用
parent构造一个新的QTransform。- static fromAxes(xAxis, yAxis, zAxis)¶
- Parameters:
- Return type:
创建一个QQuaterniom,定义从轴
xAxis、yAxis和zAxis的旋转。- static fromAxesAndAngles(axis1, angle1, axis2, angle2)¶
- Parameters:
- Return type:
从
axis1、angle1、axis2和angle2创建一个QQuaternion。返回生成的QQuaternion。- static fromAxesAndAngles(axis1, angle1, axis2, angle2, axis3, angle3)
- Parameters:
- Return type:
从
axis1、angle1、axis2、angle2、axis3和angle3创建一个QQuaternion。返回生成的QQuaternion。从
axis和angle创建一个QQuaternion。返回生成的QQuaternion。- static fromAxisAndAngle(x, y, z, angle)
- Parameters:
x – 浮点数
y – 浮点数
z – 浮点数
angle – 浮点数
- Return type:
从
x,y,z, 和angle创建一个 QQuaternion。返回生成的 QQuaternion。从
eulerAngles创建一个QQuaternion。返回生成的QQuaternion。- static fromEulerAngles(pitch, yaw, roll)
- Parameters:
pitch – 浮点数
yaw – 浮点数
roll – 浮点数
- Return type:
从
pitch、yaw和roll创建一个QQuaternion。返回生成的QQuaternion。- matrix()¶
- Return type:
另请参阅
属性
matrixᅟ的获取器。- matrixChanged()¶
属性
matrixᅟ的通知信号。- static rotateAround(point, angle, axis)¶
- Parameters:
- Return type:
从
axis和angle围绕point创建一个旋转矩阵。返回生成的QMatrix4x4。- static rotateFromAxes(xAxis, yAxis, zAxis)¶
- Parameters:
- Return type:
返回一个由轴
xAxis、yAxis、zAxis定义的旋转矩阵。- rotation()¶
- Return type:
另请参阅
setRotation()
属性
rotationᅟ的获取器。- rotationChanged(rotation)¶
- Parameters:
旋转 –
QQuaternion
属性
rotationᅟ的通知信号。- rotationX()¶
- Return type:
浮点数
另请参阅
setRotationX()
获取属性
rotationXᅟ的Getter。- rotationXChanged(rotationX)¶
- Parameters:
rotationX – 浮点数
属性
rotationXᅟ的通知信号。- rotationY()¶
- Return type:
浮点数
另请参阅
setRotationY()
属性
rotationYᅟ的获取器。- rotationYChanged(rotationY)¶
- Parameters:
rotationY – 浮点数
属性
rotationYᅟ的通知信号。- rotationZ()¶
- Return type:
浮点数
另请参阅
setRotationZ()
属性
rotationZᅟ的获取器。- rotationZChanged(rotationZ)¶
- Parameters:
rotationZ – 浮点数
属性
rotationZᅟ的通知信号。- scale()¶
- Return type:
浮点数
另请参阅
setScale()
属性
scaleᅟ的获取器。属性
scale3Dᅟ的获取器。属性
scale3Dᅟ的通知信号。- scaleChanged(scale)¶
- Parameters:
scale – 浮点数
属性
scaleᅟ的通知信号。- setMatrix(matrix)¶
- Parameters:
矩阵 –
QMatrix4x4
另请参阅
matrix()
属性
matrixᅟ的设置器。- setRotation(rotation)¶
- Parameters:
旋转 –
QQuaternion
另请参阅
rotation()
属性
rotationᅟ的设置器。- setRotationX(rotationX)¶
- Parameters:
rotationX – 浮点数
另请参阅
rotationX()
属性
rotationXᅟ的设置器。- setRotationY(rotationY)¶
- Parameters:
rotationY – 浮点数
另请参阅
rotationY()
属性
rotationYᅟ的设置器。- setRotationZ(rotationZ)¶
- Parameters:
rotationZ – 浮点数
另请参阅
rotationZ()
属性
rotationZᅟ的设置器。属性
scaleᅟ的设置器。属性
scale3Dᅟ的设置器。属性
translationᅟ的设置器。属性
translationᅟ的获取器。属性
translationᅟ的通知信号。- worldMatrix()¶
- Return type:
返回与
QTransform相关联的世界变换矩阵,当它被一个可能是QEntity层次结构的一部分的QEntity引用时。属性
worldMatrixᅟ的获取器。- worldMatrixChanged(worldMatrix)¶
- Parameters:
worldMatrix –
QMatrix4x4
属性
worldMatrixᅟ的通知信号。