| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
NavLibSwift is a Swift package for interfacing with 3DConnexion's Navigation Framework (NavLib) on macOS. This allows you to add support for their SpaceMouse line of 3D controllers to your application and makes it easier than ever.
That's it! NavLibSwift dynamically loads the 3DconnexionNavLib framework at runtime, so you don't need to link against it or add any special linker flags. Your app will build and run even on systems without the 3DConnexion drivers installed.
If you're using the hardened runtime, make sure you disable library validation (com.apple.security.cs.disable-library-validation) to allow loading the framework. If your application is sandboxed, you'll need the USB (com.apple.security.device.usb) and Bluetooth (com.apple.security.device.bluetooth) entitlements.
If your application has multiple 3D views, you can create multiple NavLibSession instances. To activate a specific session, call setAsActiveSession().
For a minimal working example, refer to the NavLibDemo repository, which demonstrates basic integration with SceneKit.
3DConnexion's macOS support is inconsistent, and documentation is sparse. Their developer forums are also relatively inactive. There are a few ways to add SpaceMouse support on macOS:
SpaceMouse devices use the HID protocol, so you can connect to them via IOKit and read raw input values. However, this approach is impractical:
The 3DconnexionClient framework is the traditional way to interface with SpaceMouse devices. It wraps HID calls and provides some preprocessing, but:
3DconnexionNavLib is a more modern, high-level library. It manages 3D navigation for you. Instead of manually handling input data, you provide callbacks to read and write properties of your 3D environment, and the library takes care of the rest.
NavLibSwift wraps 3DconnexionNavLib to provide a streamlined Swift interface. However, due to outdated headers that no longer compile with modern versions of Clang, modified headers are included in this Swift package.
NavLibSwift is licensed under the MIT License. See the LICENSE file for details.
This project is an independent initiative and is not affiliated with or endorsed by 3DConnexion. All trademarks and registered trademarks are the property of their respective owners.
| Back | FazBrowse Home | New Git URL |