ManuallyControllingBones
One technique to manually control bones in a skeletally animated character
Welcome to the new Ogre Wiki!
If you haven't done so already, be sure to visit the Wiki Portal to read about how the wiki works. Especially the Ogre Wiki Overview page.
If you haven't done so already, be sure to visit the Wiki Portal to read about how the wiki works. Especially the Ogre Wiki Overview page.
Sometimes you want to manually control bones in a skeletally animated character, e.g. to turn the characters head toward a target. Here's one technique:
Entity *ent = mSceneMgr->createEntity("robot", "robot.mesh"); SkeletonInstance* skel = ent->getSkeleton(); Animation* anim = skel->getAnimation("Walk"); Bone* manuallyControlledBone = skel->getBone("Joint10"); manuallyControlledBone->setManuallyControlled(true); anim->destroyTrack(manuallyControlledBone->getHandle());
Manipulating manually controlled Bones:
mAnimState->addTime(evt.timeSinceLastFrame); manuallyControlledBone->yaw(Degree(evt.timeSinceLastFrame*100));
The original discussion of this feature can be seen http://www.ogre3d.org/phpBB2/viewtopic.php?t=1550 here in this forum thread.
Note: Since Ogre v1.6 you have the option of not actually destroying a track, but instead using Skeletal Blend Masks. This was discussed in the forum http://www.ogre3d.org/phpBB2/viewtopic.php?t=39510 here.
Contributors to this page: jacmoe
and
system
.
Page last modified on Saturday 02 of January, 2010 07:46:34 GMT by jacmoe
.
The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.
Sidebar
Search box
Online users
48
online users

