Develop
Develop
Select your platform

Haptics Native SDK

Updated: Nov 25, 2024
Banner image displaying native SDK code.

Overview

Note on public experimental features:
  • You are permitted to distribute apps built with Haptics Native SDK on the Store.
  • You do not need to put your device in Experimental Mode to use this SDK.
By the end of this guide, you will be able to:
  • Explain how and why to use the Haptics Native SDK
  • Describe examples how the Haptics Native SDK can be used
  • Describe the workflow for designing and integrating haptics with Meta Haptics Studio and Haptics Native SDK
With the Haptics Native SDK you can easily integrate realistic vibrations on Meta Quest and other PCVR controllers by playing back .haptic clips created with Meta Haptics Studio offering pre-built effects, customization options, and support for multiple hardware devices.
A .haptic clip is a pre-authored haptic pattern created in Meta Haptics Studio that can be played back on a Meta Quest and other PCVR controllers. The haptic pattern contains information about the amplitude, frequency, emphasis and duration of the vibration.
The Haptics SDK provides a unified haptics API. The SDK optimizes the haptic pattern for the used controllers, using high-fidelity haptics when supported by the OpenXR runtime and controllers, and lower fidelity haptics with a fixed vibration frequency or a lower sample rate otherwise. This feature ensures your haptic clips are compatible with all kinds of devices.
This document describes the Haptics Native SDK, which is for integrating the Haptics SDK into native applications. For integrating the SDK into applications based on Unity, use the Haptics SDK for Unity, and for integrating into applications based on Unreal, use the Haptics SDK for Unreal.
The Haptics SDK plays back .haptic clips in your app, making controllers vibrate.

How does the Haptics Native SDK work?

The Haptics SDK plays back haptic patterns in your application, making your controllers vibrate by playing back clips in the .haptic format.
Author haptic clip in Haptics Studio. Export the .haptic clip. The SDK converts clips to vibration patterns. Vibration patterns are sent to the controller.
  1. Design your haptics patterns using Meta Haptics Studio.
  2. Export your designs as .haptic files.
  3. Download and install the Haptics Native SDK.
  4. Import the .haptic file.
  5. Build, install and start the application to trigger the event and feel the vibrations.
  6. The SDK will automatically detect the type of controller being used and adjust the vibrations accordingly.
  7. The haptic pattern is sent to the controller, triggering it to vibrate.
The SDK provides a C API so it can be integrated into applications written in C or C++.
Triggering a vibration is also possible by directly using the OpenXR haptic feedback API with the Meta extension for using PCM samples as the vibration data. The SDK provides a high-level abstraction over the PCM API to make it simple to play back haptic clips in the .haptic format.
Additionally, the SDK provides the following features on top:
  • Dynamic amplitude and frequency modulation during clip playback.
  • Looping clips.
  • Support for playing back multiple haptic clips on the same controller at the same time, with manual prioritization, and with automatic resumption of long haptic clips that were interrupted by a shorter haptic clip.
  • A hardware-agnostic file format that is forward compatible with future controllers.
The SDK provides a C API so it can be integrated into applications written in C or C++. Other languages that can call into a C API, such as Rust, should also work.
Did you find this page helpful?