Improve gravity-based roll correction #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaced the old roll angle tracking (complementary filter / decay integrator) with gravity-vector axis decomposition. Angular velocity is now projected onto world-aligned axes using a low-pass filtered accelerometer gravity estimate, so cursor movement stays screen-aligned regardless of device roll.
Horizontal tracking works well. Vertical (pitch/nod) feels slightly less responsive... currently using a hardcoded 1.3x pitch scale factor as a workaround. I think the root cause is that the yaw projection picks up incidental GY (wrist roll) via the gy*gny dot product term when the device is tilted, making horizontal feel relatively more sensitive. Pitch has no equivalent boost since the screen-right vector always has ry=0.
TODO: