R
|
A --- T
|
B --- C
Where R is RootNode, A and B are SceneNodes, T is the Target (Avatar) and C is the Camera.
The B can be yawed, so that the camera turns around the avatar, while still looking at it. Likewise it can be pitched up and down too. The trouble comes when doing both of these movements together. The camera moves unpredictably, and is difficult to control. The code is like this:
Code: Select all
mRotX = Degree(-mInputDevice->getMouseRelativeX() * 0.13);
mRotY = Degree(-mInputDevice->getMouseRelativeY() * 0.13);
mCamNode->pitch(mRotY,Node::TS_PARENT);
mCamNode->yaw(mRotX,Node::TS_PARENT);

Any help would be greatly appreciated.
P.S. I'm using BSPs so the Z axis is vertical, not the Y.
