Cursor problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Eugenik
Posts: 6
Joined: Mon Jan 29, 2007 4:58 am
Location: Russia, Sibiria, Novosibirsk

Cursor problem

Post by Eugenik »

Hello! Such problem! In the menu of game I put

scene:: ISceneManager* sm = device-> getSceneManager ();

sm-> setActiveCamera (sm-> addCameraSceneNode (0, core:: vector3df (45,0,0), core:: vector3df (0,0,10)));

The cursor goes normally.

Then after the beginning of new game I put

camera = sm-> addCameraSceneNodeFPS (0, 0.0f, 0.0f,-1, keyMap, 8, true);
(zero in speeds of displacement and turn cost{stand} because my game does not demand work with them)

sm-> setActiveCamera (camera);

Then when I leave in the menu with help Esc I again I put
sm-> setActiveCamera (sm-> addCameraSceneNode (0, core:: vector3df (45,0,0), core:: vector3df (0,0,10)));

But the cursor jams in the middle of the screen and is not shifted. Why so occurs?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Re: Cursor problem

Post by Acki »

Eugenik wrote:Then when I leave in the menu with help Esc I again I put
sm-> setActiveCamera (sm-> addCameraSceneNode (0, core:: vector3df (45,0,0), core:: vector3df (0,0,10)));

But the cursor jams in the middle of the screen and is not shifted. Why so occurs?
1. you should not create a new camera each time escape was pressed !!!
In extreme you could get 100s of cameras in your scene !!! :wink:

Then, what do you ean with jams and is not shifted ???
The cursor jumps to the center of the screen because the fps cam works this way, it counts the difference between the actual cursor position and the center and resets the cursor to the center...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply