-
Notifications
You must be signed in to change notification settings - Fork 10
/
pyopenhmd.pyx
51 lines (40 loc) · 1.39 KB
/
pyopenhmd.pyx
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
from libcpp.vector cimport vector
cdef extern from "OpenHMD.h":
cdef cppclass OpenHMD:
OpenHMD()
vector[float] rotation
vector[float] leftprojectionmatrix
vector[float] leftviewmatrix
vector[float] rightprojectionmatrix
vector[float] rightviewmatrix
void printDeviceInfo()
void poll()
void reset()
void printSensors()
void inputLoop()
cdef class PyOpenHMD:
cdef OpenHMD* thisptr # hold a C++ instance which we're wrapping
def __cinit__(self):
self.thisptr = new OpenHMD()
def __dealloc__(self):
del self.thisptr
def printSensors(self):
self.thisptr.printSensors()
def poll(self):
self.thisptr.poll()
def reset(self):
self.thisptr.reset()
def inputLoop(self):
self.thisptr.inputLoop()
def printDeviceInfo(self):
self.thisptr.printDeviceInfo()
property rotation:
def __get__(self): return self.thisptr.rotation
property leftprojectionmatrix:
def __get__(self): return self.thisptr.leftprojectionmatrix
property leftviewmatrix:
def __get__(self): return self.thisptr.leftviewmatrix
property rightprojectionmatrix:
def __get__(self): return self.thisptr.rightprojectionmatrix
property rightviewmatrix:
def __get__(self): return self.thisptr.rightviewmatrix