Qt3DCore::QTransform Class
class Qt3DCore::QTransformメッシュに対して変形を行うために使用されます。詳細...
| ヘッダー: | #include <QTransform> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3DCore) target_link_libraries(mytarget PRIVATE Qt6::3DCore) |
| qmake: | QT += 3dcore |
| QML内: | Transform |
| 継承元: | Qt3DCore::QComponent |
| ステータス: | 非推奨 |
このクラスは非推奨です。新しいコードでの使用は強く推奨しません。
プロパティ
|
パブリック関数
| QTransform(Qt3DCore::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 |
| QMatrix4x4 | worldMatrix() 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) |
| void | worldMatrixChanged(const QMatrix4x4 &worldMatrix) |
静的パブリックメンバー
| QQuaternion | fromAxes(const QVector3D &xAxis, const QVector3D &yAxis, const QVector3D &zAxis) |
| 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) |
| QMatrix4x4 | rotateFromAxes(const QVector3D &xAxis, const QVector3D &yAxis, const QVector3D &zAxis) |
詳細な説明
QTransform コンポーネントは、複数のQEntity 間で共有することはできません。変換は、QVector3D (スケール)、QQuaternion (回転)、QVector3D (平行移動)の各コンポーネントとして保持されます。これらの変換は、その順序でメッシュに適用されます。QTransform::matrix プロパティが設定されると、それはこれらの変換コンポーネントに分解され、対応するシグナルがエミットされます。
QTransformの設定には、いくつかのヘルパー関数が用意されています。fromAxisAndAngle およびfromAxesAndAngles は特定の軸周りの回転を設定するために使用でき、fromEulerAngles はオイラー角に基づいて回転を設定するために使用でき、rotateAround はローカル原点に対する特定の点を中心にオブジェクトを回転させるために使用できます。
プロパティのドキュメント
matrix : QMatrix4x4
トランスフォームのQMatrix4x4 を保持します。
注: 行列プロパティが設定されると 、それは並進、回転、拡大縮小の各成分に分解されます。
アクセス関数:
| QMatrix4x4 | matrix() const |
| void | setMatrix(const QMatrix4x4 &matrix) |
通知シグナル:
| void | matrixChanged() |
rotation : QQuaternion
トランスフォームの回転を `QQuaternion` の形式で保持します。
アクセス関数:
| QQuaternion | rotation() const |
| void | setRotation(const QQuaternion &rotation) |
通知シグナル:
| void | rotationChanged(const QQuaternion &rotation) |
rotationX : float
トランスフォームのx軸周りの回転をオイラー角として保持します。
アクセス関数:
| float | rotationX() const |
| void | setRotationX(float rotationX) |
通知シグナル:
| void | rotationXChanged(float rotationX) |
rotationY : float
トランスフォームのY軸周りの回転をオイラー角として保持します。
アクセス関数:
| float | rotationY() const |
| void | setRotationY(float rotationY) |
通知信号:
| void | rotationYChanged(float rotationY) |
rotationZ : float
トランスフォームのZ軸周りの回転をオイラー角として保持します。
アクセス関数:
| float | rotationZ() const |
| void | setRotationZ(float rotationZ) |
通知シグナル:
| void | rotationZChanged(float rotationZ) |
scale : float
変換の均一なスケールを保持します。setScale3D でスケールが設定されている場合は、x値のみを保持します。
アクセス関数:
| float | scale() const |
| void | setScale(float scale) |
通知シグナル:
| void | scaleChanged(float scale) |
scale3D : QVector3D
変換のスケールをQVector3D として保持します。
アクセス関数:
| QVector3D | scale3D() const |
| void | setScale3D(const QVector3D &scale) |
通知信号:
| void | scale3DChanged(const QVector3D &scale) |
translation : QVector3D
変換の変換行列をQVector3D として保持します。
アクセス関数:
| QVector3D | translation() const |
| void | setTranslation(const QVector3D &translation) |
通知シグナル:
| void | translationChanged(const QVector3D &translation) |
[read-only] worldMatrix : QMatrix4x4
変換のためのワールド変換行列を保持します。これは、QTransform コンポーネントがQEntityによって参照されていることを前提としています。これにより、サブツリーを構成するQEntityの一部が、ローカル変換は変更されていないにもかかわらず、ワールド座標系で変換されたかどうかを容易に特定できるようになります。
アクセス関数:
| QMatrix4x4 | worldMatrix() const |
通知シグナル:
| void | worldMatrixChanged(const QMatrix4x4 &worldMatrix) |
メンバ関数のドキュメント
[explicit] QTransform::QTransform(Qt3DCore::QNode *parent = nullptr)
parent を使用して、新しいQTransformを構築します。
[static invokable] QQuaternion QTransform::fromAxes(const QVector3D &xAxis, const QVector3D &yAxis, const QVector3D &zAxis)
xAxis 、yAxis 、zAxis の各軸からの回転を定義する QQuaterniom を作成します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[static invokable] QQuaternion QTransform::fromAxesAndAngles(const QVector3D &axis1, float angle1, const QVector3D &axis2, float angle2)
axis1 、angle1 、axis2 、およびangle2 から、QQuaternion を作成します。結果として得られるQQuaternion を返します。
注:この関数は 、メタオブジェクトシステムを介して、またQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[static invokable] QQuaternion QTransform::fromAxesAndAngles(const QVector3D &axis1, float angle1, const QVector3D &axis2, float angle2, const QVector3D &axis3, float angle3)
axis1 、angle1 、axis2 、angle2 、axis3 、およびangle3 から、QQuaternion を作成します。結果として得られるQQuaternion を返します。
注:この関数は 、メタオブジェクトシステムを介して、およびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[static invokable] QQuaternion QTransform::fromAxisAndAngle(const QVector3D &axis, float angle)
axis およびangle からQQuaternion を作成します。結果として得られるQQuaternion を返します。
注:この関数は 、メタオブジェクトシステムを介して、またはQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[static invokable] QQuaternion QTransform::fromAxisAndAngle(float x, float y, float z, float angle)
x 、y 、z 、およびangle から、QQuaternion を作成します。結果として得られたQQuaternion を返します。
注:この関数は 、メタオブジェクトシステムを介して、およびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[static invokable] QQuaternion QTransform::fromEulerAngles(const QVector3D &eulerAngles)
eulerAngles からQQuaternion を作成します。結果として得られたQQuaternion を返します。
注:この関数は 、メタオブジェクトシステムを介して、および QML から呼び出すことができます。Q_INVOKABLE を参照してください。
[static invokable] QQuaternion QTransform::fromEulerAngles(float pitch, float yaw, float roll)
pitch 、yaw 、およびroll からQQuaternion を作成します。結果として得られるQQuaternion を返します。
注:この関数は 、メタオブジェクトシステムを介して、またはQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[static invokable] QMatrix4x4 QTransform::rotateAround(const QVector3D &point, float angle, const QVector3D &axis)
axis およびangle を用いて、point を中心とする回転行列を作成します。結果として得られるQMatrix4x4 を返します。
注:この関数は 、メタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[static invokable] QMatrix4x4 QTransform::rotateFromAxes(const QVector3D &xAxis, const QVector3D &yAxis, const QVector3D &zAxis)
xAxis 、yAxis 、zAxis の各軸に基づいて定義された回転行列を返します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
QMatrix4x4 QTransform::worldMatrix() const
QEntity階層の一部である可能性のあるQEntityから参照された場合、そのQTransform に関連付けられたワールド変換行列を返します。
注: プロパティ worldMatrix のゲッター関数です 。
© 2026 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.