I am setting up what basically amounts to a 2d camera(forward,back,left,right) over a terrain mesh. It is working, but on the MoveRight and MoveLeft methods I am getting a twisting of the camera. The camera snaps back to the correct position after movement has stopped.
void CTerrain::MoveCameraRight(float _value)
{
core::vector3df cPos = eg::camera->getPosition();
core::vector3df cLook = eg::camera->getTarget();
eg::camera->setPosition(core::vector3df(cPos.X - _value,
cPos.Y,
cPos.Z));
eg::camera->setTarget(core::vector3df(cLook.X - _value,
cLook.Y,
cLook.Z));
eg::camera->updateAbsolutePosition();
return;
}
The difference between the camera position and the camera target is set to -100 on the Z axis for the target. Im sure its a bonehead mistake, but I pretty much am a bonehead...so.
EDIT: Reading the FAQ and learning how to use the search feature effectively(using booleans), I was able to find other people having the same problem. Adding the line: eg::camera->UpdateAbsolutePostion() fixed the issue.