Provides an interface to a CAPI HMD object. The ovrHmd instance is normally created by ovrHmd::Create, after which its other methods can be called. The typical process would involve calling: Setup: - Initialize() to initialize the OVR SDK. - Construct Hmd to create an ovrHmd. - Use hmd members and ovrHmd_GetFovTextureSize() to determine graphics configuration. - ConfigureTracking() to configure and initialize tracking. - ConfigureRendering() to setup graphics for SDK rendering, which is the preferred approach. - Please refer to "Client Distortion Rendering" below if you prefer to do that instead. - If ovrHmdCap_ExtendDesktop is not set, use ovrHmd_AttachToWindow to associate the window with an Hmd. - Allocate render textures as needed. Game Loop: - Call ovrHmd_BeginFrame() to get frame timing and orientation information. - Render each eye in between, using ovrHmd_GetEyePoses or ovrHmd_GetHmdPosePerEye to get the predicted hmd pose and each eye pose. - Call ovrHmd_EndFrame() to render distorted textures to the back buffer and present them on the Hmd. Shutdown: - Dispose the Hmd to release the ovrHmd. - ovr_Shutdown() to shutdown the OVR SDK.
상속: IDisposable
예제 #1
0
	void Awake () 
	{
		if(OVRManager.capiHmd == null) 
		{
		 OVR_Initialize();
		}
		IntPtr hmdPtr = IntPtr.Zero;
		OVR_GetHMD(ref hmdPtr);
		ovrHmd = (hmdPtr != IntPtr.Zero) ? new Hmd(hmdPtr) : null;
	}
예제 #2
0
	private void OnDisable()
	{
#if !UNITY_ANDROID || UNITY_EDITOR
		if (!isQuitting)
			return;

		if (ovrIsInitialized)
		{
			OVR_Destroy();
			OVRPluginEvent.Issue(RenderEventType.Destroy);
			_capiHmd = null;

			ovrIsInitialized = false;
		}
#else
		// NOTE: The coroutines will also be stopped when the object is destroyed.
		StopAllCoroutines();
#endif
	}
예제 #3
0
	private void OnDisable()
	{
		if (!isQuitting)
			return;

		if (ovrIsInitialized)
		{
			OVR_Destroy();
			OVRPluginEvent.Issue(RenderEventType.Destroy);
			_capiHmd = null;

			ovrIsInitialized = false;
		}
	}
예제 #4
0
	private void OnDisable()
	{
#if !UNITY_ANDROID || UNITY_EDITOR
		if (!isQuitting)
			return;

		if (ovrIsInitialized)
		{
			OVR_Destroy();
			OVRPluginEvent.Issue(RenderEventType.Destroy);
			_capiHmd = null;

			ovrIsInitialized = false;
		}
#else
		StopAllCoroutines();
#endif
	}