//------------------------------------------------------------------------------------- void ControllableCharacter::transformBone(Ogre::String boneName, NuiManager::NuiJointIndex jointIdx) { int state = 0; state = (int)controller->getJointStatus(jointIdx); if(state == 2) { Ogre::Bone* bone = skeleton->getBone(boneName); Ogre::Quaternion qI = bone->getInitialOrientation(); Ogre::Quaternion newQ = jointCalc->getSkeletonJointOrientation(jointIdx); bone->resetOrientation(); newQ = bone->convertWorldToLocalOrientation(newQ); bone->setOrientation(newQ * qI); Ogre::Quaternion resQ = bone->getOrientation(); if(showBoneOrientationAxes) axisLines[jointIdx]->updateLines(resQ.xAxis(), resQ.yAxis(), resQ.zAxis()); // debug } }
Quaternion GfxBody::getBoneInitialOrientation (unsigned n) { checkBone(n); Ogre::Bone *bone = skeleton->getBone(n); return from_ogre(bone->getInitialOrientation()); }