Пример #1
0
        public OculusRift()
        {
            _timer          = new DispatcherTimer(DispatcherPriority.Render);
            _timer.Interval = new TimeSpan(0, 0, 0, 0, 10);
            _timer.Tick    += _timer_Tick;

            if (OVR_Init() == -1)
            {
                throw new OculusRiftException("Failed to initialize Oculus Rift.");
            }

            OVR_HMDInfo info = new OVR_HMDInfo();

            if (OVR_QueryHMD(ref info) == -1)
            {
                throw new OculusRiftException("Failed to query HMD infomation.");
            }

            DistortionParameter = new OculusDistortionParameter()
            {
                DistortionK            = info.DistortionK,
                ScreenWidthDistance    = info.HScreenSize,
                LensSeparationDistance = info.LensSeparationDistance,
            };

            _timer.Start();
        }
Пример #2
0
 static extern unsafe int OVR_QueryHMD(ref OVR_HMDInfo refHmdInfo);