demo | ||
godot-cpp@1009da4d7e | ||
res | ||
src | ||
.gitignore | ||
.gitmodules | ||
README.md | ||
SConstruct |
🙌 Godot Ultraleap Plugin
A GDExtension plugin to use Ultraleap hand tracking in your project. See GIF below for very old status (it does more now!).
🌻 About
This GDExtension aim at exposing and abstracting the LeapC API to make Ultraleap's hand tracking available in Godot, for any kind of use. Out of the box Godot supports hand tracking through OpenXR, however that means it's only accessible for people who wants to use it for XR. Ultraleap's hand tracking is capable of tracking hands in two extra setups:
- Tabletop or "Desktop", flat on a desk pointing up
- "Screentop", on top of a monitor, pointing downward or with an angle of maximum 30 degrees
The priorities of this project is to target the most useful features of Ultraleap's hand tracking while exploring how hand tracking can be used in Godot. Because of this, there are demos and scripts that are not part of the extension but are part of the project. Some of the scripts implements new features or features related to the game engine rather than the hand tracking itself: displaying joints, rigging a skeleton etc... If possible, and when the project has matured enough, some of those extra features could be ported to the extension to make them more readily available and more performant.
✅ Features
The extension has the following features:
- Hand tracking events
- Multi-device support
- Camera images and distortion matrix
- Hand tracking interpolation
- Selecting tracking mode
- Pausing/resuming tracking
- Access to some obscure and unused parameters
One of the demos it comes with is an attempt at making a full-blown visualizer like Ultraleap's Control Panel but with more features and not using Unity. This is the main.tscn
scene.
The other important scene is an obvious rip-off of Ultraleap's Blocks demo used to test rigging a skeleton on the hand data, and interacting with objects/gestures. This one is called scenes/RiggedHands.tscn
🛠️ Build
Use SConstruct to build. More instructions to come. For now building as only been tested on Linux (and Windows but with some modifications). I aim to make this plugin buildable on Linux, MacOS, and Windows.
scons
⏩ Quick start
These are very simple instructions and barely covers all the possibilities but it shows my willingness to try and document things to help people who want to adopt this plugin
If the build went well, the final result should be found in demo/addons/godot_ultraleap_plugin
. Copy this folder over your addons
folder in your project to add it to your project. Reload your project for it to take effect.
From there the most simple way to get hand data is to add an UltraleapHandTracking node and an UltraleapDeviceNode node:
- Add an UltraleapHandTracking node to your scene
- Add a script to it with the following content (I am planning to remove this requirement in the future):
@tool
extends UltraleapHandTracking
func _ready():
start()
- Add an UltraleapDeviceNode node to your scene
- Assign the UltraleapHandTracking node to the
tracker
field on your UltraleapDeviceNode - Add a script on your UltraleapDeviceNode containing the following:
extends UltraleapDeviceNode
func _process(_delta):
var frame : UltraleapFrame = get_last_frame()
if frame != null and frame.is_right_hand_visible:
print(frame.right_hand.palm.position)
- Hit play, make sure your hand tracking camera is plugged in, flat on your desk, and show your right hand. It should print the palm position in the editor's output.