Bug #1036

Problem when we start moving the camera in third person

Added by vl about 8 years ago. Updated over 7 years ago.

Status:Closed Start date:07/28/2010
Priority:Normal Due date:
Assignee:rti % Done:

100%

Category:OS: GNU/Linux
Target version:Version 0.8.0

Description

When you are in third person view. You click to move the camera and at the beginning, there's a camera jump.

It's perhaps due to the fact that we move the mouse to the center of the screen and we perhaps badly compute the delta.

History

#1 Updated by Naush about 8 years ago

There is the same problem on first person.

Way to reproduce :
- pick a point far from center.
- Left mouse click, and move a few pixel, directions seems to depends on the chosen corner.

#2 Updated by rti about 8 years ago

There is a delay between holding the mouse and actually hiding it and switching to raw mode (to only receive movement deltas).
If the mouse is not moved during this timeout, there is no jump. It only jumps if the mouse is moved between hold and actually hide and enable raw mode.
The fix needs some further investigation :)

#3 Updated by rti about 8 years ago

What happens is:

  • mouse move events get put into the queue at any time
  • when mouse raw mode emulation is enabled, the mouse is pulled back to 0.5/0.5 and a flag is set
  • from now on, for every event in the queue, the delta to 0.5/0.5 is reported, not the real position

But:
At the moment when the raw mode emulation is activated, there might still be events in the event queue. The flag is set, and those old events are processed as if they have happened after pulling the mouse back to 0.5/0.5, but they did not. They are just old normal mouse move events which might have happened far away from 0.5/0.5, so a very high delta is reported, leading to a jump in the camera movement.

This can be fixed by dropping all outstanding mouse move events which happened after the last event processing and before raw mode emulation.

#4 Updated by rti about 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r600.

#5 Updated by rti about 8 years ago

  • Assignee set to rti
  • Target version set to Version 0.8.0

#6 Updated by kervala about 8 years ago

I checked and it works great excepted as rti noticed about the time cursor is going hidden.

#7 Updated by Naush about 8 years ago

And you fix another bug :
Pressing left and right mouse button reset the camera position under linux (X11 third button emulation ?), now your avatar is moving. We now have the same behavior for linux and windows platform :)

#8 Updated by rti about 8 years ago

Just tested with a 3 button mouse...

If I move the camera to some random position, then press the left and right mouse button, the character rotates to match the camera view direction and moves.
But if I press the third button, the camera moves to match the characters view direction. Those are two different things. Is it working the same way for you?

#9 Updated by rti over 7 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF