Commit 7e336eea authored by Rogerborg's avatar Rogerborg

http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?p=180192

Have the FPS animator set the cursor to the window centre unconditionally to cope with the cursor escaping the window.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1966 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 0025933f
...@@ -146,14 +146,15 @@ void CSceneNodeAnimatorCameraFPS::animateNode(ISceneNode* node, u32 timeMs) ...@@ -146,14 +146,15 @@ void CSceneNodeAnimatorCameraFPS::animateNode(ISceneNode* node, u32 timeMs)
{ {
relativeRotation.X = MaxVerticalAngle; relativeRotation.X = MaxVerticalAngle;
} }
// reset cursor position
CursorControl->setPosition(0.5f, 0.5f);
CenterCursor = CursorControl->getRelativePosition();
// needed to avoid problems when the ecent receiver is
// disabled
CursorPos = CenterCursor;
} }
// reset cursor position to the centre of the window. Do this unconditionally
// to cope with the case where the mouse has escaped our window in a single
// tick, so we don't get messages for it.
CursorControl->setPosition(0.5f, 0.5f);
CenterCursor = CursorControl->getRelativePosition();
// needed to avoid problems when the event receiver is disabled
CursorPos = CenterCursor;
} }
// set target // set target
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment