QTransform¶
Used to perform transforms on meshes. More…

Synopsis¶
Functions¶
def
matrix()def
rotation()def
rotationX()def
rotationY()def
rotationZ()def
scale3D()def
scale()def
translation()def
worldMatrix()
Slots¶
def
setMatrix(matrix)def
setRotation(rotation)def
setRotationX(rotationX)def
setRotationY(rotationY)def
setRotationZ(rotationZ)def
setScale3D(scale)def
setScale(scale)def
setTranslation(translation)
Signals¶
def
matrixChanged()def
rotationChanged(rotation)def
rotationXChanged(rotationX)def
rotationYChanged(rotationY)def
rotationZChanged(rotationZ)def
scale3DChanged(scale)def
scaleChanged(scale)def
translationChanged(translation)def
worldMatrixChanged(worldMatrix)
Static functions¶
def
fromAxes(xAxis, yAxis, zAxis)def
fromAxesAndAngles(axis1, angle1, axis2, angle2)def
fromAxesAndAngles(axis1, angle1, axis2, angle2, axis3, angle3)def
fromAxisAndAngle(axis, angle)def
fromAxisAndAngle(x, y, z, angle)def
fromEulerAngles(eulerAngles)def
fromEulerAngles(pitch, yaw, roll)def
rotateAround(point, angle, axis)def
rotateFromAxes(xAxis, yAxis, zAxis)
Detailed Description¶
The
QTransformcomponent is not shareable between multipleQEntity‘s. The transformation is held asQVector3Dscale,QQuaternionrotation andQVector3Dtranslation components. The transformations are applied to the mesh in that order. Whenmatrixproperty is set, it is decomposed to these transform components and corresponding signals are emitted.Several helper functions are provided to set up the
QTransform;fromAxisAndAngleandfromAxesAndAnglescan be used to set the rotation around specific axes,fromEulerAnglescan be used to set the rotation based on euler angles androtateAroundcan be used to rotate the object around specific point relative to local origin.
- class PySide2.Qt3DCore.Qt3DCore.QTransform([parent=None])¶
- param parent:
Constructs a new
QTransformwithparent.
- static PySide2.Qt3DCore.Qt3DCore.QTransform.fromAxes(xAxis, yAxis, zAxis)¶
- Parameters:
xAxis –
PySide2.QtGui.QVector3DyAxis –
PySide2.QtGui.QVector3DzAxis –
PySide2.QtGui.QVector3D
- Return type:
Creates a QQuaterniom definining a rotation from the axes
xAxis,yAxisandzAxis.
- static PySide2.Qt3DCore.Qt3DCore.QTransform.fromAxesAndAngles(axis1, angle1, axis2, angle2)¶
- Parameters:
axis1 –
PySide2.QtGui.QVector3Dangle1 – float
axis2 –
PySide2.QtGui.QVector3Dangle2 – float
- Return type:
Creates a
QQuaternionfromaxis1,angle1,axis2, andangle2. Returns the resultingQQuaternion.
- static PySide2.Qt3DCore.Qt3DCore.QTransform.fromAxesAndAngles(axis1, angle1, axis2, angle2, axis3, angle3)
- Parameters:
axis1 –
PySide2.QtGui.QVector3Dangle1 – float
axis2 –
PySide2.QtGui.QVector3Dangle2 – float
axis3 –
PySide2.QtGui.QVector3Dangle3 – float
- Return type:
Creates a
QQuaternionfromaxis1,angle1,axis2,angle2,axis3, andangle3. Returns the resultingQQuaternion.
- static PySide2.Qt3DCore.Qt3DCore.QTransform.fromAxisAndAngle(x, y, z, angle)¶
- Parameters:
x – float
y – float
z – float
angle – float
- Return type:
Creates a
QQuaternionfromx,y,z, andangle. Returns the resultingQQuaternion.
- static PySide2.Qt3DCore.Qt3DCore.QTransform.fromAxisAndAngle(axis, angle)
- Parameters:
axis –
PySide2.QtGui.QVector3Dangle – float
- Return type:
Creates a
QQuaternionfromaxisandangle. Returns the resultingQQuaternion.
- static PySide2.Qt3DCore.Qt3DCore.QTransform.fromEulerAngles(eulerAngles)¶
- Parameters:
eulerAngles –
PySide2.QtGui.QVector3D- Return type:
Creates a
QQuaternionfromeulerAngles. Returns the resultingQQuaternion.
- static PySide2.Qt3DCore.Qt3DCore.QTransform.fromEulerAngles(pitch, yaw, roll)
- Parameters:
pitch – float
yaw – float
roll – float
- Return type:
Creates a
QQuaternionfrompitch,yaw, androll. Returns the resultingQQuaternion.
- PySide2.Qt3DCore.Qt3DCore.QTransform.matrix()¶
- Return type:
Holds the
QMatrix4x4of the transform.Note
When the matrix property is set, it is decomposed to translation, rotation and scale components.
- PySide2.Qt3DCore.Qt3DCore.QTransform.matrixChanged()¶
- static PySide2.Qt3DCore.Qt3DCore.QTransform.rotateAround(point, angle, axis)¶
- Parameters:
point –
PySide2.QtGui.QVector3Dangle – float
axis –
PySide2.QtGui.QVector3D
- Return type:
Creates a rotation matrix from
axisandanglearoundpoint. Returns the resultingQMatrix4x4.
- static PySide2.Qt3DCore.Qt3DCore.QTransform.rotateFromAxes(xAxis, yAxis, zAxis)¶
- Parameters:
xAxis –
PySide2.QtGui.QVector3DyAxis –
PySide2.QtGui.QVector3DzAxis –
PySide2.QtGui.QVector3D
- Return type:
Returns a rotation matrix defined from the axes
xAxis,yAxis,zAxis.
- PySide2.Qt3DCore.Qt3DCore.QTransform.rotation()¶
- Return type:
Holds the rotation of the transform as
QQuaternion.
- PySide2.Qt3DCore.Qt3DCore.QTransform.rotationChanged(rotation)¶
- Parameters:
rotation –
PySide2.QtGui.QQuaternion
- PySide2.Qt3DCore.Qt3DCore.QTransform.rotationX()¶
- Return type:
float
Holds the x rotation of the transform as Euler angle.
- PySide2.Qt3DCore.Qt3DCore.QTransform.rotationXChanged(rotationX)¶
- Parameters:
rotationX – float
- PySide2.Qt3DCore.Qt3DCore.QTransform.rotationY()¶
- Return type:
float
Holds the y rotation of the transform as Euler angle.
- PySide2.Qt3DCore.Qt3DCore.QTransform.rotationYChanged(rotationY)¶
- Parameters:
rotationY – float
- PySide2.Qt3DCore.Qt3DCore.QTransform.rotationZ()¶
- Return type:
float
Holds the z rotation of the transform as Euler angle.
- PySide2.Qt3DCore.Qt3DCore.QTransform.rotationZChanged(rotationZ)¶
- Parameters:
rotationZ – float
- PySide2.Qt3DCore.Qt3DCore.QTransform.scale()¶
- Return type:
float
Holds the uniform scale of the transform. If the scale has been set with
setScale3D, holds the x value only.
- PySide2.Qt3DCore.Qt3DCore.QTransform.scale3D()¶
- Return type:
Holds the scale of the transform as
QVector3D.
- PySide2.Qt3DCore.Qt3DCore.QTransform.scale3DChanged(scale)¶
- Parameters:
scale –
PySide2.QtGui.QVector3D
- PySide2.Qt3DCore.Qt3DCore.QTransform.scaleChanged(scale)¶
- Parameters:
scale – float
- PySide2.Qt3DCore.Qt3DCore.QTransform.setMatrix(matrix)¶
- Parameters:
matrix –
PySide2.QtGui.QMatrix4x4
Holds the
QMatrix4x4of the transform.Note
When the matrix property is set, it is decomposed to translation, rotation and scale components.
- PySide2.Qt3DCore.Qt3DCore.QTransform.setRotation(rotation)¶
- Parameters:
rotation –
PySide2.QtGui.QQuaternion
Holds the rotation of the transform as
QQuaternion.
- PySide2.Qt3DCore.Qt3DCore.QTransform.setRotationX(rotationX)¶
- Parameters:
rotationX – float
Holds the x rotation of the transform as Euler angle.
- PySide2.Qt3DCore.Qt3DCore.QTransform.setRotationY(rotationY)¶
- Parameters:
rotationY – float
Holds the y rotation of the transform as Euler angle.
- PySide2.Qt3DCore.Qt3DCore.QTransform.setRotationZ(rotationZ)¶
- Parameters:
rotationZ – float
Holds the z rotation of the transform as Euler angle.
- PySide2.Qt3DCore.Qt3DCore.QTransform.setScale(scale)¶
- Parameters:
scale – float
Holds the uniform scale of the transform. If the scale has been set with
setScale3D, holds the x value only.
- PySide2.Qt3DCore.Qt3DCore.QTransform.setScale3D(scale)¶
- Parameters:
scale –
PySide2.QtGui.QVector3D
Holds the scale of the transform as
QVector3D.
- PySide2.Qt3DCore.Qt3DCore.QTransform.setTranslation(translation)¶
- Parameters:
translation –
PySide2.QtGui.QVector3D
Holds the translation of the transform as
QVector3D.
- PySide2.Qt3DCore.Qt3DCore.QTransform.translation()¶
- Return type:
Holds the translation of the transform as
QVector3D.
- PySide2.Qt3DCore.Qt3DCore.QTransform.translationChanged(translation)¶
- Parameters:
translation –
PySide2.QtGui.QVector3D
- PySide2.Qt3DCore.Qt3DCore.QTransform.worldMatrix()¶
- Return type:
Holds the world transformation matrix for the transform. This assumes the
QTransformcomponent is being referenced by aQEntity. This makes it more convenient to identify when aQEntitypart of a subtree has been transformed in the world even though its local transformation might not have changed.
- PySide2.Qt3DCore.Qt3DCore.QTransform.worldMatrixChanged(worldMatrix)¶
- Parameters:
worldMatrix –
PySide2.QtGui.QMatrix4x4
© 2022 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.