Used to perform transforms on meshes 更多...
头: | #include < QTransform > |
qmake: | QT += 3dcore |
Since: | Qt 5.6 |
实例化: | Transform |
继承: | Qt3DCore::QComponent |
|
QTransform (QNode * parent = nullptr) | |
QMatrix4x4 | matrix () const |
QQuaternion | rotation () const |
float | rotationX () const |
float | rotationY () const |
float | rotationZ () const |
float | scale () const |
QVector3D | scale3D () const |
QVector3D | translation () const |
void | setMatrix (const QMatrix4x4 & matrix ) |
void | setRotation (const QQuaternion & rotation ) |
void | setRotationX (float rotationX ) |
void | setRotationY (float rotationY ) |
void | setRotationZ (float rotationZ ) |
void | setScale (float scale ) |
void | setScale3D (const QVector3D & scale ) |
void | setTranslation (const QVector3D & translation ) |
void | matrixChanged () |
void | rotationChanged (const QQuaternion & rotation ) |
void | rotationXChanged (float rotationX ) |
void | rotationYChanged (float rotationY ) |
void | rotationZChanged (float rotationZ ) |
void | scale3DChanged (const QVector3D & scale ) |
void | scaleChanged (float scale ) |
void | translationChanged (const QVector3D & translation ) |
QQuaternion | fromAxesAndAngles (const QVector3D & axis1 , float angle1 , const QVector3D & axis2 , float angle2 ) |
QQuaternion | fromAxesAndAngles (const QVector3D & axis1 , float angle1 , const QVector3D & axis2 , float angle2 , const QVector3D & axis3 , float angle3 ) |
QQuaternion | fromAxisAndAngle (const QVector3D & axis , float angle ) |
QQuaternion | fromAxisAndAngle (float x , float y , float z , float angle ) |
QQuaternion | fromEulerAngles (const QVector3D & eulerAngles ) |
QQuaternion | fromEulerAngles (float pitch , float yaw , float roll ) |
QMatrix4x4 | rotateAround (const QVector3D & point , float angle , const QVector3D & axis ) |
Used to perform transforms on meshes
The QTransform component is not shareable between multiple QEntity 。变换的保持如 QVector3D 比例, QQuaternion 旋转和 QVector3D translation components. The transformations are applied to the mesh in that order. When QTransform::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.
保持 QMatrix4x4 of the transform.
注意: When the matrix property is set, it is decomposed to translation, rotation and scale components.
访问函数:
QMatrix4x4 | matrix () const |
void | setMatrix (const QMatrix4x4 & matrix ) |
通知程序信号:
void | matrixChanged () |
Holds the rotation of the transform as QQuaternion .
访问函数:
QQuaternion | rotation () const |
void | setRotation (const QQuaternion & rotation ) |
通知程序信号:
void | rotationChanged (const QQuaternion & rotation ) |
Holds the x rotation of the transform as Euler angle.
访问函数:
float | rotationX () const |
void | setRotationX (float rotationX ) |
通知程序信号:
void | rotationXChanged (float rotationX ) |
Holds the y rotation of the transform as Euler angle.
访问函数:
float | rotationY () const |
void | setRotationY (float rotationY ) |
通知程序信号:
void | rotationYChanged (float rotationY ) |
Holds the z rotation of the transform as Euler angle.
访问函数:
float | rotationZ () const |
void | setRotationZ (float rotationZ ) |
通知程序信号:
void | rotationZChanged (float rotationZ ) |
Holds the uniform scale of the transform. If the scale has been set with setScale3D , holds the x value only.
访问函数:
float | scale () const |
void | setScale (float scale ) |
通知程序信号:
void | scaleChanged (float scale ) |
Holds the scale of the transform as QVector3D .
访问函数:
QVector3D | scale3D () const |
void | setScale3D (const QVector3D & scale ) |
通知程序信号:
void | scale3DChanged (const QVector3D & scale ) |
Holds the translation of the transform as QVector3D .
访问函数:
QVector3D | translation () const |
void | setTranslation (const QVector3D & translation ) |
通知程序信号:
void | translationChanged (const QVector3D & translation ) |
构造新的 QTransform with parent .
[static]
QQuaternion
QTransform::
fromAxesAndAngles
(const
QVector3D
&
axis1
,
float
angle1
, const
QVector3D
&
axis2
,
float
angle2
)
创建 QQuaternion from axis1 , angle1 , axis2 ,和 angle2 . Returns the resulting QQuaternion .
[static]
QQuaternion
QTransform::
fromAxesAndAngles
(const
QVector3D
&
axis1
,
float
angle1
, const
QVector3D
&
axis2
,
float
angle2
, const
QVector3D
&
axis3
,
float
angle3
)
创建 QQuaternion from axis1 , angle1 , axis2 , angle2 , axis3 ,和 angle3 . Returns the resulting QQuaternion .
[static]
QQuaternion
QTransform::
fromAxisAndAngle
(const
QVector3D
&
axis
,
float
angle
)
创建 QQuaternion from axis and angle . Returns the resulting QQuaternion .
[static]
QQuaternion
QTransform::
fromAxisAndAngle
(
float
x
,
float
y
,
float
z
,
float
angle
)
创建 QQuaternion from x , y , z ,和 angle . Returns the resulting QQuaternion .
[static]
QQuaternion
QTransform::
fromEulerAngles
(const
QVector3D
&
eulerAngles
)
创建 QQuaternion from eulerAngles . Returns the resulting QQuaternion .
[static]
QQuaternion
QTransform::
fromEulerAngles
(
float
pitch
,
float
yaw
,
float
roll
)
创建 QQuaternion from pitch , yaw ,和 roll . Returns the resulting QQuaternion .
[static]
QMatrix4x4
QTransform::
rotateAround
(const
QVector3D
&
point
,
float
angle
, const
QVector3D
&
axis
)
Creates a rotation matrix from axis and angle around point . Returns the resulting QMatrix4x4 .