|
|
|
|
|
|
affineBasisX = new Vector2(cameraMatrix[0, 0], cameraMatrix[0, 1]); |
|
|
|
affineBasisY = new Vector2(cameraMatrix[1, 0], cameraMatrix[1, 1]); |
|
|
|
affineTranslation = new Vector2(cameraMatrix[0, 2], cameraMatrix[1, 2]); |
|
|
|
#endif // UNITY_IOS
|
|
|
|
#endif // UNITY_ANDROID
|
|
|
|
|
|
|
|
// The camera display matrix includes scaling and offsets to fit the aspect ratio of the device. In most
|
|
|
|
// cases, the camera display matrix should be used directly without modification when applying depth to
|
|
|
|
|
|
|
|
|
|
|
#if UNITY_ANDROID
|
|
|
|
m_DisplayRotationMatrix = k_AndroidFlipYMatrix * m_DisplayRotationMatrix; |
|
|
|
#endif // UNITY_IOS
|
|
|
|
#endif // UNITY_ANDROID
|
|
|
|
|
|
|
|
// Set the matrix to the raw image material.
|
|
|
|
m_RawImage.material.SetMatrix(k_DisplayRotationPerFrameId, m_DisplayRotationMatrix); |
|
|
|
|
|
|
switch (m_CurrentScreenOrientation) |
|
|
|
{ |
|
|
|
case ScreenOrientation.LandscapeRight: |
|
|
|
rectSize = new Vector2(maxDimension, minDimension); |
|
|
|
break; |
|
|
|
rectSize = new Vector2(minDimension, maxDimension); |
|
|
|
break; |
|
|
|
case ScreenOrientation.Portrait: |
|
|
|
default: |
|
|
|
rectSize = new Vector2(minDimension, maxDimension); |
|
|
|