Plane yaw problems

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
harmon
Halfling
Posts: 72
Joined: Thu Mar 03, 2005 9:52 pm

Plane yaw problems

Post by harmon » Thu Mar 17, 2005 2:21 am

I haven't quite warmed up to the ogre api yet, so please bear with me...

I need to know how to set a fixed yaw axis for a particular sceneNode. When my plane is rotated (looks like it is turning), the local y axis of the node is then also used for yaw. I would like to set a fixed yaw axis for this particular node so that when the plane is rotated it can also turn in the correct fashion.

this is my current yaw code from one of the tutorials that uses a local axis from which to yaw:
mControlNode->yaw(Radian (Degree( mfYaw * evt.timeSinceLastFrame )));
0 x

User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
Contact:

Post by haffax » Thu Mar 17, 2005 2:35 am

use SceneNode::setFixedYawAxis(). Some things are just as easy as they sound even if one does not believe it. :)
0 x
team-pantheon programmer
creators of Rastullahs Lockenpracht

User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac » Thu Mar 17, 2005 3:29 am

make sure you yaw in world space too by setting the last parameter of node->yaw() to Ogre::SceneNode::TS_WORLD (i think)
0 x
phear hingo

My Webpage

harmon
Halfling
Posts: 72
Joined: Thu Mar 03, 2005 9:52 pm

Post by harmon » Fri Mar 18, 2005 12:00 am

ok, I got that working now (thanks to your replies), but now ive run into another problem:
I want the ground to tilt the opposite direction that the plane is turning... so i do this (see below) with the plane and the camera and it works pretty well. The only problem is that it gets kind of "glitchy" but the framerates are still >100 all the time. Maybe im implementing this incorrectly?

Code: Select all

Quaternion qRoll, qPitch;
qRoll.FromAngleAxis(Radian (Degree (mfShipRoll)), Vector3::UNIT_Z);
qPitch.FromAngleAxis(Radian (Degree (mfShipPitch)), Vector3::UNIT_X);    
mShipNode->setOrientation( qRoll * qPitch );
mCameraNode->setOrientation( -qRoll );
0 x

Post Reply