-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathController.cs
99 lines (89 loc) · 2.34 KB
/
Controller.cs
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
using System;
using OSVR.ClientKit;
namespace OSVRFreePIE
{
public class Controller
{
private Tracker tracker;
public Button one;
public Button two;
public Button three;
public Button four;
public Button bumper;
public Button joystick;
public Button middle;
public Analog joystickX;
public Analog joystickY;
public Analog trigger;
public Controller(ClientContext context, String side)
{
tracker = new Tracker(context, "/me/hands/" + side);
one = new Button(context, "/controller/" + side + "/1");
two = new Button(context, "/controller/" + side + "/2");
three = new Button(context, "/controller/" + side + "/3");
four = new Button(context, "/controller/" + side + "/4");
bumper = new Button(context, "/controller/" + side + "/bumper");
joystick = new Button(context, "/controller/" + side + "/joystick/button");
middle = new Button(context, "/controller/" + side + "/middle");
joystickX = new Analog(context, "/controller/" + side + "/joystick/x");
joystickY = new Analog(context, "/controller/" + side + "/joystick/y");
trigger = new Analog(context, "/controller/" + side + "/trigger");
}
public Vec3 position
{
get
{
return tracker.position;
}
}
public Quaternion orientation
{
get
{
return tracker.orientation;
}
}
public double x
{
get
{
return tracker.x;
}
}
public double y
{
get
{
return tracker.y;
}
}
public double z
{
get
{
return tracker.z;
}
}
public double roll
{
get
{
return tracker.roll;
}
}
public double pitch
{
get
{
return tracker.pitch;
}
}
public double yaw
{
get
{
return tracker.yaw;
}
}
}
}