How do you set an objects Orientation to another objects in Ogre3D?

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.


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);
链接地址: http://www.djcxy.com/p/95548.html

上一篇: 如何通过按下按钮(Ogre3D)逐渐加速一个对象?

下一篇: 你如何设置一个对象定位到Ogre3D中的另一个对象?