func ConvertGoTiltStructToC(ts TiltState) *C.freenect_raw_tilt_state { c_ts := C.create_tilt_state() c_ts.accelerometer_x = C.int16_t(ts.Accelerometer_x) c_ts.accelerometer_y = C.int16_t(ts.Accelerometer_y) c_ts.accelerometer_z = C.int16_t(ts.Accelerometer_z) c_ts.tilt_angle = C.int8_t(ts.Tilt_angle) c_ts.tilt_status = C.freenect_tilt_status_code(ts.Tilt_status) return c_ts }
func (d *FreenectDevice) GetTiltState() TiltState { c_ts := (*C.freenect_raw_tilt_state)(C.create_tilt_state()) C.freenect_sync_get_tilt_state(&c_ts, d.DeviceIndexCType) ts := ConvertCTiltStructToGo(c_ts) return ts }