diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-08-11 14:03:49 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-08-16 13:19:48 +0000 |
commit | f3ae318f47a037b925fb10e71365ca3c72d6091c (patch) | |
tree | 1e2eb7c4ad47929df08e9db3c423772ecb3668f9 /tests/manual/skinned-mesh | |
parent | 1590daa5c30f40725eab7c4fb1117e89d2ddd829 (diff) |
Add the animation to the child joint rather than root joint
Shows how to animate joints using frontend API.
Change-Id: Ie2de8bebaa4fab3c83c83cfa8e560a0b4ee96e45
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/manual/skinned-mesh')
-rw-r--r-- | tests/manual/skinned-mesh/main.qml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/manual/skinned-mesh/main.qml b/tests/manual/skinned-mesh/main.qml index 47f3ee025..5f364bd63 100644 --- a/tests/manual/skinned-mesh/main.qml +++ b/tests/manual/skinned-mesh/main.qml @@ -77,10 +77,10 @@ DefaultSceneEntity { createJointsEnabled: true onRootJointChanged: { - console.log("Root joint: " + rootJoint) var animation = animationComp.createObject(rootJoint) - animation.target = rootJoint - animation.neutralPos = rootJoint.translation + var targetJoint = rootJoint.childJoints[0] + animation.target = targetJoint + animation.neutralPos = targetJoint.translation animation.running = true } @@ -98,14 +98,14 @@ DefaultSceneEntity { property: "translation" from: sequentialAnimation.neutralPos.plus(Qt.vector3d(-sequentialAnimation.dx, 0.0, 0.0)) to: sequentialAnimation.neutralPos.plus(Qt.vector3d(sequentialAnimation.dx, 0.0, 0.0)) - duration: 1000 + duration: 500 } Vector3dAnimation { target: sequentialAnimation.target property: "translation" from: sequentialAnimation.neutralPos.plus(Qt.vector3d(sequentialAnimation.dx, 0.0, 0.0)) to: sequentialAnimation.neutralPos.plus(Qt.vector3d(-sequentialAnimation.dx, 0.0, 0.0)) - duration: 1000 + duration: 500 } } } |