8

I am making a VR video player using google VR SDK for android. I want to have gaze control in my VR player to add media pause and play controls in the player. I know we can achieve this using unity but I need to do this using android or java code. Is there any way to implement it in native android code without using unity.

vijaypalod
  • 398
  • 4
  • 15

1 Answers1

1

Yes, you can, but you will need to calculate if the user is gazing at the buttons yourself. Google has provided an example Android VR project that does this here. Take a look at the isLookingAtObject() method at the very bottom of the linked file. You can apply this to buttons whose position you have in world space, instead of a cube target like in the demo.

However since you are just making a video player where neither the camera nor the buttons move, you could just hard-code the angles at which you are looking at certain buttons, and if the camera rotation is within a threshold of a given button's viewing angle then you know you are gazing at the button.

MBorsch
  • 20
  • 1
  • 2