如何在 Ogre3D 中将对象的方向设置为另一个对象?
我尝试这样做:
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);
但一点运气都没有。有没有一种简单的方法可以将一个骨骼旋转设置为另一个骨骼旋转任何提示或想法将不胜感激。谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一次又一次,它永远不会失败。当我发布这篇文章后,我会继续查看 API 文档并找到解决方案。 -。- 对不起。
很简单:
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: