Пример #1
0
        public static SrdXrResult GetProjectionMatrix(IntPtr session, float nearClip, float farClip,
                                                      out Matrix4x4 leftProjectionMatrix, out Matrix4x4 rightProjectionMatrix)
        {
            var projMat = new SrdXrProjectionMatrix();
            var projectionMatrixInfo = new SrdXrProjectionMatrixInfo
            {
                graphics_api      = XRRuntimeGraphicsDeviceType[SystemInfo.graphicsDeviceType],
                coordinate_system = SrdXrCoordinateSystem.COORDINATE_SYSTEM_RIGHT_Y_UP_Z_FORWARD,
                near_clip         = nearClip,
                far_clip          = farClip,
                reversed_z        = false
            };

            var xrResult = XRRuntimeAPI.GetProjectionMatrix(session, ref projectionMatrixInfo, out projMat);

            leftProjectionMatrix  = ToUnityMatrix4x4(projMat.left_projection);
            rightProjectionMatrix = ToUnityMatrix4x4(projMat.right_projection);

            return(xrResult);
        }
Пример #2
0
 public static extern SrdXrResult GetProjectionMatrix(IntPtr session, [In] ref SrdXrProjectionMatrixInfo projection_matrix_info, out SrdXrProjectionMatrix projection_matrix);