Used to perform transforms on meshes. 更多 …
def
matrix
()
def
rotation
()
def
rotationX
()
def
rotationY
()
def
rotationZ
()
def
scale3D
()
def
scale
()
def
translation
()
def
worldMatrix
()
def
setMatrix
(matrix)
def
setRotation
(rotation)
def
setRotationX
(rotationX)
def
setRotationY
(rotationY)
def
setRotationZ
(rotationZ)
def
setScale3D
(scale)
def
setScale
(scale)
def
setTranslation
(translation)
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)
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)
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.
PySide2.Qt3DCore.Qt3DCore.
QTransform
(
[
parent=None
]
)
¶
- param parent
QNode
构造新
QTransform
with
parent
.
PySide2.Qt3DCore.Qt3DCore.QTransform.
fromAxes
(
xAxis
,
yAxis
,
zAxis
)
¶
xAxis
–
QVector3D
yAxis
–
QVector3D
zAxis
–
QVector3D
QQuaternion
Creates a QQuaterniom definining a rotation from the axes
xAxis
,
yAxis
and
zAxis
.
PySide2.Qt3DCore.Qt3DCore.QTransform.
fromAxesAndAngles
(
axis1
,
angle1
,
axis2
,
angle2
)
¶
axis1
–
QVector3D
angle1
–
float
axis2
–
QVector3D
angle2
–
float
QQuaternion
创建
QQuaternion
from
axis1
,
angle1
,
axis2
,和
angle2
. Returns the resulting
QQuaternion
.
PySide2.Qt3DCore.Qt3DCore.QTransform.
fromAxesAndAngles
(
axis1
,
angle1
,
axis2
,
angle2
,
axis3
,
angle3
)
¶
axis1
–
QVector3D
angle1
–
float
axis2
–
QVector3D
angle2
–
float
axis3
–
QVector3D
angle3
–
float
QQuaternion
创建
QQuaternion
from
axis1
,
angle1
,
axis2
,
angle2
,
axis3
,和
angle3
. Returns the resulting
QQuaternion
.
PySide2.Qt3DCore.Qt3DCore.QTransform.
fromAxisAndAngle
(
x
,
y
,
z
,
angle
)
¶
x
–
float
y
–
float
z
–
float
angle
–
float
QQuaternion
创建
QQuaternion
from
x
,
y
,
z
,和
angle
. Returns the resulting
QQuaternion
.
PySide2.Qt3DCore.Qt3DCore.QTransform.
fromAxisAndAngle
(
axis
,
angle
)
¶
axis
–
QVector3D
angle
–
float
QQuaternion
创建
QQuaternion
from
axis
and
angle
. Returns the resulting
QQuaternion
.
PySide2.Qt3DCore.Qt3DCore.QTransform.
fromEulerAngles
(
eulerAngles
)
¶
eulerAngles
–
QVector3D
QQuaternion
创建
QQuaternion
from
eulerAngles
. Returns the resulting
QQuaternion
.
PySide2.Qt3DCore.Qt3DCore.QTransform.
fromEulerAngles
(
pitch
,
yaw
,
roll
)
¶
pitch
–
float
yaw
–
float
roll
–
float
QQuaternion
创建
QQuaternion
from
pitch
,
yaw
,和
roll
. Returns the resulting
QQuaternion
.
PySide2.Qt3DCore.Qt3DCore.QTransform.
matrix
(
)
¶
QMatrix4x4
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
matrixChanged
(
)
¶
PySide2.Qt3DCore.Qt3DCore.QTransform.
rotateAround
(
point
,
angle
,
axis
)
¶
point
–
QVector3D
angle
–
float
axis
–
QVector3D
QMatrix4x4
Creates a rotation matrix from
axis
and
angle
around
point
. Returns the resulting
QMatrix4x4
.
PySide2.Qt3DCore.Qt3DCore.QTransform.
rotateFromAxes
(
xAxis
,
yAxis
,
zAxis
)
¶
xAxis
–
QVector3D
yAxis
–
QVector3D
zAxis
–
QVector3D
QMatrix4x4
Returns a rotation matrix defined from the axes
xAxis
,
yAxis
,
zAxis
.
PySide2.Qt3DCore.Qt3DCore.QTransform.
rotation
(
)
¶
QQuaternion
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
rotationChanged
(
rotation
)
¶
rotation
–
QQuaternion
PySide2.Qt3DCore.Qt3DCore.QTransform.
rotationX
(
)
¶
float
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
rotationXChanged
(
rotationX
)
¶
rotationX
–
float
PySide2.Qt3DCore.Qt3DCore.QTransform.
rotationY
(
)
¶
float
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
rotationYChanged
(
rotationY
)
¶
rotationY
–
float
PySide2.Qt3DCore.Qt3DCore.QTransform.
rotationZ
(
)
¶
float
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
rotationZChanged
(
rotationZ
)
¶
rotationZ
–
float
PySide2.Qt3DCore.Qt3DCore.QTransform.
scale
(
)
¶
float
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
scale3D
(
)
¶
QVector3D
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
scale3DChanged
(
scale
)
¶
scale
–
QVector3D
PySide2.Qt3DCore.Qt3DCore.QTransform.
scaleChanged
(
scale
)
¶
scale
–
float
PySide2.Qt3DCore.Qt3DCore.QTransform.
setRotation
(
rotation
)
¶
rotation
–
QQuaternion
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
setRotationX
(
rotationX
)
¶
rotationX
–
float
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
setRotationY
(
rotationY
)
¶
rotationY
–
float
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
setRotationZ
(
rotationZ
)
¶
rotationZ
–
float
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
setTranslation
(
translation
)
¶
translation
–
QVector3D
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
translation
(
)
¶
QVector3D
另请参阅
PySide2.Qt3DCore.Qt3DCore.QTransform.
translationChanged
(
translation
)
¶
translation
–
QVector3D
PySide2.Qt3DCore.Qt3DCore.QTransform.
worldMatrix
(
)
¶
QMatrix4x4
Returns the world transformation matrix associated to the
QTransform
when referenced by a
QEntity
which may be part of a
QEntity
hierarchy.
PySide2.Qt3DCore.Qt3DCore.QTransform.
worldMatrixChanged
(
worldMatrix
)
¶
worldMatrix
–
QMatrix4x4