SDK Libraries

The Leap Motion library is written in C++. Leap Motion also uses SWIG, an open source tool, to generate language bindings for C#, Java, and Python. The SWIG-generated bindings translate calls written in the bound programming language to calls into the base C++ Leap Motion library. Each SWIG binding uses two additional libraries. For JavaScript and web application development, Leap Motion provides a WebSocket server and a client-side JavaScript library.

All the library, code, and header files required to develop Leap-enabled applications and plugins are included in the Leap Motion SDK, except the leap.js client JavaScript library. You can download the Leap Motion SDK from the Leap Motion Developer Portal. An SDK package is available for each supported operating system. The JavaScript client library is distributed separately and can be downloaded from the LeapJS GitHub repository.

Plugins for Unity 5 and Unreal Engine 4.9 are provided separately from the main SDK. The Unreal plugin is included with Unreal Engine 4.9+ (source code release only, at this time). The Unity plugin is available at https://developer.leapmotion.com/downloads/unity.

Supported Compilers and IDEs

  • C++ on Windows: Visual Studio 2008, 2010, 2012, and 2013
  • C++ on Mac: Xcode 3.0+, clang 3.0+, and gcc
  • Objective-C: Mac OS 10.7+, Xcode 4.2+ and clang 3.0+
  • C# for .NET framework versions 3.5 and 4.0
  • Mono version 2.10
  • Unity Pro and Personal versions 5.0
  • Java versions 6 and 7
  • Python version 2.7.3
  • UnrealEngine 4.9

Python

Leap.py contains the Python module that you reference in your Python application. This module loads LeapPython.so (Mac and Linux) or LeapPython.dll (Windows). These libraries load libLeap.dylib, Leap.dll, or libLeap.so (depending on platform).

C++

To develop for the Leap Motion Controller in C++, include the API header files in your program and link with the Leap Motion library, either libLeap.dylib, Leap.dll, or libLeap.so, depending on platform.

On Windows, separate libraries are provided for 32-bit versus 64-bit architectures as well as debug builds versus release builds (for a total of 4 versions for each component).

On Mac OS X, both architectures and release modes are supported in a single library file.

Objective-C

Objective-C applications are supported by hand-written wrapper code. To build a Leap-enabled Objective-C application, include the wrapper header and Objective-C++ code file in your application along with the Leap Motion C++ headers. You can then use the classes defined in the wrapper in (otherwise) pure Objective-C applications. Link your application with libLeap.dylib and include the library in your application package.

C#

The C# class definitions are provided for .NET 3.5 and .NET 4.0 in separate libraries. Your code can reference either LeapCSharp.NET3.5.dll or LeapCSharp.NET4.0.dll (the same library names are used for this library on all supported operating systems). These libraries load libCSharp.dylib (Mac), LeapCSharp.dll (Windows), or libLeapCSharp.so (Linux). The intermediate libraries load libLeap.dylib, Leap.dll, or libLeap.so (depending on platform).

Unity

As of Unity 5, both the Pro and Personal versions support plugins. The Unity plugin uses the C# class definitions in LeapCSharp.NET3.5.dll. This library loads the native libCSharp.dylib (Mac) or LeapCSharp.dll (Windows) library. In turn, these intermediate libraries load libLeap.dylib or Leap.dll (depending on platform).

Java

Leap.jar contains the Leap Motion Java classes. This code loads libLeapJava.dylib (Mac), LeapJava.dll (Windows), or libLeapJava.so (Linux). These libraries contain the native code that translates the Java calls to the base Leap Motion API in libLeap.dylib, Leap.dll, or libLeap.so (depending on platform). The base Leap Motion dynamic library is loaded by the intermediate library. For Windows 64-bit architectures, the Microsoft Visual C runtime libraries are also required.

JavaScript

Leap Motion JavaScript support has two main components. The first component is the WebSocket server provided by the Leap Motion service. This server allows web applications (or any application that can connect to a WebSocket) to access Leap Motion tracking data as JSON-formatted messages. The second component is the JavaScript client library, Leap.js. Leap.js is an open-source JavaScript API that consumes the WebSocket JSON output and presents it in a form that is consistent in philosophy and structure to the native Leap Motion API.

Other Languages

Many community-created language bindings are available, for a partial list, visit: Community Libraries.

Operating System Support

The Leap Motion software currently supports Linux (Ubuntu 12), OS X 10.7+, Windows 7+.