diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-08-26 17:31:10 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-09-02 18:10:40 +0000 |
commit | 88d63171992f957ddbc6e46b094504ac2ea9aeba (patch) | |
tree | e94fe4d7c8c00ebafd1fbd9c5974a6170a7349b0 /src/animation/backend/animationclip.cpp | |
parent | bbc14b772c323476a5cc41c1da06921f4e3dbf3e (diff) | |
download | qt3d-88d63171992f957ddbc6e46b094504ac2ea9aeba.tar.gz |
Extend generateClipFormatIndices() to handle jointIndex
AnimationClip now matches on name and jointIndex if jointIndex is valid.
Change-Id: Id2b3f41bf465a847048537583fc244743c0d026b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/animation/backend/animationclip.cpp')
-rw-r--r-- | src/animation/backend/animationclip.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/animation/backend/animationclip.cpp b/src/animation/backend/animationclip.cpp index 6a3c3c15b..0f90ff493 100644 --- a/src/animation/backend/animationclip.cpp +++ b/src/animation/backend/animationclip.cpp @@ -239,12 +239,14 @@ void AnimationClip::setDuration(float duration) notifyObservers(e); } -int AnimationClip::channelIndex(const QString &channelName) const +int AnimationClip::channelIndex(const QString &channelName, int jointIndex) const { const int channelCount = m_channels.size(); for (int i = 0; i < channelCount; ++i) { - if (m_channels[i].name == channelName) + if (m_channels[i].name == channelName + && (jointIndex == -1 || m_channels[i].jointIndex == jointIndex)) { return i; + } } return -1; } |