QTransform#
Used to perform transforms on meshes. More…
Synopsis#
Properties#
Functions#
def
matrix
()def
rotation
()def
rotationX
()def
rotationY
()def
rotationZ
()def
scale
()def
scale3D
()def
translation
()def
worldMatrix
()
Slots#
def
setMatrix
(matrix)def
setRotation
(rotation)def
setRotationX
(rotationX)def
setRotationY
(rotationY)def
setRotationZ
(rotationZ)def
setScale
(scale)def
setScale3D
(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)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
The QTransform
component is not shareable between multiple QEntity
‘s. The transformation is held as QVector3D
scale, QQuaternion
rotation and QVector3D
translation components. The transformations are applied to the mesh in that order. When matrix
property is set, it is decomposed to these transform components and corresponding signals are emitted.
Several helper functions are provided to set up the QTransform
; fromAxisAndAngle
and fromAxesAndAngles
can be used to set the rotation around specific axes, fromEulerAngles
can be used to set the rotation based on euler angles and rotateAround
can be used to rotate the object around specific point relative to local origin.
- class PySide6.Qt3DCore.Qt3DCore.QTransform([parent=None])#
- Parameters:
parent –
PySide6.Qt3DCore.Qt3DCore.QNode
Constructs a new QTransform
with parent
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.Qt3DCore.Qt3DCore.QTransform.matrix: PySide6.QtGui.QMatrix4x4#
Holds the QMatrix4x4
of the transform.
Note
When the matrix property is set, it is decomposed to translation, rotation and scale components.
- Access functions:
matrix
()setMatrix
(matrix)Signal
matrixChanged
()
- property PᅟySide6.Qt3DCore.Qt3DCore.QTransform.rotation: PySide6.QtGui.QQuaternion#
Holds the rotation of the transform as QQuaternion
.
- Access functions:
rotation
()setRotation
(rotation)Signal
rotationChanged
(rotation)
- property PᅟySide6.Qt3DCore.Qt3DCore.QTransform.rotationX: float#
Holds the x rotation of the transform as Euler angle.
- Access functions:
rotationX
()setRotationX
(rotationX)Signal
rotationXChanged
(rotationX)
- property PᅟySide6.Qt3DCore.Qt3DCore.QTransform.rotationY: float#
Holds the y rotation of the transform as Euler angle.
- Access functions:
rotationY
()setRotationY
(rotationY)Signal
rotationYChanged
(rotationY)
- property PᅟySide6.Qt3DCore.Qt3DCore.QTransform.rotationZ: float#
Holds the z rotation of the transform as Euler angle.
- Access functions:
rotationZ
()setRotationZ
(rotationZ)Signal
rotationZChanged
(rotationZ)
- property PᅟySide6.Qt3DCore.Qt3DCore.QTransform.scale: float#
Holds the uniform scale of the transform. If the scale has been set with setScale3D
, holds the x value only.
- Access functions:
scale
()setScale
(scale)Signal
scaleChanged
(scale)
- property PᅟySide6.Qt3DCore.Qt3DCore.QTransform.scale3D: PySide6.QtGui.QVector3D#
Holds the scale of the transform as QVector3D
.
- Access functions:
scale3D
()setScale3D
(scale)Signal
scale3DChanged
(scale)
- property PᅟySide6.Qt3DCore.Qt3DCore.QTransform.translation: PySide6.QtGui.QVector3D#
Holds the translation of the transform as QVector3D
.
- Access functions:
translation
()setTranslation
(translation)Signal
translationChanged
(translation)
- property PᅟySide6.Qt3DCore.Qt3DCore.QTransform.worldMatrix: PySide6.QtGui.QMatrix4x4#
Holds the world transformation matrix for the transform. This assumes the QTransform
component is being referenced by a QEntity
. This makes it more convenient to identify when a QEntity
part of a subtree has been transformed in the world even though its local transformation might not have changed.
- Access functions:
worldMatrix
()Signal
worldMatrixChanged
(worldMatrix)
- static PySide6.Qt3DCore.Qt3DCore.QTransform.fromAxes(xAxis, yAxis, zAxis)#
- Parameters:
xAxis –
PySide6.QtGui.QVector3D
yAxis –
PySide6.QtGui.QVector3D
zAxis –
PySide6.QtGui.QVector3D
- Return type:
Creates a QQuaterniom definining a rotation from the axes xAxis
, yAxis
and zAxis
.
- static PySide6.Qt3DCore.Qt3DCore.QTransform.fromAxesAndAngles(axis1, angle1, axis2, angle2)#
- Parameters:
axis1 –
PySide6.QtGui.QVector3D
angle1 – float
axis2 –
PySide6.QtGui.QVector3D
angle2 – float
- Return type:
Creates a QQuaternion
from axis1
, angle1
, axis2
, and angle2
. Returns the resulting QQuaternion
.
- static PySide6.Qt3DCore.Qt3DCore.QTransform.fromAxesAndAngles(axis1, angle1, axis2, angle2, axis3, angle3)
- Parameters:
axis1 –
PySide6.QtGui.QVector3D
angle1 – float
axis2 –
PySide6.QtGui.QVector3D
angle2 – float
axis3 –
PySide6.QtGui.QVector3D
angle3 – float
- Return type:
Creates a QQuaternion
from axis1
, angle1
, axis2
, angle2
, axis3
, and angle3
. Returns the resulting QQuaternion
.
- static PySide6.Qt3DCore.Qt3DCore.QTransform.fromAxisAndAngle(axis, angle)#
- Parameters:
axis –
PySide6.QtGui.QVector3D
angle – float
- Return type:
Creates a QQuaternion
from axis
and angle
. Returns the resulting QQuaternion
.
- static PySide6.Qt3DCore.Qt3DCore.QTransform.fromAxisAndAngle(x, y, z, angle)
- Parameters:
x – float
y – float
z – float
angle – float
- Return type:
Creates a QQuaternion
from x
, y
, z
, and angle
. Returns the resulting QQuaternion
.
- static PySide6.Qt3DCore.Qt3DCore.QTransform.fromEulerAngles(eulerAngles)#
- Parameters:
eulerAngles –
PySide6.QtGui.QVector3D
- Return type:
Creates a QQuaternion
from eulerAngles
. Returns the resulting QQuaternion
.
- static PySide6.Qt3DCore.Qt3DCore.QTransform.fromEulerAngles(pitch, yaw, roll)
- Parameters:
pitch – float
yaw – float
roll – float
- Return type:
Creates a QQuaternion
from pitch
, yaw
, and roll
. Returns the resulting QQuaternion
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.matrix()#
- Return type:
See also
setMatrix()
Getter of property matrix
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.matrixChanged()#
Notification signal of property matrix
.
- static PySide6.Qt3DCore.Qt3DCore.QTransform.rotateAround(point, angle, axis)#
- Parameters:
point –
PySide6.QtGui.QVector3D
angle – float
axis –
PySide6.QtGui.QVector3D
- Return type:
Creates a rotation matrix from axis
and angle
around point
. Returns the resulting QMatrix4x4
.
- static PySide6.Qt3DCore.Qt3DCore.QTransform.rotateFromAxes(xAxis, yAxis, zAxis)#
- Parameters:
xAxis –
PySide6.QtGui.QVector3D
yAxis –
PySide6.QtGui.QVector3D
zAxis –
PySide6.QtGui.QVector3D
- Return type:
Returns a rotation matrix defined from the axes xAxis
, yAxis
, zAxis
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.rotation()#
- Return type:
See also
setRotation()
Getter of property rotation
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.rotationChanged(rotation)#
- Parameters:
rotation –
PySide6.QtGui.QQuaternion
Notification signal of property rotation
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.rotationX()#
- Return type:
float
See also
setRotationX()
Getter of property rotationX
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.rotationXChanged(rotationX)#
- Parameters:
rotationX – float
Notification signal of property rotationX
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.rotationY()#
- Return type:
float
See also
setRotationY()
Getter of property rotationY
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.rotationYChanged(rotationY)#
- Parameters:
rotationY – float
Notification signal of property rotationY
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.rotationZ()#
- Return type:
float
See also
setRotationZ()
Getter of property rotationZ
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.rotationZChanged(rotationZ)#
- Parameters:
rotationZ – float
Notification signal of property rotationZ
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.scale()#
- Return type:
float
See also
setScale()
Getter of property scale
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.scale3D()#
- Return type:
See also
setScale3D()
Getter of property scale3D
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.scale3DChanged(scale)#
- Parameters:
scale –
PySide6.QtGui.QVector3D
Notification signal of property scale3D
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.scaleChanged(scale)#
- Parameters:
scale – float
Notification signal of property scale
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.setMatrix(matrix)#
- Parameters:
matrix –
PySide6.QtGui.QMatrix4x4
See also
matrix()
Setter of property matrix
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.setRotation(rotation)#
- Parameters:
rotation –
PySide6.QtGui.QQuaternion
See also
rotation()
Setter of property rotation
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.setRotationX(rotationX)#
- Parameters:
rotationX – float
See also
rotationX()
Setter of property rotationX
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.setRotationY(rotationY)#
- Parameters:
rotationY – float
See also
rotationY()
Setter of property rotationY
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.setRotationZ(rotationZ)#
- Parameters:
rotationZ – float
See also
rotationZ()
Setter of property rotationZ
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.setScale(scale)#
- Parameters:
scale – float
See also
scale()
Setter of property scale
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.setScale3D(scale)#
- Parameters:
scale –
PySide6.QtGui.QVector3D
See also
scale3D()
Setter of property scale3D
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.setTranslation(translation)#
- Parameters:
translation –
PySide6.QtGui.QVector3D
See also
translation()
Setter of property translation
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.translation()#
- Return type:
See also
setTranslation()
Getter of property translation
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.translationChanged(translation)#
- Parameters:
translation –
PySide6.QtGui.QVector3D
Notification signal of property translation
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.worldMatrix()#
- Return type:
Returns the world transformation matrix associated to the QTransform
when referenced by a QEntity
which may be part of a QEntity
hierarchy.
Getter of property worldMatrix
.
- PySide6.Qt3DCore.Qt3DCore.QTransform.worldMatrixChanged(worldMatrix)#
- Parameters:
worldMatrix –
PySide6.QtGui.QMatrix4x4
Notification signal of property worldMatrix
.