{"name":"prefab-hand-controls","title":"Hand controls","kind":"prefab","status":"available","summary":"Hand landmarks → pointer/pinch events; camera + MediaPipe HandLandmarker + its model weights bundled in, no separate model pack needed. Reported pointer position is smoothed (configurable) to cut per-frame detector jitter without adding lag to pinch detection.","spec":"prefab-hand-controls@0.1.2","version":"0.1.2","versions":["0.1.2","0.1.1","0.1.0"],"license":"MIT","source":"prototir","sizeKB":7640,"requires":["mediapipe-vision"],"permissions":["camera"],"flags":{"wasm":false,"streamed":false},"compatibility":"Desktop and mobile browsers with a camera. Needs \"permissions\": [\"camera\"] in prototir.json; the player is asked first.","install":{"manifest":"{\n  \"modules\": [\n    \"prefab-hand-controls@0.1.2\"\n  ],\n  \"permissions\": [\n    \"camera\"\n  ]\n}","importFrom":"prefab-hand-controls"},"example":"import { createHandControls } from 'prefab-hand-controls';\n\nconst hand = await createHandControls({\n  onMove({ x, y }) {\n    cursor.style.left = `${x * 100}%`;\n    cursor.style.top = `${y * 100}%`;\n  },\n  onPinch({ down }) {\n    down ? grab() : release();\n  }\n});","api":[{"heading":"createHandControls(options)","entries":[{"signature":"onMove({ x, y })","description":"Index fingertip position, 0..1 of the view, smoothed."},{"signature":"onPinch({ x, y, down })","description":"Thumb-to-index pinch, fired only when it starts or ends."},{"signature":"pinchThreshold = 0.07, numHands = 1, mirror = true","description":"Pinch distance, hands to track, and whether to mirror like a selfie view."},{"signature":"smoothing = 0.5","description":"0 is raw, closer to 1 is steadier but lags. Only the reported position is smoothed; pinch detection uses raw landmarks."},{"signature":"delegate = 'CPU', showPreview = true, video, mount","description":"'GPU' is faster where WebGL is available. showPreview draws the camera image; video passes getUserMedia constraints."}]},{"heading":"The returned object","entries":[{"signature":"video, stream, landmarker","description":"The camera element, stream and MediaPipe landmarker."},{"signature":"destroy()","description":"Stops the camera and the model."}]}],"notes":["The hand model ships with the module, so detection makes no external network calls."],"upstreamDocs":null,"labs":[]}