I’ve solved this issue, here’s the solution (valid for Cardboard v0.5.2)
First, as suggested by smd, you need to apply orientation adjust in BaseCardboardDevice / UpdateState(). However, you should check ScreenOrientation rather than DeviceOrientation. Code is as follows:
public override void UpdateState() {
ProcessEvents();
GetHeadPose(headData);
ExtractMatrix(ref headView, headData);
headPose.SetRightHanded(headView.inverse);
if (Screen.orientation == ScreenOrientation.LandscapeRight) {
headPose.Set(headPose.Position, headPose.Orientation * Quaternion.Euler(0, 0, 180)); // Workaround
}
This will fix the orientation, but that’s not enough, because you will be facing wrong direction after Cardboard Recenter(). To workaround this, you also need to apply the rotation in CardboardHead / UpdateHead() method, the code is like this:
private void UpdateHead() {
if (updated) { // Only one update per frame, please.
return;
}
updated = true;
Cardboard.SDK.UpdateState();
if (trackRotation) {
var rot = Cardboard.SDK.HeadPose.Orientation;
if (Screen.orientation == ScreenOrientation.LandscapeRight) {
rot = Quaternion.Euler(0, 180, 0) * rot; // << Workaround
}
if (target == null) {
transform.localRotation = rot;
} else {
transform.rotation = target.rotation * rot;
}
}
if (trackPosition) {
Vector3 pos = Cardboard.SDK.HeadPose.Position;
if (target == null) {
transform.localPosition = pos;
} else {
transform.position = target.position + target.rotation * pos;
}
}
if (OnHeadUpdated != null) {
OnHeadUpdated(gameObject);
}
}