Hey guys I'm trying to calculate the mouse move delta so I can apply it to a node's rotation, I'm using the EMIE_MOUSE_MOVED event inside an event receiver and the issue is when the mouse is reset to the center of the screen that too fires the event. I've been trying to think of a way to compensate for this but I'm drawing a blank. Here's what I've got going on so far, I removed all code not related to the issue:
When the mouse is moved the delta is displayed in console but then when the mouse snaps back to the center of the screen that delta is displayed in console also which in turn negates the movement.
I appreciate any insight into this issue, I appreciate your time.
Using addCameraSceneNodeFPS() or via device->getCursorControl()->setPosition(irr::core::position2di(400, 300)) both fire the event receiver when the mouse is repositioned in the center of the screen. However I would rather not opt to use addCameraSceneNodeFPS since I'm parenting the camera to a scene node rotating the node in the left and right and the camera in the up and down.
EDIT: Is there another way to physically set the mouse position that doesn't involve irr::gui? I plan to compile Irrlicht without GUI in the future.
The reason I asked is that when you set it yourself you know when the cursor is reset and you can correspondingly reset the variables in your mouse-move event. With the FPS animator it's probably not possible.
And it seems ICursorControl will stay in even if you don't compile with the gui despite it's namespace. As far as I can see that define only affects gui elements.
Okay thank you very much CuteAlien, it's good to know ICursorControl will stay. I was trying with just the regular ICameraSceneNode but that's when I was running into the issue of the event firing again when I reset the mouse position. I'll take another crack at it. Thank you very much for your time helping here :)
Yeah - the event still fires. But you know now _when_ it fires. So you can save the old position before and the new afterwards and disregard that change.