I'm having problem with this demo I'm working on. I have 2 cameras, one is :
camera2 = sm->addCameraSceneNodeFPS(0, 100.0f, 600.0f, -1, keyMap, 8 );
and the other one is:
camera = smgr->addCameraSceneNode(BackNode,core::vector3df(0, 100, 0), core::vector3df(0, 0, -1));
During the game camera is folowing my character, and when I press ENTER I want to take a free look around.So when I press ENTER this function is called:
void CDemo::switchcamera()
{
freelook = (!freelook);
freelook ? smgr->setActiveCamera(camera2) : smgr->setActiveCamera(camera);
if(freelook)
{
camera2->setPosition(camera->getAbsolutePosition());
camera2->setTarget(camera->getTarget());
}
}
The point is that when switching camera I want to have the same look with my freelook camera (camera2), but its not like that. After switching camera 2 position is ok (same as camera position), but it looks somewhere up, not in my character. I cant solve this problem, anyone?