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