UNPKG

@threlte/xr

Version:

Tools to more easily create VR and AR experiences with Threlte

17 lines (16 loc) 484 B
import { currentWritable } from '@threlte/core'; export const left = currentWritable(undefined); export const right = currentWritable(undefined); /** * Provides a reference to a current XRHand, filtered by handedness. */ export const useHand = (handedness) => { switch (handedness) { case 'left': return left; case 'right': return right; default: throw new Error('useHand handedness must be left or right.'); } };