Jack DeLano
Jack DeLano

Reputation: 93

How Do I Use Google Cardboard's HeadTracker Class?

I am trying to detect head movement for a Google Cardboard Android application. My device is a Nexus 5. I tried using the HeadTransform class (https://developers.google.com/cardboard/android/latest/reference/com/google/vrtoolkit/cardboard/HeadTransform), but the data from the getTranslation() method was useless (all zeros). I researched and found some mentions of a HeadTracker class (Google Cardboard VR sensors), but I was unable to find any documentation from Google. I managed to get the HeadTracker.getLastHeadView(Float[], int) to write into the provided array, but it gives me 16 elements. Because I can't find documentation, I don't know what any of the values represent. Does anyone know how to use this class?

Upvotes: 0

Views: 761

Answers (1)

Jack DeLano
Jack DeLano

Reputation: 93

Wow, I feel silly! After further thinking, the provided array is obviously a 4x4 matrix.

Upvotes: 0

Related Questions