RotateYawOnly
Rotating yaw while ignoring pitch and roll
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.
Note: This assumes sn is your (SceneNode*) and mDestination holds the location your sn is trying to go to.
Vector3 vecModifiedDest = mDestination, vecCurrentPosition; vecCurrentPosition = sn->getPosition(); vecModifiedDest.y = vecCurrentPosition.y; sn->lookAt(vecModifiedDest, Node::TransformSpace::TS_LOCAL, Vector3::NEGATIVE_UNIT_Z);
Note (to GCC users): When refering to the TransformSpace you want to use, you may get "Node::TransformSpace is not a class or namespace" errors. This is because you are supplying an enumeration value. Strictly, you should not qualify it with enumeration name itself. I believe other compilers may look over this. If this problem occurs, replace the problematic argument with this:
Node::TS_LOCAL
Contributors to this page: spacegaier
,
Spacegaier
and
jacmoe
.
Page last modified on Thursday 05 of August, 2010 23:23:31 UTC by spacegaier
.
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
74
online users

