Mercurial > hg > Game > Games
comparison Orchestland/Assets/LeapMotion/Scripts/LeapDeviceInfo.cs @ 1:f7675884f2a1
Add Orchestland project
author | Daiki OYAKAWA <e135764@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Jul 2015 23:09:20 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:347d21cdfc22 | 1:f7675884f2a1 |
---|---|
1 using UnityEngine; | |
2 using System.Collections; | |
3 | |
4 public enum LeapDeviceType { | |
5 Invalid, | |
6 Peripheral | |
7 } | |
8 | |
9 /// <summary> | |
10 /// Leap device info struct. | |
11 /// </summary> | |
12 /// <remarks> | |
13 /// Default values are for Leap peripheral. | |
14 /// </remarks> | |
15 public struct LeapDeviceInfo { | |
16 public LeapDeviceType type; | |
17 public bool isEmbedded; | |
18 // TODO: Is head mounted | |
19 public float baseline; //(meters) Distance between focal points of cameras | |
20 public float focalPlaneOffset; //(meters) Distance from mount center to focal plane of cameras | |
21 public float horizontalViewAngle; //(degrees) Field of view angle in parallel to baseline axis | |
22 public float verticalViewAngle; //(degrees) Field of view angle perpendicular to baseline axis | |
23 public float trackingRange; //(degrees) Maximum radius for reliable tracking | |
24 public string serialID; //Device alphanumeric unique hardware ID | |
25 | |
26 public LeapDeviceInfo(LeapDeviceType initialization = LeapDeviceType.Invalid) { | |
27 type = initialization; | |
28 switch (type) { | |
29 case LeapDeviceType.Peripheral: | |
30 isEmbedded = false; | |
31 baseline = 0.04f; | |
32 focalPlaneOffset = 0.07f; | |
33 horizontalViewAngle = 2.303835f * Mathf.Rad2Deg; | |
34 verticalViewAngle = 2.007129f * Mathf.Rad2Deg; | |
35 trackingRange = 470f / 1000f; | |
36 serialID = ""; | |
37 break; | |
38 default: | |
39 isEmbedded = false; | |
40 baseline = 0f; | |
41 focalPlaneOffset = 0f; | |
42 horizontalViewAngle = 0f; | |
43 verticalViewAngle = 0f; | |
44 trackingRange = 0f; | |
45 serialID = ""; | |
46 break; | |
47 } | |
48 } | |
49 } |