Ejemplo n.º 1
0
        public IHeadTracker Create(Identifier id)
        {
            OVR.Initialize();
            var hmd = OVR.HmdCreate(id.Number);

            hmd.ConfigureTracking(TrackingCapabilities.Orientation | TrackingCapabilities.Position | TrackingCapabilities.MagYawCorrection, TrackingCapabilities.None);
            return(new HeadTracker(hmd));
        }
Ejemplo n.º 2
0
 protected VRGame()
 {
     // Creates a graphics manager. This is mandatory.
     Graphics = new GraphicsDeviceManager(this);
     OVR.Initialize();
     hmd = OVR.HmdCreate(0) ?? OVR.HmdCreateDebug(HMDType.DK2);
     ToDispose(hmd);
     Graphics.PreferredBackBufferWidth       = hmd.Resolution.Width;
     Graphics.PreferredBackBufferHeight      = hmd.Resolution.Height;
     Graphics.PreferredFullScreenOutputIndex = 1;
     Graphics.DeviceCreationFlags           |= DeviceCreationFlags.Debug;
 }
Ejemplo n.º 3
0
        public Renderer(GraphicsDeviceManager graphicsDeviceManager)
        {
            // Initialize the SharpOVR library
            OVR.Initialize();

            // Create our HMD or if not present, a dummy one
            HMD = OVR.HmdCreate(0) ?? OVR.HmdCreateDebug(HMDType.DK2);

            // Match back buffer size with HMD resolution
            graphicsDeviceManager.PreferredBackBufferWidth  = HMD.Resolution.Width;
            graphicsDeviceManager.PreferredBackBufferHeight = HMD.Resolution.Height;
            EyePose     = new PoseF[2];
            EyeOffset   = new Vector3[2];
            EyeViewport = new Rect[2];
            FPS         = new FPS();
        }
Ejemplo n.º 4
0
        //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

        //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


        /// <summary>
        /// Initializes a new instance of the <see cref="TelepresenceSystem" /> class.
        /// </summary>
        public TelepresenceSystem(TelepresenceSystemConfiguration _configuration)
        {
            // configuration
            config = _configuration;
            Constructor_BaslerCamera();

            // Creates a graphics manager. This is mandatory.
            graphicsDeviceManager = new GraphicsDeviceManager(this);

            // Force no vsync and use real timestep to print actual FPS
            graphicsDeviceManager.SynchronizeWithVerticalRetrace = false;
            IsFixedTimeStep = false;


            Constructor_FPS();
            fpsClock = new Stopwatch(); // readonly


            // Input Constructor
            // all initial components should be created in game constructor
            keyboardManager = new KeyboardManager(this); // readonly
            mouseManager    = new MouseManager(this);
            Constructor_Input();

            Constructor_Sound();

            // Setup the relative directory to the executable directory
            // for loading contents with the ContentManager
            Content.RootDirectory = @"Content\Demo";

            // Initialize OVR Library
            OVR.Initialize();

            // Create our HMD
            hmd = OVR.HmdCreate(0) ?? OVR.HmdCreateDebug(HMDType.DK1);

            // Match back buffer size with HMD resolution
            graphicsDeviceManager.PreferredBackBufferWidth  = hmd.Resolution.Width;
            graphicsDeviceManager.PreferredBackBufferHeight = hmd.Resolution.Height;
        }
Ejemplo n.º 5
0
        public CsEx()
        {
            graphicsDeviceManager = new GraphicsDeviceManager(this);

            //Content.RootDirectory = "Content";
            OVR.Initialize();
            hmd = OVR.HmdCreate(0) ?? OVR.HmdCreateDebug(HMDType.DK2);
            hmd.ConfigureTracking(TrackingCapabilities.Orientation | TrackingCapabilities.Position | TrackingCapabilities.MagYawCorrection, TrackingCapabilities.None);
            hmd.EnabledCaps = HMDCapabilities.LowPersistence | HMDCapabilities.DynamicPrediction;

            hmdToEyeViewOffset[0] = hmd.GetRenderDesc(EyeType.Left, hmd.DefaultEyeFov[0]).HmdToEyeViewOffset;
            hmdToEyeViewOffset[1] = hmd.GetRenderDesc(EyeType.Right, hmd.DefaultEyeFov[1]).HmdToEyeViewOffset;

            // Match back buffer size with HMD resolution
            graphicsDeviceManager.PreferredBackBufferWidth       = hmd.Resolution.Width;
            graphicsDeviceManager.PreferredBackBufferHeight      = hmd.Resolution.Height;
            graphicsDeviceManager.PreferredFullScreenOutputIndex = 1;

            bool res = ovrcam.Open();

            Console.WriteLine("OVR OPEN:" + res.ToString());
            ovrcam.useProcessingQuality = 2;
        }