このページでは

Qt3DAnimation::QMorphingAnimation Class

class Qt3DAnimation::QMorphingAnimation

ブレンドシェイプによるモーフィングアニメーションを実装したクラス。詳細...

ヘッダー: #include <qmorphinganimation.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3danimation)
target_link_libraries(mytarget PRIVATE Qt6::3danimation)
qmake: QT += 3danimation
QML内: MorphingAnimation
継承元: Qt3DAnimation::QAbstractAnimation
ステータス: テクノロジープレビュー

このクラスはテクノロジープレビュー段階にあり、変更される可能性があります。

パブリック型

enum Method { Normalized, Relative }

プロパティ

パブリック関数

QMorphingAnimation(QObject *parent = nullptr)
void addMorphTarget(Qt3DAnimation::QMorphTarget *target)
QEasingCurve easing() const
QVector<float> getWeights(int positionIndex)
float interpolator() const
Qt3DAnimation::QMorphingAnimation::Method method() const
QVector<Qt3DAnimation::QMorphTarget *> morphTargetList()
void removeMorphTarget(Qt3DAnimation::QMorphTarget *target)
void setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)
void setWeights(int positionIndex, const QVector<float> &weights)
Qt3DRender::QGeometryRenderer *target() const
QString targetName() const
QVector<float> targetPositions() const

パブリックスロット

void setEasing(const QEasingCurve &easing)
void setMethod(Qt3DAnimation::QMorphingAnimation::Method method)
void setTarget(Qt3DRender::QGeometryRenderer *target)
void setTargetName(const QString name)
void setTargetPositions(const QVector<float> &targetPositions)

シグナル

void easingChanged(const QEasingCurve &easing)
void interpolatorChanged(float interpolator)
void methodChanged(Qt3DAnimation::QMorphingAnimation::Method method)
void targetChanged(Qt3DRender::QGeometryRenderer *target)
void targetNameChanged(const QString &name)
void targetPositionsChanged(const QVector<float> &targetPositions)

詳細な説明

Qt3DAnimation::QMorphingAnimation クラスは、ターゲットのQGeometryRenderer に対するブレンドシェイプ・モーフィングアニメーションを実装します。QMorphingAnimationは、morph targets からターゲットのQGeometryRenderer::geometry へ正しいQAttributes を設定し、現在の位置に対する補間関数を計算します。 属性間の実際のブレンドは、マテリアル内で実装する必要があります。Qt3DAnimation::QMorphPhongMaterialは、Phongライティングモデル向けのモーフィング対応マテリアルを実装しています。ブレンドは、「base」と「target」という2つの属性間で行われます。 ベース属性とターゲット属性の名称は、モーフターゲットの名称から取得されます。この際、ベース属性は既存の名称を保持し、ターゲット属性の名称には「Target」が末尾に付加されます。補間関数は、使用されるマテリアルに対するQParameter として設定できます。アニメーション内のすべてのモーフターゲットには、ベースジオメトリ内の属性と同じ名称の属性が含まれている必要があります。

メンバータイプのドキュメント

enum QMorphingAnimation::Method

この列挙型は、モーフィング方式を指定します。

定数値説明
Qt3DAnimation::QMorphingAnimation::Normalized0ブレンディングには、正規化された式 V' = Vbase * (1.0 - sum(Wi)) + sum[Vi * Wi] を使用する必要があります。
Qt3DAnimation::QMorphingAnimation::Relative1ブレンドには、相対式 V' = Vbase + sum[Vi * Wi] を使用します。

プロパティのドキュメント

easing : QEasingCurve

モーフターゲット間の補間器のイージングカーブを保持します。

アクセス関数:

QEasingCurve easing() const
void setEasing(const QEasingCurve &easing)

通知シグナル:

void easingChanged(const QEasingCurve &easing)

[read-only] interpolator : float

ベース属性とターゲット属性の間の補間値を保持します。

アクセス関数:

float interpolator() const

通知信号:

void interpolatorChanged(float interpolator)

method : Method

モーフィング方式を指定します。デフォルトは「相対」です。

アクセス関数:

Qt3DAnimation::QMorphingAnimation::Method method() const
void setMethod(Qt3DAnimation::QMorphingAnimation::Method method)

通知シグナル:

void methodChanged(Qt3DAnimation::QMorphingAnimation::Method method)

target : Qt3DRender::QGeometryRenderer*

モーフィングアニメーションが適用される対象の QGeometryRenderer を保持します。

アクセス関数:

Qt3DRender::QGeometryRenderer *target() const
void setTarget(Qt3DRender::QGeometryRenderer *target)

Notifier シグナル:

void targetChanged(Qt3DRender::QGeometryRenderer *target)

targetName : QString

ターゲットジオメトリの名前を保持します。これは、ターゲットジオメトリをモーフィングアニメーションと照合しやすくするための便利なプロパティです。この名前は通常、ターゲットの QGeometryRenderer の親エンティティの名前と同じですが、必ずしもそうである必要はありません。

アクセス関数:

QString targetName() const
void setTargetName(const QString name)

Notifierシグナル:

void targetNameChanged(const QString &name)

targetPositions : QVector<float>

モーフターゲットの位置値を保持します。リスト内の各位置は、同じインデックスを持つ対応するモーフターゲットの位置を指定します。値は昇順で並んでいる必要があります。値は正または負の値をとることができ、あらかじめ定義された単位はありません。

アクセス関数:

QVector<float> targetPositions() const
void setTargetPositions(const QVector<float> &targetPositions)

通知シグナル:

void targetPositionsChanged(const QVector<float> &targetPositions)

メンバ関数のドキュメント

[explicit] QMorphingAnimation::QMorphingAnimation(QObject *parent = nullptr)

parent を使用して、新しいQMorphingAnimationを作成します。

void QMorphingAnimation::addMorphTarget(Qt3DAnimation::QMorphTarget *target)

アニメーションの最後に、新しいモーフ「target 」を追加します。

QVector<float> QMorphingAnimation::getWeights(int positionIndex)

positionIndex でモーフの重みを返す。

QVector<Qt3DAnimation::QMorphTarget *> QMorphingAnimation::morphTargetList()

モーフターゲットのリストを返します。

void QMorphingAnimation::removeMorphTarget(Qt3DAnimation::QMorphTarget *target)

アニメーションから「target 」のモーフを削除します。

void QMorphingAnimation::setMorphTargets(const QVector<Qt3DAnimation::QMorphTarget *> &targets)

「targets 」のモーフを「アニメーション」に設定します。以前のターゲットはクリアされます。

void QMorphingAnimation::setWeights(int positionIndex, const QVector<float> &weights)

positionIndex で、weights のモーフを設定します。

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