class QTransform

Used to perform transforms on meshes. More

Inheritance diagram of PySide6.Qt3DCore.Qt3DCore.QTransform

Synopsis

Properties

Methods

Slots

Signals

Static functions

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.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property matrixᅟ: 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:
property rotationᅟ: QQuaternion

Holds the rotation of the transform as QQuaternion.

Access functions:
property rotationXᅟ: float

Holds the x rotation of the transform as Euler angle.

Access functions:
property rotationYᅟ: float

Holds the y rotation of the transform as Euler angle.

Access functions:
property rotationZᅟ: float

Holds the z rotation of the transform as Euler angle.

Access functions:
property scaleᅟ: float

Holds the uniform scale of the transform. If the scale has been set with setScale3D , holds the x value only.

Access functions:
property scale3Dᅟ: QVector3D

Holds the scale of the transform as QVector3D.

Access functions:
property translationᅟ: QVector3D

Holds the translation of the transform as QVector3D.

Access functions:
property worldMatrixᅟ: 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:
__init__([parent=None])
Parameters:

parentQNode

Constructs a new QTransform with parent.

static fromAxes(xAxis, yAxis, zAxis)
Parameters:
Return type:

QQuaternion

Creates a QQuaterniom definining a rotation from the axes xAxis, yAxis and zAxis.

static fromAxesAndAngles(axis1, angle1, axis2, angle2)
Parameters:
Return type:

QQuaternion

Creates a QQuaternion from axis1, angle1, axis2, and angle2. Returns the resulting QQuaternion.

static fromAxesAndAngles(axis1, angle1, axis2, angle2, axis3, angle3)
Parameters:
Return type:

QQuaternion

Creates a QQuaternion from axis1, angle1, axis2, angle2, axis3, and angle3. Returns the resulting QQuaternion.

static fromAxisAndAngle(axis, angle)
Parameters:
Return type:

QQuaternion

Creates a QQuaternion from axis and angle. Returns the resulting QQuaternion.

static fromAxisAndAngle(x, y, z, angle)
Parameters:
  • x – float

  • y – float

  • z – float

  • angle – float

Return type:

QQuaternion

Creates a QQuaternion from x, y, z, and angle. Returns the resulting QQuaternion.

static fromEulerAngles(eulerAngles)
Parameters:

eulerAnglesQVector3D

Return type:

QQuaternion

Creates a QQuaternion from eulerAngles. Returns the resulting QQuaternion.

static fromEulerAngles(pitch, yaw, roll)
Parameters:
  • pitch – float

  • yaw – float

  • roll – float

Return type:

QQuaternion

Creates a QQuaternion from pitch, yaw, and roll. Returns the resulting QQuaternion.

matrix()
Return type:

QMatrix4x4

See also

setMatrix()

Getter of property matrixᅟ .

matrixChanged()

Notification signal of property matrixᅟ .

static rotateAround(point, angle, axis)
Parameters:
Return type:

QMatrix4x4

Creates a rotation matrix from axis and angle around point. Returns the resulting QMatrix4x4.

static rotateFromAxes(xAxis, yAxis, zAxis)
Parameters:
Return type:

QMatrix4x4

Returns a rotation matrix defined from the axes xAxis, yAxis, zAxis.

rotation()
Return type:

QQuaternion

See also

setRotation()

Getter of property rotationᅟ .

rotationChanged(rotation)
Parameters:

rotationQQuaternion

Notification signal of property rotationᅟ .

rotationX()
Return type:

float

See also

setRotationX()

Getter of property rotationXᅟ .

rotationXChanged(rotationX)
Parameters:

rotationX – float

Notification signal of property rotationXᅟ .

rotationY()
Return type:

float

See also

setRotationY()

Getter of property rotationYᅟ .

rotationYChanged(rotationY)
Parameters:

rotationY – float

Notification signal of property rotationYᅟ .

rotationZ()
Return type:

float

See also

setRotationZ()

Getter of property rotationZᅟ .

rotationZChanged(rotationZ)
Parameters:

rotationZ – float

Notification signal of property rotationZᅟ .

scale()
Return type:

float

See also

setScale()

Getter of property scaleᅟ .

scale3D()
Return type:

QVector3D

See also

setScale3D()

Getter of property scale3Dᅟ .

scale3DChanged(scale)
Parameters:

scaleQVector3D

Notification signal of property scale3Dᅟ .

scaleChanged(scale)
Parameters:

scale – float

Notification signal of property scaleᅟ .

setMatrix(matrix)
Parameters:

matrixQMatrix4x4

See also

matrix()

Setter of property matrixᅟ .

setRotation(rotation)
Parameters:

rotationQQuaternion

See also

rotation()

Setter of property rotationᅟ .

setRotationX(rotationX)
Parameters:

rotationX – float

See also

rotationX()

Setter of property rotationXᅟ .

setRotationY(rotationY)
Parameters:

rotationY – float

See also

rotationY()

Setter of property rotationYᅟ .

setRotationZ(rotationZ)
Parameters:

rotationZ – float

See also

rotationZ()

Setter of property rotationZᅟ .

setScale(scale)
Parameters:

scale – float

See also

scale()

Setter of property scaleᅟ .

setScale3D(scale)
Parameters:

scaleQVector3D

See also

scale3D()

Setter of property scale3Dᅟ .

setTranslation(translation)
Parameters:

translationQVector3D

See also

translation()

Setter of property translationᅟ .

translation()
Return type:

QVector3D

See also

setTranslation()

Getter of property translationᅟ .

translationChanged(translation)
Parameters:

translationQVector3D

Notification signal of property translationᅟ .

worldMatrix()
Return type:

QMatrix4x4

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ᅟ .

worldMatrixChanged(worldMatrix)
Parameters:

worldMatrixQMatrix4x4

Notification signal of property worldMatrixᅟ .