public OSVRService(Game game, string appIdentifier = "net.demonixis.c3de") : base(game) { #if !DESKTOP throw new NotSupportedException("[OSVR] This plugin is not supported on this platform"); #endif ClientContext.PreloadNativeLibraries(); _context = new ClientContext(appIdentifier); _head = new VRHead(null, _context, new XnaPoseInterface(_context.GetPoseInterface("/me/head"))); _width = Screen.Width / 2; _height = Screen.Height; _distortionCenter = new Vector2(0.5f, 0.5f); _useRenderManager = !string.IsNullOrEmpty(_context.getStringParameter("/renderManagerConfig")); }
protected override void Initialize() { context = new ClientContext("osvr.monogame.Sample"); leftHandPose = new XnaPoseInterface(context.GetPoseInterface("/me/hands/left")); rightHandPose = new XnaPoseInterface(context.GetPoseInterface("/me/hands/right")); leftEye2D = new XnaPosition2DInterface(context.GetEyeTracker2DInterface("/me/eyes/left")); // You should always be using "/me/head" for HMD orientation tracking, // but we're mocking HMD head tracking with either hand tracking (e.g. Hydra controllers) // or with mouselook. You can cycle through them with the O key. headPose = new XnaPoseInterface(context.GetPoseInterface("/me/head")); // Mouselook emulation of the head-tracking orientation interface mouselook = new MouselookInterface(GraphicsDevice.Viewport); vrHead = new VRHead(graphics, context, headPose); base.Initialize(); }