~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to intern/ghost/intern/GHOST_NDOFManagerX11.cpp

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
 
32
32
GHOST_NDOFManagerX11::GHOST_NDOFManagerX11(GHOST_System& sys)
33
 
    :
34
 
      GHOST_NDOFManager(sys),
35
 
      m_available(false)
 
33
        :
 
34
        GHOST_NDOFManager(sys),
 
35
        m_available(false)
36
36
{
37
37
        setDeadZone(0.1f); /* how to calibrate on Linux? throw away slight motion! */
38
38
 
44
44
#define MAX_LINE_LENGTH 100
45
45
 
46
46
                /* look for USB devices with Logitech's vendor ID */
47
 
                FILE* command_output = popen("lsusb -d 046d:","r");
 
47
                FILE *command_output = popen("lsusb -d 046d:", "r");
48
48
                if (command_output) {
49
49
                        char line[MAX_LINE_LENGTH] = {0};
50
50
                        while (fgets(line, MAX_LINE_LENGTH, command_output)) {
58
58
                }
59
59
        }
60
60
        else {
 
61
#ifdef DEBUG
 
62
                /* annoying for official builds, just adds noise and most prople don't own these */
61
63
                puts("ndof: spacenavd not found");
62
64
                /* This isn't a hard error, just means the user doesn't have a 3D mouse. */
 
65
#endif
63
66
        }
64
67
}
65
68
 
87
90
                                case SPNAV_EVENT_MOTION:
88
91
                                {
89
92
                                        /* convert to blender view coords */
90
 
                                        short t[3] = {e.motion.x, e.motion.y, -e.motion.z};
91
 
                                        short r[3] = {-e.motion.rx, -e.motion.ry, e.motion.rz};
 
93
                                        short t[3] = {(short)e.motion.x, (short)e.motion.y, (short)-e.motion.z};
 
94
                                        short r[3] = {(short)-e.motion.rx, (short)-e.motion.ry, (short)e.motion.rz};
92
95
 
93
96
                                        updateTranslation(t, now);
94
97
                                        updateRotation(r, now);