views:

9

answers:

1

I tried do do this:

    Ogre::Vector3 src = bone1->_getDerivedOrientation() * Ogre::Vector3::UNIT_X;
 Ogre::Quaternion quatt = src.getRotationTo(bone2->_getDerivedOrientation() * Ogre::Vector3::UNIT_X);
 bone1->rotate(quatt);

 src  = bone1->_getDerivedOrientation() * Ogre::Vector3::UNIT_Y;
 quatt = src.getRotationTo(bone2->_getDerivedOrientation() * Ogre::Vector3::UNIT_Y);
 bone1->rotate(quatt);

 src = bone1->_getDerivedOrientation() * Ogre::Vector3::UNIT_Z;
 quatt = src.getRotationTo(bone2->_getDerivedOrientation() * Ogre::Vector3::UNIT_Z);
 bone1->rotate(quatt);

and had no luck at all. Is there a simple way to just set one bones rotation to anothers any tips or ideas would be greatly appreciated. Thanks.

+1  A: 

Once, again, it never fails. As soon as I post this I continue looking through API Docs and find the solution. -.- Sorry.

it was as simple as:

bone1->setOrientation(bone2->_getDerivedOrientation().w,bone2->_getDerivedOrientation().x,bone2->_getDerivedOrientation().y,bone2->_getDerivedOrientation().z);
Pete L