Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
- Posts: 91
- Joined: Tue Mar 29, 2005 7:29 pm
- Location: Houston, TX
This assumes 'sn' is your (SceneNode *) and 'mDestination' holds the place your sn is trying to go.
Warning: Only tested with ninja.mesh
Code: Select all
Vector3 vecModifiedDest = mDestination, vecCurrentPosition;
vecCurrentPosition = sn->getPosition();
vecModifiedDest.y = vecCurrentPosition.y;
sn->lookAt( vecModifiedDest, Node::TransformSpace::TS_LOCAL, Vector3::NEGATIVE_UNIT_Z);
If there are better snippets out there, feel free to post them. Hope this helps someone.
- OGRE Retired Team Member
- Posts: 19265
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 65
Please post code snippets in the Wiki rather than the forums; tips here will get lost in the deluge of threads over time.