Saturday, July 02, 2005

mouse damping

Zone rings does damping from the timer hook: It repeatedly computes the difference between the origin and the mouse cursor, multiplies the difference by a normalized damping factor, and adds the result to the origin. The damping factor ranges from 0..1, 0 = maximum damping, 1 = no damping. At damping = 1, the result is always equal to the entire distance between origin and cursor, so the origin jumps immediately to the cursor position. At damping = 0, the origin would never move at all. Maybe the damping factor is kept above zero to prevent this.

No comments: