capture
29-05-2008 01:22:44
I've been working on a first person camera system, but I don't seem to be making much progress.
So far I envision the player moving about using the arrows for forward and such and the mouse will control left and right orientation of the character and the camera. To do this I set the camera to the position of a childnode of the characters body, which gets the forward backward motion good.
But how do i sync the left and right orientation of the character and the camera, using the mouse?
I've been doing something like this:
Characters part
Cameras part
My code does not seem to work, and causes the camera seems to continue spinning after the mouse has stopped moving.
Any help with this?
So far I envision the player moving about using the arrows for forward and such and the mouse will control left and right orientation of the character and the camera. To do this I set the camera to the position of a childnode of the characters body, which gets the forward backward motion good.
But how do i sync the left and right orientation of the character and the camera, using the mouse?
I've been doing something like this:
Characters part
Ogre::Quaternion quat = camHandler->getCameraOrientation();
mPlayer->getNode()->yaw(quat.getYaw());
mPlayer->setDirection(mPlayer->getNode()->getOrientation());
Cameras part
mCamera->yaw(mPlayer->getNode()->getOrientation().getYaw());
mCamera->pitch(mRotY);
My code does not seem to work, and causes the camera seems to continue spinning after the mouse has stopped moving.
Any help with this?