I have an issue in my game. I need some ideas about my approach.
I am currently having a gameloop with fixed time step. When I am rendering I always have the current state and previous state available. In order to render "in-between-states" I always render one update back in time by using this formula:
pos = current_state * alpha + last_state * (1 - alpha).
where alpha amount (fraction) that I have passed current_state (I hope it makes sense this far ).
...all this works well when rendering - everything is nice and smooth. The issue is the mouse! I have trouble wrapping my head around how to handle the mouse. At this point I handle the mouse in the exact same way. So I am getting the mouse position by interpolating based on last_state and current_state.... but the mouse "feels" laggy (it is smooth though).
What is the best-practice approach? Do I need to grab the mouse position in the updates or the rendering part?
Edited by sharepointme, 31 March 2014 - 02:44 AM.