Glove mocap
Windows · Unity 6000.0.44f1 · Plugin 2.6.0 · Requires Teslasuit Studio
This example drives tracked hands from Teslasuit gloves. It uses the ready-made hand prefabs, so it is the quickest way to see finger tracking working. The scene is TS/Examples/Scenes/Mocap/GloveMocap.unity.
What it demonstrates#
- Using the
hand_landhand_rprefabs to get glove-tracked hands with no manual wiring. - Streaming finger tracking through a
TsLiveMotionProvider. - Retargeting finger bones with
TsHandAnimator.
Scene setup#
The scene places the two hand prefabs. Each prefab is self-contained: its root carries a TsGloveBehaviour set to the correct glove index and side, a TsLiveMotionProvider, and a TsHandAnimator wired to that provider and to a hand avatar settings asset. The prefab also contains its own finger skeleton and SkinnedMeshRenderer.
Because the prefabs carry everything they need, the scene itself does almost no wiring. The hand_l prefab is set to the left glove and hand_r to the right. For the full breakdown of what is inside each prefab, see Hand prefabs.
The key API pattern#
TsGloveBehaviour resolves the glove from index and side, TsLiveMotionProvider starts the stream, and TsHandAnimator applies finger rotations each frame.
// Inside the prefab, on the hand root.
private void Update()
{
var skeleton = m_motionProvider.GetSkeleton(Time.time); // from TsLiveMotionProvider
foreach (var finger in m_avatarSettings.HandFingers)
{
var targetRotation = Conversion.TsRotationToUnityRotation(
skeleton.GetBoneTransform(finger.boneIndex).rotation);
// boneTransform.rotation = offset * targetRotation * poseRotation
}
}The finger-to-transform mapping lives in the prefab's TsHandAvatarSettings asset, already configured for the bundled hand mesh.
Reproducing it in your project#
- Drag
hand_landhand_rfromTS/Examples/Prefabsinto your scene. - Set the glove index and side on each
TsGloveBehaviourto match your hardware. - Enter play mode with the gloves connected.
Note. The hand prefabs are not tied to this scene. They work as-is anywhere once a glove connects, which is why this example is mostly prefab placement.
The scene also carries an orbit camera (OrbitalCamera, CameraMouseInput, CameraFocusPoint) so you can view the hands from any angle: hold the left mouse button and drag to orbit. It is demo scaffolding, not a plugin component, so it is only worth knowing about if you are exploring this scene in the editor.
What to read next#
- Hand prefabs: what the prefabs contain and how to retarget them.
- Suit mocap: the full-body equivalent.
TsHandAnimatorreference: the finger retargeting API.
