void OnScreenDataChange(ScreenData screen) { int angle = 0; switch (DeviceOrientationChange.GetDeviceOrientation()) { case DeviceOrientation.LandscapeLeft: RotateLandscapeLeft(); angle = 0; break; case DeviceOrientation.LandscapeRight: RotateLandscapeRight(); angle = 180; break; case DeviceOrientation.Portrait: RotatePortrait(); angle = 90; break; case DeviceOrientation.PortraitUpsideDown: RotatePortaitUpsideDown(); angle = 270; break; } PikkartARCore.UpdateViewport((int)screen.resolution.x, (int)screen.resolution.y, angle); }
public static Matrix4x4 GetRotationMatrixForOrientation() { switch (DeviceOrientationChange.GetDeviceOrientation()) { case DeviceOrientation.Portrait: return(GetRotationMatrixPortrait()); case DeviceOrientation.PortraitUpsideDown: return(GetRotationMatrixPortraitUpsideDown()); case DeviceOrientation.LandscapeRight: return(GetRotationLandscapeRight()); default: return(GetRotationLandscapeLeft()); } }