Commit d7b92909 authored by cutealien's avatar cutealien

CSceneNodeAnimatorCameraFPS now resets the key-input when it was disabled (thx...

CSceneNodeAnimatorCameraFPS now resets the key-input when it was disabled (thx @ gerdb for reporting and patch-proposal)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4258 dfc29bdd-3216-0410-991c-e03cc46cb475
parent b316f61d
Changes in 1.8 (??.??.2011) Changes in 1.8 (??.??.2011)
- CSceneNodeAnimatorCameraFPS now resets the key-input when it was disabled (thx @ gerdb for reporting and patch-proposal)
- Properly destroy OpenGL resources on linux (thx @curaga for the patch) - Properly destroy OpenGL resources on linux (thx @curaga for the patch)
......
...@@ -22,7 +22,7 @@ CSceneNodeAnimatorCameraFPS::CSceneNodeAnimatorCameraFPS(gui::ICursorControl* cu ...@@ -22,7 +22,7 @@ CSceneNodeAnimatorCameraFPS::CSceneNodeAnimatorCameraFPS(gui::ICursorControl* cu
: CursorControl(cursorControl), MaxVerticalAngle(88.0f), : CursorControl(cursorControl), MaxVerticalAngle(88.0f),
MoveSpeed(moveSpeed), RotateSpeed(rotateSpeed), JumpSpeed(jumpSpeed), MoveSpeed(moveSpeed), RotateSpeed(rotateSpeed), JumpSpeed(jumpSpeed),
MouseYDirection(invertY ? -1.0f : 1.0f), MouseYDirection(invertY ? -1.0f : 1.0f),
LastAnimationTime(0), firstUpdate(true), NoVerticalMovement(noVerticalMovement) LastAnimationTime(0), firstUpdate(true), firstInput(true), NoVerticalMovement(noVerticalMovement)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CCameraSceneNodeAnimatorFPS"); setDebugName("CCameraSceneNodeAnimatorFPS");
...@@ -105,7 +105,7 @@ void CSceneNodeAnimatorCameraFPS::animateNode(ISceneNode* node, u32 timeMs) ...@@ -105,7 +105,7 @@ void CSceneNodeAnimatorCameraFPS::animateNode(ISceneNode* node, u32 timeMs)
if (firstUpdate) if (firstUpdate)
{ {
camera->updateAbsolutePosition(); camera->updateAbsolutePosition();
if (CursorControl && camera) if (CursorControl )
{ {
CursorControl->setPosition(0.5f, 0.5f); CursorControl->setPosition(0.5f, 0.5f);
CursorPos = CenterCursor = CursorControl->getRelativePosition(); CursorPos = CenterCursor = CursorControl->getRelativePosition();
...@@ -118,7 +118,16 @@ void CSceneNodeAnimatorCameraFPS::animateNode(ISceneNode* node, u32 timeMs) ...@@ -118,7 +118,16 @@ void CSceneNodeAnimatorCameraFPS::animateNode(ISceneNode* node, u32 timeMs)
// If the camera isn't the active camera, and receiving input, then don't process it. // If the camera isn't the active camera, and receiving input, then don't process it.
if(!camera->isInputReceiverEnabled()) if(!camera->isInputReceiverEnabled())
{
firstInput = true;
return; return;
}
if ( firstInput )
{
allKeysUp();
firstInput = false;
}
scene::ISceneManager * smgr = camera->getSceneManager(); scene::ISceneManager * smgr = camera->getSceneManager();
if(smgr && smgr->getActiveCamera() != camera) if(smgr && smgr->getActiveCamera() != camera)
......
...@@ -112,6 +112,7 @@ namespace scene ...@@ -112,6 +112,7 @@ namespace scene
bool CursorKeys[EKA_COUNT]; bool CursorKeys[EKA_COUNT];
bool firstUpdate; bool firstUpdate;
bool firstInput;
bool NoVerticalMovement; bool NoVerticalMovement;
}; };
......
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