Repository navigation
Expand file tree
/
Copy pathOSVRFreePIE.cs
More file actions
133 lines (106 loc) · 2.77 KB
/
Copy pathOSVRFreePIE.cs
File metadata and controls
133 lines (106 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
using System;
using System.Collections.Generic;
using FreePIE.Core.Contracts;
using OSVR.ClientKit;
namespace OSVRFreePIE
{
[GlobalType(Type = typeof(OSVRGlobal), IsIndexed = true)]
public class OSVRFreePIE : IPlugin
{
private ClientContext context;
public event EventHandler Started;
public OSVRFreePIE()
{
}
public object CreateGlobal()
{
context = new ClientContext("com.osvr.freepieClient");
return new OSVRGlobal(this);
}
public string FriendlyName
{
get { return "OSVR Interface"; }
}
public bool GetProperty(int index, IPluginProperty property)
{
return false;
}
public bool SetProperties(Dictionary<string, object> properties)
{
return false;
}
public Action Start()
{
context.SetRoomRotationUsingHead();
return null;
}
public void Stop()
{
}
public void DoBeforeNextExecute()
{
context.update();
}
static public implicit operator ClientContext(OSVRFreePIE osvrFreePIE)
{
return osvrFreePIE.context;
}
}
[Global(Name = "OSVR")]
public class OSVRGlobal
{
private readonly OSVRFreePIE osvr;
public OSVRGlobal(OSVRFreePIE osvr)
{
this.osvr = osvr;
}
public Analog analog(String path)
{
return new Analog(osvr, path);
}
public Button button(String path)
{
return new Button(osvr, path);
}
public Direction direction(String path)
{
return new Direction(osvr, path);
}
public EyeTracker eyeTracker(String path)
{
return new EyeTracker(osvr, path);
}
public Location2D location2D(String path)
{
return new Location2D(osvr, path);
}
public Locomotion locomotion(String path)
{
return new Locomotion(osvr, path);
}
public Tracker tracker(String path)
{
return new Tracker(osvr, path);
}
public Tracker head()
{
return new Tracker(osvr, "/me/head");
}
public Tracker leftHand()
{
return new Tracker(osvr, "/me/hands/left");
}
public Tracker rightHand()
{
return new Tracker(osvr, "/me/hands/right");
}
public Controller leftController()
{
return new Controller(osvr, "left");
}
public Controller rightController()
{
return new Controller(osvr, "right");
}
}
}