I made update from Cardboard to GoogleVR so some code become deprecated.
I get the current head position of player to calculate the following user rotation. So what I need just to put player in front of image automatically. Here is an example:
moving player closer to picture
Vector3 spawnPos = hitObjectPos + hitObjectDirection * spawnDistance;
spawnPos = new Vector3 (spawnPos.x, transform.position.y, spawnPos.z);
player.transform.position = spawnPos;
calculate rotation
var headRotation = Cardboard.SDK.HeadPose.Orientation;
Quaternion lookAt = Quaternion.LookRotation (hitObject.transform.position - transform.position);
perform rotate as need
Vector3 rot = new Vector3 (0, lookAt.eulerAngles.y - headRotation.eulerAngles.y, 0);
player.transform.rotation = Quaternion.Euler (rot);
But now Cardboard.SDK.HeadPose.Orientation
is deprecated.
Does anyone find the alternative to find Head position?