Plug-in to add support for 3Dconnexion Space Mouse and Space Navigator 3D mice input devices. Control the Godot Engine editor viewport camera with 6DOF (6 degrees of freedom). Freely translate the camera position and also rotate along the yaw, pitch, and roll axes. Currently supporting Godot 3.4.4.
Click Here to Download the Latest Release
For manual install, download the addons
folder from this repository and copy it into your Godot project.
- Place the
addons
folder, with all contents, into your Godot project root directory. - To enable the plug-in, click
Project
Project Settings
Plugins
and checkEnable
next to theGodot Space Mouse
entry. - Use the
Space
dock in the editor to adjust speed or change to object or camera control. - The 3Dconnexion driver is not needed on any OS. However, if you're on Windows, and have the driver installed, please first open the Godot editor, then open the 3Dconnexion app. You'll see a pop-up with the name of the Godot editor executable. Click
Advanced Settings
, then disable all navigation and zoom controls, as these can conflict with the viewport controls. - If you are using a wireless Space Mouse, on Windows, you'll have to make sure only the correct HID device is enabled for the plug-in. First do a Windows Update, and check the Optional Updates for the 3Dconnexion driver. Then open
Device Manager
, clickView
Devices by container
. You should see an entry for3Dconnexion Universal Receiver
and underneath3Dconnexion Wireless Device
which is the driver we just installed. Below that, there may be around 6 entries forHID-compliant vendor-defined device
. Right-click on each of those and disable them. You will have to clickYes
, but don't chooseRestart
. Wait until you have disabled all those on the list, then restart your machine. - On Linux you will need to allow HID access via udev rules. First, download the file
70-space-mouse.rules
from theaddons/spacemouse/bin/
folder and place this file in the correct directory for your distro, such as/etc/udev/rules.d/
. Then replug your Space Mouse hardware or runsudo udevadm control --reload-rules && sudo udevadm trigger
to update the rules. For Ubuntu, or related distros, please run this on the command line:sudo apt install libhidapi-hidraw0
. - For macOS, you must uninstall the 3Dconnexion drivers, as they're incompatible with the plug-in.
- Please note, a Space Mouse or Space Navigator hardware device from 3Dconnexion is required.
- Download
libspacemouse.c
from thesrc
folder. - Get dependencies for Godot GDNative and HIDAPI.
cl /Folibspacemouse.obj /c libspacemouse.c /nologo -EHsc -DNDEBUG /MD /I ..\godot-headers /I ..\hidapi-win\include
link /nologo /dll /out:libspacemouse.dll /implib:libspacemouse.lib libspacemouse.obj /LIBPATH:..\hidapi-win\x64 hidapi.lib
gcc -std=c11 -fPIC -c -I ../godot-headers -I /usr/include/hidapi libspacemouse.c -o libspacemouse.o
gcc -shared libspacemouse.o -o libspacemouse.so -lhidapi-hidraw
gcc -std=c11 -fPIC -c -I ../godot-headers -I ../hidapi-hidapi-0.12.0/hidapi -I ../hidapi-hidapi-0.12.0/mac libspacemouse.c -o libspacemouse.o
gcc -shared libspacemouse.o -o libspacemouse.dylib -L . -lhidapi.0
install_name_tool -change @rpath/libhidapi.0.dylib @loader_path/libhidapi.0.dylib libspacemouse.dylib
MIT License
Copyright (c) 2022 Andres Hernandez
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.