Blender  V3.3
GHOST_NDOFManager.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include "GHOST_NDOFManager.h"
4 #include "GHOST_Debug.h"
5 #include "GHOST_EventKey.h"
6 #include "GHOST_EventNDOF.h"
7 #include "GHOST_WindowManager.h"
8 #include "GHOST_utildefines.h"
9 
10 #include <climits>
11 #include <cmath>
12 #include <cstdio> /* For error/info reporting. */
13 #include <cstring> /* For memory functions. */
14 
15 #ifdef DEBUG_NDOF_MOTION
16 /* Printable version of each GHOST_TProgress value. */
17 static const char *progress_string[] = {
18  "not started", "starting", "in progress", "finishing", "finished"};
19 #endif
20 
21 #ifdef DEBUG_NDOF_BUTTONS
22 static const char *ndof_button_names[] = {
23  /* used internally, never sent */
24  "NDOF_BUTTON_NONE",
25  /* these two are available from any 3Dconnexion device */
26  "NDOF_BUTTON_MENU",
27  "NDOF_BUTTON_FIT",
28  /* standard views */
29  "NDOF_BUTTON_TOP",
30  "NDOF_BUTTON_BOTTOM",
31  "NDOF_BUTTON_LEFT",
32  "NDOF_BUTTON_RIGHT",
33  "NDOF_BUTTON_FRONT",
34  "NDOF_BUTTON_BACK",
35  /* more views */
36  "NDOF_BUTTON_ISO1",
37  "NDOF_BUTTON_ISO2",
38  /* 90 degree rotations */
39  "NDOF_BUTTON_ROLL_CW",
40  "NDOF_BUTTON_ROLL_CCW",
41  "NDOF_BUTTON_SPIN_CW",
42  "NDOF_BUTTON_SPIN_CCW",
43  "NDOF_BUTTON_TILT_CW",
44  "NDOF_BUTTON_TILT_CCW",
45  /* device control */
46  "NDOF_BUTTON_ROTATE",
47  "NDOF_BUTTON_PANZOOM",
48  "NDOF_BUTTON_DOMINANT",
49  "NDOF_BUTTON_PLUS",
50  "NDOF_BUTTON_MINUS",
51  /* keyboard emulation */
52  "NDOF_BUTTON_ESC",
53  "NDOF_BUTTON_ALT",
54  "NDOF_BUTTON_SHIFT",
55  "NDOF_BUTTON_CTRL",
56  /* general-purpose buttons */
57  "NDOF_BUTTON_1",
58  "NDOF_BUTTON_2",
59  "NDOF_BUTTON_3",
60  "NDOF_BUTTON_4",
61  "NDOF_BUTTON_5",
62  "NDOF_BUTTON_6",
63  "NDOF_BUTTON_7",
64  "NDOF_BUTTON_8",
65  "NDOF_BUTTON_9",
66  "NDOF_BUTTON_10",
67  /* more general-purpose buttons */
68  "NDOF_BUTTON_A",
69  "NDOF_BUTTON_B",
70  "NDOF_BUTTON_C",
71  /* the end */
72  "NDOF_BUTTON_LAST"};
73 #endif
74 
75 /* Shared by the latest 3Dconnexion hardware
76  * SpacePilotPro uses all of these
77  * smaller devices use only some, based on button mask. */
78 static const NDOF_ButtonT Modern3Dx_HID_map[] = {
87 
104 };
105 
106 /* This is the older SpacePilot (sans Pro)
107  * thanks to polosson for info about this device. */
114  NDOF_BUTTON_NONE /* the CONFIG button -- what does it do? */
115 };
116 
117 static const NDOF_ButtonT Generic_HID_map[] = {
130 };
131 
133 
135  : m_system(sys),
136  m_deviceType(NDOF_UnknownDevice), /* Each platform has its own device detection code. */
137  m_buttonCount(genericButtonCount),
138  m_buttonMask(0),
139  m_hidMap(Generic_HID_map),
140  m_buttons(0),
141  m_motionTime(0),
142  m_prevMotionTime(0),
143  m_motionState(GHOST_kNotStarted),
144  m_motionEventPending(false),
145  m_deadZone(0.0f)
146 {
147  /* To avoid the rare situation where one triple is updated and
148  * the other is not, initialize them both here: */
149  memset(m_translation, 0, sizeof(m_translation));
150  memset(m_rotation, 0, sizeof(m_rotation));
151 }
152 
153 bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short product_id)
154 {
155  /* Call this function until it returns true
156  * it's a good idea to stop calling it after that, as it will "forget"
157  * whichever device it already found */
158 
159  /* Default to safe generic behavior for "unknown" devices
160  * unidentified devices will emit motion events like normal
161  * rogue buttons do nothing by default, but can be customized by the user. */
162 
163  m_deviceType = NDOF_UnknownDevice;
164  m_hidMap = Generic_HID_map;
165  m_buttonCount = genericButtonCount;
166  m_buttonMask = 0;
167 
168  /* "mystery device" owners can help build a HID_map for their hardware
169  * A few users have already contributed information about several older devices
170  * that I don't have access to. Thanks! */
171 
172  switch (vendor_id) {
173  case 0x046D: /* Logitech (3Dconnexion was a subsidiary). */
174  switch (product_id) {
175  /* -- current devices -- */
176  case 0xC626: /* full-size SpaceNavigator */
177  case 0xC628: /* the "for Notebooks" one */
178  puts("ndof: using SpaceNavigator");
179  m_deviceType = NDOF_SpaceNavigator;
180  m_buttonCount = 2;
181  m_hidMap = Modern3Dx_HID_map;
182  break;
183  case 0xC627:
184  puts("ndof: using SpaceExplorer");
185  m_deviceType = NDOF_SpaceExplorer;
186  m_buttonCount = 15;
187  m_hidMap = SpaceExplorer_HID_map;
188  break;
189  case 0xC629:
190  puts("ndof: using SpacePilot Pro");
191  m_deviceType = NDOF_SpacePilotPro;
192  m_buttonCount = 31;
193  m_hidMap = Modern3Dx_HID_map;
194  break;
195  case 0xC62B:
196  puts("ndof: using SpaceMouse Pro");
197  m_deviceType = NDOF_SpaceMousePro;
198  m_buttonCount = 27;
199  /* ^^ actually has 15 buttons, but their HID codes range from 0 to 26 */
200  m_buttonMask = 0x07C0F137;
201  m_hidMap = Modern3Dx_HID_map;
202  break;
203 
204  /* -- older devices -- */
205  case 0xC625:
206  puts("ndof: using SpacePilot");
207  m_deviceType = NDOF_SpacePilot;
208  m_buttonCount = 21;
209  m_hidMap = SpacePilot_HID_map;
210  break;
211  case 0xC621:
212  puts("ndof: using Spaceball 5000");
213  m_deviceType = NDOF_Spaceball5000;
214  m_buttonCount = 12;
215  break;
216  case 0xC623:
217  puts("ndof: using SpaceTraveler");
218  m_deviceType = NDOF_SpaceTraveler;
219  m_buttonCount = 8;
220  break;
221 
222  default:
223  printf("ndof: unknown Logitech product %04hx\n", product_id);
224  }
225  break;
226  case 0x256F: /* 3Dconnexion */
227  switch (product_id) {
228  case 0xC62E: /* Plugged in. */
229  case 0xC62F: /* Wireless. */
230  puts("ndof: using SpaceMouse Wireless");
231  m_deviceType = NDOF_SpaceMouseWireless;
232  m_buttonCount = 2;
233  m_hidMap = Modern3Dx_HID_map;
234  break;
235  case 0xC631: /* Plugged in. */
236  case 0xC632: /* Wireless. */
237  puts("ndof: using SpaceMouse Pro Wireless");
238  m_deviceType = NDOF_SpaceMouseProWireless;
239  m_buttonCount = 27;
240  /* ^^ actually has 15 buttons, but their HID codes range from 0 to 26. */
241  m_buttonMask = 0x07C0F137;
242  m_hidMap = Modern3Dx_HID_map;
243  break;
244  case 0xC633:
245  puts("ndof: using SpaceMouse Enterprise");
246  m_deviceType = NDOF_SpaceMouseEnterprise;
247  m_buttonCount = 31;
248  m_hidMap = Modern3Dx_HID_map;
249  break;
250 
251  default:
252  printf("ndof: unknown 3Dconnexion product %04hx\n", product_id);
253  }
254  break;
255  default:
256  printf("ndof: unknown device %04hx:%04hx\n", vendor_id, product_id);
257  }
258 
259  if (m_buttonMask == 0) {
260  m_buttonMask = (int)~(UINT_MAX << m_buttonCount);
261  }
262 
263 #ifdef DEBUG_NDOF_BUTTONS
264  printf("ndof: %d buttons -> hex:%X\n", m_buttonCount, m_buttonMask);
265 #endif
266 
267  return m_deviceType != NDOF_UnknownDevice;
268 }
269 
271 {
272  memcpy(m_translation, t, sizeof(m_translation));
273  m_motionTime = time;
274  m_motionEventPending = true;
275 }
276 
278 {
279  memcpy(m_rotation, r, sizeof(m_rotation));
280  m_motionTime = time;
281  m_motionEventPending = true;
282 }
283 
284 void GHOST_NDOFManager::sendButtonEvent(NDOF_ButtonT button,
285  bool press,
286  uint64_t time,
287  GHOST_IWindow *window)
288 {
289  GHOST_ASSERT(button > NDOF_BUTTON_NONE && button < NDOF_BUTTON_LAST,
290  "rogue button trying to escape NDOF manager");
291 
292  GHOST_EventNDOFButton *event = new GHOST_EventNDOFButton(time, window);
293  GHOST_TEventNDOFButtonData *data = (GHOST_TEventNDOFButtonData *)event->getData();
294 
295  data->action = press ? GHOST_kPress : GHOST_kRelease;
296  data->button = button;
297 
298 #ifdef DEBUG_NDOF_BUTTONS
299  printf("%s %s\n", ndof_button_names[button], press ? "pressed" : "released");
300 #endif
301 
302  m_system.pushEvent(event);
303 }
304 
305 void GHOST_NDOFManager::sendKeyEvent(GHOST_TKey key,
306  bool press,
307  uint64_t time,
308  GHOST_IWindow *window)
309 {
311  GHOST_EventKey *event = new GHOST_EventKey(time, type, window, key, false);
312 
313 #ifdef DEBUG_NDOF_BUTTONS
314  printf("keyboard %s\n", press ? "down" : "up");
315 #endif
316 
317  m_system.pushEvent(event);
318 }
319 
320 void GHOST_NDOFManager::updateButton(int button_number, bool press, uint64_t time)
321 {
323 
324 #ifdef DEBUG_NDOF_BUTTONS
325  printf("ndof: button %d -> ", button_number);
326 #endif
327 
328  NDOF_ButtonT button = (button_number < m_buttonCount) ? m_hidMap[button_number] :
330 
331  switch (button) {
332  case NDOF_BUTTON_NONE:
333 #ifdef DEBUG_NDOF_BUTTONS
334  printf("discarded\n");
335 #endif
336  break;
337  case NDOF_BUTTON_ESC:
338  sendKeyEvent(GHOST_kKeyEsc, press, time, window);
339  break;
340  case NDOF_BUTTON_ALT:
341  sendKeyEvent(GHOST_kKeyLeftAlt, press, time, window);
342  break;
343  case NDOF_BUTTON_SHIFT:
344  sendKeyEvent(GHOST_kKeyLeftShift, press, time, window);
345  break;
346  case NDOF_BUTTON_CTRL:
347  sendKeyEvent(GHOST_kKeyLeftControl, press, time, window);
348  break;
349  default:
350  sendButtonEvent(button, press, time, window);
351  }
352 
353  int mask = 1 << button_number;
354  if (press) {
355  m_buttons |= mask; /* Set this button's bit. */
356  }
357  else {
358  m_buttons &= ~mask; /* Clear this button's bit. */
359  }
360 }
361 
363 {
364  button_bits &= m_buttonMask; /* Discard any "garbage" bits. */
365 
366  int diff = m_buttons ^ button_bits;
367 
368  for (int button_number = 0; button_number < m_buttonCount; ++button_number) {
369  int mask = 1 << button_number;
370 
371  if (diff & mask) {
372  bool press = button_bits & mask;
373  updateButton(button_number, press, time);
374  }
375  }
376 }
377 
379 {
380  if (dz < 0.0f) {
381  /* Negative values don't make sense, so clamp at zero. */
382  dz = 0.0f;
383  }
384  else if (dz > 0.5f) {
385  /* Warn the rogue user/developer, but allow it. */
386  GHOST_PRINTF("ndof: dead zone of %.2f is rather high...\n", dz);
387  }
388  m_deadZone = dz;
389 
390  GHOST_PRINTF("ndof: dead zone set to %.2f\n", dz);
391 }
392 
393 static bool atHomePosition(GHOST_TEventNDOFMotionData *ndof)
394 {
395 #define HOME(foo) (ndof->foo == 0.0f)
396  return HOME(tx) && HOME(ty) && HOME(tz) && HOME(rx) && HOME(ry) && HOME(rz);
397 #undef HOME
398 }
399 
400 static bool nearHomePosition(GHOST_TEventNDOFMotionData *ndof, float threshold)
401 {
402  if (threshold == 0.0f) {
403  return atHomePosition(ndof);
404  }
405  else {
406 #define HOME(foo) (fabsf(ndof->foo) < threshold)
407  return HOME(tx) && HOME(ty) && HOME(tz) && HOME(rx) && HOME(ry) && HOME(rz);
408 #undef HOME
409  }
410 }
411 
413 {
414  if (!m_motionEventPending)
415  return false;
416 
417  m_motionEventPending = false; /* Any pending motion is handled right now. */
418 
420 
421  if (window == NULL) {
422  m_motionState = GHOST_kNotStarted; /* Avoid large `dt` times when changing windows. */
423  return false; /* Delivery will fail, so don't bother sending. */
424  }
425 
426  GHOST_EventNDOFMotion *event = new GHOST_EventNDOFMotion(m_motionTime, window);
427  GHOST_TEventNDOFMotionData *data = (GHOST_TEventNDOFMotionData *)event->getData();
428 
429  /* Scale axis values here to normalize them to around +/- 1
430  * they are scaled again for overall sensitivity in the WM based on user preferences. */
431 
432  const float scale = 1.0f / 350.0f; /* 3Dconnexion devices send +/- 350 usually */
433 
434  data->tx = scale * m_translation[0];
435  data->ty = scale * m_translation[1];
436  data->tz = scale * m_translation[2];
437 
438  data->rx = scale * m_rotation[0];
439  data->ry = scale * m_rotation[1];
440  data->rz = scale * m_rotation[2];
441 
442  data->dt = 0.001f * (m_motionTime - m_prevMotionTime); /* In seconds. */
443  m_prevMotionTime = m_motionTime;
444 
445  bool weHaveMotion = !nearHomePosition(data, m_deadZone);
446 
447  /* Determine what kind of motion event to send `(Starting, InProgress, Finishing)`
448  * and where that leaves this NDOF manager `(NotStarted, InProgress, Finished)`. */
449  switch (m_motionState) {
450  case GHOST_kNotStarted:
451  case GHOST_kFinished:
452  if (weHaveMotion) {
453  data->progress = GHOST_kStarting;
454  m_motionState = GHOST_kInProgress;
455  /* Previous motion time will be ancient, so just make up a reasonable time delta. */
456  data->dt = 0.0125f;
457  }
458  else {
459  /* Send no event and keep current state. */
460 #ifdef DEBUG_NDOF_MOTION
461  printf("ndof motion ignored -- %s\n", progress_string[data->progress]);
462 #endif
463  delete event;
464  return false;
465  }
466  break;
467  case GHOST_kInProgress:
468  if (weHaveMotion) {
469  data->progress = GHOST_kInProgress;
470  /* Remain 'InProgress'. */
471  }
472  else {
473  data->progress = GHOST_kFinishing;
474  m_motionState = GHOST_kFinished;
475  }
476  break;
477  default:
478  /* Will always be one of the above. */
479  break;
480  }
481 
482 #ifdef DEBUG_NDOF_MOTION
483  printf("ndof motion sent -- %s\n", progress_string[data->progress]);
484 
485  /* Show details about this motion event. */
486  printf(" T=(%d,%d,%d) R=(%d,%d,%d) raw\n",
487  m_translation[0],
488  m_translation[1],
489  m_translation[2],
490  m_rotation[0],
491  m_rotation[1],
492  m_rotation[2]);
493  printf(" T=(%.2f,%.2f,%.2f) R=(%.2f,%.2f,%.2f) dt=%.3f\n",
494  data->tx,
495  data->ty,
496  data->tz,
497  data->rx,
498  data->ry,
499  data->rz,
500  data->dt);
501 #endif
502 
503  m_system.pushEvent(event);
504 
505  return true;
506 }
#define ARRAY_SIZE(arr)
#define GHOST_PRINTF(x,...)
Definition: GHOST_Debug.h:36
#define GHOST_ASSERT(x, info)
Definition: GHOST_Debug.h:54
static const NDOF_ButtonT Modern3Dx_HID_map[]
static const int genericButtonCount
#define HOME(foo)
static bool atHomePosition(GHOST_TEventNDOFMotionData *ndof)
static const NDOF_ButtonT SpacePilot_HID_map[]
static const NDOF_ButtonT SpaceExplorer_HID_map[]
static const NDOF_ButtonT Generic_HID_map[]
static bool nearHomePosition(GHOST_TEventNDOFMotionData *ndof, float threshold)
@ NDOF_SpaceMousePro
@ NDOF_SpaceMouseProWireless
@ NDOF_SpaceMouseWireless
@ NDOF_SpacePilotPro
@ NDOF_SpaceExplorer
@ NDOF_SpaceMouseEnterprise
@ NDOF_SpacePilot
@ NDOF_UnknownDevice
@ NDOF_SpaceNavigator
@ NDOF_Spaceball5000
@ NDOF_SpaceTraveler
NDOF_ButtonT
@ NDOF_BUTTON_SHIFT
@ NDOF_BUTTON_ESC
@ NDOF_BUTTON_LAST
@ NDOF_BUTTON_ALT
@ NDOF_BUTTON_CTRL
GHOST_TEventType
Definition: GHOST_Types.h:169
@ GHOST_kEventKeyDown
Definition: GHOST_Types.h:183
@ GHOST_kEventKeyUp
Definition: GHOST_Types.h:184
GHOST_TKey
Definition: GHOST_Types.h:259
@ GHOST_kKeyLeftAlt
Definition: GHOST_Types.h:328
@ GHOST_kKeyLeftControl
Definition: GHOST_Types.h:326
@ GHOST_kKeyEsc
Definition: GHOST_Types.h:267
@ GHOST_kKeyLeftShift
Definition: GHOST_Types.h:324
@ GHOST_kStarting
Definition: GHOST_Types.h:513
@ GHOST_kNotStarted
Definition: GHOST_Types.h:512
@ GHOST_kFinishing
Definition: GHOST_Types.h:515
@ GHOST_kFinished
Definition: GHOST_Types.h:516
@ GHOST_kInProgress
Definition: GHOST_Types.h:514
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
GHOST_System & m_system
void updateButtons(int button_bits, uint64_t time)
void updateButton(int button_number, bool press, uint64_t time)
void updateTranslation(const int t[3], uint64_t time)
GHOST_NDOFManager(GHOST_System &)
void updateRotation(const int r[3], uint64_t time)
bool setDevice(unsigned short vendor_id, unsigned short product_id)
GHOST_WindowManager * getWindowManager() const
Definition: GHOST_System.h:432
GHOST_TSuccess pushEvent(GHOST_IEvent *event)
GHOST_IWindow * getActiveWindow(void) const
double time
#define UINT_MAX
Definition: hash_md5.c:43
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
IMETHOD Vector diff(const Vector &a, const Vector &b, double dt=1)
unsigned __int64 uint64_t
Definition: stdint.h:90
@ NDOF_BUTTON_7
@ NDOF_BUTTON_2
@ NDOF_BUTTON_8
@ NDOF_BUTTON_MENU
@ NDOF_BUTTON_1
@ NDOF_BUTTON_BOTTOM
@ NDOF_BUTTON_BACK
@ NDOF_BUTTON_5
@ NDOF_BUTTON_RIGHT
@ NDOF_BUTTON_ROLL_CW
@ NDOF_BUTTON_10
@ NDOF_BUTTON_3
@ NDOF_BUTTON_PLUS
@ NDOF_BUTTON_A
@ NDOF_BUTTON_ISO2
@ NDOF_BUTTON_PANZOOM
@ NDOF_BUTTON_B
@ NDOF_BUTTON_MINUS
@ NDOF_BUTTON_NONE
@ NDOF_BUTTON_C
@ NDOF_BUTTON_DOMINANT
@ NDOF_BUTTON_9
@ NDOF_BUTTON_LEFT
@ NDOF_BUTTON_FIT
@ NDOF_BUTTON_4
@ NDOF_BUTTON_FRONT
@ NDOF_BUTTON_ISO1
@ NDOF_BUTTON_6
@ NDOF_BUTTON_TOP
@ NDOF_BUTTON_ROTATE
@ NDOF_BUTTON_ROLL_CCW