forked from lubosz/python-openhmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyrift.pyx
35 lines (25 loc) · 796 Bytes
/
pyrift.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
from libcpp.vector cimport vector
cdef extern from "Rift.h":
cdef cppclass Rift:
Rift()
vector[float] rotation
void printDeviceInfo()
void poll()
void printSensors()
void inputLoop()
cdef class PyRift:
cdef Rift* thisptr # hold a C++ instance which we're wrapping
def __cinit__(self):
self.thisptr = new Rift()
def __dealloc__(self):
del self.thisptr
def printSensors(self):
self.thisptr.printSensors()
def poll(self):
self.thisptr.poll()
def inputLoop(self):
self.thisptr.inputLoop()
def printDeviceInfo(self):
self.thisptr.printDeviceInfo()
property rotation:
def __get__(self): return self.thisptr.rotation