Ejemplo n.º 1
0
        private static void Main(string[] args)
        {
            using (var mgr = new HMDManager())
            {
                // We need to ensure that the user has attached his rift to the computer
                // or wait until he has done so.
                IHMD hmd = mgr.AttachedDevice;
                if (hmd == null)
                {
                    Console.WriteLine("Please attach your rift to the computer...");
                    hmd = mgr.WaitForAttachedDevice(null);
                }

                Console.WriteLine("Found HMD at: {0}", hmd.Info.DisplayDevice);
                Console.WriteLine("Manufacturer: {0}", hmd.Info.Manufacturer);

                while (true)
                {
                    var sensorState = hmd.GetSensorState(0.0);
                    Console.WriteLine("Acceleration " + sensorState.Recorded.LinearAcceleration.X + ","
                        + sensorState.Recorded.LinearAcceleration.Y + ","
                        + sensorState.Recorded.LinearAcceleration.Z);
                    Thread.Sleep(100);
                }

                hmd.Reset();
            }
            Console.Read();
        }
Ejemplo n.º 2
0
		private static void Main(string[] args)
		{
			using (var mgr = new HMDManager())
			{
				// We need to ensure that the user has attached his rift to the computer
				// or wait until he has done so.
				var hmd = mgr.AttachedDevice;
				if (hmd == null)
				{
					Console.WriteLine("Please attach your rift to the computer...");
					hmd = mgr.WaitForAttachedDevice(null);
				}

				Console.WriteLine("Found HMD at: {0}", hmd.Info.DisplayDevice);
				Console.WriteLine("Manufacturer: {0}", hmd.Info.Manufacturer);

				hmd.Reset();
			}
		}