c# - Unity Cardboard Orientation Landscape Right Upside Down -


hi have unity app uses google cardboard sdk enable stereoscopic view have vr enabled app. app runs fine.

but there problem if set player settings orientation auto orientation landscape left , landscape right allowed. when in landscape left, works per normal when in landscape right cardboard view turn 180 degrees (settings button moved bottom of screen) unity objects not. have upside-down objects.

any method fix this?

thanks.

it appears native code sdk uses read gyro hardcoded landscape left orientation only. can worked around editing basecardboarddevice.cs , replacing definition of updatestate() following code:

private quaternion fixorientation;  public override void updatestate() {   getheadpose(headdata, time.smoothdeltatime);   extractmatrix(ref headview, headdata);   headpose.setrighthanded(headview.inverse);    // fix head pose based on device orientation (since native code assumes landscape left).   switch (input.deviceorientation) {     case deviceorientation.landscapeleft:       fixorientation = quaternion.identity;       return;     case deviceorientation.landscaperight:       fixorientation = quaternion.euler(0, 0, 180);       break;   }   headpose.set(headpose.position, headpose.orientation * fixorientation); } 

i suggest turning off neck model scale (set 0) in cardboard settings too, since won't come out right code.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -