IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QVertexBlendAnimation Class

A class implementing vertex-blend morphing animation.

This class was introduced in Qt 5.9.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QVertexBlendAnimation Class

  • Header: QVertexBlendAnimation

  • Since: Qt 5.9

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS 3danimation)

    target_link_libraries(mytarget PRIVATE Qt6::3danimation)

  • qmake: QT += 3danimation

  • Inherited By:

  • Instantiated By: qml-qt3d-animation-vertexblendanimation.xml

  • Inherits: Qt3DAnimation::QAbstractAnimation

Detailed Description

A Qt3DAnimation::QVertexBlendAnimation class implements vertex-blend morphing animation to a target QGeometryRenderer. The QVertexBlendAnimation sets the correct QAttributes from the morph targets to the target QGeometryRenderer::geometry and calculates interpolator for the current position. Unlike with QMorphingAnimation, where the blending is controller with blend weights, the blending occurs between sequential morph targets. The actual blending between the attributes must be implemented in the material. Qt3DAnimation::QMorphPhongMaterial implements material with morphing support for phong lighting model. The blending happens between 2 attributes - 'base' and 'target'. The names for the base and target attributes are taken from the morph target names, where the base attribute retains the name it already has and the target attribute name gets 'Target' appended to the name. The interpolator can be set as a QParameter to the used material. All morph targets in the animation should contain the attributes with same names as those in the base geometry.

Property Documentation

 

[read-only] interpolator : const float

Holds the interpolator between base and target attributes.

Access functions:

  • float interpolator() const

Notifier signal:

  • void interpolatorChanged(float interpolator)

target : Qt3DRender::QGeometryRenderer*

Holds the target QGeometryRenderer the morphing animation is applied to.

Access functions:

  • *target() const

  • void setTarget( *target)

Notifier signal:

  • void targetChanged( *target)

targetName : QString

Holds the name of the target geometry. This is a convenience property making it easier to match the target geometry to the morphing animation. The name is usually same as the name of the parent entity of the target QGeometryRenderer, but does not have to be.

Access functions:

  • targetName() const

  • void setTargetName(const name)

Notifier signal:

  • void targetNameChanged(const &name)

targetPositions : QList<float>

Holds the position values of the morph target. Each position in the list specifies the position of the corresponding morph target with the same index. The values must be in an ascending order. Values can be positive or negative and do not have any predefined unit.

Access functions:

  • <float> targetPositions() const

  • void setTargetPositions(const <float> &targetPositions)

Notifier signal:

  • void targetPositionsChanged(const <float> &targetPositions)

Member Function Documentation

 

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

Construct a new QVertexBlendAnimation with parent.

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

Add new morph target at the end of the animation.

QList<Qt3DAnimation::QMorphTarget *> QVertexBlendAnimation::morphTargetList()

Return morph target list.

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

Remove morph target from the animation.

void QVertexBlendAnimation::setMorphTargets(const QList<Qt3DAnimation::QMorphTarget *> &targets)

Set morph targets to animation. Old targets are cleared.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+