Describes a full set of distortion mesh data, filled in by ovrHmd_CreateDistortionMesh. Contents of this data structure, if not null, should be freed by ovrHmd_DestroyDistortionMesh.
コード例 #1
0
ファイル: OvrCapi.cs プロジェクト: benlewis/unhinged_vr
        /// <summary>
		/// Generate distortion mesh per eye.
		/// Distortion capabilities will depend on 'distortionCaps' flags. Users should
		/// render using the appropriate shaders based on their settings.
		/// Distortion mesh data will be allocated and written into the ovrDistortionMesh data structure,
		/// which should be explicitly freed with ovrHmd_DestroyDistortionMesh.
		/// Users should call ovrHmd_GetRenderScaleAndOffset to get uvScale and Offset values for rendering.
		/// The function shouldn't fail unless theres is a configuration or memory error, in which case
		/// ovrDistortionMesh values will be set to null.
		/// This is the only function in the SDK reliant on eye relief, currently imported from profiles,
		/// or overridden here.
        /// </summary>
		public DistortionMesh? CreateDistortionMesh(Eye eye, FovPort fov, uint distortionCaps)
		{
			DistortionMesh_Raw rawMesh = new DistortionMesh_Raw();

            bool result = ovrHmd_CreateDistortionMesh(HmdPtr, eye, fov, distortionCaps, out rawMesh) != 0;
            if (!result)
			{
				return null;
			}

			DistortionMesh mesh = new DistortionMesh(rawMesh);
			ovrHmd_DestroyDistortionMesh(ref rawMesh);
			return mesh;
		}
コード例 #2
0
ファイル: OvrCapi.cs プロジェクト: uxl/rdgvr
        public DistortionMesh? CreateDistortionMeshDebug(Eye eye, FovPort fov, uint distortionCaps, float debugEyeReliefOverrideInMeters)
        {
            DistortionMesh_Raw rawMesh = new DistortionMesh_Raw();

            bool result = ovrHmd_CreateDistortionMeshDebug(
                HmdPtr,
                eye,
                fov,
                distortionCaps,
                out rawMesh,
                debugEyeReliefOverrideInMeters) != 0;

            if (!result)
            {
                return null;
            }

            DistortionMesh mesh = new DistortionMesh(rawMesh);
            ovrHmd_DestroyDistortionMesh(ref rawMesh);
            return mesh;
        }