@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,521 @@
|
|
|
1
|
+
import { TrackerPoint } from '../types/common';
|
|
2
|
+
/** The person's side (anatomical: their own left / right, on any camera). */
|
|
3
|
+
export type BodySide = "left" | "right";
|
|
4
|
+
/**
|
|
5
|
+
* What one arm is doing:
|
|
6
|
+
* - `raised` — wrist clearly above the head (any angle or twist; a real full raise leans and turns)
|
|
7
|
+
* - `out` — stretched out to the side at shoulder height (a T-pose arm)
|
|
8
|
+
* - `onHead` — hand on or just above the head, elbow bent
|
|
9
|
+
* - `onHip` — hand on the hip (at the waist, above the hip line), elbow well out
|
|
10
|
+
* - `thumbUp` — a fist held up in front (elbow bent), the thumb pointing up
|
|
11
|
+
* - `crossed` — wrist across the body's midline at chest / belly height
|
|
12
|
+
* - `down` — hanging well below the shoulder
|
|
13
|
+
* - `other` — anything else (a half raise, a reach forward …)
|
|
14
|
+
*/
|
|
15
|
+
export type ArmState = "raised" | "out" | "onHead" | "onHip" | "thumbUp" | "crossed" | "down" | "other";
|
|
16
|
+
/** MediaPipe pose landmark indices the body poses read. */
|
|
17
|
+
export declare const BODY_POSE_JOINTS: {
|
|
18
|
+
readonly nose: 0;
|
|
19
|
+
readonly leftShoulder: 11;
|
|
20
|
+
readonly rightShoulder: 12;
|
|
21
|
+
readonly leftElbow: 13;
|
|
22
|
+
readonly rightElbow: 14;
|
|
23
|
+
readonly leftWrist: 15;
|
|
24
|
+
readonly rightWrist: 16;
|
|
25
|
+
/** MediaPipe's hand points on the pose: pinky and index knuckles, the thumb's second knuckle. */
|
|
26
|
+
readonly leftPinky: 17;
|
|
27
|
+
readonly rightPinky: 18;
|
|
28
|
+
readonly leftIndex: 19;
|
|
29
|
+
readonly rightIndex: 20;
|
|
30
|
+
readonly leftThumb: 21;
|
|
31
|
+
readonly rightThumb: 22;
|
|
32
|
+
readonly leftHip: 23;
|
|
33
|
+
readonly rightHip: 24;
|
|
34
|
+
readonly leftKnee: 25;
|
|
35
|
+
readonly rightKnee: 26;
|
|
36
|
+
readonly leftAnkle: 27;
|
|
37
|
+
readonly rightAnkle: 28;
|
|
38
|
+
};
|
|
39
|
+
/** MediaPipe pose landmarks per body (`analyzeBodyShape` needs all of them). */
|
|
40
|
+
export declare const BODY_LANDMARK_COUNT = 33;
|
|
41
|
+
/** Landmarks that must be visible for the upper body to count as in view. */
|
|
42
|
+
export declare const BODY_UPPER_JOINTS: readonly [0, 11, 12, 13, 14, 15, 16];
|
|
43
|
+
/** Landmarks that must be visible for the lower body to count as in view (hips, knees, ankles). */
|
|
44
|
+
export declare const BODY_LOWER_JOINTS: readonly [23, 24, 25, 26, 27, 28];
|
|
45
|
+
/**
|
|
46
|
+
* What one leg is doing:
|
|
47
|
+
* - `raised` — knee lifted toward hip height with the foot off the ground (standing on the other leg)
|
|
48
|
+
* - `down` — standing: the knee well below the hip
|
|
49
|
+
* - `other` — anything else (a squat's bent knee, a step …)
|
|
50
|
+
*/
|
|
51
|
+
export type LegState = "raised" | "down" | "other";
|
|
52
|
+
/**
|
|
53
|
+
* The classifier's default thresholds (in shoulder widths, angles in degrees).
|
|
54
|
+
* Read-only: tune per call with `analyzeBodyShape(landmarks, { limits })` or a
|
|
55
|
+
* hook's `limits` option.
|
|
56
|
+
*/
|
|
57
|
+
export declare const BODY_SHAPE_LIMITS: Readonly<{
|
|
58
|
+
/** A landmark counts as visible above this. */
|
|
59
|
+
visible: 0.5;
|
|
60
|
+
/** `raised`: wrist this far above its shoulder … */
|
|
61
|
+
raisedAboveShoulder: 0.75;
|
|
62
|
+
/** `out`: wrist within this of shoulder height … */
|
|
63
|
+
outLevel: 0.5;
|
|
64
|
+
/** … reaching at least this far outward … */
|
|
65
|
+
outReach: 0.9;
|
|
66
|
+
/** … with the elbow this straight (max bend). */
|
|
67
|
+
outStraight: 45;
|
|
68
|
+
/** `onHead`: wrist above the shoulder by at least this … */
|
|
69
|
+
onHeadAboveShoulder: 0.35;
|
|
70
|
+
/** … within this of the nose sideways … */
|
|
71
|
+
onHeadNearNose: 0.8;
|
|
72
|
+
/** … not higher than this above the nose (a hand ON the head, not reaching up) … */
|
|
73
|
+
onHeadMaxAboveNose: 1.1;
|
|
74
|
+
/** … with the elbow bent at least this much. */
|
|
75
|
+
onHeadBend: 55;
|
|
76
|
+
/**
|
|
77
|
+
* `onHip`: wrist ABOVE the hip landmark by this much (at the waist; hands in
|
|
78
|
+
* pockets sit on the hip line) …
|
|
79
|
+
*/
|
|
80
|
+
onHipAboveMin: 0.12;
|
|
81
|
+
/** … but not higher than this … */
|
|
82
|
+
onHipAboveMax: 0.9;
|
|
83
|
+
/** … and sideways (hip outward positive), between these … */
|
|
84
|
+
onHipInward: -0.45;
|
|
85
|
+
onHipOutward: 0.7;
|
|
86
|
+
/** … with the elbow well out past the shoulder by this … */
|
|
87
|
+
onHipElbowOut: 0.3;
|
|
88
|
+
/** … and bent at least this much. */
|
|
89
|
+
onHipBend: 45;
|
|
90
|
+
/**
|
|
91
|
+
* `thumbUp`: the thumb point at least this far above the index and pinky
|
|
92
|
+
* knuckles (a fist, thumb up — not an open hand or a thumb to the side) …
|
|
93
|
+
*/
|
|
94
|
+
thumbUpLift: 0.08;
|
|
95
|
+
/** … and above the wrist by at least this … */
|
|
96
|
+
thumbUpAboveWrist: 0.12;
|
|
97
|
+
/** … with the wrist between these heights relative to the shoulder (down negative) … */
|
|
98
|
+
thumbUpTop: 0.6;
|
|
99
|
+
thumbUpBottom: -1.3;
|
|
100
|
+
/** … not reaching more than this past the midline (a hand in front of its own side). */
|
|
101
|
+
thumbUpPastMidline: 0.3;
|
|
102
|
+
/** `crossed`: wrist past the midline by this … */
|
|
103
|
+
crossedPast: 0.05;
|
|
104
|
+
/** … between these heights relative to the shoulder (down negative). */
|
|
105
|
+
crossedTop: 0.35;
|
|
106
|
+
crossedBottom: -1.9;
|
|
107
|
+
/** `down`: wrist at least this far below its shoulder. */
|
|
108
|
+
downBelow: 0.9;
|
|
109
|
+
/** Leg `raised`: knee no lower than this relative to its hip (negative = below) … */
|
|
110
|
+
legRaisedKnee: -0.6;
|
|
111
|
+
/** … and its ankle at least this far above the other ankle (the foot is off the ground). */
|
|
112
|
+
legRaisedAnkle: 0.4;
|
|
113
|
+
/** Leg `down`: knee at least this far below its hip. */
|
|
114
|
+
legDownBelow: 0.8;
|
|
115
|
+
/**
|
|
116
|
+
* `squat`: the hips at most this high above the ankles (standing ≈ 2.2, a
|
|
117
|
+
* deep squat ≈ 1.1), with both feet on the ground.
|
|
118
|
+
*/
|
|
119
|
+
squatHipHeight: 1.65;
|
|
120
|
+
/** `lean`: the torso (hips → shoulders) tilted at least this far from upright, degrees. */
|
|
121
|
+
leanDegrees: 8;
|
|
122
|
+
/** `wideStance`: the ankles at least this far apart. */
|
|
123
|
+
wideStance: 1.4;
|
|
124
|
+
}>;
|
|
125
|
+
/** The classifier thresholds (see `BODY_SHAPE_LIMITS` for each one's meaning). */
|
|
126
|
+
export type BodyShapeLimits = Record<keyof typeof BODY_SHAPE_LIMITS, number>;
|
|
127
|
+
export type ArmShape = {
|
|
128
|
+
state: ArmState;
|
|
129
|
+
/** Wrist height above the shoulder, in shoulder widths. */
|
|
130
|
+
up: number;
|
|
131
|
+
/** Wrist reach away from the body's midline past the shoulder, in shoulder widths. */
|
|
132
|
+
out: number;
|
|
133
|
+
/** Elbow bend in degrees (0 = straight). */
|
|
134
|
+
bend: number;
|
|
135
|
+
/** Elbow reach away from the body past the shoulder, in shoulder widths. */
|
|
136
|
+
elbowOut: number;
|
|
137
|
+
/** Wrist height above the same-side hip landmark, in shoulder widths. */
|
|
138
|
+
aboveHip: number;
|
|
139
|
+
/**
|
|
140
|
+
* How far the thumb point rises above the higher of the index and pinky
|
|
141
|
+
* knuckles, in shoulder widths (positive for a thumbs up).
|
|
142
|
+
*/
|
|
143
|
+
thumbLift: number;
|
|
144
|
+
};
|
|
145
|
+
export type LegShape = {
|
|
146
|
+
state: LegState;
|
|
147
|
+
/** Knee height relative to its hip, in shoulder widths (standing ≈ −1.1, knee at hip height ≈ 0). */
|
|
148
|
+
kneeLift: number;
|
|
149
|
+
/** Ankle height above the other ankle, in shoulder widths. */
|
|
150
|
+
ankleLift: number;
|
|
151
|
+
/** Knee bend in degrees (0 = straight). */
|
|
152
|
+
bend: number;
|
|
153
|
+
};
|
|
154
|
+
export type BodyShape = {
|
|
155
|
+
arms: Record<BodySide, ArmShape>;
|
|
156
|
+
/** Shoulder width in tracker units (the scale everything is measured in). */
|
|
157
|
+
shoulderWidth: number;
|
|
158
|
+
/** Whether the upper body (nose, shoulders, elbows, wrists) is visible. */
|
|
159
|
+
upperBodyVisible: boolean;
|
|
160
|
+
/** Whether the hips are visible (needed for `onHip` and `lean`). */
|
|
161
|
+
hipsVisible: boolean;
|
|
162
|
+
/** Whether hips, knees and ankles are visible (needed for the leg poses). */
|
|
163
|
+
lowerBodyVisible: boolean;
|
|
164
|
+
/** Each leg (`null` while the lower body is not in view). */
|
|
165
|
+
legs: Record<BodySide, LegShape> | null;
|
|
166
|
+
/**
|
|
167
|
+
* Torso tilt from upright in degrees, + toward the person's own left
|
|
168
|
+
* (`null` while the hips are not in view).
|
|
169
|
+
*/
|
|
170
|
+
lean: number | null;
|
|
171
|
+
/** The side the torso leans toward past `leanDegrees`, else `null`. */
|
|
172
|
+
leanSide: BodySide | null;
|
|
173
|
+
/** Hip height above the ankles, in shoulder widths (`null` without the lower body). */
|
|
174
|
+
hipHeight: number | null;
|
|
175
|
+
/** Ankle spread, in shoulder widths (`null` without the lower body). */
|
|
176
|
+
stance: number | null;
|
|
177
|
+
/** Hips low over both feet. */
|
|
178
|
+
squat: boolean;
|
|
179
|
+
/** Feet spread wide. */
|
|
180
|
+
wideStance: boolean;
|
|
181
|
+
};
|
|
182
|
+
export type AnalyzeBodyShapeOptions = {
|
|
183
|
+
/**
|
|
184
|
+
* The tracker input is mirrored (the selfie webcam): MediaPipe's left / right
|
|
185
|
+
* labels then name the person's opposite side, so they are swapped. Default `false`.
|
|
186
|
+
*/
|
|
187
|
+
mirrored?: boolean;
|
|
188
|
+
/** Per-landmark visibility (0..1); without it every landmark counts as visible. */
|
|
189
|
+
visibility?: readonly number[];
|
|
190
|
+
/** Thresholds to override (the rest keep `BODY_SHAPE_LIMITS`). */
|
|
191
|
+
limits?: Partial<BodyShapeLimits>;
|
|
192
|
+
/**
|
|
193
|
+
* The tracked frame's aspect ratio, width ÷ height (`useXRFeedAspect()`).
|
|
194
|
+
* Tracker x and y each span −1..1 across the frame, so on a portrait or
|
|
195
|
+
* landscape frame a unit of x is not a unit of y; the landmarks are scaled
|
|
196
|
+
* to square units first (`squareLandmarks`) so every pose reads the same on
|
|
197
|
+
* any frame. Default 1 (the landmarks are already in square units).
|
|
198
|
+
*/
|
|
199
|
+
aspect?: number;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Landmarks in square units: x (and MediaPipe's depth z, which shares x's
|
|
203
|
+
* scale) multiplied by the frame's aspect ratio (width ÷ height), so a unit
|
|
204
|
+
* of x equals a unit of y (half the frame height). Tracker space spans the
|
|
205
|
+
* frame on each axis, so without this a horizontal distance on a portrait
|
|
206
|
+
* frame reads 1.78× too long next to a vertical one. Returns the input
|
|
207
|
+
* unchanged for a square frame (`aspect` 1).
|
|
208
|
+
*/
|
|
209
|
+
export declare const squareLandmarks: (landmarks: readonly TrackerPoint[], aspect?: number) => readonly TrackerPoint[];
|
|
210
|
+
/**
|
|
211
|
+
* Reads each arm's state from MediaPipe pose landmarks in tracker coordinates
|
|
212
|
+
* (`BodyTracker`'s `getLandmarks2D`: x right, y up, 33 points). Scale-free
|
|
213
|
+
* (shoulder widths), side-correct (measured from the body's midline, labels
|
|
214
|
+
* swapped on a mirrored feed) and, given the frame's `aspect`, the same on
|
|
215
|
+
* portrait, landscape and square frames. Pure.
|
|
216
|
+
*/
|
|
217
|
+
export declare const analyzeBodyShape: (tracked: readonly TrackerPoint[], { mirrored, visibility, limits, aspect }?: AnalyzeBodyShapeOptions) => BodyShape;
|
|
218
|
+
/**
|
|
219
|
+
* What a pose requires of each arm; an array means any of those states,
|
|
220
|
+
* omitted = any. `anyOf` passes when one of its rules does (a thumbs up with
|
|
221
|
+
* either hand).
|
|
222
|
+
*/
|
|
223
|
+
export type BodyPoseRule = {
|
|
224
|
+
arms?: Partial<Record<BodySide, ArmState | readonly ArmState[]>>;
|
|
225
|
+
/** Per leg, like `arms` (needs the lower body in view). */
|
|
226
|
+
legs?: Partial<Record<BodySide, LegState | readonly LegState[]>>;
|
|
227
|
+
/** The torso leans toward this side, or `"none"` = upright (needs the hips in view). */
|
|
228
|
+
lean?: BodySide | "none";
|
|
229
|
+
/** Hips low over both feet (`true`) or not (`false`). */
|
|
230
|
+
squat?: boolean;
|
|
231
|
+
/** Feet spread wide (`true`) or not (`false`). */
|
|
232
|
+
wideStance?: boolean;
|
|
233
|
+
anyOf?: readonly BodyPoseRule[];
|
|
234
|
+
};
|
|
235
|
+
/** Your own test of a body shape (any logic over the arm measurements). */
|
|
236
|
+
export type BodyPoseMatch = (shape: BodyShape) => boolean;
|
|
237
|
+
/** How the hint figure shows a pose. */
|
|
238
|
+
export type BodyPoseHintPose = {
|
|
239
|
+
/** The hint model's animation clip that shows it (`ybot.glb` ships one per pose). */
|
|
240
|
+
clip: string;
|
|
241
|
+
/** The person's arms that make the pose (drawn brighter on the hint). Default none. */
|
|
242
|
+
arms?: readonly BodySide[];
|
|
243
|
+
/** The person's legs that make the pose (drawn brighter on the hint). Default none. */
|
|
244
|
+
legs?: readonly BodySide[];
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* A pose: its default copy, how it is detected (`rule`, or `match` for logic
|
|
248
|
+
* a rule cannot express; with both, both must pass) and how the hint figure
|
|
249
|
+
* shows it. Make your own with `defineBodyPose`.
|
|
250
|
+
*/
|
|
251
|
+
export type BodyPoseDefinition = {
|
|
252
|
+
/** Default instruction copy. */
|
|
253
|
+
label: string;
|
|
254
|
+
rule?: BodyPoseRule;
|
|
255
|
+
match?: BodyPoseMatch;
|
|
256
|
+
/**
|
|
257
|
+
* What the detector's `isInView` asks for (the "waiting" status and the
|
|
258
|
+
* nudge; completion only needs the rule): the upper body (default) or the
|
|
259
|
+
* whole body (the leg and lean poses).
|
|
260
|
+
*/
|
|
261
|
+
view?: "upper" | "full";
|
|
262
|
+
hint: BodyPoseHintPose;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Anything that names a pose to detect: a built-in name, a rule, a match
|
|
266
|
+
* function or a full definition.
|
|
267
|
+
*/
|
|
268
|
+
export type BodyPoseSpec = BodyPoseName | BodyPoseRule | BodyPoseMatch | BodyPoseDefinition;
|
|
269
|
+
/**
|
|
270
|
+
* Checks and returns your own pose definition (it needs a `rule` or a
|
|
271
|
+
* `match`). Pass it anywhere a pose name goes.
|
|
272
|
+
*
|
|
273
|
+
* ```ts
|
|
274
|
+
* const flex = defineBodyPose({
|
|
275
|
+
* label: "Show your muscles",
|
|
276
|
+
* rule: { arms: { left: "onHead", right: "onHead" } },
|
|
277
|
+
* hint: { clip: "flex", arms: ["left", "right"] }, // a clip in your own figure
|
|
278
|
+
* });
|
|
279
|
+
* ```
|
|
280
|
+
*/
|
|
281
|
+
export declare const defineBodyPose: <T extends BodyPoseDefinition>(definition: T) => T;
|
|
282
|
+
/**
|
|
283
|
+
* The body instruction vocabulary (arm poses; the upper body is enough). Left /
|
|
284
|
+
* right are the person's own sides.
|
|
285
|
+
*/
|
|
286
|
+
export declare const BODY_POSES: {
|
|
287
|
+
readonly hooray: {
|
|
288
|
+
readonly label: "Raise both arms";
|
|
289
|
+
readonly rule: {
|
|
290
|
+
readonly arms: {
|
|
291
|
+
readonly left: "raised";
|
|
292
|
+
readonly right: "raised";
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
readonly hint: {
|
|
296
|
+
readonly clip: "hooray";
|
|
297
|
+
readonly arms: readonly ["left", "right"];
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
/** Alias of `hooray` (the same rule and hint): both arms raised. */
|
|
301
|
+
readonly handsUp: {
|
|
302
|
+
readonly label: "Hands up";
|
|
303
|
+
readonly rule: {
|
|
304
|
+
readonly arms: {
|
|
305
|
+
readonly left: "raised";
|
|
306
|
+
readonly right: "raised";
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
readonly hint: {
|
|
310
|
+
readonly clip: "hooray";
|
|
311
|
+
readonly arms: readonly ["left", "right"];
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
readonly tPose: {
|
|
315
|
+
readonly label: "Make a T-pose";
|
|
316
|
+
readonly rule: {
|
|
317
|
+
readonly arms: {
|
|
318
|
+
readonly left: "out";
|
|
319
|
+
readonly right: "out";
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
readonly hint: {
|
|
323
|
+
readonly clip: "tpose";
|
|
324
|
+
readonly arms: readonly ["left", "right"];
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
readonly raiseLeft: {
|
|
328
|
+
readonly label: "Raise your left arm";
|
|
329
|
+
readonly rule: {
|
|
330
|
+
readonly arms: {
|
|
331
|
+
readonly left: "raised";
|
|
332
|
+
readonly right: readonly ["down", "other", "onHip"];
|
|
333
|
+
};
|
|
334
|
+
readonly lean: "none";
|
|
335
|
+
};
|
|
336
|
+
readonly hint: {
|
|
337
|
+
readonly clip: "raiseLeft";
|
|
338
|
+
readonly arms: readonly ["left"];
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
readonly raiseRight: {
|
|
342
|
+
readonly label: "Raise your right arm";
|
|
343
|
+
readonly rule: {
|
|
344
|
+
readonly arms: {
|
|
345
|
+
readonly right: "raised";
|
|
346
|
+
readonly left: readonly ["down", "other", "onHip"];
|
|
347
|
+
};
|
|
348
|
+
readonly lean: "none";
|
|
349
|
+
};
|
|
350
|
+
readonly hint: {
|
|
351
|
+
readonly clip: "raiseRight";
|
|
352
|
+
readonly arms: readonly ["right"];
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
readonly handsOnHips: {
|
|
356
|
+
readonly label: "Hands on your hips";
|
|
357
|
+
readonly rule: {
|
|
358
|
+
readonly arms: {
|
|
359
|
+
readonly left: "onHip";
|
|
360
|
+
readonly right: "onHip";
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
readonly hint: {
|
|
364
|
+
readonly clip: "handsOnHips";
|
|
365
|
+
readonly arms: readonly ["left", "right"];
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
readonly armsCrossed: {
|
|
369
|
+
readonly label: "Cross your arms";
|
|
370
|
+
readonly rule: {
|
|
371
|
+
readonly arms: {
|
|
372
|
+
readonly left: "crossed";
|
|
373
|
+
readonly right: "crossed";
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
readonly hint: {
|
|
377
|
+
readonly clip: "armsCrossed";
|
|
378
|
+
readonly arms: readonly ["left", "right"];
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
readonly handsOnHead: {
|
|
382
|
+
readonly label: "Hands on your head";
|
|
383
|
+
readonly rule: {
|
|
384
|
+
readonly arms: {
|
|
385
|
+
readonly left: "onHead";
|
|
386
|
+
readonly right: "onHead";
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
readonly hint: {
|
|
390
|
+
readonly clip: "handsOnHead";
|
|
391
|
+
readonly arms: readonly ["left", "right"];
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
readonly thumbUp: {
|
|
395
|
+
readonly label: "Give a thumbs up";
|
|
396
|
+
readonly rule: {
|
|
397
|
+
readonly anyOf: readonly [{
|
|
398
|
+
readonly arms: {
|
|
399
|
+
readonly right: "thumbUp";
|
|
400
|
+
};
|
|
401
|
+
}, {
|
|
402
|
+
readonly arms: {
|
|
403
|
+
readonly left: "thumbUp";
|
|
404
|
+
};
|
|
405
|
+
}];
|
|
406
|
+
};
|
|
407
|
+
readonly hint: {
|
|
408
|
+
readonly clip: "thumbUp";
|
|
409
|
+
readonly arms: readonly ["right"];
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
readonly bothThumbsUp: {
|
|
413
|
+
readonly label: "Two thumbs up";
|
|
414
|
+
readonly rule: {
|
|
415
|
+
readonly arms: {
|
|
416
|
+
readonly left: "thumbUp";
|
|
417
|
+
readonly right: "thumbUp";
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
readonly hint: {
|
|
421
|
+
readonly clip: "bothThumbsUp";
|
|
422
|
+
readonly arms: readonly ["left", "right"];
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
readonly salute: {
|
|
426
|
+
readonly label: "Salute";
|
|
427
|
+
readonly rule: {
|
|
428
|
+
readonly arms: {
|
|
429
|
+
readonly right: "onHead";
|
|
430
|
+
readonly left: readonly ["down", "other", "onHip"];
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
readonly hint: {
|
|
434
|
+
readonly clip: "salute";
|
|
435
|
+
readonly arms: readonly ["right"];
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
readonly squat: {
|
|
439
|
+
readonly label: "Squat down";
|
|
440
|
+
readonly rule: {
|
|
441
|
+
readonly squat: true;
|
|
442
|
+
};
|
|
443
|
+
readonly view: "full";
|
|
444
|
+
readonly hint: {
|
|
445
|
+
readonly clip: "squat";
|
|
446
|
+
readonly arms: readonly [];
|
|
447
|
+
readonly legs: readonly ["left", "right"];
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
readonly leanLeft: {
|
|
451
|
+
readonly label: "Lean to your left";
|
|
452
|
+
readonly rule: {
|
|
453
|
+
readonly lean: "left";
|
|
454
|
+
};
|
|
455
|
+
readonly view: "full";
|
|
456
|
+
readonly hint: {
|
|
457
|
+
readonly clip: "leanLeft";
|
|
458
|
+
readonly arms: readonly ["right"];
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
readonly leanRight: {
|
|
462
|
+
readonly label: "Lean to your right";
|
|
463
|
+
readonly rule: {
|
|
464
|
+
readonly lean: "right";
|
|
465
|
+
};
|
|
466
|
+
readonly view: "full";
|
|
467
|
+
readonly hint: {
|
|
468
|
+
readonly clip: "leanRight";
|
|
469
|
+
readonly arms: readonly ["left"];
|
|
470
|
+
};
|
|
471
|
+
};
|
|
472
|
+
readonly oneLeg: {
|
|
473
|
+
readonly label: "Stand on one leg";
|
|
474
|
+
readonly rule: {
|
|
475
|
+
readonly anyOf: readonly [{
|
|
476
|
+
readonly legs: {
|
|
477
|
+
readonly right: "raised";
|
|
478
|
+
readonly left: "down";
|
|
479
|
+
};
|
|
480
|
+
}, {
|
|
481
|
+
readonly legs: {
|
|
482
|
+
readonly left: "raised";
|
|
483
|
+
readonly right: "down";
|
|
484
|
+
};
|
|
485
|
+
}];
|
|
486
|
+
};
|
|
487
|
+
readonly view: "full";
|
|
488
|
+
readonly hint: {
|
|
489
|
+
readonly clip: "oneLeg";
|
|
490
|
+
readonly arms: readonly [];
|
|
491
|
+
readonly legs: readonly ["right"];
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
readonly star: {
|
|
495
|
+
readonly label: "Make a star";
|
|
496
|
+
readonly rule: {
|
|
497
|
+
readonly wideStance: true;
|
|
498
|
+
readonly arms: {
|
|
499
|
+
readonly left: readonly ["raised", "out"];
|
|
500
|
+
readonly right: readonly ["raised", "out"];
|
|
501
|
+
};
|
|
502
|
+
};
|
|
503
|
+
readonly view: "full";
|
|
504
|
+
readonly hint: {
|
|
505
|
+
readonly clip: "star";
|
|
506
|
+
readonly arms: readonly ["left", "right"];
|
|
507
|
+
readonly legs: readonly ["left", "right"];
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
export type BodyPoseName = keyof typeof BODY_POSES;
|
|
512
|
+
export declare const BODY_POSE_NAMES: BodyPoseName[];
|
|
513
|
+
/** The full definition a spec names (`undefined` for a bare rule or match function). */
|
|
514
|
+
export declare const resolveBodyPose: (pose: BodyPoseSpec) => BodyPoseDefinition | undefined;
|
|
515
|
+
/**
|
|
516
|
+
* Whether a shape satisfies a pose: a name from `BODY_POSES`, a rule, a match
|
|
517
|
+
* function or a definition.
|
|
518
|
+
*/
|
|
519
|
+
export declare const matchBodyPose: (shape: BodyShape, pose: BodyPoseSpec) => boolean;
|
|
520
|
+
/** Every named pose a shape satisfies. */
|
|
521
|
+
export declare const matchingBodyPoses: (shape: BodyShape) => BodyPoseName[];
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { TrackerPoint } from '../../types/common';
|
|
2
|
+
export type ArmParams = {
|
|
3
|
+
/** Upper arm, from hanging down (0) out to the side (90) and up (180); negative swings across the body. */
|
|
4
|
+
upper: number;
|
|
5
|
+
/** Upper arm tilt toward the camera (90 = pointing at it). */
|
|
6
|
+
upperFwd: number;
|
|
7
|
+
/** Forearm, same convention, absolute (not relative to the upper arm). */
|
|
8
|
+
fore: number;
|
|
9
|
+
foreFwd: number;
|
|
10
|
+
};
|
|
11
|
+
export type LegParams = {
|
|
12
|
+
/** Thigh raised toward the camera from hanging (0) to level (90). */
|
|
13
|
+
thighFwd: number;
|
|
14
|
+
/** Thigh swung out to the side. */
|
|
15
|
+
thighOut: number;
|
|
16
|
+
/** Shin, absolute: forward tilt toward the camera (negative = foot behind, a heel kick). */
|
|
17
|
+
shinFwd: number;
|
|
18
|
+
shinOut: number;
|
|
19
|
+
};
|
|
20
|
+
export type BodyParams = {
|
|
21
|
+
/** Hip midpoint position in tracker units, and tracker units per metre. */
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
scale: number;
|
|
25
|
+
/**
|
|
26
|
+
* The frame's aspect, width ÷ height (9/16 portrait, 16/9 landscape). Tracker
|
|
27
|
+
* x spans the frame width, so it reads square-unit x ÷ aspect.
|
|
28
|
+
*/
|
|
29
|
+
aspect: number;
|
|
30
|
+
/** Whole-body lift above the ground (m): a jump. */
|
|
31
|
+
lift: number;
|
|
32
|
+
/** Torso tilt toward the camera (deg). */
|
|
33
|
+
torsoFwd: number;
|
|
34
|
+
left: ArmParams;
|
|
35
|
+
right: ArmParams;
|
|
36
|
+
leftLeg: LegParams;
|
|
37
|
+
rightLeg: LegParams;
|
|
38
|
+
};
|
|
39
|
+
export declare const STANDING: BodyParams;
|
|
40
|
+
export type SyntheticFrame = {
|
|
41
|
+
landmarks: TrackerPoint[];
|
|
42
|
+
visibility: number[];
|
|
43
|
+
mirrored: boolean;
|
|
44
|
+
/** The frame's aspect (width ÷ height), to pass on as `aspect`. */
|
|
45
|
+
aspect: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Visibility as MediaPipe reports a whole body standing in frame with the feet
|
|
49
|
+
* near the bottom edge: high on the upper body and hips, lower on the knees,
|
|
50
|
+
* and well under 0.5 on the ankles and feet.
|
|
51
|
+
*/
|
|
52
|
+
export declare const IN_FRAME_VISIBILITY: Record<number, number>;
|
|
53
|
+
/**
|
|
54
|
+
* Visibility as MediaPipe reports a body cut off below the hips (a front camera
|
|
55
|
+
* held close): the hips borderline, the knees and ankles near 0.
|
|
56
|
+
*/
|
|
57
|
+
export declare const CLOSE_UP_VISIBILITY: Record<number, number>;
|
|
58
|
+
export type RenderOptions = {
|
|
59
|
+
/** The selfie feed: the image flips and MediaPipe's labels follow the image. */
|
|
60
|
+
mirrored?: boolean;
|
|
61
|
+
/** Hips, knees, ankles and feet hidden (visibility 0.1): the body cut off at the waist. */
|
|
62
|
+
legsHidden?: boolean;
|
|
63
|
+
/** Visibility per landmark index to force. */
|
|
64
|
+
visibility?: Record<number, number>;
|
|
65
|
+
};
|
|
66
|
+
/** MediaPipe's 33 landmarks (unmirrored: the person's left on screen-right). */
|
|
67
|
+
export declare const renderBody: (p: BodyParams, options?: RenderOptions) => SyntheticFrame;
|
|
68
|
+
/** Deep-ish override of the standing figure (arm / leg params merge field by field). */
|
|
69
|
+
export type BodyPatch = Partial<Omit<BodyParams, "left" | "right" | "leftLeg" | "rightLeg">> & {
|
|
70
|
+
left?: Partial<ArmParams>;
|
|
71
|
+
right?: Partial<ArmParams>;
|
|
72
|
+
leftLeg?: Partial<LegParams>;
|
|
73
|
+
rightLeg?: Partial<LegParams>;
|
|
74
|
+
};
|
|
75
|
+
export declare const pose: (patch?: BodyPatch, base?: BodyParams) => BodyParams;
|
|
76
|
+
export declare const lerpBody: (a: BodyParams, b: BodyParams, t: number) => BodyParams;
|
|
77
|
+
/** Keyframes `[timeMs, params]` sampled every `stepMs` (30 fps by default), smooth in between. */
|
|
78
|
+
export declare const timeline: (keys: ReadonlyArray<readonly [number, BodyParams]>, stepMs?: number) => Array<{
|
|
79
|
+
t: number;
|
|
80
|
+
body: BodyParams;
|
|
81
|
+
}>;
|
|
82
|
+
/** Move every keyframe: `x` / `y` add to the figure's own offsets, `scale` / `aspect` replace. */
|
|
83
|
+
export declare const placed: (keys: ReadonlyArray<readonly [number, BodyParams]>, { x, y, ...rest }: Partial<Pick<BodyParams, "x" | "y" | "scale" | "aspect">>) => Array<[number, BodyParams]>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { BodyShape, BodyShapeLimits, BodySide } from '../body-pose';
|
|
2
|
+
import { TrackerPoint } from '../types/common';
|
|
3
|
+
/** The joints a move reads, named by the person's OWN side. */
|
|
4
|
+
export type BodyMoveJointName = "nose" | "leftShoulder" | "rightShoulder" | "leftElbow" | "rightElbow" | "leftWrist" | "rightWrist" | "leftIndex" | "rightIndex" | "leftHip" | "rightHip" | "leftKnee" | "rightKnee" | "leftAnkle" | "rightAnkle";
|
|
5
|
+
/**
|
|
6
|
+
* When a joint counts as in view for the moves. MediaPipe's visibility for an
|
|
7
|
+
* ankle in frame is often well below 0.5 (0.2 to 0.5 is common for feet near
|
|
8
|
+
* the bottom edge), while a joint outside the frame (legs cut off by a close
|
|
9
|
+
* front camera) drops near 0 and sits well past the edge; a low visibility bar
|
|
10
|
+
* plus a position check separates the two.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BODY_MOVE_VIEW_LIMITS: Readonly<{
|
|
13
|
+
/** MediaPipe visibility at or above which a joint counts. */
|
|
14
|
+
visible: 0.2;
|
|
15
|
+
/**
|
|
16
|
+
* How far past the frame edge a joint may sit (frame units: each axis spans
|
|
17
|
+
* −1..1), so an ankle right at the edge, feet partly cropped, still counts.
|
|
18
|
+
*/
|
|
19
|
+
edge: 0.12;
|
|
20
|
+
}>;
|
|
21
|
+
/** The in-view thresholds (see `BODY_MOVE_VIEW_LIMITS`). */
|
|
22
|
+
export type BodyMoveViewLimits = Record<keyof typeof BODY_MOVE_VIEW_LIMITS, number>;
|
|
23
|
+
/**
|
|
24
|
+
* One analysed tracker sample of one body, shared by every trigger that reads
|
|
25
|
+
* it: BodyInstruction's `analyzeBodyShape` result plus the person-side joints
|
|
26
|
+
* and the scales the moves measure in. Left / right are the person's OWN
|
|
27
|
+
* sides on every camera (MediaPipe's labels are swapped on a mirrored feed).
|
|
28
|
+
* Joints are in square tracker units: x right, y up, `z` toward the camera
|
|
29
|
+
* (MediaPipe's relative depth), with x and z multiplied by the frame's aspect
|
|
30
|
+
* so a unit of x equals a unit of y on any frame.
|
|
31
|
+
*/
|
|
32
|
+
export type BodyMoveFrame = {
|
|
33
|
+
/** BodyInstruction's analysis of the same landmarks (arm / leg states, squat, lean …). */
|
|
34
|
+
shape: BodyShape;
|
|
35
|
+
/** The landmarks as tracked (MediaPipe's labels; frame units, each axis spans −1..1). */
|
|
36
|
+
landmarks: readonly TrackerPoint[];
|
|
37
|
+
/** The person's own joints, in square units (`joints.leftWrist` is their left wrist). */
|
|
38
|
+
joints: Record<BodyMoveJointName, TrackerPoint>;
|
|
39
|
+
/** Each joint's MediaPipe visibility (1 when the source gives none). */
|
|
40
|
+
visibility: Record<BodyMoveJointName, number>;
|
|
41
|
+
/**
|
|
42
|
+
* Whether each joint is in view: visibility at least
|
|
43
|
+
* `BODY_MOVE_VIEW_LIMITS.visible` and no further than `edge` past the frame edge.
|
|
44
|
+
*/
|
|
45
|
+
seen: Record<BodyMoveJointName, boolean>;
|
|
46
|
+
/** Shoulder width in square units (= `shape.shoulderWidth`): the scale of the arm moves. */
|
|
47
|
+
shoulderWidth: number;
|
|
48
|
+
/**
|
|
49
|
+
* Torso length, shoulder midpoint to hip midpoint, measured vertically: the
|
|
50
|
+
* scale of the leg moves (vertical against vertical). 0 when the hips are
|
|
51
|
+
* not below the shoulders.
|
|
52
|
+
*/
|
|
53
|
+
torso: number;
|
|
54
|
+
/** Tracker-x direction of the person's own left: +1 on an unmirrored camera, −1 on the selfie feed. */
|
|
55
|
+
leftward: 1 | -1;
|
|
56
|
+
/** Shoulders, elbows and wrists are in view (`seen`). */
|
|
57
|
+
upperInView: boolean;
|
|
58
|
+
/** Shoulders, hips, knees and ankles are in view (`seen`): the leg moves need it. */
|
|
59
|
+
fullInView: boolean;
|
|
60
|
+
/** The input was a mirrored (selfie) feed. */
|
|
61
|
+
mirrored: boolean;
|
|
62
|
+
/** The frame's aspect ratio (width ÷ height) the joints were squared with. */
|
|
63
|
+
aspect: number;
|
|
64
|
+
};
|
|
65
|
+
export type CreateBodyMoveFrameOptions = {
|
|
66
|
+
/** The tracker input is mirrored (the selfie webcam). Default `false`. */
|
|
67
|
+
mirrored?: boolean;
|
|
68
|
+
/** Per-landmark visibility (0..1); without it every landmark counts as visible. */
|
|
69
|
+
visibility?: readonly number[];
|
|
70
|
+
/** BodyInstruction classifier thresholds to override (see `BODY_SHAPE_LIMITS`). */
|
|
71
|
+
limits?: Partial<BodyShapeLimits>;
|
|
72
|
+
/** The tracked frame's aspect ratio, width ÷ height (`useXRFeedAspect()`). Default 1. */
|
|
73
|
+
aspect?: number;
|
|
74
|
+
/** When a joint counts as in view (see `BODY_MOVE_VIEW_LIMITS`). */
|
|
75
|
+
view?: Partial<BodyMoveViewLimits>;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Analyses one tracker sample of one body for the body triggers. Pure; needs
|
|
79
|
+
* all 33 MediaPipe pose landmarks (`BODY_LANDMARK_COUNT`), else it throws
|
|
80
|
+
* (like `analyzeBodyShape`).
|
|
81
|
+
*/
|
|
82
|
+
export declare const createBodyMoveFrame: (landmarks: readonly TrackerPoint[], { mirrored, visibility, limits, aspect, view }?: CreateBodyMoveFrameOptions) => BodyMoveFrame;
|
|
83
|
+
type LimbJoint = "Shoulder" | "Elbow" | "Wrist" | "Index" | "Hip" | "Knee" | "Ankle";
|
|
84
|
+
/** `"leftWrist"` for `("left", "Wrist")`: the person's own joint on that side. */
|
|
85
|
+
export declare const sideJoint: (side: BodySide, joint: LimbJoint) => BodyMoveJointName;
|
|
86
|
+
/** Whether the arm on that side (shoulder, elbow, wrist) is seen. */
|
|
87
|
+
export declare const armInView: (frame: BodyMoveFrame, side: BodySide) => boolean;
|
|
88
|
+
export {};
|