@vincentt-xr/sdk 2.0.0-alpha.7 → 2.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GROUNDING.md +5651 -82
- package/README.md +1 -0
- package/dist/CanonicalHeadFrame-BHcWyaiK.js +1506 -0
- package/dist/CanonicalHeadFrame-D-_T1OMU.cjs +1 -0
- package/dist/DebuggerUI-7ngnJsBe.js +275 -0
- package/dist/DebuggerUI-CoglgKdO.cjs +1 -0
- package/dist/FaceRetouch-CLoTfrcs.js +1071 -0
- package/dist/FaceRetouch-J1lC1WbS.cjs +134 -0
- package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
- package/dist/FaceSurface-DmP9AEeC.js +27 -0
- package/dist/SegmentationOverlay-D_FWkcyP.cjs +35 -0
- package/dist/SegmentationOverlay-vn5x_knv.js +6237 -0
- package/dist/SkeletonUtils-C2r90MtN.js +21 -0
- package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
- package/dist/TextLabel-XE0rQSDn.cjs +2 -0
- package/dist/TextLabel-c9BCucOI.js +961 -0
- package/dist/assets/cache.d.ts +99 -0
- package/dist/assets/estimate.d.ts +11 -0
- package/dist/assets/gltfLoader.d.ts +16 -0
- package/dist/assets/index.d.ts +7 -0
- package/dist/assets/loaders.d.ts +43 -0
- package/dist/assets/react.d.ts +33 -0
- package/dist/body-pose/index.d.ts +521 -0
- package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
- package/dist/body-trigger/frame.d.ts +88 -0
- package/dist/body-trigger/index.d.ts +6 -0
- package/dist/body-trigger/moves.d.ts +235 -0
- package/dist/body-trigger/trigger.d.ts +75 -0
- package/dist/calibration/calibration.d.ts +75 -0
- package/dist/calibration/index.d.ts +6 -0
- package/dist/calibration/storage.d.ts +13 -0
- package/dist/calibration/types.d.ts +53 -0
- package/dist/calibration/useXRCalibration.d.ts +46 -0
- package/dist/camera/CameraPermissionGate.d.ts +26 -0
- package/dist/camera/devices.d.ts +26 -0
- package/dist/camera/index.d.ts +8 -0
- package/dist/camera/permission.d.ts +86 -0
- package/dist/camera/useCameraPermission.d.ts +35 -0
- package/dist/canonicalFace-BHwyCx1c.js +9 -0
- package/dist/canonicalFace-C83I225R.cjs +1 -0
- package/dist/capabilities/detect.d.ts +45 -0
- package/dist/capabilities/index.d.ts +5 -0
- package/dist/capabilities/types.d.ts +120 -0
- package/dist/capabilities/useXRCapabilities.d.ts +18 -0
- package/dist/compat/environment.d.ts +5 -0
- package/dist/compat/index.d.ts +4 -0
- package/dist/compat/run.d.ts +18 -0
- package/dist/compat/scenarios.d.ts +10 -0
- package/dist/compat/types.d.ts +101 -0
- package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
- package/dist/components/BodyInstruction/index.d.ts +69 -0
- package/dist/components/BodyInstruction/useBodyPose.d.ts +23 -0
- package/dist/components/BodyTracker/index.d.ts +17 -0
- package/dist/components/BodyTrigger/index.d.ts +49 -0
- package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
- package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
- package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
- package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
- package/dist/components/FaceAtlas/constants.d.ts +8 -0
- package/dist/components/FaceAtlas/index.d.ts +7 -0
- package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
- package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
- package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
- package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
- package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
- package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
- package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
- package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
- package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
- package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
- package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
- package/dist/components/FaceCharacter/index.d.ts +18 -0
- package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
- package/dist/components/FaceInset/FaceInset.d.ts +68 -0
- package/dist/components/FaceInset/frame.d.ts +94 -0
- package/dist/components/FaceInset/index.d.ts +6 -0
- package/dist/components/FaceInset/material.d.ts +40 -0
- package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
- package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
- package/dist/components/FaceInstruction/index.d.ts +56 -0
- package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
- package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
- package/dist/components/FaceLiquify/debug.d.ts +37 -0
- package/dist/components/FaceLiquify/frame.d.ts +55 -0
- package/dist/components/FaceLiquify/index.d.ts +10 -0
- package/dist/components/FaceLiquify/material.d.ts +39 -0
- package/dist/components/FaceLiquify/pass.d.ts +49 -0
- package/dist/components/FaceLiquify/presence.d.ts +25 -0
- package/dist/components/FaceLiquify/presets.d.ts +82 -0
- package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
- package/dist/components/FaceLiquify/target.d.ts +85 -0
- package/dist/components/FaceLiquify/warp.d.ts +72 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +37 -5
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +1 -1
- package/dist/components/FaceMesh/index.d.ts +2 -2
- package/dist/components/FaceRetouch/Background.d.ts +3 -1
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +5 -0
- package/dist/components/FaceRetouch/renderState.d.ts +19 -0
- package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
- package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
- package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
- package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
- package/dist/components/FaceSwap/index.d.ts +13 -0
- package/dist/components/FaceSwap/settings.d.ts +300 -0
- package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
- package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
- package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
- package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
- package/dist/components/FaceWarp3D/index.d.ts +2 -3
- package/dist/components/Faceless/Faceless.d.ts +51 -0
- package/dist/components/Faceless/index.d.ts +2 -0
- package/dist/components/GestureListener/index.d.ts +11 -0
- package/dist/components/HairLock/HairLock.d.ts +39 -0
- package/dist/components/HairLock/index.d.ts +2 -0
- package/dist/components/HairLock/lockGeometry.d.ts +15 -0
- package/dist/components/HandCutout/index.d.ts +35 -0
- package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
- package/dist/components/HandInstruction/index.d.ts +74 -0
- package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
- package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
- package/dist/components/HandRig/HandAttachment.d.ts +34 -0
- package/dist/components/HandRig/HandOccluder.d.ts +55 -0
- package/dist/components/HandRig/HandTattoo.d.ts +61 -0
- package/dist/components/HandRig/WristAttachment.d.ts +34 -0
- package/dist/components/HandRig/index.d.ts +101 -0
- package/dist/components/HandRig/useArmMask.d.ts +29 -0
- package/dist/components/HandRig/wristSolve.d.ts +69 -0
- package/dist/components/HandTouch/HandTouch.d.ts +62 -0
- package/dist/components/HandTouch/Touchable.d.ts +36 -0
- package/dist/components/HandTouch/index.d.ts +2 -0
- package/dist/components/HandTracker/index.d.ts +10 -0
- package/dist/components/HeadBinding/index.d.ts +14 -0
- package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
- package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
- package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
- package/dist/components/HeadOccluder/NeckOccluder.d.ts +64 -0
- package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
- package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
- package/dist/components/HeadOccluder/index.d.ts +57 -3
- package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
- package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
- package/dist/components/HolisticTracker/index.d.ts +69 -0
- package/dist/components/HolisticTracker/settings.d.ts +58 -0
- package/dist/components/HolisticTracker/signals.d.ts +49 -0
- package/dist/components/Instruction/HintStage.d.ts +29 -0
- package/dist/components/Instruction/InstructionCue.d.ts +126 -0
- package/dist/components/Instruction/gestureHold.d.ts +20 -0
- package/dist/components/Instruction/ghost.d.ts +129 -0
- package/dist/components/Instruction/hintBlend.d.ts +19 -0
- package/dist/components/Instruction/hintLook.d.ts +81 -0
- package/dist/components/Instruction/hintLoop.d.ts +36 -0
- package/dist/components/Instruction/index.d.ts +41 -0
- package/dist/components/Instruction/useGhostModel.d.ts +33 -0
- package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
- package/dist/components/IrisEffect/IrisMaterial.d.ts +73 -0
- package/dist/components/IrisEffect/index.d.ts +51 -0
- package/dist/components/IrisEffect/settings.d.ts +117 -0
- package/dist/components/LipEffect/LipEffect.d.ts +27 -1
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +95 -7
- package/dist/components/LipEffect/LipEffects.d.ts +12 -0
- package/dist/components/LipEffect/defaults.d.ts +46 -4
- package/dist/components/LipEffect/index.d.ts +11 -3
- package/dist/components/LipEffect/lipShading.d.ts +73 -0
- package/dist/components/LipEffect/settings.d.ts +375 -0
- package/dist/components/LipEffect/shader.d.ts +39 -0
- package/dist/components/LipEffect/types.d.ts +128 -9
- package/dist/components/LipEffect/useLipDesignTextures.d.ts +17 -0
- package/dist/components/LipEffect/uvGuide.d.ts +74 -0
- package/dist/components/Makeup/Blush.d.ts +18 -0
- package/dist/components/Makeup/Brows.d.ts +20 -0
- package/dist/components/Makeup/Contour.d.ts +17 -0
- package/dist/components/Makeup/Eyeliner.d.ts +20 -0
- package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
- package/dist/components/Makeup/Highlighter.d.ts +18 -0
- package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
- package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
- package/dist/components/Makeup/constants.d.ts +44 -0
- package/dist/components/Makeup/design.d.ts +106 -0
- package/dist/components/Makeup/designSamples.d.ts +42 -0
- package/dist/components/Makeup/eyes.d.ts +114 -0
- package/dist/components/Makeup/fields.d.ts +10 -0
- package/dist/components/Makeup/geometry.d.ts +106 -0
- package/dist/components/Makeup/index.d.ts +26 -0
- package/dist/components/Makeup/looks.d.ts +28 -0
- package/dist/components/Makeup/material.d.ts +239 -0
- package/dist/components/Makeup/settings.d.ts +54 -0
- package/dist/components/Makeup/shades.d.ts +143 -0
- package/dist/components/Makeup/shapes.d.ts +27 -0
- package/dist/components/Makeup/skinTone.d.ts +135 -0
- package/dist/components/Makeup/types.d.ts +110 -0
- package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
- package/dist/components/Necklace/Necklace.d.ts +44 -0
- package/dist/components/Necklace/index.d.ts +1 -0
- package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
- package/dist/components/ParticleEmitter/index.d.ts +1 -0
- package/dist/components/PersonCutout/index.d.ts +50 -0
- package/dist/components/PersonCutout/personCutout.d.ts +16 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +1 -1
- package/dist/components/ScreenImage/index.d.ts +3 -1
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +1 -1
- package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
- package/dist/components/ScreenImage/source.d.ts +6 -0
- package/dist/components/ScreenImage/types.d.ts +18 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlay.d.ts +37 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlayMaterial.d.ts +31 -0
- package/dist/components/SegmentationOverlay/index.d.ts +9 -0
- package/dist/components/SegmentationOverlay/maskTexture.d.ts +23 -0
- package/dist/components/SegmentationOverlay/providers.d.ts +72 -0
- package/dist/components/SegmentationOverlay/settings.d.ts +65 -0
- package/dist/components/ShoulderOccluder/index.d.ts +43 -0
- package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +24 -0
- package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
- package/dist/components/SpringSwing/index.d.ts +1 -0
- package/dist/components/XRProvider/index.d.ts +16 -2
- package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
- package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +1 -1
- package/dist/components/index.d.ts +11 -0
- package/dist/config/index.d.ts +0 -1
- package/dist/constants/index.d.ts +4 -1
- package/dist/context-DTxSQvp4.js +13 -0
- package/dist/context-hA0Rb2Xa.cjs +1 -0
- package/dist/contexts-BH7PdKFS.cjs +1 -0
- package/dist/contexts-jak8-tND.js +667 -0
- package/dist/coordinates/feed.d.ts +52 -0
- package/dist/coordinates/index.d.ts +7 -0
- package/dist/coordinates/side.d.ts +40 -0
- package/dist/coordinates/spaces.d.ts +49 -0
- package/dist/coordinates/viewport.d.ts +22 -0
- package/dist/coordinates/world.d.ts +15 -0
- package/dist/debug-ui/default-setting.cjs +2 -2
- package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
- package/dist/debug-ui/gesture-settings/index.d.ts +14 -0
- package/dist/debug-ui/hierarchy-panel/index.d.ts +3 -2
- package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
- package/dist/debug-ui/index.d.ts +18 -3
- package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
- package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
- package/dist/debug-ui/media-source/index.d.ts +1 -1
- package/dist/debug-ui/media-source/session.d.ts +30 -2
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui/object-inspector-panel/index.d.ts +3 -2
- package/dist/debug-ui/product-hotspots/index.d.ts +25 -0
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +3 -1
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +3 -1
- package/dist/debug-ui/screen-image-settings/index.d.ts +3 -1
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +1 -1
- package/dist/debug-ui/screen-text-settings/types.d.ts +2 -0
- package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
- package/dist/debug-ui/settings-panel/index.d.ts +6 -1
- package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
- package/dist/debug-ui/xr-diagnostics/index.d.ts +26 -0
- package/dist/debug-ui.cjs +3 -3
- package/dist/debug-ui.js +2695 -2547
- package/dist/detector-K8aej4MB.js +59 -0
- package/dist/detector-ijypGtse.cjs +1 -0
- package/dist/entries/all.d.ts +3 -1
- package/dist/entries/core.d.ts +20 -2
- package/dist/entries/face-effects.d.ts +123 -9
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +2 -1
- package/dist/entries/low-level.d.ts +49 -3
- package/dist/entries/particles.d.ts +11 -0
- package/dist/entries/product.d.ts +11 -0
- package/dist/entries/tracking.d.ts +60 -2
- package/dist/face-atlas/attributes.d.ts +30 -0
- package/dist/face-atlas/eyes.d.ts +272 -0
- package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
- package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
- package/dist/face-atlas/glsl/common.d.ts +55 -0
- package/dist/face-atlas/glsl/design.d.ts +49 -0
- package/dist/face-atlas/glsl/eyes.d.ts +73 -0
- package/dist/face-atlas/glsl/finish.d.ts +24 -0
- package/dist/face-atlas/glsl/format.d.ts +4 -0
- package/dist/face-atlas/glsl/index.d.ts +59 -0
- package/dist/face-atlas/glsl/shading.d.ts +15 -0
- package/dist/face-atlas/glsl/shapes.d.ts +66 -0
- package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
- package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
- package/dist/face-atlas/guide.d.ts +51 -0
- package/dist/face-atlas/index.d.ts +25 -0
- package/dist/face-atlas/lead.d.ts +117 -0
- package/dist/face-atlas/madeUpCamera.d.ts +125 -0
- package/dist/face-atlas/masks.d.ts +53 -0
- package/dist/face-atlas/obj.d.ts +69 -0
- package/dist/face-atlas/polylines.d.ts +63 -0
- package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
- package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
- package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
- package/dist/face-atlas/probe/constants.d.ts +137 -0
- package/dist/face-atlas/probe/glsl.d.ts +43 -0
- package/dist/face-atlas/probe/lightFit.d.ts +108 -0
- package/dist/face-atlas/probe/schedule.d.ts +44 -0
- package/dist/face-atlas/probe/selfTest.d.ts +87 -0
- package/dist/face-atlas/probe/stats.d.ts +143 -0
- package/dist/face-atlas/probe/targets.d.ts +70 -0
- package/dist/face-atlas/probe/unwrap.d.ts +76 -0
- package/dist/face-atlas/quality.d.ts +28 -0
- package/dist/face-atlas/regions.d.ts +31 -0
- package/dist/face-atlas/registry.d.ts +252 -0
- package/dist/face-atlas/renderState.d.ts +86 -0
- package/dist/face-atlas/selfOcclusion.d.ts +62 -0
- package/dist/face-atlas/shading.d.ts +406 -0
- package/dist/face-atlas/shapes.d.ts +86 -0
- package/dist/face-atlas/sides.d.ts +41 -0
- package/dist/face-atlas/skinMask.d.ts +35 -0
- package/dist/face-atlas/surface.d.ts +155 -0
- package/dist/face-atlas/topology.d.ts +44 -0
- package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
- package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
- package/dist/face-character/bindFaceModel.d.ts +106 -0
- package/dist/face-character/canonicalFace.d.ts +17 -0
- package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
- package/dist/face-character/canonicalFacePositions.d.ts +7 -0
- package/dist/face-character/driveFaceModel.d.ts +57 -0
- package/dist/face-character/expressionOutputs.d.ts +45 -0
- package/dist/face-character/faceExpressions.d.ts +104 -0
- package/dist/face-character/faceImageLandmarker.d.ts +93 -0
- package/dist/face-character/faceMeshBinding.d.ts +62 -0
- package/dist/face-character/faceMorph.d.ts +77 -0
- package/dist/face-character/faceMorphs.d.ts +46 -0
- package/dist/face-character/facePhoto.d.ts +138 -0
- package/dist/face-character/facePiercings.d.ts +116 -0
- package/dist/face-character/facePin.d.ts +131 -0
- package/dist/face-character/faceReprojection.d.ts +273 -0
- package/dist/face-character/faceReprojector.d.ts +171 -0
- package/dist/face-character/faceRig.d.ts +176 -0
- package/dist/face-character/faceSwapPresence.d.ts +85 -0
- package/dist/face-character/faceTexture.d.ts +169 -0
- package/dist/face-character/faceTextureBaker.d.ts +86 -0
- package/dist/face-character/faceTextureGuide.d.ts +106 -0
- package/dist/face-character/faceTextureStats.d.ts +298 -0
- package/dist/face-character/faceTransfer.d.ts +396 -0
- package/dist/face-character/faceTransferGeometry.d.ts +109 -0
- package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
- package/dist/face-character/faceWarp3D.d.ts +101 -0
- package/dist/face-character/faceless.d.ts +79 -0
- package/dist/face-character/featureWarp.d.ts +28 -0
- package/dist/face-character/liveFaceRegistry.d.ts +370 -0
- package/dist/face-character/liveValue.d.ts +12 -0
- package/dist/face-character/memo.d.ts +15 -0
- package/dist/face-effects.cjs +2324 -1
- package/dist/face-effects.js +14208 -2268
- package/dist/face-expression/index.d.ts +182 -0
- package/dist/face-info/landmarks.d.ts +17 -3
- package/dist/face-info/types.d.ts +20 -3
- package/dist/gestures/definitions.d.ts +98 -0
- package/dist/gestures/detector.d.ts +87 -0
- package/dist/gestures/index.d.ts +8 -0
- package/dist/gestures/measures.d.ts +114 -0
- package/dist/gestures/settings.d.ts +49 -0
- package/dist/getFaceInfo-B1otSDMX.cjs +1 -0
- package/dist/getFaceInfo-Cu4xDWiL.js +62 -0
- package/dist/hand/armFit.d.ts +46 -0
- package/dist/hand/armMask.d.ts +178 -0
- package/dist/hand/handCutout.d.ts +23 -0
- package/dist/hand/handCutoutRegistry.d.ts +7 -0
- package/dist/hand/handGestures.d.ts +524 -0
- package/dist/hand/handPose.d.ts +98 -0
- package/dist/hand/handRigSolver.d.ts +159 -0
- package/dist/hand/handTattoo.d.ts +81 -0
- package/dist/hand/handTouch.d.ts +240 -0
- package/dist/hand/wrist.d.ts +44 -0
- package/dist/hand/wristFilter.d.ts +44 -0
- package/dist/hooks/selectors.d.ts +76 -1
- package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
- package/dist/hooks/useFaceInfo.d.ts +13 -1
- package/dist/hooks/useFaceInfos.d.ts +1 -1
- package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
- package/dist/hooks/useGesture.d.ts +32 -0
- package/dist/hooks/useIrisTracking.d.ts +45 -0
- package/dist/hooks/useTrackerContext.d.ts +6 -0
- package/dist/hooks/useXRDiagnostics.d.ts +81 -0
- package/dist/hooks/useXRModel.d.ts +7 -0
- package/dist/hooks/useXRSession/facade.d.ts +42 -2
- package/dist/hooks/useXRSession/index.d.ts +2 -2
- package/dist/hooks/useXRSession/reason.d.ts +3 -1
- package/dist/hooks/useXRSession/registry.d.ts +14 -0
- package/dist/hooks/useXRSession/store.d.ts +52 -3
- package/dist/index-B1_TzJaI.js +1104 -0
- package/dist/index-BavF06C6.js +190 -0
- package/dist/index-BfFmpddl.cjs +21 -0
- package/dist/index-BuBzneeW.cjs +46 -0
- package/dist/index-CGsQWodV.cjs +1 -0
- package/dist/index-CIe7eCMH.js +3200 -0
- package/dist/index-CfSF8LXa.cjs +1 -0
- package/dist/index-D5GTzOzD.cjs +1 -0
- package/dist/index-DBhQzvVa.js +314 -0
- package/dist/index-DE17y0ZI.cjs +1 -0
- package/dist/index-JII7huPk.js +442 -0
- package/dist/index-tpCr9CLj.cjs +1 -0
- package/dist/index-w1S7fI2B.js +1432 -0
- package/dist/index-zGaqrz_K.js +188 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1507 -0
- package/dist/{internal-Dmk1cTXq.js → internal-B90P-clC.js} +138 -119
- package/dist/internal-Cjinca64.cjs +1 -0
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +15 -10
- package/dist/iris/compute.d.ts +27 -0
- package/dist/iris/index.d.ts +4 -0
- package/dist/iris/lead.d.ts +19 -0
- package/dist/iris/types.d.ts +89 -0
- package/dist/landmarkMask-BFDyBnKM.js +224 -0
- package/dist/landmarkMask-u7es2k4X.cjs +1 -0
- package/dist/landmarks-BlUqf5MZ.cjs +1 -0
- package/dist/landmarks-bftdwq6Z.js +76 -0
- package/dist/loaders-BGAUACsd.js +363 -0
- package/dist/loaders-BJ1_QCHt.cjs +1 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +1190 -675
- package/dist/main.cjs +1 -1
- package/dist/main.js +1190 -452
- package/dist/models/Base/index.d.ts +49 -0
- package/dist/models/Body/index.d.ts +3 -1
- package/dist/models/Face/constants.d.ts +8 -0
- package/dist/models/Face/index.d.ts +4 -12
- package/dist/models/Face/rotation.d.ts +18 -3
- package/dist/models/Hand/GestureTracking.d.ts +1 -1
- package/dist/models/Hand/HandTracking.d.ts +17 -1
- package/dist/models/Holistic/index.d.ts +49 -0
- package/dist/models/Holistic/result.d.ts +68 -0
- package/dist/models/Segmentation/index.d.ts +2 -0
- package/dist/models/SemanticSegmentation/index.d.ts +31 -0
- package/dist/models/SemanticSegmentation/presets.d.ts +28 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/nodeSource.d.ts +9 -0
- package/dist/particles/emission.d.ts +24 -0
- package/dist/particles/eyes.d.ts +24 -0
- package/dist/particles/glsl.d.ts +14 -0
- package/dist/particles/index.d.ts +10 -0
- package/dist/particles/motion.d.ts +42 -0
- package/dist/particles/presets.d.ts +12 -0
- package/dist/particles/ring.d.ts +58 -0
- package/dist/particles/selfTest.d.ts +53 -0
- package/dist/particles/settings.d.ts +127 -0
- package/dist/particles/shapes.d.ts +29 -0
- package/dist/particles/spawner.d.ts +60 -0
- package/dist/particles/system.d.ts +64 -0
- package/dist/particles.cjs +122 -0
- package/dist/particles.js +774 -0
- package/dist/product/ProductDimensions.d.ts +16 -0
- package/dist/product/ProductHotspot.d.ts +16 -0
- package/dist/product/ProductViewer.d.ts +9 -0
- package/dist/product/details.d.ts +53 -0
- package/dist/product/index.d.ts +14 -0
- package/dist/product/loadModelViewer.d.ts +4 -0
- package/dist/product/types.d.ts +71 -0
- package/dist/product/useProductAr.d.ts +37 -0
- package/dist/product/useProductDetails.d.ts +60 -0
- package/dist/product.cjs +1 -0
- package/dist/product.js +414 -0
- package/dist/providers-C8rE26Uf.js +366 -0
- package/dist/providers-DHsrhDI2.cjs +62 -0
- package/dist/quality/XRQualityController.d.ts +25 -0
- package/dist/quality/controller.d.ts +33 -0
- package/dist/quality/index.d.ts +6 -0
- package/dist/quality/types.d.ts +100 -0
- package/dist/quality/useXRQuality.d.ts +28 -0
- package/dist/render/renderPasses.d.ts +8 -0
- package/dist/render/sceneBeforeRender.d.ts +12 -0
- package/dist/{renderGroups-KZk6eRiY.js → renderGroups-B38pUaX2.js} +1 -1
- package/dist/{renderGroups-80H3DpTl.cjs → renderGroups-Cb_4Ar1Q.cjs} +1 -1
- package/dist/renderPasses-B6l8IpJv.js +1290 -0
- package/dist/renderPasses-dqmkft4P.cjs +158 -0
- package/dist/renderState-CJNmj5jz.js +39 -0
- package/dist/renderState-apSfg4eR.cjs +1 -0
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/segmentation-Cb3ouK6Z.js +1758 -0
- package/dist/segmentation-D9pYO6aR.cjs +1 -0
- package/dist/segmentation2d/faceMemory.d.ts +28 -0
- package/dist/segmentation2d/faceRegions.d.ts +24 -0
- package/dist/segmentation2d/index.d.ts +9 -0
- package/dist/segmentation2d/maskUv.d.ts +23 -0
- package/dist/segmentation2d/rasterize.d.ts +14 -0
- package/dist/segmentation2d/types.d.ts +52 -0
- package/dist/select-Ck5LGz-J.cjs +1 -0
- package/dist/select-pYRo_win.js +233 -0
- package/dist/selectors-C4X71aoD.cjs +1 -0
- package/dist/selectors-DmNaKIwE.js +196 -0
- package/dist/session-BrH8G7iJ.cjs +31 -0
- package/dist/session-DgA_z6O1.js +418 -0
- package/dist/settings-BJ7FMBsO.js +111 -0
- package/dist/settings-C63FMBlF.cjs +1 -0
- package/dist/similarityFit-BFqHND2e.cjs +1 -0
- package/dist/similarityFit-Bbz-R8AY.js +91 -0
- package/dist/spring/index.d.ts +2 -0
- package/dist/spring/spring.d.ts +69 -0
- package/dist/spring/swing.d.ts +54 -0
- package/dist/subjects/index.d.ts +2 -0
- package/dist/subjects/select.d.ts +62 -0
- package/dist/subjects/types.d.ts +55 -0
- package/dist/tracking-config/apply.d.ts +57 -0
- package/dist/tracking-config/index.d.ts +7 -0
- package/dist/tracking-config/resolve.d.ts +25 -0
- package/dist/tracking-config/storage.d.ts +8 -0
- package/dist/tracking-config/types.d.ts +106 -0
- package/dist/tracking-config/useXRTrackingConfig.d.ts +38 -0
- package/dist/tracking.cjs +10 -1
- package/dist/tracking.js +1326 -506
- package/dist/trigger-D0Pm9noT.cjs +49 -0
- package/dist/trigger-IQeys0oS.js +2128 -0
- package/dist/types/compositor.d.ts +21 -0
- package/dist/types/face.d.ts +20 -1
- package/dist/types/hand-tracking.d.ts +9 -0
- package/dist/types/holistic.d.ts +121 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/model.d.ts +22 -2
- package/dist/types/nodes.d.ts +47 -3
- package/dist/types/segmentation.d.ts +24 -0
- package/dist/types/session.d.ts +41 -3
- package/dist/updateThrottle-BseecYag.js +4 -0
- package/dist/updateThrottle-Of5Y4SVa.cjs +1 -0
- package/dist/useFaceInfo-BHDNCvsJ.cjs +1 -0
- package/dist/useFaceInfo-J4x7LsqL.js +76 -0
- package/dist/useFaceResultReader-BvEo5REG.js +61 -0
- package/dist/useFaceResultReader-DuaL1KJG.cjs +1 -0
- package/dist/useInstructionHold-DOu-RpCM.js +53 -0
- package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
- package/dist/useXRCapabilities-Cr3RzuAW.cjs +1 -0
- package/dist/useXRCapabilities-Cxmlmpbd.js +30 -0
- package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
- package/dist/utils/fns.d.ts +6 -3
- package/dist/utils/headOccluderFit.d.ts +42 -0
- package/dist/utils/integrity.d.ts +21 -1
- package/dist/utils/resolveNumFaces.d.ts +13 -0
- package/dist/utils/shoulderOccluderFit.d.ts +38 -0
- package/dist/utils/similarityFit.d.ts +23 -0
- package/dist/utils/updateThrottle.d.ts +2 -0
- package/dist/utils/useStableUniforms.d.ts +18 -0
- package/dist/uv-BMFt19bg.cjs +1 -0
- package/dist/{index-ByoNj0QP.js → uv-DJU_XfmN.js} +15 -247
- package/docs/SDK_DOCUMENTATION.md +1 -2
- package/docs/api/adaptive-quality.mdx +104 -0
- package/docs/api/asset-lifecycle.mdx +78 -0
- package/docs/api/body-instructions.mdx +285 -0
- package/docs/api/body-triggers.mdx +234 -0
- package/docs/api/camera-permission.mdx +142 -0
- package/docs/api/coordinate-spaces.mdx +168 -0
- package/docs/api/cross-camera.mdx +89 -0
- package/docs/api/debug-ui-scene-editor.mdx +23 -2
- package/docs/api/diagnostics-calibration.mdx +97 -0
- package/docs/api/external-face-mesh.mdx +231 -0
- package/docs/api/face-actions.mdx +20 -16
- package/docs/api/face-attribute-expression.mdx +1 -1
- package/docs/api/face-binding-anchors.mdx +4 -2
- package/docs/api/face-character.mdx +157 -0
- package/docs/api/face-effects.mdx +9 -0
- package/docs/api/face-expression-controller.mdx +153 -0
- package/docs/api/face-info.mdx +17 -11
- package/docs/api/face-inset.mdx +204 -0
- package/docs/api/face-instructions.mdx +183 -0
- package/docs/api/face-liquify.mdx +196 -0
- package/docs/api/face-mesh.mdx +8 -9
- package/docs/api/face-morph.mdx +117 -0
- package/docs/api/face-painting.mdx +7 -0
- package/docs/api/face-reprojection.mdx +154 -0
- package/docs/api/face-retouching.mdx +18 -10
- package/docs/api/face-swap.mdx +350 -0
- package/docs/api/face-warp-3d.mdx +166 -0
- package/docs/api/faceless.mdx +143 -0
- package/docs/api/gestures.mdx +209 -0
- package/docs/api/hair.mdx +97 -0
- package/docs/api/hand-instructions.mdx +222 -0
- package/docs/api/hand-rig.mdx +535 -0
- package/docs/api/hand-touch.mdx +162 -0
- package/docs/api/head-occluder.mdx +563 -0
- package/docs/api/holistic-tracker.mdx +164 -0
- package/docs/api/instructions.mdx +323 -0
- package/docs/api/iris-tracking.mdx +247 -0
- package/docs/api/made-up-camera.mdx +131 -0
- package/docs/api/makeup-skin-tone.mdx +135 -0
- package/docs/api/makeup.mdx +353 -0
- package/docs/api/multi-subject.mdx +98 -0
- package/docs/api/particles.mdx +155 -0
- package/docs/api/person-cutout.mdx +136 -0
- package/docs/api/pin-to-face-mesh.mdx +274 -0
- package/docs/api/product-ar.mdx +114 -0
- package/docs/api/product-details.mdx +78 -0
- package/docs/api/screen-space-coordinates.mdx +4 -1
- package/docs/api/segmentation-overlay.mdx +301 -0
- package/docs/api/session-lifecycle.mdx +136 -0
- package/docs/api/trackers.mdx +5 -0
- package/docs/api/tracking-config.mdx +108 -0
- package/docs/docs.json +51 -1
- package/docs/examples/lip-shaders.mdx +273 -0
- package/docs/guides/face-atlas-template.svg +1 -0
- package/docs/guides/face-atlas-textures.mdx +186 -0
- package/docs/guides/face-texture-template.svg +1 -0
- package/docs/guides/harness-debug-ui.mdx +4 -4
- package/docs/guides/lip-effect-textures.mdx +368 -0
- package/docs/guides/lip-uv-template.png +0 -0
- package/docs/guides/lip-uv-template.svg +1 -0
- package/docs/guides/makeup-design-textures.mdx +109 -0
- package/docs/introduction.mdx +1 -2
- package/package.json +23 -1
- package/dist/DebuggerUI-B6bP6P9r.cjs +0 -1
- package/dist/DebuggerUI-BjOMr8q_.js +0 -269
- package/dist/FaceMeshRenderer-C5l6VLdO.cjs +0 -155
- package/dist/FaceMeshRenderer-wjAHrJzP.js +0 -1270
- package/dist/FaceRetouch-BkJzoA79.cjs +0 -134
- package/dist/FaceRetouch-DwbKQJAN.js +0 -551
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +0 -15
- package/dist/components/FaceWarp3D/defaults.d.ts +0 -37
- package/dist/components/FaceWarp3D/warp.d.ts +0 -13
- package/dist/contexts-ByhzppYl.js +0 -663
- package/dist/contexts-Dr62It_K.cjs +0 -1
- package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
- package/dist/getFaceInfo-C4QpCQIY.js +0 -118
- package/dist/getFaceInfo-fA1bFBub.cjs +0 -1
- package/dist/index-9dlAQAhy.js +0 -1462
- package/dist/index-BjmTe9eM.cjs +0 -1
- package/dist/index-BpEf2BBb.cjs +0 -1
- package/dist/index-CyUUurQT.cjs +0 -1
- package/dist/index-DCiMbxC3.cjs +0 -1
- package/dist/index-DXT3WccE.js +0 -2089
- package/dist/index-DpI-qo5X.cjs +0 -17
- package/dist/index-DyVF4vEW.js +0 -111
- package/dist/index-VJ0SJwmG.js +0 -214
- package/dist/internal-Cq-TEQ5Y.cjs +0 -1
- package/dist/renderLayers-lDtL0_43.cjs +0 -1
- package/dist/renderLayers-zrK2pv5O.js +0 -13
- package/dist/renderPasses-BOoBSr8z.cjs +0 -21
- package/dist/renderPasses-BcquyVtu.js +0 -1500
- package/dist/selectors-B8H97CKA.js +0 -59
- package/dist/selectors-CZLKT2Iv.cjs +0 -1
- package/dist/session-CpkiK5YA.cjs +0 -31
- package/dist/session-DLFN_VII.js +0 -363
- package/dist/useFaceInfo-BJ8-_MOs.cjs +0 -1
- package/dist/useFaceInfo-Dk426LTu.js +0 -62
- package/dist/useFaceResults-CtetsO9M.js +0 -19
- package/dist/useFaceResults-wBJF3zyp.cjs +0 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Handedness } from '../types/hand-tracking';
|
|
2
|
+
import { SimilarityFit } from '../utils/similarityFit';
|
|
3
|
+
import { HandJointName, HandPose } from './handPose';
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
/**
|
|
6
|
+
* Hand rig contract (v1).
|
|
7
|
+
*
|
|
8
|
+
* A compatible model has a node named after each joint it rotates — the
|
|
9
|
+
* `wrist` plus three per digit — placed AT that joint, each child of the
|
|
10
|
+
* previous one along the digit and every digit's first node a child of
|
|
11
|
+
* `wrist`:
|
|
12
|
+
*
|
|
13
|
+
* wrist ─┬ thumbCmc → thumbMcp → thumbIp → (thumbTip)
|
|
14
|
+
* ├ indexMcp → indexPip → indexDip → (indexTip)
|
|
15
|
+
* ├ middleMcp → … (middleTip)
|
|
16
|
+
* ├ ringMcp → … (ringTip)
|
|
17
|
+
* └ pinkyMcp → … (pinkyTip)
|
|
18
|
+
*
|
|
19
|
+
* The `…Tip` nodes are optional (without one the tip is extrapolated from the
|
|
20
|
+
* last bone). Any rest pose, units, bone roll and authoring axes work: the
|
|
21
|
+
* driver measures every rotation from the model's own rest pose. The model is
|
|
22
|
+
* ONE chirality (`modelHand`, default `"right"`); the other is drawn mirrored.
|
|
23
|
+
*/
|
|
24
|
+
export declare const HAND_RIG_REQUIRED_JOINTS: readonly HandJointName[];
|
|
25
|
+
/** The rotating bones, parents before children, with the joint each one aims at. */
|
|
26
|
+
export declare const HAND_RIG_BONES: ReadonlyArray<{
|
|
27
|
+
name: HandJointName;
|
|
28
|
+
parent: HandJointName;
|
|
29
|
+
child: HandJointName;
|
|
30
|
+
}>;
|
|
31
|
+
/** Palm joints that move rigidly with the hand: they fix the root pose. */
|
|
32
|
+
export declare const HAND_RIG_PALM_JOINTS: readonly HandJointName[];
|
|
33
|
+
export type HandRigBinding = {
|
|
34
|
+
/** The object whose matrix places the whole rig (its rest = identity). */
|
|
35
|
+
root: THREE.Object3D;
|
|
36
|
+
bones: Record<HandJointName, THREE.Object3D | null>;
|
|
37
|
+
/** Rest joint positions in root space (model units), indexed like `HAND_JOINT_NAMES`. */
|
|
38
|
+
restPositions: THREE.Vector3[];
|
|
39
|
+
/** Rest orientation of each bone in root space. */
|
|
40
|
+
restQuaternions: Partial<Record<HandJointName, THREE.Quaternion>>;
|
|
41
|
+
/** Rest local quaternion (`bone.quaternion`) of each bone. */
|
|
42
|
+
restLocal: Partial<Record<HandJointName, THREE.Quaternion>>;
|
|
43
|
+
/** Rest local position / scale of each joint node (finger lengths are applied on top). */
|
|
44
|
+
restLocalPosition: Partial<Record<HandJointName, THREE.Vector3>>;
|
|
45
|
+
restLocalScale: Partial<Record<HandJointName, THREE.Vector3>>;
|
|
46
|
+
restPalm: Float64Array;
|
|
47
|
+
/** Unit normal out of the palm, root space, rest pose. */
|
|
48
|
+
restPalmNormal: THREE.Vector3;
|
|
49
|
+
modelHand: Handedness;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Reads a compatible rig's rest pose. `root` is the model's top object (for a
|
|
53
|
+
* GLB, the cloned `gltf.scene`); call before posing it. Throws if a required
|
|
54
|
+
* joint is missing.
|
|
55
|
+
*/
|
|
56
|
+
export declare const bindHandRig: (root: THREE.Object3D, modelHand?: Handedness) => HandRigBinding;
|
|
57
|
+
/** Bones `HandAttachment` can sit on: the 15 rotating finger bones. */
|
|
58
|
+
export type HandAttachmentJoint = (typeof HAND_RIG_BONES)[number]["name"];
|
|
59
|
+
export type HandAttachmentTransform = {
|
|
60
|
+
/** Position in the bone's local space. */
|
|
61
|
+
position: THREE.Vector3;
|
|
62
|
+
/** Orientation in the bone's local space. */
|
|
63
|
+
quaternion: THREE.Quaternion;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Where content attached to `joint`'s bone sits, in that bone's LOCAL space:
|
|
67
|
+
* `along` of the way from the joint to the next one (0 = at the joint, 1 = at
|
|
68
|
+
* the next), in the attachment frame — +Y along the finger toward the tip, +Z
|
|
69
|
+
* out of the palm (so −Z is the back of the hand), +X = Y × Z. Content
|
|
70
|
+
* authored in that frame (a ring around +Y with its stone at −Z) lands on the
|
|
71
|
+
* finger whatever the rig's bone axes are. Reads the child joint's CURRENT
|
|
72
|
+
* local position, so tracked finger lengths move the attachment with them.
|
|
73
|
+
*/
|
|
74
|
+
export declare const handAttachmentLocal: (binding: HandRigBinding, joint: HandAttachmentJoint, along: number, out?: HandAttachmentTransform) => HandAttachmentTransform;
|
|
75
|
+
/**
|
|
76
|
+
* A tracked hand's 21 joints in scene (world) space: the metric world joints
|
|
77
|
+
* (true 3D shape) scaled, rotated in the image plane and moved so their x / y
|
|
78
|
+
* land on the tracked image points unprojected onto the `z = 0` plane. The
|
|
79
|
+
* depth keeps the metric shape at that scale (weak perspective).
|
|
80
|
+
*/
|
|
81
|
+
export declare const handPoseToScene: (pose: Pick<HandPose, "image" | "world">, camera: THREE.Camera, out?: THREE.Vector3[]) => THREE.Vector3[];
|
|
82
|
+
export type HandRigSolution = {
|
|
83
|
+
/** Root pose without the mirror (proper similarity) — smooth this one. */
|
|
84
|
+
fit: SimilarityFit;
|
|
85
|
+
/** Mirror the root in X (the hand on screen has the other chirality). */
|
|
86
|
+
mirrored: boolean;
|
|
87
|
+
/** Local quaternion for each rotating bone. */
|
|
88
|
+
local: Partial<Record<HandJointName, THREE.Quaternion>>;
|
|
89
|
+
/**
|
|
90
|
+
* Each rotating bone's tracked segment length over its rest length (after
|
|
91
|
+
* the palm fit), clamped to `HAND_RIG_LENGTH_RANGE`. `1` = the model's own
|
|
92
|
+
* proportion.
|
|
93
|
+
*/
|
|
94
|
+
lengths: Partial<Record<HandJointName, number>>;
|
|
95
|
+
/**
|
|
96
|
+
* Where each digit's first knuckle (thumb CMC, the four MCPs) is tracked,
|
|
97
|
+
* relative to the rig's rest knuckle after the palm fit — rig-root space,
|
|
98
|
+
* model units. The palm fit is rigid, so a hand with a wider or narrower
|
|
99
|
+
* knuckle spread than the model's leaves its fingers starting a few
|
|
100
|
+
* millimetres off; these offsets move them onto the person's knuckles.
|
|
101
|
+
*/
|
|
102
|
+
knuckles: Partial<Record<HandJointName, THREE.Vector3>>;
|
|
103
|
+
};
|
|
104
|
+
/** A knuckle moves at most this many palm lengths from its rest spot (≈ 1.75 cm). */
|
|
105
|
+
export declare const HAND_RIG_KNUCKLE_SHIFT = 0.2;
|
|
106
|
+
/** Clamp for finger segment length ratios: tracking noise and odd rigs stay sane. */
|
|
107
|
+
export declare const HAND_RIG_LENGTH_RANGE: readonly [number, number];
|
|
108
|
+
/**
|
|
109
|
+
* A hand that moves farther than this many palm lengths (wrist → middle MCP)
|
|
110
|
+
* in one frame snaps instead of easing: another hand took the slot, or it
|
|
111
|
+
* re-entered elsewhere. 2.5 palms ≈ 22 cm on an average hand.
|
|
112
|
+
*/
|
|
113
|
+
export declare const HAND_RIG_SNAP_PALMS = 2.5;
|
|
114
|
+
/**
|
|
115
|
+
* The snap distance for `stepLandmarkPoseSmoothing`, in the MODEL's units:
|
|
116
|
+
* `HAND_RIG_SNAP_PALMS` × the rig's rest palm length. The palm fit maps from
|
|
117
|
+
* model units, so a fixed centimetre threshold would never fire on a model
|
|
118
|
+
* authored in metres (and fire constantly on one in millimetres).
|
|
119
|
+
*/
|
|
120
|
+
export declare const handRigSnapDistance: (binding: HandRigBinding) => number;
|
|
121
|
+
/**
|
|
122
|
+
* The on-screen chirality of a hand: its anatomical side, flipped when the
|
|
123
|
+
* feed is mirrored (a right hand in the mirrored selfie view LOOKS like a left
|
|
124
|
+
* hand, so a right-hand model must be mirrored onto it).
|
|
125
|
+
*/
|
|
126
|
+
export declare const screenChirality: (hand: Handedness, feedMirrored: boolean) => Handedness;
|
|
127
|
+
/**
|
|
128
|
+
* Solves the rig for one frame: the root similarity (from the palm joints)
|
|
129
|
+
* and each bone's local rotation (a swing from its rest direction to the live
|
|
130
|
+
* direction of its child joint, carried down the chain). Pure; reuse `out`.
|
|
131
|
+
*/
|
|
132
|
+
export declare const solveHandRig: (binding: HandRigBinding, pose: Pick<HandPose, "image" | "world" | "handedness">, camera: THREE.Camera, feedMirrored: boolean, out?: HandRigSolution) => HandRigSolution;
|
|
133
|
+
/**
|
|
134
|
+
* Gives each finger segment its length ratio WITHOUT changing its thickness,
|
|
135
|
+
* and (with `knuckles`) starts each digit at its tracked knuckle.
|
|
136
|
+
*
|
|
137
|
+
* - A segment with a rotating bone below it (MCP, PIP; thumb CMC, MCP) is
|
|
138
|
+
* lengthened by moving the next joint out along it (its rest local position
|
|
139
|
+
* × ratio); the skin between the two joints stretches through its weights,
|
|
140
|
+
* the cross-section keeps the model's size.
|
|
141
|
+
* - The last segment (DIP, thumb IP) has nothing weighted below it, so it is
|
|
142
|
+
* stretched along its own axis (the direction of its tip node, when that is
|
|
143
|
+
* one of the bone's local axes — Blender's +Y); otherwise uniformly.
|
|
144
|
+
*
|
|
145
|
+
* `knuckles` (rig-root space, `HandRigSolution.knuckles`) move each digit's
|
|
146
|
+
* first bone, clamped to `HAND_RIG_KNUCKLE_SHIFT` palm lengths; the palm skin
|
|
147
|
+
* between the knuckles follows through its weights.
|
|
148
|
+
*
|
|
149
|
+
* `null` lengths and knuckles reset every joint to its rest position and scale.
|
|
150
|
+
*/
|
|
151
|
+
export declare const applyHandRigLengths: (binding: HandRigBinding, lengths: Partial<Record<HandJointName, number>> | null, knuckles?: Partial<Record<HandJointName, THREE.Vector3>> | null) => void;
|
|
152
|
+
/**
|
|
153
|
+
* Writes a solution onto the bound bones (no smoothing). `matchLengths`
|
|
154
|
+
* (default `true`) also gives the digits the tracked segment lengths
|
|
155
|
+
* (`applyHandRigLengths`); `false` keeps the model's proportions.
|
|
156
|
+
*/
|
|
157
|
+
export declare const applyHandRigSolution: (binding: HandRigBinding, solution: HandRigSolution, matchLengths?: boolean) => void;
|
|
158
|
+
/** The root's matrix for a (possibly smoothed) fit: similarity, then the mirror. */
|
|
159
|
+
export declare const handRigRootMatrix: (fit: Pick<SimilarityFit, "scale" | "quaternion" | "translation">, mirrored: boolean, out?: THREE.Matrix4) => THREE.Matrix4;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { HandRigBinding } from './handRigSolver';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Hand tattoos (#271): art projected onto a hand model's surface in the
|
|
5
|
+
* model's REST pose, so it deforms with the skin.
|
|
6
|
+
*
|
|
7
|
+
* The projector is a box on one side of the hand — the back or the palm —
|
|
8
|
+
* centred half-way from the wrist to the knuckles. A surface point is inked
|
|
9
|
+
* when it lies on that side of the palm's mid-plane, inside the art's
|
|
10
|
+
* rectangle, and faces the projector. Everything is measured from the rig
|
|
11
|
+
* contract (joint positions, palm normal), so it works on any compatible
|
|
12
|
+
* model, with or without UVs.
|
|
13
|
+
*/
|
|
14
|
+
/** Which side of the hand the art goes on. */
|
|
15
|
+
export type HandTattooPlacement = "back" | "palm";
|
|
16
|
+
/** Default art width, in palm lengths (wrist → middle MCP): 0.55 ≈ 4.8 cm on an average hand. */
|
|
17
|
+
export declare const HAND_TATTOO_DEFAULT_SIZE = 0.55;
|
|
18
|
+
/**
|
|
19
|
+
* Drawn after the hand model (transparent pass, order 0): the tattoo blends
|
|
20
|
+
* over whatever the hand shows — the camera image under a `HandOccluder`, or
|
|
21
|
+
* a visible model (skin, glove).
|
|
22
|
+
*/
|
|
23
|
+
export declare const HAND_TATTOO_RENDER_ORDER = 1;
|
|
24
|
+
/** Ink fades in between these facings (cosine between the surface normal and the projector). */
|
|
25
|
+
export declare const HAND_TATTOO_FACING_FADE: readonly [number, number];
|
|
26
|
+
/** A placement's frame in the rig root's rest space (model units). */
|
|
27
|
+
export type HandTattooFrame = {
|
|
28
|
+
/** Centre: half-way from the wrist to the four knuckles, on the palm's mid-plane. */
|
|
29
|
+
origin: THREE.Vector3;
|
|
30
|
+
/** Out of the tattooed side (the back: away from the palm; the palm: out of it). */
|
|
31
|
+
normal: THREE.Vector3;
|
|
32
|
+
/** Toward the fingers, perpendicular to `normal`. */
|
|
33
|
+
up: THREE.Vector3;
|
|
34
|
+
/** The viewer's right when looking at that side with the fingers up (`up × normal`). */
|
|
35
|
+
right: THREE.Vector3;
|
|
36
|
+
/** Toward the thumb: `right` or `−right`, depending on the side and the model's chirality. */
|
|
37
|
+
thumb: THREE.Vector3;
|
|
38
|
+
/** Palm length (wrist → middle MCP), model units. */
|
|
39
|
+
palm: number;
|
|
40
|
+
};
|
|
41
|
+
/** The frame a placement projects from, read off the rig's rest joints. Pure. */
|
|
42
|
+
export declare const handTattooFrame: (binding: Pick<HandRigBinding, "restPositions" | "restPalmNormal">, placement: HandTattooPlacement) => HandTattooFrame;
|
|
43
|
+
export type HandTattooPlacementOptions = {
|
|
44
|
+
/** Art width, model units. */
|
|
45
|
+
size: number;
|
|
46
|
+
/** `[towardThumb, towardFingers]` from the frame's origin, model units. */
|
|
47
|
+
offset?: readonly [number, number];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The matrix from a hand mesh's geometry (its `position` attribute) to decal
|
|
51
|
+
* space: x along `frame.right`, y along `frame.up`, z along `frame.normal`,
|
|
52
|
+
* in art widths, origin at the art's centre. The art covers |x| ≤ ½ and
|
|
53
|
+
* |y| ≤ ½ ÷ aspect; z > 0 is the tattooed side of the palm's mid-plane.
|
|
54
|
+
* `geometryToRoot` comes from `handGeometryToRoot`.
|
|
55
|
+
*/
|
|
56
|
+
export declare const handTattooMatrix: (frame: HandTattooFrame, geometryToRoot: THREE.Matrix4, { size, offset }: HandTattooPlacementOptions, out?: THREE.Matrix4) => THREE.Matrix4;
|
|
57
|
+
/**
|
|
58
|
+
* The matrix from a hand mesh's geometry to the rig root's rest space.
|
|
59
|
+
*
|
|
60
|
+
* A skinned mesh's rest surface is `bone rest × inverse bind matrix × bind
|
|
61
|
+
* matrix × position`; using the wrist (which `HandRig` never moves inside the
|
|
62
|
+
* model) gives it for every vertex, and also undoes position quantisation
|
|
63
|
+
* (KHR_mesh_quantization folds it into the inverse bind matrices). A mesh
|
|
64
|
+
* that is not skinned on the wrist uses its own transform relative to the root.
|
|
65
|
+
*/
|
|
66
|
+
export declare const handGeometryToRoot: (binding: Pick<HandRigBinding, "root" | "bones">, mesh: THREE.Mesh, out?: THREE.Matrix4) => THREE.Matrix4;
|
|
67
|
+
export type HandTattooLook = {
|
|
68
|
+
/** Radians, counter-clockwise as seen looking at the tattooed side. */
|
|
69
|
+
rotation?: number;
|
|
70
|
+
/** Art width ÷ height. Default `1`. */
|
|
71
|
+
aspect?: number;
|
|
72
|
+
/** The hand is drawn mirrored (the model's other chirality). */
|
|
73
|
+
mirrored?: boolean;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Where a point in decal space (`handTattooMatrix` × position) samples the
|
|
77
|
+
* art, or `null` when it gets no ink (outside the art, or on the other side
|
|
78
|
+
* of the palm). The JS twin of the tattoo shader. On a mirrored hand the art
|
|
79
|
+
* is flipped back, so it never reads mirrored and turns the same way.
|
|
80
|
+
*/
|
|
81
|
+
export declare const handTattooUv: (decal: THREE.Vector3, { rotation, aspect, mirrored }?: HandTattooLook, out?: THREE.Vector2) => THREE.Vector2 | null;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { Handedness } from '../types/hand-tracking';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Touch objects with the hands, no physics engine: each tracked hand is a
|
|
5
|
+
* palm sphere plus five fingertip spheres; objects are spheres (balls, and
|
|
6
|
+
* boxes approximated by their inscribed sphere) in a box world with gravity,
|
|
7
|
+
* a floor, walls, bounces and damping. Pinch to grab and carry, release to
|
|
8
|
+
* throw, push or poke with the hand, hover and tap with the index tip.
|
|
9
|
+
*
|
|
10
|
+
* Everything is in scene units at the hand's own depth (`handPoseToScene`:
|
|
11
|
+
* the `z = 0` tracking plane plus the hand's relative depth). One camera can't
|
|
12
|
+
* measure how far the hand is, so by default (`flat`) the hand reaches every
|
|
13
|
+
* object on screen: hand-to-object contacts ignore depth.
|
|
14
|
+
*/
|
|
15
|
+
/** The fingertips that touch, thumb to pinky. */
|
|
16
|
+
export declare const HAND_TOUCH_TIPS: readonly ["thumbTip", "indexTip", "middleTip", "ringTip", "pinkyTip"];
|
|
17
|
+
export type HandTouchTip = (typeof HAND_TOUCH_TIPS)[number];
|
|
18
|
+
export type HandTouchPart = "palm" | HandTouchTip;
|
|
19
|
+
/** A tracked hand, or the screen pointer (mouse / touch) playing as one. */
|
|
20
|
+
export type TouchHandId = Handedness | "pointer";
|
|
21
|
+
export type HandTouchSettings = {
|
|
22
|
+
/** Palm sphere radius, in palm lengths (wrist → middle knuckle). Default 0.5. */
|
|
23
|
+
palmRadius: number;
|
|
24
|
+
/** Fingertip sphere radius, in palm lengths. Default 0.12. */
|
|
25
|
+
tipRadius: number;
|
|
26
|
+
/** A pinch starts when the thumb and index tips are closer than this, palm lengths. Default 0.3. */
|
|
27
|
+
pinchStart: number;
|
|
28
|
+
/** A pinch ends when they are farther than this, palm lengths. Default 0.45. */
|
|
29
|
+
pinchEnd: number;
|
|
30
|
+
/**
|
|
31
|
+
* Below this thumb–index distance (palm lengths) the hand is closing to pinch:
|
|
32
|
+
* the thumb and index tips stop pushing, so they don't knock away what they
|
|
33
|
+
* are about to grab. Default 0.6.
|
|
34
|
+
*/
|
|
35
|
+
pinchReady: number;
|
|
36
|
+
/** Per-detection EMA on the colliders, `1` = none. Default 0.6. */
|
|
37
|
+
smoothing: number;
|
|
38
|
+
};
|
|
39
|
+
export declare const HAND_TOUCH_DEFAULTS: Readonly<HandTouchSettings>;
|
|
40
|
+
export type TouchSphere = {
|
|
41
|
+
center: THREE.Vector3;
|
|
42
|
+
/** Scene units per second, smoothed. */
|
|
43
|
+
velocity: THREE.Vector3;
|
|
44
|
+
radius: number;
|
|
45
|
+
};
|
|
46
|
+
/** One hand's colliders and pinch, updated from its scene joints (`updateTouchHand`). */
|
|
47
|
+
export type TouchHand = {
|
|
48
|
+
hand: TouchHandId;
|
|
49
|
+
tracked: boolean;
|
|
50
|
+
/** Wrist → middle knuckle, scene units. */
|
|
51
|
+
palmLength: number;
|
|
52
|
+
palm: TouchSphere;
|
|
53
|
+
tips: Record<HandTouchTip, TouchSphere>;
|
|
54
|
+
/** Thumb–index tip distance in palm lengths. */
|
|
55
|
+
pinchDistance: number;
|
|
56
|
+
pinching: boolean;
|
|
57
|
+
/** Between the thumb and index tips. */
|
|
58
|
+
pinch: THREE.Vector3;
|
|
59
|
+
/** The pinch point's velocity over the last ~0.1 s (what a release throws with). */
|
|
60
|
+
pinchVelocity: THREE.Vector3;
|
|
61
|
+
/** The detection the colliders come from (`HandPose.timestampMs`). */
|
|
62
|
+
timeMs: number | null;
|
|
63
|
+
/** Recent pinch points, for `pinchVelocity`. */
|
|
64
|
+
history: {
|
|
65
|
+
timeMs: number;
|
|
66
|
+
point: THREE.Vector3;
|
|
67
|
+
}[];
|
|
68
|
+
};
|
|
69
|
+
export declare const createTouchHand: (hand: TouchHandId) => TouchHand;
|
|
70
|
+
/**
|
|
71
|
+
* Updates a hand's colliders from its 21 scene joints (`handPoseToScene`), or
|
|
72
|
+
* `null` when the hand is lost. `timeMs` is the detection's time: the same
|
|
73
|
+
* detection twice changes nothing, so it can run every render frame.
|
|
74
|
+
*/
|
|
75
|
+
export declare const updateTouchHand: (state: TouchHand, joints: readonly THREE.Vector3[] | null, timeMs: number, settings?: Partial<HandTouchSettings>) => TouchHand;
|
|
76
|
+
/**
|
|
77
|
+
* The screen pointer as a hand: a sphere of `radius` at `point` (scene units,
|
|
78
|
+
* on the hand plane) that hovers what it is over; pressed = pinching, so a
|
|
79
|
+
* press on an object grabs it, a release throws it, a quick click taps it and
|
|
80
|
+
* a press elsewhere dragged across objects pushes them. `point` null: off the
|
|
81
|
+
* screen.
|
|
82
|
+
*/
|
|
83
|
+
export declare const updatePointerHand: (state: TouchHand, point: THREE.Vector3 | null, pressed: boolean, timeMs: number, radius: number) => TouchHand;
|
|
84
|
+
export type TouchShape = "sphere" | "box";
|
|
85
|
+
export type TouchBodyOptions = {
|
|
86
|
+
/** Default `"sphere"`. A box collides as its inscribed sphere and settles flat on the floor. */
|
|
87
|
+
shape?: TouchShape;
|
|
88
|
+
/** Diameter (sphere) or edge (box), scene units. Default 0.4. */
|
|
89
|
+
size?: number;
|
|
90
|
+
/** Start position, scene units. Default the origin. */
|
|
91
|
+
position?: readonly [number, number, number];
|
|
92
|
+
/** Start velocity, scene units per second. */
|
|
93
|
+
velocity?: readonly [number, number, number];
|
|
94
|
+
/** Default `size³`: bigger objects push smaller ones further. */
|
|
95
|
+
mass?: number;
|
|
96
|
+
/** Bounciness 0..1. Default the world's `bounce`. */
|
|
97
|
+
bounce?: number;
|
|
98
|
+
/** A pinch can pick it up. Default true. */
|
|
99
|
+
grabbable?: boolean;
|
|
100
|
+
/** The hands push it. Default true. */
|
|
101
|
+
pushable?: boolean;
|
|
102
|
+
/** It falls. Default true; false floats where it is put, still pushed and grabbed. */
|
|
103
|
+
gravity?: boolean;
|
|
104
|
+
};
|
|
105
|
+
export type TouchBody = {
|
|
106
|
+
readonly id: number;
|
|
107
|
+
shape: TouchShape;
|
|
108
|
+
size: number;
|
|
109
|
+
/** Collision radius: half the size. */
|
|
110
|
+
radius: number;
|
|
111
|
+
mass: number;
|
|
112
|
+
bounce: number | undefined;
|
|
113
|
+
grabbable: boolean;
|
|
114
|
+
pushable: boolean;
|
|
115
|
+
gravity: boolean;
|
|
116
|
+
position: THREE.Vector3;
|
|
117
|
+
velocity: THREE.Vector3;
|
|
118
|
+
quaternion: THREE.Quaternion;
|
|
119
|
+
/** Angular velocity, radians per second (world axes). */
|
|
120
|
+
spin: THREE.Vector3;
|
|
121
|
+
grabbedBy: TouchHandId | null;
|
|
122
|
+
hoveredBy: TouchHandId | null;
|
|
123
|
+
/** On the floor and nearly still. */
|
|
124
|
+
resting: boolean;
|
|
125
|
+
/** Free for the app. */
|
|
126
|
+
userData: Record<string, unknown>;
|
|
127
|
+
/** Where it hangs from the pinch while carried. */
|
|
128
|
+
grabOffset: THREE.Vector3;
|
|
129
|
+
/** This frame's hand contacts, `hand:part`. */
|
|
130
|
+
contacts: Set<string>;
|
|
131
|
+
/** When each hand's index tip started touching it (for taps; NaN: touched without a tap). */
|
|
132
|
+
tapStart: Partial<Record<TouchHandId, number>>;
|
|
133
|
+
};
|
|
134
|
+
export type TouchEvent = {
|
|
135
|
+
type: "grab";
|
|
136
|
+
body: TouchBody;
|
|
137
|
+
hand: TouchHandId;
|
|
138
|
+
}
|
|
139
|
+
/** `speed`: how fast it was thrown (0 when dropped). */
|
|
140
|
+
| {
|
|
141
|
+
type: "release";
|
|
142
|
+
body: TouchBody;
|
|
143
|
+
hand: TouchHandId;
|
|
144
|
+
speed: number;
|
|
145
|
+
} | {
|
|
146
|
+
type: "hoverstart";
|
|
147
|
+
body: TouchBody;
|
|
148
|
+
hand: TouchHandId;
|
|
149
|
+
} | {
|
|
150
|
+
type: "hoverend";
|
|
151
|
+
body: TouchBody;
|
|
152
|
+
hand: TouchHandId;
|
|
153
|
+
}
|
|
154
|
+
/** The index tip touched it and left within `tapMs`. */
|
|
155
|
+
| {
|
|
156
|
+
type: "tap";
|
|
157
|
+
body: TouchBody;
|
|
158
|
+
hand: TouchHandId;
|
|
159
|
+
}
|
|
160
|
+
/** A hand part started touching it; `speed` is how hard. */
|
|
161
|
+
| {
|
|
162
|
+
type: "touch";
|
|
163
|
+
body: TouchBody;
|
|
164
|
+
hand: TouchHandId;
|
|
165
|
+
part: HandTouchPart;
|
|
166
|
+
speed: number;
|
|
167
|
+
};
|
|
168
|
+
export type TouchWorldSettings = {
|
|
169
|
+
/** Scene units per second², down (−Y). Default 9. */
|
|
170
|
+
gravity: number;
|
|
171
|
+
/** Air drag on motion and spin, per second. Default 0.4. */
|
|
172
|
+
damping: number;
|
|
173
|
+
/** Bounciness 0..1 (objects can override). Default 0.5. */
|
|
174
|
+
bounce: number;
|
|
175
|
+
/** How fast objects stop sliding on the floor, per second. Default 4. */
|
|
176
|
+
friction: number;
|
|
177
|
+
/** A pinch grabs an object whose surface is within this many palm lengths. Default 0.35. */
|
|
178
|
+
grabReach: number;
|
|
179
|
+
/** The index tip hovers an object within this many palm lengths of its surface. Default 0.5. */
|
|
180
|
+
hoverReach: number;
|
|
181
|
+
/**
|
|
182
|
+
* An index-tip touch shorter than this is a tap, ms (for the pointer: a
|
|
183
|
+
* click on the object). Default 350.
|
|
184
|
+
*/
|
|
185
|
+
tapMs: number;
|
|
186
|
+
/**
|
|
187
|
+
* A tap starts with the index tip moving into the object at least this
|
|
188
|
+
* fast, palm lengths per second: an object falling past a still finger
|
|
189
|
+
* isn't a tap. Default 1.
|
|
190
|
+
*/
|
|
191
|
+
tapSpeed: number;
|
|
192
|
+
/** A release throws at the hand's speed times this. Default 1. */
|
|
193
|
+
throwScale: number;
|
|
194
|
+
/** Speed cap, scene units per second. Default 14. */
|
|
195
|
+
maxSpeed: number;
|
|
196
|
+
/** Hand-to-object contacts ignore depth (one camera can't measure it). Default true. */
|
|
197
|
+
flat: boolean;
|
|
198
|
+
};
|
|
199
|
+
export declare const TOUCH_WORLD_DEFAULTS: Readonly<TouchWorldSettings>;
|
|
200
|
+
/**
|
|
201
|
+
* The world the hands play in: objects, the box they stay in (`bounds`, the
|
|
202
|
+
* floor is `bounds.min.y`), and the rules. Call `step` every frame with the
|
|
203
|
+
* hands; it returns what happened (grabs, releases, hovers, taps, touches).
|
|
204
|
+
*/
|
|
205
|
+
export declare class TouchWorld {
|
|
206
|
+
readonly bodies: TouchBody[];
|
|
207
|
+
readonly bounds: THREE.Box3;
|
|
208
|
+
settings: TouchWorldSettings;
|
|
209
|
+
/** Simulated time, ms. */
|
|
210
|
+
timeMs: number;
|
|
211
|
+
private nextId;
|
|
212
|
+
private pinched;
|
|
213
|
+
/** What the pointer pressed on, and when (a quick click is a tap). */
|
|
214
|
+
private press;
|
|
215
|
+
private handSettings;
|
|
216
|
+
constructor(settings?: Partial<TouchWorldSettings>, handSettings?: Partial<HandTouchSettings>);
|
|
217
|
+
/** The hand collider settings `pinchReady` is read from. */
|
|
218
|
+
setHandSettings(handSettings: Partial<HandTouchSettings>): void;
|
|
219
|
+
add(options?: TouchBodyOptions): TouchBody;
|
|
220
|
+
remove(body: TouchBody): void;
|
|
221
|
+
/** The nearest grabbable (`any`: any) object whose surface is within `reach` of `point`. */
|
|
222
|
+
pick(point: THREE.Vector3, reach: number, any?: boolean): TouchBody | null;
|
|
223
|
+
/** Advances `dt` seconds with these hands; returns what happened. */
|
|
224
|
+
step(dt: number, hands: readonly TouchHand[]): TouchEvent[];
|
|
225
|
+
/** Grab / hover reach: palm lengths for a hand; the pointer reaches as far as its sphere. */
|
|
226
|
+
private reach;
|
|
227
|
+
private distance;
|
|
228
|
+
private release;
|
|
229
|
+
private grabAndRelease;
|
|
230
|
+
private substep;
|
|
231
|
+
private turn;
|
|
232
|
+
private walls;
|
|
233
|
+
/** Turns a box toward its nearest face-down orientation. */
|
|
234
|
+
private settleFlat;
|
|
235
|
+
private collideBodies;
|
|
236
|
+
private collideHands;
|
|
237
|
+
/** The pointer: a press and a quick release on the same object is a tap. */
|
|
238
|
+
private clickTap;
|
|
239
|
+
private hoverAndTap;
|
|
240
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { HandRigBinding } from './handRigSolver';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* The wrist on a hand rig (pure): its frame and its size, from the rig's rest
|
|
5
|
+
* pose, in the model's units (centimetres for the SDK hand). Content placed
|
|
6
|
+
* in the wrist bone rides on the `HandRig` fit, so it scales and turns with
|
|
7
|
+
* the tracked hand.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A wrist is about this share of the knuckle span (index to pinky knuckle
|
|
11
|
+
* centres) across: wrist breadth ≈ 5.6–6.2 cm against a ≈ 6–6.5 cm span.
|
|
12
|
+
*/
|
|
13
|
+
export declare const WRIST_WIDTH_OF_PALM = 0.9;
|
|
14
|
+
/** And about this share of its width from back to palm. */
|
|
15
|
+
export declare const WRIST_DEPTH_OF_WIDTH = 0.7;
|
|
16
|
+
export type WristSize = {
|
|
17
|
+
/** Across the wrist (thumb side to little-finger side). */
|
|
18
|
+
width: number;
|
|
19
|
+
/** From the back of the wrist to the palm side. */
|
|
20
|
+
depth: number;
|
|
21
|
+
/** Index to pinky knuckle. */
|
|
22
|
+
palmWidth: number;
|
|
23
|
+
/** Wrist to middle knuckle. */
|
|
24
|
+
palmLength: number;
|
|
25
|
+
};
|
|
26
|
+
/** The wrist's size on `binding`'s model at rest (model units). */
|
|
27
|
+
export declare const wristSizeOf: (binding: Pick<HandRigBinding, "restPositions">) => WristSize;
|
|
28
|
+
export type WristFrame = {
|
|
29
|
+
position: THREE.Vector3;
|
|
30
|
+
quaternion: THREE.Quaternion;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The wrist frame in the wrist bone's own space: origin at the wrist joint,
|
|
34
|
+
* +Y toward the middle knuckle (the hand's axis; −Y runs up the forearm), +Z
|
|
35
|
+
* out of the palm (−Z is the back of the wrist, where a watch face goes), +X
|
|
36
|
+
* across. The same axes as `HandAttachment`.
|
|
37
|
+
*/
|
|
38
|
+
export declare const wristFrameLocal: (binding: Pick<HandRigBinding, "restPositions" | "restQuaternions" | "restPalmNormal">, out?: WristFrame) => WristFrame;
|
|
39
|
+
/** How far the forearm occluder reaches up the arm, in palm lengths (wrist to middle knuckle). */
|
|
40
|
+
export declare const FOREARM_OCCLUDER_LENGTH = 2.5;
|
|
41
|
+
/** How much wider the forearm is at its far end than at the wrist. */
|
|
42
|
+
export declare const FOREARM_OCCLUDER_FLARE = 1.25;
|
|
43
|
+
/** How far the forearm occluder reaches into the hand past the wrist joint (palm lengths): it overlaps the hand mesh, no gap. */
|
|
44
|
+
export declare const FOREARM_OCCLUDER_OVERLAP = 0.15;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* Experimental (vincentt-xr/sdk#319): may change in a later alpha.
|
|
4
|
+
*
|
|
5
|
+
* Keeps wristwear from flipping round the arm. When a hand turns edge-on,
|
|
6
|
+
* one camera can't tell which side of the palm faces it, and the tracked
|
|
7
|
+
* hand's depth can flip for a few frames: the fitted hand (and anything on
|
|
8
|
+
* its wrist) jumps tens of degrees and back. This filter passes ordinary
|
|
9
|
+
* motion through (eased) and holds through a sudden jump unless the new pose
|
|
10
|
+
* stays: a real turn lasts, a flip doesn't.
|
|
11
|
+
*/
|
|
12
|
+
export type WristFilterSettings = {
|
|
13
|
+
/**
|
|
14
|
+
* A jump: the hand this far from the steadied wrist, degrees. The rig eases
|
|
15
|
+
* a raw flip in by halves, so its first frame is already a big step, while a
|
|
16
|
+
* real fast turn stays within about 15°. Default 35.
|
|
17
|
+
*/
|
|
18
|
+
jump: number;
|
|
19
|
+
/** A jump is taken once the new pose has held this long, ms. Default 200. */
|
|
20
|
+
confirmMs: number;
|
|
21
|
+
/**
|
|
22
|
+
* …and shown up in this many hand detections (a slow device draws few
|
|
23
|
+
* frames; one stuck detection mustn't count as a lasting turn). Default 4.
|
|
24
|
+
*/
|
|
25
|
+
confirmSamples: number;
|
|
26
|
+
/** Per-frame easing toward the hand otherwise, `1` = none. Default 0.6. */
|
|
27
|
+
smoothing: number;
|
|
28
|
+
};
|
|
29
|
+
export declare const WRIST_FILTER_DEFAULTS: Readonly<WristFilterSettings>;
|
|
30
|
+
export declare class WristRotationFilter {
|
|
31
|
+
settings: WristFilterSettings;
|
|
32
|
+
private readonly q;
|
|
33
|
+
private has;
|
|
34
|
+
private pending;
|
|
35
|
+
constructor(settings?: Partial<WristFilterSettings>);
|
|
36
|
+
/**
|
|
37
|
+
* Filters this frame's wrist rotation (`target`) at `nowMs`; writes into
|
|
38
|
+
* `out`. `sample` names the hand detection it comes from (its timestamp);
|
|
39
|
+
* omitted, every call counts as one.
|
|
40
|
+
*/
|
|
41
|
+
apply(target: THREE.Quaternion, nowMs: number, out: THREE.Quaternion, sample?: number): THREE.Quaternion;
|
|
42
|
+
/** Forget the wrist (the hand was lost): the next pose is taken as it is. */
|
|
43
|
+
reset(): void;
|
|
44
|
+
}
|
|
@@ -1,13 +1,81 @@
|
|
|
1
1
|
import { CanvasTexture } from 'three';
|
|
2
2
|
import { XRModel } from '../constants';
|
|
3
|
-
import {
|
|
3
|
+
import { sessionReasonToFallback } from '../capabilities/detect';
|
|
4
|
+
import { XRFallbackReason } from '../capabilities/types';
|
|
5
|
+
import { XRCameraPermissionState } from '../camera/permission';
|
|
6
|
+
import { XRCameraFacing, XROrientation } from '../types/compositor';
|
|
7
|
+
import { XRQualityConfig, XRQualityState } from '../quality/types';
|
|
8
|
+
import { FeedCrop } from '../coordinates/feed';
|
|
9
|
+
import { SessionLifecycleState, XRModelError, XRSessionError } from './useXRSession/store';
|
|
4
10
|
export declare const useXRReady: () => boolean;
|
|
5
11
|
export declare const useXRError: () => XRSessionError | undefined;
|
|
12
|
+
/** The session lifecycle state (`idle` → `media-bound` → `running` ⇄ `paused` → `stopped`). */
|
|
13
|
+
export declare const useXRLifecycle: () => SessionLifecycleState;
|
|
14
|
+
/** Models whose last initialize failed, keyed by `XRModel`. Empty map while healthy. */
|
|
15
|
+
export declare const useXRModelErrors: () => ReadonlyMap<XRModel, XRModelError>;
|
|
16
|
+
export { sessionReasonToFallback };
|
|
17
|
+
export type XRCameraPermission = {
|
|
18
|
+
state: XRCameraPermissionState;
|
|
19
|
+
/** Structured cause for `denied` / `blocked` / `unavailable`; `null` otherwise. */
|
|
20
|
+
reason: XRFallbackReason | null;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Whether the session mirrors its feed. One answer for preview AND tracking:
|
|
24
|
+
* both read the same mirrored (front camera) or straight (rear camera, image,
|
|
25
|
+
* video) feed, so a point computed from landmarks lands where the preview
|
|
26
|
+
* shows it. Use it only for *direction* signs (left/right semantics), never
|
|
27
|
+
* to flip positions.
|
|
28
|
+
*/
|
|
29
|
+
export declare const useXRMirrored: () => boolean;
|
|
30
|
+
/** Device orientation (`portrait` / `landscape`, rotation angle) as the session tracks it. */
|
|
31
|
+
export declare const useXROrientation: () => XROrientation;
|
|
32
|
+
/** Device id of the live camera (`null` for stream / canvas sources or when the browser hides it). */
|
|
33
|
+
export declare const useXRCameraDeviceId: () => string | null;
|
|
34
|
+
/** The mounted quality controller's resolved config (`null` when none is mounted). */
|
|
35
|
+
export declare const useXRQualityConfig: () => XRQualityConfig | null;
|
|
36
|
+
/** Adaptive-quality state as published by the controller (`null` when none is mounted). */
|
|
37
|
+
export declare const useXRQualityState: () => XRQualityState | null;
|
|
38
|
+
/** Facing of the live camera the session bound (`null` for stream / canvas sources). */
|
|
39
|
+
export declare const useXRCameraFacing: () => XRCameraFacing | null;
|
|
40
|
+
/**
|
|
41
|
+
* The SESSION's live camera permission: `requesting` while its webcam
|
|
42
|
+
* `getUserMedia` prompt is open, `granted` once bound, `denied` / `blocked` /
|
|
43
|
+
* `unavailable` after a failure or a mid-session revoke, `unknown` before
|
|
44
|
+
* the first webcam bind. This is not the pre-session gate: for a landing
|
|
45
|
+
* screen without a provider use `useCameraPermission` from the core door.
|
|
46
|
+
*/
|
|
47
|
+
export declare const useXRSessionCameraPermission: () => XRCameraPermission;
|
|
48
|
+
export type XRTrackerStatus = {
|
|
49
|
+
/**
|
|
50
|
+
* `unavailable`: nobody acquired the model. `loading`: acquired, not yet
|
|
51
|
+
* initialized. `ready`: initialized, whatever the session lifecycle (a
|
|
52
|
+
* paused or stopped session keeps it initialized; `useXRDiagnostics`
|
|
53
|
+
* reports that as `paused`). `blocked`: the camera failed, so the model
|
|
54
|
+
* cannot see frames. `error`: the model itself failed to initialize.
|
|
55
|
+
*/
|
|
56
|
+
status: "unavailable" | "loading" | "ready" | "blocked" | "error";
|
|
57
|
+
/** Structured cause for `blocked` / `error`; `null` otherwise. */
|
|
58
|
+
fallback: XRFallbackReason | null;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Actionable status for one tracker, readable by components that do not own
|
|
62
|
+
* it (a "tracking unavailable" banner, a fallback 2D mode). Combines the
|
|
63
|
+
* session's camera error with the model's registration and init error.
|
|
64
|
+
*/
|
|
65
|
+
export declare const useXRTrackerStatus: (modelName: XRModel) => XRTrackerStatus;
|
|
6
66
|
export declare const useXRCameraTexture: () => CanvasTexture | undefined;
|
|
7
67
|
export declare const useXRRenderSize: () => {
|
|
8
68
|
width: number;
|
|
9
69
|
height: number;
|
|
10
70
|
};
|
|
71
|
+
/**
|
|
72
|
+
* The tracked frame's aspect ratio, width ÷ height: the frame every tracker
|
|
73
|
+
* landmark is normalised to (the render size when a scene sets it, else the
|
|
74
|
+
* media's own size). Tracker x and y each span −1..1 across that frame, so
|
|
75
|
+
* multiply x by this to compare horizontal with vertical distances
|
|
76
|
+
* (`analyzeBodyShape(landmarks, { aspect })`). 1 until media is bound.
|
|
77
|
+
*/
|
|
78
|
+
export declare const useXRFeedAspect: () => number;
|
|
11
79
|
/**
|
|
12
80
|
* Read the live model node for `modelName`. Returns `null` until some
|
|
13
81
|
* component has acquired the model via `useXRModel(modelName)` and its
|
|
@@ -21,6 +89,13 @@ export declare const useXRRenderSize: () => {
|
|
|
21
89
|
* directly would warn about unstable snapshots because most model classes
|
|
22
90
|
* build their node object literal on every `getModelNode()` call.
|
|
23
91
|
*/
|
|
92
|
+
/**
|
|
93
|
+
* The session's source → feed transform (`FeedCrop`): cover crop at the
|
|
94
|
+
* render size, `perf.cameraZoom`, and the webcam mirror. `null` until media
|
|
95
|
+
* is bound. Feed it to `sourceToFeed` / `feedToSource` from `@vincentt-xr/sdk`
|
|
96
|
+
* to move points between raw media pixels and landmark space.
|
|
97
|
+
*/
|
|
98
|
+
export declare const useXRFeedCrop: () => FeedCrop | null;
|
|
24
99
|
export declare const useXRModelNode: <T extends Record<string, unknown>>(modelName: XRModel) => T | null;
|
|
25
100
|
/**
|
|
26
101
|
* Snapshot of which models are currently registered. Useful for debugger
|