elmarti / react-joystick-component

Tiny, multitouch, component driven joysticks in react
MIT License
86 stars 27 forks source link

Magic numbers #21

Closed elmarti closed 2 years ago

elmarti commented 4 years ago

1 year down the line, not sure what these values are, need to reverse engineer them and name them.

https://github.com/elmarti/react-joystick-component/blob/58a1bd79005b5cb72c12f1b77128c1dc3a6f0cbb/src/Joystick.tsx#L129

elmarti commented 4 years ago

The atan2 value is a radiand for the direction of the joy stick, I guess these numbers refer to the axes.

elmarti commented 4 years ago

The values refer to the 45 degree corner points, as that is the point where one direction changes to another.

elmarti commented 2 years ago

Fixed by https://github.com/elmarti/react-joystick-component/commit/fab12ae9ff653d0b97d0277b5b736cdb09b79eaa