Created
October 11, 2019 05:09
-
-
Save hakanai/d71dd998f780ce840c35035ce7654a9f to your computer and use it in GitHub Desktop.
Stashing this for safekeeping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool isVR() { | |
// USING_STEREO_MATRICES | |
#if UNITY_SINGLE_PASS_STEREO | |
return true; | |
#else | |
return false; | |
#endif | |
} | |
bool isVRHandCamera() { | |
return !isVR() && abs(UNITY_MATRIX_V[0].y) > 0.0000005; | |
} | |
bool isDesktop() { | |
return !isVRHandCamera(); | |
} | |
bool isVRHandCameraPreview() { | |
return isVRHandCamera() && _ScreenParams.y == 720; | |
} | |
bool isVRHandCameraPicture() { | |
return isVRHandCamera() && _ScreenParams.y == 1080; | |
} | |
bool isPanorama() { | |
// Crude method | |
// FOV=90=camproj=[1][1] | |
return unity_CameraProjection[1][1] == 1 && _ScreenParams.x == 1075 && _ScreenParams.y == 1025; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment