Rosalie241 / RMG

Rosalie's Mupen GUI
GNU General Public License v3.0
611 stars 52 forks source link

RMG-Input: improve control stick behavior #164

Closed kev4cards closed 1 year ago

kev4cards commented 1 year ago

This PR replaces PR #142. It addresses the comments from that PR as well as reworked to fit into the recent refactor. The code is designed to set a a value, maxInpuRadius, derived from the mapping equation to encompass the octagon of the N64. With the octagon fully encompassed by this circle, input can now abide by the mapping equation instead of having to be re-scaled as it is in the current code. Any input that exceeds the octagon is either clamped by the edge of the octagon or to maxAxis (which coincides with the cardinal vertices of the octagon). Lastly, an epsilon is added for each direction in the case that floating point error leaves a value just shy of next the whole number. Ceil or round would have been too aggressive when considering fine aiming just around the deadzone-input border.

Rosalie241 commented 1 year ago

Thank you! :heart: