UNPKG

@threlte/xr

Version:

Tools to more easily create VR and AR experiences with Threlte

14 lines (13 loc) 557 B
import { hands } from '../../hooks/useHand.svelte.js'; export const defaultComputeFunction = (_context, handContext) => { handContext.originValid = false; const xrhand = hands[handContext.hand]; if (xrhand === undefined) return; const jointSpace = xrhand.hand.joints[handContext.joint]; if (jointSpace === undefined || jointSpace.jointRadius === undefined) return; jointSpace.updateWorldMatrix(true, false); handContext.origin.setFromMatrixPosition(jointSpace.matrixWorld); handContext.originValid = true; };