[no bug]FPS Camera always recieves input, even if disabled

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
DeM0nFiRe
Posts: 117
Joined: Thu Oct 16, 2008 11:59 pm

[no bug]FPS Camera always recieves input, even if disabled

Post by DeM0nFiRe »

Hey guys,

So this bug is pretty simple. Even if your FPS Camera is deactivated and/or you explicitly disable event receiving, it will receive the events and animate anyway.

I looked at the source code, and the change from 1.41 to 1.5 switched from having a CCameraFPSSceneNode that animated itself to using a CSceneNodeAnimatorCameraFPS instead. When this switch was made, the animator was written such that it always receives input (Check out Line 54 of CSceneNodeAnimatorCameraFPS.h) and it also will not check if the camera's event receiver is enabled or disabled.
DeM0nFiRe
Posts: 117
Joined: Thu Oct 16, 2008 11:59 pm

Post by DeM0nFiRe »

So I was able to partially fix this just by adding a

Code: Select all

if (camera->isInputReceiverEnabled() != true)
     return;
It works the first time I disable, but if I enable then disable again this fix stops working. Anyone have any ideas on where I should be looking to fix this?

EDIT: Ok, I just had to center the cursor while I was switching
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Thanks for the report, added to tracker
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I cannot reproduce this. Example 09 can disable input via Escape. Everything works as expected.
DeM0nFiRe
Posts: 117
Joined: Thu Oct 16, 2008 11:59 pm

Post by DeM0nFiRe »

No, example 09 does not work. The movement of the camera using the key map is disabled, but the animation of the direction of the camera does not take cues from the camera, it takes cues from the CursorControl. Look at Example 09 again and switch to FPS, back to regular, mover the mouse around a bunch, and then switch back to FPS. The FPS camera's direction will have changed. I am not making this up, if you look at the code of the animator you will see what I mean.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yeah, I've looked at the animator code. And I've tried to reproduce it via example 09 (with the steps you said). But both things failed, I couldn't see any problems.
DeM0nFiRe
Posts: 117
Joined: Thu Oct 16, 2008 11:59 pm

Post by DeM0nFiRe »

Well, perhaps you are testing with an SVN version? As of Irrlicht 1.5, with no modifications, the code for that animator teaks cues directly from the CursorConbtrol regardless of the camera's state.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, you're right. The plain 1.5 has this problem, which was mentioned and fixed shortly after the 1.5 release. Both the 1.5 branch and trunk have this fixed.
Post Reply