ncazanav
10-02-2007 00:19:40
Hi all,
I would like to control the camera in the scene as it is done in the Ellipsoid Collision Detection exmaple application of Paul Nette (downloadable at http://www.paulnettle.com/ in the code section.
So I slightly modified the code of tutorial 04 in order to rotate directly the camera as the user move the mouse, without to press any button. I modified the original code
to simply this :
Everything works fine, but the problem is the following : as soon as the mouse leaves the form, there is no more rotation of the camera because the mouse events are only fired when the mouse move over the form!!
How can I achieve something similarly to Paul Nette's application with Mogre?
I would like to control the camera in the scene as it is done in the Ellipsoid Collision Detection exmaple application of Paul Nette (downloadable at http://www.paulnettle.com/ in the code section.
So I slightly modified the code of tutorial 04 in order to rotate directly the camera as the user move the mouse, without to press any button. I modified the original code
void MouseMoveHandler(object sender, MouseEventArgs e)
{
if (mRotating)
{
float x = mLastPosition.X - Cursor.Position.X;
float y = mLastPosition.Y - Cursor.Position.Y;
Camera.Yaw(new Degree(x * ROTATE));
Camera.Pitch(new Degree(y * ROTATE));
mLastPosition = Cursor.Position;
}
}
to simply this :
void MouseMoveHandler(object sender, MouseEventArgs e)
{
float x = mLastPosition.X - Cursor.Position.X;
float y = mLastPosition.Y - Cursor.Position.Y;
Camera.Yaw(new Degree(x * ROTATE));
Camera.Pitch(new Degree(y * ROTATE));
mLastPosition = Cursor.Position;
}
Everything works fine, but the problem is the following : as soon as the mouse leaves the form, there is no more rotation of the camera because the mouse events are only fired when the mouse move over the form!!
How can I achieve something similarly to Paul Nette's application with Mogre?