Page 1 of 1

Mouse motion question

Posted: Tue May 29, 2007 9:07 pm
by kendric
Learning this engine, its really cool. I have a question on mouse movement.
if(event.MouseInput.Event==EMIE_MOUSE_MOVED)
{
printf("Mouse is now at x=%d",event.MouseInput.X);
}

This gives me the position. But if I want to get motion, ie to control the camera myself, is there a function for that? Or is it my job to recenter the mouse after each event and just track the delta from the center? If so whats the recomended way to move the mouse.

Thanks in advance for any input.

Posted: Tue May 29, 2007 9:15 pm
by Dances
Yes, you would need to reset it to center each time you use the value.

Posted: Wed May 30, 2007 7:13 pm
by Mastiff
To change the cursor position:

device->getCursorControl()->setPosition(int x,int y);

There are also more options listed in the Irrlicht API:
http://irrlicht.sourceforge.net/docu/cl ... ntrol.html