18#define LOG (&LOG_NDOF_UNIX)
26 else if (spnav_open() != -1) {
32#define MAX_LINE_LENGTH 100
35 FILE *command_output = popen(
"lsusb | grep '046d:\\|256f:'",
"r");
39 ushort vendor_id = 0, product_id = 0;
40 if (sscanf(line,
"Bus %*d Device %*d: ID %hx:%hx", &vendor_id, &product_id) == 2) {
46 pclose(command_output);
71#define USE_FINISH_GLITCH_WORKAROUND
74#ifdef USE_FINISH_GLITCH_WORKAROUND
80 bool anyProcessed =
false;
85#ifdef USE_FINISH_GLITCH_WORKAROUND
86 bool motion_test =
false;
89 while (spnav_poll_event(&
e)) {
91 case SPNAV_EVENT_MOTION: {
94 const int t[3] = {
int(
e.motion.x),
int(
e.motion.y),
int(-
e.motion.z)};
95 const int r[3] = {
int(-
e.motion.rx),
int(-
e.motion.ry),
int(
e.motion.rz)};
99#ifdef USE_FINISH_GLITCH_WORKAROUND
104 case SPNAV_EVENT_BUTTON:
112#ifdef USE_FINISH_GLITCH_WORKAROUND
115 const int v[3] = {0, 0, 0};
#define CLOG_INFO(clg_ref, level,...)
static bool motion_test_prev
static const char * spnav_sock_path
static CLG_LogRef LOG_NDOF_UNIX
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
virtual uint64_t getMilliSeconds() const =0
GHOST_NDOFManagerUnix(GHOST_System &)
void updateButton(int button_number, bool press, uint64_t time)
void updateTranslation(const int t[3], uint64_t time)
void updateRotation(const int r[3], uint64_t time)
bool setDevice(unsigned short vendor_id, unsigned short product_id)
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
unsigned __int64 uint64_t