I’m currently developing a simple Cardboard-oriented game and wanted to implement some head movement into my gameplay so that I could hook up some actions to head nods (both up and down), head shakes (the “no-no” movement) or head tilts (like the character jumping when you tilt your head to the right). Is there any easy way of handling these? The only way I thought of would be to manually catch the direction at which the head turned at each frame and if for a given number of consecutive frames the movement happened in the given direction (for example, only up on the Y axis with minimal change in X for the up nod), then interpret this as a given gesture. This sounds pretty hard and time-consuming, though.
Is there any less cumbersome way of doing this? Maybe some plug-and-play solutions for supporting head movement-based events?