About Store Forum Documentation Contact



Post Reply 
Skeleton run different Animation
Author Message
rect Offline
Member

Post: #1
Skeleton run different Animation
Hi Esenthel

I have a Skeleton with three bones:

BoneA - main bone;
BoneB - bones of the upper half of skeleton(Parent bone is BoneA);
BoneC - bones of the lower half of skeleton(Parent bone is BoneA);

now I have two animations:

attack -
walk -

I want BoneB run the attack animation
and BoneC run the walk anination

how can i do it?

thanks.
(This post was last modified: 05-02-2015 02:08 PM by rect.)
05-02-2015 02:03 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #2
RE: Skeleton run different Animation
Apply combinations of animate and the updateMatrix procedures in skeleton.h to get the desired effect:

Code:
CSkeleton& updateMatrix        (C Matrix &body_matrix          );      
CSkeleton& updateMatrixParents (C Matrix &body_matrix, Int bone);      
CSkeleton& updateMatrixChildren(                       Int bone);
05-02-2015 05:31 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Skeleton run different Animation
Hello,

You can try using

AnimatedSkeleton::disable(bone_index, true); // to disable
AnimatedSkeleton::animate(..animation_1);
AnimatedSkeleton::disable(bone_index, false); // to enable

AnimatedSkeleton::disable(bone_index2, true); // to disable
AnimatedSkeleton::animate(..animation_2);
AnimatedSkeleton::disable(bone_index2, false); // to enable

you can also try using disableChildren method.

Or just copy the animation and delete all keyframes of lower body, then applying this animation will affect only those bones which have keyframes.
05-03-2015 01:17 AM
Find all posts by this user Quote this message in a reply
Post Reply