Pucho1982
(Pucho1982)
March 17, 2015, 9:04pm
16
Well the EASY way is just to map-range the values such that, when the stick is tilted toward the corner, it JUST reaches it, and then use and Min nodes to clamp the other values inside the box (that is to say, visualize the stick as moving the cursor in a circle which exactly encompasses all 4 corners of the screen). The problem with this method is it means that for a standard up/down movement, the cursor will reach the screen’s edge before the stick is pushed all the way to maximum; the advantage is it means the stick’s movements will interpolate correctly (i.e. a horizontal movement of the stick will always correspond to a horizontal movement of the cursor, it won’t bow inward toward center screen when you move directly from up-left to up-right).
You know what? This might just be good enough… I’ll definitely give this a shot tonight. It somehow never occurred to me to place the circle OUTSIDE of the rectangle, like you mentioned. That’s pretty clever!