RotateYawOnly         Rotating yaw while ignoring pitch and roll
Print

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: spacegaier4386 points  , Spacegaier4386 points  and jacmoe133512 points  .
Page last modified on Thursday 05 of August, 2010 23:23:31 UTC by spacegaier4386 points .


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.