@vincentt-xr/sdk 2.0.0-alpha.0 → 2.0.0-alpha.10
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 +8193 -111
- package/README.md +86 -52
- package/dist/CanonicalHeadFrame-D_0OzdB9.cjs +1 -0
- package/dist/CanonicalHeadFrame-DdUqF6Fv.js +1506 -0
- package/dist/DebuggerUI-CVuV-VJ5.cjs +1 -0
- package/dist/DebuggerUI-D-rcPa54.js +275 -0
- package/dist/FaceRetouch-C1AxBNex.js +1071 -0
- package/dist/FaceRetouch-D7kryDE6.cjs +134 -0
- package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
- package/dist/FaceSurface-DmP9AEeC.js +27 -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/assets/sdkModels.d.ts +22 -0
- package/dist/audio/AudioEngine.d.ts +3 -1
- package/dist/audio/AudioPlayer.d.ts +29 -0
- package/dist/audio/AudioPlayerLogic.d.ts +4 -0
- package/dist/audio/index.d.ts +2 -0
- package/dist/body/__fixtures__/syntheticRig.d.ts +21 -0
- package/dist/body/bodyFlipGuard.d.ts +39 -0
- package/dist/body/bodyIdentity.d.ts +72 -0
- package/dist/body/bodyMask.d.ts +79 -0
- package/dist/body/bodyMaskMaterial.d.ts +15 -0
- package/dist/body/bodyPose.d.ts +58 -0
- package/dist/body/bodyRigFit.d.ts +148 -0
- package/dist/body/bodyRigSolver.d.ts +114 -0
- package/dist/body/bodySubject.d.ts +46 -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/bodyMaskMaterial-CBWub5t_.cjs +68 -0
- package/dist/bodyMaskMaterial-Cs2awskk.js +207 -0
- package/dist/cache-2x3CUJuY.js +212 -0
- package/dist/cache-DL1Dbz6k.cjs +1 -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/Axes/index.d.ts +6 -0
- package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
- package/dist/components/BodyInstruction/index.d.ts +76 -0
- package/dist/components/BodyInstruction/useBodyPose.d.ts +30 -0
- package/dist/components/BodyRig/BodyAttachment.d.ts +28 -0
- package/dist/components/BodyRig/BodyOccluder.d.ts +27 -0
- package/dist/components/BodyRig/bodyDepth.d.ts +57 -0
- package/dist/components/BodyRig/index.d.ts +129 -0
- package/dist/components/BodyRig/useBodyDepthTexture.d.ts +40 -0
- package/dist/components/BodyTracker/index.d.ts +26 -1
- package/dist/components/BodyTrigger/index.d.ts +56 -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/FaceMeshRenderer.d.ts +25 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +70 -1
- package/dist/components/FaceMesh/canonical/FaceMeshMaterial.d.ts +25 -0
- package/dist/components/FaceMesh/canonical/assets.d.ts +3 -0
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +30 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +24 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +2 -0
- package/dist/components/FaceMesh/deform.d.ts +3 -0
- package/dist/components/FaceMesh/index.d.ts +6 -1
- package/dist/components/FaceMesh/material/defaults.d.ts +74 -0
- package/dist/components/FaceMesh/material/index.d.ts +1 -0
- package/dist/components/FaceMesh/material/options.d.ts +5 -1
- package/dist/components/FaceMesh/material/support.d.ts +7 -2
- package/dist/components/FaceMesh/material/textures.d.ts +4 -0
- package/dist/components/FaceMesh/material/types.d.ts +4 -2
- package/dist/components/FaceRetouch/Background.d.ts +11 -5
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +52 -0
- package/dist/components/FaceRetouch/index.d.ts +2 -6
- package/dist/components/FaceRetouch/landmarkMask.d.ts +4 -6
- package/dist/components/FaceRetouch/renderState.d.ts +19 -0
- package/dist/components/FaceRetouch/useFaceRetouchMask.d.ts +4 -7
- 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/FaceTracker/index.d.ts +5 -3
- package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
- package/dist/components/FaceWarp3D/index.d.ts +2 -0
- 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/HandEffect/index.d.ts +36 -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/HandJoints2D/index.d.ts +6 -0
- package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
- package/dist/components/HandRig/HandAttachment.d.ts +34 -0
- package/dist/components/HandRig/HandNails.d.ts +61 -0
- package/dist/components/HandRig/HandOccluder.d.ts +45 -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 +127 -0
- package/dist/components/HandRig/useArmMask.d.ts +29 -0
- package/dist/components/HandRig/wristSolve.d.ts +96 -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 +12 -2
- package/dist/components/HandTracking2D/HandVisual.d.ts +12 -0
- package/dist/components/HandTracking2D/index.d.ts +5 -0
- package/dist/components/HandTracking2DController/index.d.ts +5 -0
- package/dist/components/HandTracking3D/index.d.ts +6 -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 +67 -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/LightObject/index.d.ts +20 -0
- package/dist/components/LipEffect/LipEffect.d.ts +28 -0
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +98 -0
- package/dist/components/LipEffect/LipEffects.d.ts +12 -0
- package/dist/components/LipEffect/defaults.d.ts +51 -0
- package/dist/components/LipEffect/index.d.ts +12 -0
- 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 +141 -0
- package/dist/components/LipEffect/useLipDesignTextures.d.ts +17 -0
- package/dist/components/LipEffect/uvGuide.d.ts +74 -0
- package/dist/components/LookAt/index.d.ts +23 -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/MeshRenderer/index.d.ts +59 -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 +46 -0
- package/dist/components/PersonCutout/personCutout.d.ts +16 -0
- package/dist/components/PersonCutout/personMask.d.ts +19 -0
- package/dist/components/PersonCutout/useBodyMaskTexture.d.ts +35 -0
- package/dist/components/PerspectiveCamera/index.d.ts +2 -8
- package/dist/components/PinToMesh/index.d.ts +47 -0
- package/dist/components/RenderGroupLayer/index.d.ts +6 -0
- package/dist/components/SceneObjectRenderer/index.d.ts +23 -0
- package/dist/components/Screen2D/ScreenTransformFrame.d.ts +11 -0
- package/dist/components/Screen2D/ScreenTransformHelpers.d.ts +19 -0
- package/dist/components/Screen2D/ScreenTransformInteraction.d.ts +18 -0
- package/dist/components/Screen2D/index.d.ts +5 -0
- package/dist/components/ScreenGlass/defaults.d.ts +3 -0
- package/dist/components/ScreenGlass/index.d.ts +5 -0
- package/dist/components/ScreenGlass/shaders.d.ts +2 -0
- package/dist/components/ScreenGlass/types.d.ts +10 -0
- package/dist/components/ScreenGradient/defaults.d.ts +5 -0
- package/dist/components/ScreenGradient/index.d.ts +5 -0
- package/dist/components/ScreenGradient/shaders.d.ts +2 -0
- package/dist/components/ScreenGradient/types.d.ts +19 -0
- package/dist/components/ScreenImage/ScreenImage.d.ts +4 -0
- package/dist/components/ScreenImage/components/DynamicTextureSync.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageFrame.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageTransformFrame.d.ts +9 -0
- package/dist/components/ScreenImage/fit.d.ts +52 -0
- package/dist/components/ScreenImage/index.d.ts +10 -0
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +9 -0
- package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
- package/dist/components/ScreenImage/materials/ScreenImageMatcap.d.ts +3 -0
- package/dist/components/ScreenImage/source.d.ts +25 -0
- package/dist/components/ScreenImage/types.d.ts +64 -0
- package/dist/components/ScreenImage/utils/ScreenImageConstants.d.ts +9 -0
- package/dist/components/ScreenImage/utils/ScreenImageHelpers.d.ts +4 -0
- package/dist/components/ScreenShape/geometry.d.ts +5 -0
- package/dist/components/ScreenShape/index.d.ts +5 -0
- package/dist/components/ScreenShape/types.d.ts +54 -0
- package/dist/components/ScreenSpaceUI/ScreenTransformGuide.d.ts +15 -0
- package/dist/components/ScreenSpaceUI/ScreenTransformOverlayGuide.d.ts +9 -0
- package/dist/components/ScreenSpaceUI/index.d.ts +3 -0
- package/dist/components/ScreenText/components/ScreenTextBody.d.ts +2 -0
- package/dist/components/ScreenText/components/ScreenTextTransformFrame.d.ts +9 -0
- package/dist/components/ScreenText/constants.d.ts +5 -0
- package/dist/components/ScreenText/index.d.ts +6 -0
- package/dist/components/ScreenText/types.d.ts +31 -0
- package/dist/components/ScreenText/utils/ScreenTextHelpers.d.ts +14 -0
- package/dist/components/ScreenText/utils/ScreenTextMappings.d.ts +17 -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/SequentialRenderPasses/index.d.ts +6 -0
- package/dist/components/ShoulderOccluder/index.d.ts +46 -0
- package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +27 -0
- package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
- package/dist/components/SpringSwing/index.d.ts +1 -0
- package/dist/components/TextLabel/TextLabel.d.ts +5 -0
- package/dist/components/TextLabel/alignment.d.ts +4 -0
- package/dist/components/TextLabel/bend.d.ts +9 -0
- package/dist/components/TextLabel/canvas/buildTextLabelTexture.d.ts +4 -0
- package/dist/components/TextLabel/canvas/canvasTypography.d.ts +13 -0
- package/dist/components/TextLabel/canvas/drawBackground.d.ts +21 -0
- package/dist/components/TextLabel/canvas/drawEffects.d.ts +34 -0
- package/dist/components/TextLabel/canvas/drawText.d.ts +19 -0
- package/dist/components/TextLabel/components/TextLabelMesh.d.ts +13 -0
- package/dist/components/TextLabel/constants.d.ts +2 -0
- package/dist/components/TextLabel/hooks/useTextLabelTexture.d.ts +7 -0
- package/dist/components/TextLabel/index.d.ts +2 -62
- package/dist/components/TextLabel/layout/measurement.d.ts +8 -0
- package/dist/components/TextLabel/layout/resolveTextLayout.d.ts +25 -0
- package/dist/components/TextLabel/layout/wrapText.d.ts +6 -0
- package/dist/components/TextLabel/types.d.ts +337 -0
- package/dist/components/TrackingAnchor/index.d.ts +18 -2
- package/dist/components/Transform3D/index.d.ts +30 -0
- package/dist/components/XRMediaSurface/index.d.ts +8 -7
- package/dist/components/XRProvider/index.d.ts +16 -2
- package/dist/components/XRScene/index.d.ts +14 -3
- package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
- package/dist/components/XRViewport/XRViewport.d.ts +11 -0
- package/dist/components/XRViewport/components/HiddenMedia.d.ts +7 -0
- package/dist/components/XRViewport/components/MediaAssetPicker.d.ts +8 -0
- package/dist/components/XRViewport/components/MediaControlStack.d.ts +13 -0
- package/dist/components/XRViewport/components/XRViewportLayers.d.ts +30 -0
- package/dist/components/XRViewport/constants.d.ts +24 -0
- package/dist/components/XRViewport/contexts.d.ts +6 -0
- package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +13 -0
- package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +16 -0
- package/dist/components/XRViewport/hooks/useViewportMediaTexture.d.ts +10 -0
- package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +41 -0
- package/dist/components/XRViewport/hooks/useViewportRenderState.d.ts +47 -0
- package/dist/components/XRViewport/index.d.ts +3 -101
- package/dist/components/XRViewport/layout.d.ts +16 -0
- package/dist/components/XRViewport/slots.d.ts +16 -0
- package/dist/components/XRViewport/types.d.ts +89 -0
- package/dist/components/XRViewport/useViewportSize.d.ts +3 -0
- package/dist/components/index.d.ts +31 -0
- package/dist/components/occluder/skinnedOccluder.d.ts +39 -0
- package/dist/config/index.d.ts +1 -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-DQc7zyqT.cjs +1 -0
- package/dist/contexts-Y_FhdnIv.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/component-editor/index.d.ts +19 -0
- package/dist/debug-ui/default-setting/index.d.ts +37 -0
- package/dist/debug-ui/default-setting.cjs +21 -0
- package/dist/debug-ui/default-setting.js +777 -0
- package/dist/debug-ui/face-mesh-renderer-settings/index.d.ts +8 -0
- package/dist/debug-ui/face-retouch/index.d.ts +11 -0
- 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/hand-joints-2d/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-2d/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-2d-controller/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-3d/index.d.ts +6 -0
- package/dist/debug-ui/hierarchy-panel/index.d.ts +30 -0
- package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
- package/dist/debug-ui/index.d.ts +61 -0
- package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
- package/dist/debug-ui/layer-panel/index.d.ts +18 -0
- package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
- package/dist/debug-ui/media-source/MediaSourceSwitcher.d.ts +10 -0
- package/dist/debug-ui/media-source/index.d.ts +6 -0
- package/dist/debug-ui/media-source/media-preset.d.ts +21 -0
- package/dist/debug-ui/media-source/session.d.ts +40 -0
- package/dist/debug-ui/media-source.cjs +1 -0
- package/dist/debug-ui/media-source.js +11 -0
- package/dist/debug-ui/mesh-renderer-settings/index.d.ts +6 -0
- package/dist/debug-ui/object-inspector-panel/index.d.ts +26 -0
- package/dist/debug-ui/pin-to-mesh-settings/index.d.ts +10 -0
- package/dist/debug-ui/product-hotspots/index.d.ts +25 -0
- package/dist/debug-ui/scene-editor/context.d.ts +38 -0
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +11 -0
- package/dist/debug-ui/scene-editor/index.d.ts +11 -0
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +9 -0
- package/dist/debug-ui/scene-editor/store-utils.d.ts +2 -0
- package/dist/debug-ui/scene-editor/viewport-toolbar.d.ts +4 -0
- package/dist/debug-ui/scene-editor/viewport.d.ts +21 -0
- package/dist/debug-ui/screen-glass-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-gradient-settings/GradientStopsEditor.d.ts +5 -0
- package/dist/debug-ui/screen-gradient-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-gradient-settings/styles.d.ts +3 -0
- package/dist/debug-ui/screen-image-settings/index.d.ts +11 -0
- package/dist/debug-ui/screen-shape-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-text-settings/NumberField.d.ts +9 -0
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +3 -0
- package/dist/debug-ui/screen-text-settings/controls/NestedSection.d.ts +7 -0
- package/dist/debug-ui/screen-text-settings/controls/Section.d.ts +8 -0
- package/dist/debug-ui/screen-text-settings/controls/icons.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/index.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/BackgroundSection.d.ts +8 -0
- package/dist/debug-ui/screen-text-settings/sections/ContentSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/EffectsSection.d.ts +25 -0
- package/dist/debug-ui/screen-text-settings/sections/StyleSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/TransformSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundFillControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundSizeControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundStrokeControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/types.d.ts +7 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/BendEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/EffectChrome.d.ts +21 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/GlowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/InnerShadowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/OutlineEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/ShadowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/types.d.ts +14 -0
- package/dist/debug-ui/screen-text-settings/settings.d.ts +90 -0
- package/dist/debug-ui/screen-text-settings/styles.d.ts +26 -0
- package/dist/debug-ui/screen-text-settings/transform.d.ts +6 -0
- package/dist/debug-ui/screen-text-settings/types.d.ts +11 -0
- package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
- package/dist/debug-ui/settings-panel/index.d.ts +43 -0
- package/dist/debug-ui/shared/MaterialSection.d.ts +13 -0
- package/dist/debug-ui/shared/ScreenTransformSection.d.ts +32 -0
- package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
- package/dist/debug-ui/transform-3d-settings/index.d.ts +11 -0
- package/dist/debug-ui/xr-diagnostics/index.d.ts +26 -0
- package/dist/debug-ui.cjs +10 -0
- package/dist/debug-ui.js +9051 -0
- package/dist/detector-K8aej4MB.js +59 -0
- package/dist/detector-ijypGtse.cjs +1 -0
- package/dist/drawNormalizedCrop-C4KFaRne.cjs +1 -0
- package/dist/drawNormalizedCrop-DG3gtJxf.js +135 -0
- package/dist/entries/all.d.ts +4 -1
- package/dist/entries/core.d.ts +76 -6
- package/dist/entries/face-effects.d.ts +130 -10
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +5 -2
- package/dist/entries/low-level.d.ts +104 -6
- package/dist/entries/particles.d.ts +15 -0
- package/dist/entries/product.d.ts +11 -0
- package/dist/entries/scene-object.d.ts +10 -0
- package/dist/entries/tracking.d.ts +110 -2
- package/dist/face-action/index.d.ts +34 -0
- 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-attribute-expression/index.d.ts +10 -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 +2267 -195
- package/dist/face-effects.js +14191 -3346
- package/dist/face-expression/index.d.ts +182 -0
- package/dist/face-info/blendshapes.d.ts +3 -0
- package/dist/face-info/derive.d.ts +8 -0
- package/dist/face-info/drawFaceCrop.d.ts +10 -0
- package/dist/face-info/getFaceInfo.d.ts +8 -0
- package/dist/face-info/index.d.ts +8 -0
- package/dist/face-info/landmarks.d.ts +35 -0
- package/dist/face-info/types.d.ts +69 -0
- 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-BafgGT27.js +62 -0
- package/dist/getFaceInfo-BzlwHMjX.cjs +1 -0
- package/dist/hand/armFit.d.ts +46 -0
- package/dist/hand/armMask.d.ts +190 -0
- package/dist/hand/forearm.d.ts +114 -0
- package/dist/hand/handCutout.d.ts +23 -0
- package/dist/hand/handCutoutRegistry.d.ts +7 -0
- package/dist/hand/handEffect.d.ts +38 -0
- package/dist/hand/handGestures.d.ts +524 -0
- package/dist/hand/handJoints2d.d.ts +49 -0
- package/dist/hand/handNail.d.ts +73 -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/handTracking2d.d.ts +33 -0
- package/dist/hand/handTracking2dController.d.ts +65 -0
- package/dist/hand/handTracking3d.d.ts +52 -0
- package/dist/hand/nailImageMask.d.ts +40 -0
- package/dist/hand/nailMaskFingers.d.ts +23 -0
- package/dist/hand/nailTipRefine.d.ts +37 -0
- package/dist/hand/wrist.d.ts +44 -0
- package/dist/hand/wristFilter.d.ts +44 -0
- package/dist/hooks/faceResults.d.ts +1 -1
- package/dist/hooks/selectors.d.ts +77 -4
- package/dist/hooks/useBodies.d.ts +39 -0
- package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
- package/dist/hooks/useFaceAction.d.ts +3 -0
- package/dist/hooks/useFaceAttributeExpression.d.ts +16 -0
- package/dist/hooks/useFaceDetection.d.ts +18 -0
- package/dist/hooks/useFaceInfo.d.ts +19 -0
- package/dist/hooks/useFaceInfos.d.ts +15 -0
- package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
- package/dist/hooks/useFaceResultReader.d.ts +10 -0
- package/dist/hooks/useFrameCapture.d.ts +18 -0
- package/dist/hooks/useGesture.d.ts +39 -0
- package/dist/hooks/useIrisTracking.d.ts +45 -0
- package/dist/hooks/useMediaRecorder.d.ts +14 -2
- package/dist/hooks/useOwnedTexture.d.ts +6 -0
- package/dist/hooks/useTrackerContext.d.ts +14 -2
- package/dist/hooks/useXRDiagnostics.d.ts +81 -0
- package/dist/hooks/useXRModel.d.ts +12 -0
- package/dist/hooks/useXRSession/facade.d.ts +47 -2
- package/dist/hooks/useXRSession/index.d.ts +2 -2
- package/dist/hooks/useXRSession/reason.d.ts +21 -0
- package/dist/hooks/useXRSession/registry.d.ts +23 -0
- package/dist/hooks/useXRSession/store.d.ts +64 -7
- package/dist/index-BZoBxyLn.js +1103 -0
- package/dist/index-By_LCo2V.cjs +1 -0
- package/dist/index-C-Mryx_u.cjs +21 -0
- package/dist/index-CKRN-xJp.js +3740 -0
- package/dist/index-CUldCMRl.js +188 -0
- package/dist/index-Cyk_VIZE.js +1432 -0
- package/dist/index-D-4w34GO.cjs +1 -0
- package/dist/index-DiIoHK_4.js +442 -0
- package/dist/index-Dv3WnY9n.cjs +46 -0
- package/dist/index-ItufYyHH.cjs +1 -0
- package/dist/index-S3gqudT6.cjs +1 -0
- package/dist/index-Sho4F4it.cjs +1 -0
- package/dist/index-iIQ9jBDb.js +240 -0
- package/dist/index-vr2ichWQ.js +190 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1528 -0
- package/dist/internal-Bb9ZXbpr.cjs +1 -0
- package/dist/{internal-KOKJDxCG.js → internal-Gt1wn6Z3.js} +152 -127
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +16 -9
- 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-CvN-L5NT.cjs +1 -0
- package/dist/landmarkMask-DHivVjJm.js +225 -0
- package/dist/landmarks-BEjJXcnE.cjs +1 -0
- package/dist/landmarks-DtCAFV_m.js +76 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +1494 -629
- package/dist/main.cjs +1 -1
- package/dist/main.js +1306 -475
- package/dist/material/MaterialFill.d.ts +20 -0
- package/dist/material/MeshMaterial.d.ts +14 -0
- package/dist/material/index.d.ts +2 -0
- package/dist/models/Base/index.d.ts +49 -0
- package/dist/models/Body/index.d.ts +30 -1
- package/dist/models/Face/constants.d.ts +8 -0
- package/dist/models/Face/index.d.ts +5 -12
- package/dist/models/Face/rotation.d.ts +18 -0
- package/dist/models/Hand/GestureTracking.d.ts +1 -1
- package/dist/models/Hand/HandTracking.d.ts +19 -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 +6 -3
- 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 +71 -0
- package/dist/particles/system.d.ts +66 -0
- package/dist/particles.cjs +122 -0
- package/dist/particles.js +999 -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-CEZQgz2s.cjs +62 -0
- package/dist/providers-CRuaD8bi.js +424 -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/layerStack.d.ts +29 -0
- package/dist/render/renderGroups.d.ts +47 -0
- package/dist/render/renderPasses.d.ts +26 -0
- package/dist/render/sceneBeforeRender.d.ts +12 -0
- package/dist/renderGroups-BADrepA1.cjs +1 -0
- package/dist/renderGroups-CNB99dZ2.js +152 -0
- package/dist/renderPasses-DgxUKn9b.cjs +158 -0
- package/dist/renderPasses-DuapJA6V.js +1290 -0
- package/dist/renderState-CJNmj5jz.js +39 -0
- package/dist/renderState-apSfg4eR.cjs +1 -0
- package/dist/scene-object/index.d.ts +146 -0
- package/dist/scene-object/runtimeRegistry.d.ts +14 -0
- package/dist/scene-object.cjs +1 -0
- package/dist/scene-object.js +40 -0
- package/dist/screen-image/screenImagePresets.d.ts +13 -0
- package/dist/screen-image/screenImageSettings.d.ts +57 -0
- package/dist/screen-text/screenTextPresets.d.ts +6 -0
- package/dist/screen-text/screenTextSettings.d.ts +147 -0
- package/dist/screen2d/coordinates.d.ts +107 -0
- package/dist/screen2d/index.d.ts +7 -0
- package/dist/screen2d/material-runtime.d.ts +32 -0
- package/dist/screen2d/screenTransform.d.ts +60 -0
- package/dist/screen2d/smoothing.d.ts +5 -0
- package/dist/screen2d/texture.d.ts +10 -0
- package/dist/screen2d/transform.d.ts +25 -0
- package/dist/screen2d/types.d.ts +90 -0
- package/dist/segmentation-BOZJdWFC.js +1911 -0
- package/dist/segmentation-J8GoNBvP.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/selectors-BvJepq6H.js +196 -0
- package/dist/selectors-QB2qsaxy.cjs +1 -0
- package/dist/services/MetricsCollector/index.d.ts +7 -1
- package/dist/services/MetricsCollector/utils.d.ts +1 -1
- package/dist/session-BVX859as.cjs +31 -0
- package/dist/session-Cz8aie4K.js +493 -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 +70 -0
- package/dist/subjects/types.d.ts +59 -0
- package/dist/texture/animatedTexture.d.ts +63 -0
- package/dist/texture/animationMath.d.ts +8 -0
- package/dist/texture/gifReader.d.ts +17 -0
- package/dist/texture/gifTextureSource.d.ts +16 -0
- package/dist/texture/sourceResolver.d.ts +30 -0
- package/dist/textures-BVwo9Z7z.js +38 -0
- package/dist/textures-DAfc61zz.cjs +1 -0
- package/dist/tracking/coordinates.d.ts +5 -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 +1531 -294
- package/dist/trigger-D9L4GPmQ.js +3726 -0
- package/dist/trigger-DZ9vU7jo.cjs +147 -0
- package/dist/types/common.d.ts +11 -1
- package/dist/types/compositor.d.ts +21 -0
- package/dist/types/face.d.ts +21 -14
- package/dist/types/gesture-tracking.d.ts +2 -2
- package/dist/types/hand-tracking.d.ts +19 -2
- package/dist/types/holistic.d.ts +121 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/model.d.ts +22 -2
- package/dist/types/nodes.d.ts +83 -6
- package/dist/types/segmentation.d.ts +26 -0
- package/dist/types/session.d.ts +50 -4
- package/dist/types/tracking.d.ts +8 -2
- package/dist/types/util-types.d.ts +1 -1
- package/dist/useBodies-BYzJpQ4L.js +75 -0
- package/dist/useBodies-Cxpmx6Bb.cjs +1 -0
- package/dist/useFaceInfo-BzEUj2OI.js +75 -0
- package/dist/useFaceInfo-DlLRAVNw.cjs +1 -0
- package/dist/useFaceResultReader-Cc4Qrutf.js +61 -0
- package/dist/useFaceResultReader-D3jOQNKz.cjs +1 -0
- package/dist/useInstructionHold-DOu-RpCM.js +53 -0
- package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
- package/dist/useIrisTracking-Bz4uLDa7.js +6190 -0
- package/dist/useIrisTracking-DRGWgoNy.cjs +35 -0
- package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
- package/dist/useXRCapabilities-B1KLckqw.js +30 -0
- package/dist/useXRCapabilities-CZlPUBjF.cjs +1 -0
- package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
- package/dist/utils/drawNormalizedCrop.d.ts +22 -0
- package/dist/utils/fns.d.ts +6 -3
- package/dist/utils/headOccluderFit.d.ts +42 -0
- package/dist/utils/integrity.d.ts +25 -26
- package/dist/utils/landmarkBounds.d.ts +1 -1
- package/dist/utils/logger.d.ts +2 -2
- 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/utils/visionWasm.d.ts +18 -0
- package/dist/uv-BMFt19bg.cjs +1 -0
- package/dist/{index-BD-JWMjE.js → uv-DJU_XfmN.js} +15 -180
- package/dist/x-Co8jPhP0.js +127 -0
- package/dist/x-KC8E4Gaj.cjs +41 -0
- package/docs/MIGRATION_GUIDE.md +589 -0
- package/docs/SDK_DOCUMENTATION.md +1157 -0
- package/docs/api/adaptive-quality.mdx +104 -0
- package/docs/api/asset-lifecycle.mdx +78 -0
- package/docs/api/audio.mdx +36 -0
- package/docs/api/behavior-components.mdx +164 -0
- package/docs/api/body-instructions.mdx +287 -0
- package/docs/api/body-rig.mdx +384 -0
- package/docs/api/body-triggers.mdx +235 -0
- package/docs/api/camera-permission.mdx +142 -0
- package/docs/api/capture-recording.mdx +111 -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 +270 -0
- package/docs/api/diagnostics-calibration.mdx +97 -0
- package/docs/api/external-face-mesh.mdx +231 -0
- package/docs/api/face-actions.mdx +108 -0
- package/docs/api/face-attribute-expression.mdx +87 -0
- package/docs/api/face-binding-anchors.mdx +55 -0
- package/docs/api/face-character.mdx +157 -0
- package/docs/api/face-effects.mdx +28 -0
- package/docs/api/face-expression-controller.mdx +153 -0
- package/docs/api/face-info.mdx +118 -0
- 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 +130 -0
- package/docs/api/face-morph.mdx +117 -0
- package/docs/api/face-painting.mdx +40 -0
- package/docs/api/face-reprojection.mdx +154 -0
- package/docs/api/face-retouching.mdx +81 -0
- 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 +210 -0
- package/docs/api/hair.mdx +97 -0
- package/docs/api/hand-instructions.mdx +222 -0
- package/docs/api/hand-rig.mdx +661 -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/material-render-state.mdx +132 -0
- package/docs/api/multi-subject.mdx +185 -0
- package/docs/api/particles.mdx +183 -0
- package/docs/api/person-cutout.mdx +171 -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/runtime-3d.mdx +316 -0
- package/docs/api/scene-object-store.mdx +213 -0
- package/docs/api/screen-image.mdx +67 -0
- package/docs/api/screen-shape.mdx +64 -0
- package/docs/api/screen-space-coordinates.mdx +75 -0
- package/docs/api/screen-text.mdx +39 -0
- package/docs/api/segmentation-overlay.mdx +301 -0
- package/docs/api/session-lifecycle.mdx +136 -0
- package/docs/api/texture-sources.mdx +74 -0
- package/docs/api/trackers.mdx +65 -0
- package/docs/api/tracking-config.mdx +108 -0
- package/docs/docs.json +121 -0
- package/docs/examples/lip-shaders.mdx +273 -0
- package/docs/examples/scene-object-recipes.mdx +194 -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 +139 -0
- 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/inspector/hierarchy-panel.mdx +51 -0
- package/docs/inspector/object-inspector-panel.mdx +51 -0
- package/docs/introduction.mdx +120 -0
- package/docs/scene-objects/overview.mdx +127 -0
- package/docs/scene-objects/render-groups.mdx +77 -0
- package/docs/scene-objects/runtime-rendering.mdx +75 -0
- package/docs/texture-api-consumer.md +84 -0
- package/package.json +86 -8
- package/settings.json +1998 -0
- package/dist/DebuggerUI-CEfdddkZ.cjs +0 -1
- package/dist/DebuggerUI-Dgop6Q6o.js +0 -269
- package/dist/components/FaceRetouch/retouchRegions.d.ts +0 -23
- package/dist/components/FaceRetouch/useFaceRetouchRegions.d.ts +0 -12
- package/dist/index-B5J4gzn2.cjs +0 -1
- package/dist/index-BVBVg96G.cjs +0 -1
- package/dist/index-CYMj26Ej.js +0 -1331
- package/dist/index-DtwHElmG.js +0 -157
- package/dist/index-PtFmD6B8.cjs +0 -1
- package/dist/internal-DH5d1Xnq.cjs +0 -1
- package/dist/modules/XRClient/index.d.ts +0 -9
- package/dist/modules/index.d.ts +0 -1
- package/dist/selectors-BHO6TnoC.js +0 -59
- package/dist/selectors-Bub0o3qy.cjs +0 -1
- package/dist/services/ApiService.d.ts +0 -12
- package/dist/types/client.d.ts +0 -3
- package/dist/useFaceResults-cpsSmKKc.js +0 -81
- package/dist/useFaceResults-hVUJYSEY.cjs +0 -1
|
@@ -0,0 +1,1528 @@
|
|
|
1
|
+
import { jsxs as Vt, jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import { T as Ee, S as Rt } from "./TextLabel-c9BCucOI.js";
|
|
3
|
+
import { useFrame as Z, useThree as De } from "@react-three/fiber";
|
|
4
|
+
import { useState as Ct, useRef as D, useEffect as q, useMemo as R, useCallback as jt } from "react";
|
|
5
|
+
import * as i from "three";
|
|
6
|
+
import { u as Pe } from "./context-DTxSQvp4.js";
|
|
7
|
+
import { s as st, u as qt } from "./useInstructionHold-DOu-RpCM.js";
|
|
8
|
+
import { G as Ro, b as vo, c as Ho, d as Io, a as _o } from "./useInstructionHold-DOu-RpCM.js";
|
|
9
|
+
import { e as T, H as Ce, j as Se } from "./index-CKRN-xJp.js";
|
|
10
|
+
import { H as kt, b as Ae, s as Be, r as vt, B as Le, a as ze, m as Ue } from "./index-DiIoHK_4.js";
|
|
11
|
+
import { c as Eo, d as Do, e as Po, f as Co, g as Ao, h as Bo, i as Lo, j as zo, k as Uo } from "./index-DiIoHK_4.js";
|
|
12
|
+
import { f as Kt, g as We } from "./selectors-BvJepq6H.js";
|
|
13
|
+
import { c as Ve } from "./SkeletonUtils-C2r90MtN.js";
|
|
14
|
+
import { u as ke } from "./landmarks-DtCAFV_m.js";
|
|
15
|
+
import { a as Fe, b as Ge } from "./getFaceInfo-BafgGT27.js";
|
|
16
|
+
import { u as je } from "./useBodies-BYzJpQ4L.js";
|
|
17
|
+
const qe = () => {
|
|
18
|
+
const n = document.createElement("canvas");
|
|
19
|
+
n.width = n.height = 128;
|
|
20
|
+
const e = n.getContext("2d"), o = e.createRadialGradient(
|
|
21
|
+
128 * 0.38,
|
|
22
|
+
128 * 0.32,
|
|
23
|
+
128 * 0.05,
|
|
24
|
+
128 / 2,
|
|
25
|
+
128 / 2,
|
|
26
|
+
128 * 0.55
|
|
27
|
+
);
|
|
28
|
+
o.addColorStop(0, "#ffffff"), o.addColorStop(0.5, "#eef2f7"), o.addColorStop(0.85, "#c9d3df"), o.addColorStop(1, "#9aa8b8"), e.fillStyle = o, e.fillRect(0, 0, 128, 128);
|
|
29
|
+
const s = new i.CanvasTexture(n);
|
|
30
|
+
return s.colorSpace = i.SRGBColorSpace, s;
|
|
31
|
+
}, Ft = 96, Ke = (t, n = {}) => {
|
|
32
|
+
const e = {
|
|
33
|
+
uHighlight: { value: new Float32Array(Ft) },
|
|
34
|
+
uHighlightGain: { value: 0 },
|
|
35
|
+
uCore: { value: n.core ?? 0.5 },
|
|
36
|
+
uRim: { value: n.rim ?? 0.95 },
|
|
37
|
+
uWhiten: { value: n.whiten ?? 0.6 },
|
|
38
|
+
uHighlightOpacity: { value: n.highlightOpacity ?? 0.9 },
|
|
39
|
+
uHighlightWhiten: { value: n.highlightWhiten ?? 0.55 }
|
|
40
|
+
}, o = new i.MeshMatcapMaterial({
|
|
41
|
+
matcap: t,
|
|
42
|
+
color: n.color ?? "#ffffff",
|
|
43
|
+
transparent: !0,
|
|
44
|
+
depthWrite: !1,
|
|
45
|
+
vertexColors: n.vertexColors ?? !0
|
|
46
|
+
});
|
|
47
|
+
return o.userData.ghost = e, o.onBeforeCompile = (s) => {
|
|
48
|
+
Object.assign(s.uniforms, e), s.vertexShader = s.vertexShader.replace(
|
|
49
|
+
"#include <common>",
|
|
50
|
+
`#include <common>
|
|
51
|
+
uniform float uHighlight[ ${Ft} ];
|
|
52
|
+
varying float vHighlight;`
|
|
53
|
+
).replace(
|
|
54
|
+
"#include <skinning_vertex>",
|
|
55
|
+
`#include <skinning_vertex>
|
|
56
|
+
vHighlight = 0.0;
|
|
57
|
+
#ifdef USE_SKINNING
|
|
58
|
+
vHighlight = uHighlight[ int( skinIndex.x ) ] * skinWeight.x
|
|
59
|
+
+ uHighlight[ int( skinIndex.y ) ] * skinWeight.y
|
|
60
|
+
+ uHighlight[ int( skinIndex.z ) ] * skinWeight.z
|
|
61
|
+
+ uHighlight[ int( skinIndex.w ) ] * skinWeight.w;
|
|
62
|
+
#endif`
|
|
63
|
+
), s.fragmentShader = s.fragmentShader.replace(
|
|
64
|
+
"#include <common>",
|
|
65
|
+
`#include <common>
|
|
66
|
+
uniform float uHighlightGain;
|
|
67
|
+
uniform float uCore;
|
|
68
|
+
uniform float uRim;
|
|
69
|
+
uniform float uWhiten;
|
|
70
|
+
uniform float uHighlightOpacity;
|
|
71
|
+
uniform float uHighlightWhiten;
|
|
72
|
+
varying float vHighlight;`
|
|
73
|
+
).replace(
|
|
74
|
+
"#include <opaque_fragment>",
|
|
75
|
+
`float ghostRim = 1.0 - abs( dot( normal, normalize( vViewPosition ) ) );
|
|
76
|
+
ghostRim = pow( ghostRim, 1.6 );
|
|
77
|
+
float lit = clamp( vHighlight, 0.0, 1.0 ) * uHighlightGain;
|
|
78
|
+
outgoingLight = mix( outgoingLight, vec3( 1.0 ), max( ghostRim * uWhiten, lit * uHighlightWhiten ) );
|
|
79
|
+
float ghostAlpha = mix( uCore, uRim, ghostRim );
|
|
80
|
+
diffuseColor.a *= mix( ghostAlpha, max( ghostAlpha, uHighlightOpacity ), lit );
|
|
81
|
+
#include <opaque_fragment>`
|
|
82
|
+
);
|
|
83
|
+
}, o.customProgramCacheKey = () => "instruction-hint-ghost", o;
|
|
84
|
+
}, $e = ({
|
|
85
|
+
width: t,
|
|
86
|
+
color: n = "#0f172a",
|
|
87
|
+
opacity: e = 0.3,
|
|
88
|
+
vertexColors: o = !0
|
|
89
|
+
}) => {
|
|
90
|
+
const s = {
|
|
91
|
+
uHaloWidth: { value: t },
|
|
92
|
+
uHaloColor: { value: new i.Color(n) },
|
|
93
|
+
uHaloOpacity: { value: e }
|
|
94
|
+
}, r = new i.MeshMatcapMaterial({
|
|
95
|
+
transparent: !0,
|
|
96
|
+
depthWrite: !1,
|
|
97
|
+
side: i.BackSide,
|
|
98
|
+
vertexColors: o
|
|
99
|
+
});
|
|
100
|
+
return r.userData.halo = s, r.onBeforeCompile = (a) => {
|
|
101
|
+
Object.assign(a.uniforms, s), a.vertexShader = a.vertexShader.replace("#include <common>", `#include <common>
|
|
102
|
+
uniform float uHaloWidth;`).replace(
|
|
103
|
+
"#include <skinning_vertex>",
|
|
104
|
+
`#include <skinning_vertex>
|
|
105
|
+
transformed += normalize( objectNormal ) * uHaloWidth;`
|
|
106
|
+
), a.fragmentShader = a.fragmentShader.replace(
|
|
107
|
+
"#include <common>",
|
|
108
|
+
`#include <common>
|
|
109
|
+
uniform vec3 uHaloColor;
|
|
110
|
+
uniform float uHaloOpacity;`
|
|
111
|
+
).replace(
|
|
112
|
+
"#include <opaque_fragment>",
|
|
113
|
+
`float haloFacing = abs( dot( normal, normalize( vViewPosition ) ) );
|
|
114
|
+
outgoingLight = uHaloColor;
|
|
115
|
+
diffuseColor.a *= uHaloOpacity * smoothstep( 0.0, 0.7, haloFacing );
|
|
116
|
+
#include <opaque_fragment>`
|
|
117
|
+
);
|
|
118
|
+
}, r.customProgramCacheKey = () => `instruction-hint-halo-${o}`, r;
|
|
119
|
+
}, Ye = () => new i.MeshBasicMaterial({ colorWrite: !1, depthWrite: !0, transparent: !0 }), Ot = "instructionHintTwin", Qe = (t) => {
|
|
120
|
+
const n = [];
|
|
121
|
+
return t.traverse((e) => {
|
|
122
|
+
e.frustumCulled = !1, e instanceof i.Mesh && !e.userData[Ot] && n.push(e);
|
|
123
|
+
}), n.map((e) => ({
|
|
124
|
+
mesh: e,
|
|
125
|
+
twins: ["prepass", "halo"].map((o) => {
|
|
126
|
+
var r;
|
|
127
|
+
const s = e.clone();
|
|
128
|
+
return s.userData[Ot] = o, s.frustumCulled = !1, (r = e.parent) == null || r.add(s), s;
|
|
129
|
+
})
|
|
130
|
+
}));
|
|
131
|
+
}, Xe = (t, {
|
|
132
|
+
main: n,
|
|
133
|
+
prepass: e,
|
|
134
|
+
halo: o,
|
|
135
|
+
showHalo: s,
|
|
136
|
+
renderOrder: r = 0
|
|
137
|
+
}) => {
|
|
138
|
+
t.traverse((a) => {
|
|
139
|
+
if (!(a instanceof i.Mesh)) return;
|
|
140
|
+
const c = a.userData[Ot];
|
|
141
|
+
c === "prepass" ? (a.material = e, a.renderOrder = r - 0.5) : c === "halo" ? (a.material = o, a.renderOrder = r - 0.25, a.visible = s) : (a.material = n(a), a.renderOrder = r);
|
|
142
|
+
});
|
|
143
|
+
}, Je = [-1, -0.5, 0, 0.5, 1], $t = (t, n, e) => {
|
|
144
|
+
let o = 1e-6, s = 1e-6;
|
|
145
|
+
const r = new i.Vector3();
|
|
146
|
+
for (const a of Je) {
|
|
147
|
+
const c = new i.Matrix4().makeRotationY(e * a);
|
|
148
|
+
for (const l of t)
|
|
149
|
+
r.copy(l).sub(n).applyMatrix4(c), o = Math.max(o, Math.abs(r.x)), s = Math.max(s, Math.abs(r.y));
|
|
150
|
+
}
|
|
151
|
+
return 2 * Math.max(o, s);
|
|
152
|
+
}, it = (t) => t * t * (3 - 2 * t), Ze = (t = "#ffffff", n = 0.75) => {
|
|
153
|
+
const o = document.createElement("canvas");
|
|
154
|
+
o.width = o.height = 128;
|
|
155
|
+
const s = o.getContext("2d"), r = new i.Color(t), a = `${Math.round(r.r * 255)},${Math.round(r.g * 255)},${Math.round(r.b * 255)}`, c = s.createRadialGradient(128 / 2, 128 / 2, 0, 128 / 2, 128 / 2, 128 / 2);
|
|
156
|
+
c.addColorStop(0, `rgba(${a},1)`), c.addColorStop(0.5, `rgba(${a},0.75)`), c.addColorStop(0.68, `rgba(${a},0.32)`), c.addColorStop(0.84, `rgba(${a},0.1)`), c.addColorStop(1, `rgba(${a},0)`), s.fillStyle = c, s.fillRect(0, 0, 128, 128);
|
|
157
|
+
const l = new i.CanvasTexture(o);
|
|
158
|
+
l.colorSpace = i.SRGBColorSpace;
|
|
159
|
+
const d = new i.MeshBasicMaterial({
|
|
160
|
+
map: l,
|
|
161
|
+
transparent: !0,
|
|
162
|
+
opacity: n,
|
|
163
|
+
depthWrite: !1,
|
|
164
|
+
depthTest: !1,
|
|
165
|
+
// A mirrored hint (negative scale) would otherwise turn the disc's back to the camera.
|
|
166
|
+
side: i.DoubleSide
|
|
167
|
+
});
|
|
168
|
+
return d.userData.glowTexture = l, d;
|
|
169
|
+
}, tn = (t) => {
|
|
170
|
+
var n;
|
|
171
|
+
(n = t.userData.glowTexture) == null || n.dispose(), t.dispose();
|
|
172
|
+
}, en = (t) => {
|
|
173
|
+
let n = !0;
|
|
174
|
+
return t.traverse((e) => {
|
|
175
|
+
e instanceof i.Mesh && !e.geometry.getAttribute("color") && (n = !1);
|
|
176
|
+
}), n;
|
|
177
|
+
}, ue = /* @__PURE__ */ new WeakMap(), he = (t) => {
|
|
178
|
+
const n = ue.get(t);
|
|
179
|
+
if (n) return n;
|
|
180
|
+
const e = /* @__PURE__ */ new Map();
|
|
181
|
+
for (const o of t.tracks) {
|
|
182
|
+
const { nodeName: s, propertyName: r } = i.PropertyBinding.parseTrackName(o.name);
|
|
183
|
+
if (r !== "quaternion") continue;
|
|
184
|
+
const [a, c, l, d] = o.values;
|
|
185
|
+
e.set(s, new i.Quaternion(a, c, l, d).normalize());
|
|
186
|
+
}
|
|
187
|
+
return ue.set(t, e), e;
|
|
188
|
+
}, me = /* @__PURE__ */ new WeakMap(), de = (t) => {
|
|
189
|
+
const n = me.get(t);
|
|
190
|
+
if (n) return n;
|
|
191
|
+
const e = /* @__PURE__ */ new Map();
|
|
192
|
+
for (const o of t.tracks) {
|
|
193
|
+
const { nodeName: s, propertyName: r } = i.PropertyBinding.parseTrackName(o.name);
|
|
194
|
+
if (r !== "position") continue;
|
|
195
|
+
const [a, c, l] = o.values;
|
|
196
|
+
e.set(s, new i.Vector3(a, c, l));
|
|
197
|
+
}
|
|
198
|
+
return me.set(t, e), e;
|
|
199
|
+
}, Ht = 2e3, nn = { sm: 0.1, md: 0.14, lg: 0.19 }, At = 160, on = 0.66, rn = {
|
|
200
|
+
color: "#ffffff",
|
|
201
|
+
fontWeight: "bold",
|
|
202
|
+
textAlign: "center",
|
|
203
|
+
bgColor: "transparent",
|
|
204
|
+
padding: 4,
|
|
205
|
+
resolution: At,
|
|
206
|
+
fontSize: At * on,
|
|
207
|
+
resizeToFit: !0,
|
|
208
|
+
minFontSize: At * 0.3,
|
|
209
|
+
shadowEnabled: !0,
|
|
210
|
+
shadowColor: "#000000",
|
|
211
|
+
shadowBlur: 10,
|
|
212
|
+
shadowOffsetY: 2,
|
|
213
|
+
shadowOpacity: 0.55
|
|
214
|
+
}, Bt = (t, n) => {
|
|
215
|
+
t.traverse((e) => {
|
|
216
|
+
var s;
|
|
217
|
+
if (!(e instanceof i.Mesh)) return;
|
|
218
|
+
const o = Array.isArray(e.material) ? e.material : [e.material];
|
|
219
|
+
for (const r of o)
|
|
220
|
+
(s = r.userData).baseOpacity ?? (s.baseOpacity = r.opacity), r.opacity = r.userData.baseOpacity * n;
|
|
221
|
+
});
|
|
222
|
+
}, It = ({
|
|
223
|
+
text: t,
|
|
224
|
+
doneText: n,
|
|
225
|
+
nudgeText: e = null,
|
|
226
|
+
nudgeAfterMs: o = 3e3,
|
|
227
|
+
size: s = "md",
|
|
228
|
+
placement: r = "center",
|
|
229
|
+
offset: a = [0, 0],
|
|
230
|
+
color: c,
|
|
231
|
+
textStyle: l,
|
|
232
|
+
nudgeTextStyle: d,
|
|
233
|
+
renderText: p,
|
|
234
|
+
motion: u = {},
|
|
235
|
+
layout: y = {},
|
|
236
|
+
hideOnComplete: M = !0,
|
|
237
|
+
onStatusChange: f,
|
|
238
|
+
detector: b,
|
|
239
|
+
symbol: h,
|
|
240
|
+
symbolAspect: g = 1
|
|
241
|
+
}) => {
|
|
242
|
+
const { width: m, height: w } = Pe(), x = b.status, {
|
|
243
|
+
fadeIn: H = 0.35,
|
|
244
|
+
fadeOut: v = 0.5,
|
|
245
|
+
rise: U = 0.15,
|
|
246
|
+
bob: Q = 0.02,
|
|
247
|
+
pop: I = 0.1,
|
|
248
|
+
popSeconds: N = 0.3,
|
|
249
|
+
nudgePulse: K = 0.06,
|
|
250
|
+
ring: k = {}
|
|
251
|
+
} = u, L = k ? k.seconds ?? 0.6 : 0, P = k ? k.from ?? 0.45 : 0, E = k ? k.to ?? 0.95 : 0, W = k ? k.opacity ?? 0.7 : 0, A = typeof s == "number" ? s : nn[s], F = Math.min(w * A, m * 0.42), G = Math.min(F * g, w * 0.62), nt = F * (y.textHeight ?? 0.3), at = F * (y.nudgeHeight ?? 0.2), ct = Math.min(m * 0.9, F * (y.textWidth ?? 6)), lt = w * (y.edgeMargin ?? 0.06), tt = G + F * (y.gap ?? 0.1) + nt, ut = (r === "top" ? w / 2 - lt - tt / 2 : r === "bottom" ? -w / 2 + lt + tt / 2 + (e !== null ? at : 0) : 0) + a[1] * w / 2, wt = tt / 2 - G / 2, ht = -tt / 2 + nt / 2, mt = ht - nt / 2 - at / 2, [_t, te] = Ct("waiting"), [z, C] = Ct(!1), X = D("waiting"), dt = D(performance.now()), B = D(f);
|
|
252
|
+
B.current = f;
|
|
253
|
+
const Y = D(b.isInView);
|
|
254
|
+
Y.current = b.isInView;
|
|
255
|
+
const ft = D(!1);
|
|
256
|
+
q(() => {
|
|
257
|
+
var V;
|
|
258
|
+
ft.current || (ft.current = !0, (V = B.current) == null || V.call(B, X.current));
|
|
259
|
+
}, []);
|
|
260
|
+
const ot = D(null), et = D(null), pt = D(null), Nt = D(null), Mt = D(null), Et = R(() => new i.RingGeometry(0.94, 1, 72), []), ee = k ? k.color ?? "#ffffff" : "#ffffff", Tt = R(
|
|
261
|
+
() => new i.MeshBasicMaterial({
|
|
262
|
+
color: ee,
|
|
263
|
+
transparent: !0,
|
|
264
|
+
opacity: 0,
|
|
265
|
+
depthTest: !1,
|
|
266
|
+
depthWrite: !1
|
|
267
|
+
}),
|
|
268
|
+
[ee]
|
|
269
|
+
);
|
|
270
|
+
q(() => () => Et.dispose(), [Et]), q(() => () => Tt.dispose(), [Tt]);
|
|
271
|
+
const j = R(() => ({ age: 0, doneAge: 0, nudge: 0 }), []), [ne, _e] = Ct(!1);
|
|
272
|
+
if (Z((V, Dt) => {
|
|
273
|
+
var le;
|
|
274
|
+
const ie = performance.now(), se = Y.current();
|
|
275
|
+
se && (dt.current = ie);
|
|
276
|
+
const J = x === "done" ? "done" : x === "holding" ? "holding" : se ? "detected" : "waiting";
|
|
277
|
+
J !== X.current && (X.current = J, te(J), ft.current = !0, (le = B.current) == null || le.call(B, J));
|
|
278
|
+
const Pt = e !== null && J === "waiting" && ie - dt.current > o;
|
|
279
|
+
Pt !== z && C(Pt), j.age += Dt, j.nudge = i.MathUtils.damp(j.nudge, Pt ? 1 : 0, 6, Dt);
|
|
280
|
+
const ae = H > 0 ? it(Math.min(j.age / H, 1)) : 1;
|
|
281
|
+
let xt = ae, ce = 1;
|
|
282
|
+
if (J === "done" && (j.doneAge += Dt, N > 0 && (ce = 1 + I * Math.sin(Math.min(j.doneAge / N, 1) * Math.PI)), M && (xt *= v > 0 ? 1 - it(Math.min(j.doneAge / v, 1)) : 0, j.doneAge >= v && !ne && _e(!0))), ot.current && (ot.current.position.y = ut - (1 - ae) * G * U, ot.current.scale.setScalar(ce)), et.current) {
|
|
283
|
+
const rt = j.age;
|
|
284
|
+
et.current.position.y = wt + Math.sin(rt * 2.2) * G * Q, et.current.scale.setScalar(
|
|
285
|
+
1 + j.nudge * K * (0.5 + 0.5 * Math.sin(rt * 4))
|
|
286
|
+
), Bt(et.current, xt);
|
|
287
|
+
}
|
|
288
|
+
if (Mt.current) {
|
|
289
|
+
const rt = J === "done" && L > 0 ? Math.min(j.doneAge / L, 1) : 1;
|
|
290
|
+
Mt.current.visible = J === "done" && rt < 1, Mt.current.scale.setScalar(G * (P + (E - P) * it(rt))), Tt.opacity = W * (1 - rt);
|
|
291
|
+
}
|
|
292
|
+
pt.current && Bt(pt.current, xt), Nt.current && Bt(Nt.current, xt * j.nudge * 0.85);
|
|
293
|
+
}), ne) return null;
|
|
294
|
+
const gt = Ht, oe = {
|
|
295
|
+
...rn,
|
|
296
|
+
...c !== void 0 ? { color: c } : {},
|
|
297
|
+
...l
|
|
298
|
+
}, Ne = { ...oe, fontWeight: "normal", ...d }, re = (V) => p ? p(V) : /* @__PURE__ */ S(
|
|
299
|
+
Ee,
|
|
300
|
+
{
|
|
301
|
+
text: V.text,
|
|
302
|
+
...V.style,
|
|
303
|
+
aspect: V.width / V.height,
|
|
304
|
+
scale: [V.width, V.height, 1],
|
|
305
|
+
renderOrder: V.renderOrder
|
|
306
|
+
}
|
|
307
|
+
);
|
|
308
|
+
return /* @__PURE__ */ Vt("group", { ref: ot, position: [a[0] * m / 2, ut, 0], children: [
|
|
309
|
+
/* @__PURE__ */ Vt("mesh", { renderOrder: gt, scale: [1e-4, 1e-4, 1], onBeforeRender: (V) => V.clearDepth(), children: [
|
|
310
|
+
/* @__PURE__ */ S("planeGeometry", { args: [1, 1] }),
|
|
311
|
+
/* @__PURE__ */ S("meshBasicMaterial", { colorWrite: !1, depthWrite: !1, transparent: !0 })
|
|
312
|
+
] }),
|
|
313
|
+
/* @__PURE__ */ S("group", { ref: et, position: [0, wt, G * 0.5], children: h(G, gt + 1) }),
|
|
314
|
+
k && /* @__PURE__ */ S(
|
|
315
|
+
"mesh",
|
|
316
|
+
{
|
|
317
|
+
ref: Mt,
|
|
318
|
+
geometry: Et,
|
|
319
|
+
material: Tt,
|
|
320
|
+
position: [0, wt, 0],
|
|
321
|
+
renderOrder: gt + 3,
|
|
322
|
+
visible: !1
|
|
323
|
+
}
|
|
324
|
+
),
|
|
325
|
+
/* @__PURE__ */ S("group", { ref: pt, position: [0, ht, 0], children: re({
|
|
326
|
+
text: _t === "done" && n !== void 0 ? n : t,
|
|
327
|
+
role: "text",
|
|
328
|
+
width: ct,
|
|
329
|
+
height: nt,
|
|
330
|
+
renderOrder: gt + 2,
|
|
331
|
+
style: oe
|
|
332
|
+
}) }),
|
|
333
|
+
e !== null && /* @__PURE__ */ S("group", { ref: Nt, position: [0, mt, 0], visible: z || j.nudge > 0.01, children: re({
|
|
334
|
+
text: e,
|
|
335
|
+
role: "nudge",
|
|
336
|
+
width: ct,
|
|
337
|
+
height: at,
|
|
338
|
+
renderOrder: gt + 2,
|
|
339
|
+
style: Ne
|
|
340
|
+
}) })
|
|
341
|
+
] });
|
|
342
|
+
}, mo = ({ active: t = !0, ...n }) => t ? /* @__PURE__ */ S(Rt, { children: /* @__PURE__ */ S(It, { ...n }) }) : null, bt = ["thumb", "index", "middle", "ring", "pinky"], sn = (t) => new i.Vector3(t.x, t.y, t.z), yt = (t, n, e) => {
|
|
343
|
+
const o = n.clone().sub(t), s = e.clone().sub(n);
|
|
344
|
+
return o.lengthSq() < 1e-12 || s.lengthSq() < 1e-12 ? 0 : o.angleTo(s);
|
|
345
|
+
}, fe = Object.freeze({
|
|
346
|
+
/** A finger is extended when its PIP + DIP bends stay under this (radians, ~55°). */
|
|
347
|
+
fingerStraight: i.MathUtils.degToRad(55),
|
|
348
|
+
/** … and its MCP bend stays under this (~70°, a finger folded at the knuckle is not up). */
|
|
349
|
+
fingerKnuckle: i.MathUtils.degToRad(70),
|
|
350
|
+
/** The thumb is extended when its MCP + IP bends stay under this (~60°) … */
|
|
351
|
+
thumbStraight: i.MathUtils.degToRad(60),
|
|
352
|
+
/** … and its tip is at least this many palm widths from the index MCP (tucked thumbs sit closer). */
|
|
353
|
+
thumbReach: 0.75,
|
|
354
|
+
/** |cos| of the thumb's angle to screen-up for "up" / "down" (~45°). */
|
|
355
|
+
thumbVertical: Math.cos(i.MathUtils.degToRad(45)),
|
|
356
|
+
/** Thumb and index tips touch within this many palm lengths (~1.75 cm). */
|
|
357
|
+
touch: 0.2,
|
|
358
|
+
/** Full curl, radians summed over a finger's three bends (normalises `curl`). */
|
|
359
|
+
fullCurl: i.MathUtils.degToRad(255)
|
|
360
|
+
}), Oe = (t, { limits: n } = {}) => {
|
|
361
|
+
if (t.length < 21) throw new Error("analyzeHandShape needs 21 joints");
|
|
362
|
+
const e = t.map(sn), o = n ? { ...fe, ...n } : fe, s = e[T.middleMcp].distanceTo(e[T.wrist]), r = e[T.indexMcp].distanceTo(e[T.pinkyMcp]), a = {}, c = {};
|
|
363
|
+
for (const u of ["index", "middle", "ring", "pinky"]) {
|
|
364
|
+
const y = e[T[`${u}Mcp`]], M = e[T[`${u}Pip`]], f = e[T[`${u}Dip`]], b = e[T[`${u}Tip`]], h = yt(e[T.wrist], y, M), g = yt(y, M, f) + yt(M, f, b);
|
|
365
|
+
c[u] = i.MathUtils.clamp((h + g) / o.fullCurl, 0, 1), a[u] = g < o.fingerStraight && h < o.fingerKnuckle && b.distanceTo(e[T.wrist]) > M.distanceTo(e[T.wrist]);
|
|
366
|
+
}
|
|
367
|
+
const l = yt(e[T.thumbCmc], e[T.thumbMcp], e[T.thumbIp]) + yt(e[T.thumbMcp], e[T.thumbIp], e[T.thumbTip]);
|
|
368
|
+
c.thumb = i.MathUtils.clamp(l / i.MathUtils.degToRad(150), 0, 1), a.thumb = l < o.thumbStraight && e[T.thumbTip].distanceTo(e[T.indexMcp]) > o.thumbReach * r && e[T.thumbTip].distanceTo(e[T.pinkyMcp]) > e[T.thumbIp].distanceTo(e[T.pinkyMcp]);
|
|
369
|
+
const d = e[T.thumbTip].clone().sub(e[T.thumbMcp]).normalize(), p = a.thumb ? d.y >= o.thumbVertical ? "up" : d.y <= -o.thumbVertical ? "down" : "side" : "side";
|
|
370
|
+
return {
|
|
371
|
+
extended: a,
|
|
372
|
+
curl: c,
|
|
373
|
+
count: bt.filter((u) => a[u]).length,
|
|
374
|
+
thumbDirection: p,
|
|
375
|
+
thumbIndexTouch: e[T.thumbTip].distanceTo(e[T.indexTip]) < o.touch * s
|
|
376
|
+
};
|
|
377
|
+
}, fo = (t) => {
|
|
378
|
+
if (!t.rule && !t.match)
|
|
379
|
+
throw new Error("defineHandGesture needs a rule or a match function");
|
|
380
|
+
return t;
|
|
381
|
+
}, Lt = { index: !1, middle: !1, ring: !1, pinky: !1 }, $ = (t = {}) => ({
|
|
382
|
+
thumb: 1,
|
|
383
|
+
index: 1,
|
|
384
|
+
middle: 1,
|
|
385
|
+
ring: 1,
|
|
386
|
+
pinky: 1,
|
|
387
|
+
...t
|
|
388
|
+
}), Re = {
|
|
389
|
+
palm: {
|
|
390
|
+
label: "Show your palm",
|
|
391
|
+
rule: { count: 5 },
|
|
392
|
+
hint: { clip: "palm", spread: 0.8, thumbTuck: 0 }
|
|
393
|
+
},
|
|
394
|
+
fist: {
|
|
395
|
+
label: "Make a fist",
|
|
396
|
+
rule: { digits: { thumb: !1, ...Lt } },
|
|
397
|
+
// Thumb across the front of the index / middle middle segments.
|
|
398
|
+
hint: {
|
|
399
|
+
clip: "fist",
|
|
400
|
+
curl: $(),
|
|
401
|
+
thumbTuck: 1,
|
|
402
|
+
thumbTo: { joint: "indexPip", offset: [-0.15, -0.1, 0.13] }
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
peace: {
|
|
406
|
+
label: "Show a peace sign",
|
|
407
|
+
rule: { digits: { index: !0, middle: !0, ring: !1, pinky: !1 } },
|
|
408
|
+
hint: {
|
|
409
|
+
clip: "peace",
|
|
410
|
+
curl: $({ index: 0, middle: 0 }),
|
|
411
|
+
spread: 1,
|
|
412
|
+
thumbTuck: 1,
|
|
413
|
+
thumbTo: { joint: "ringPip", offset: [0, -0.08, 0.12] }
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
thumbUp: {
|
|
417
|
+
label: "Give a thumbs up",
|
|
418
|
+
rule: { digits: { thumb: !0, ...Lt }, thumbDirection: "up" },
|
|
419
|
+
hint: { clip: "thumbUp", curl: $({ thumb: 0 }), thumbTuck: 0, aimThumb: "up" }
|
|
420
|
+
},
|
|
421
|
+
thumbDown: {
|
|
422
|
+
label: "Give a thumbs down",
|
|
423
|
+
rule: { digits: { thumb: !0, ...Lt }, thumbDirection: "down" },
|
|
424
|
+
hint: { clip: "thumbUp", curl: $({ thumb: 0 }), thumbTuck: 0, aimThumb: "down" }
|
|
425
|
+
},
|
|
426
|
+
point: {
|
|
427
|
+
label: "Point your index finger",
|
|
428
|
+
rule: { digits: { index: !0, middle: !1, ring: !1, pinky: !1 } },
|
|
429
|
+
// The thumb holds the curled middle and ring fingers down.
|
|
430
|
+
hint: {
|
|
431
|
+
clip: "one",
|
|
432
|
+
curl: $({ index: 0 }),
|
|
433
|
+
thumbTuck: 0.6,
|
|
434
|
+
thumbTo: { joint: "middlePip", offset: [0.1, -0.1, 0.1] }
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
one: {
|
|
438
|
+
label: "Show 1 finger",
|
|
439
|
+
rule: { count: 1 },
|
|
440
|
+
// Counting: the thumb must be folded away, or it counts as a second digit.
|
|
441
|
+
hint: {
|
|
442
|
+
clip: "one",
|
|
443
|
+
curl: $({ index: 0 }),
|
|
444
|
+
thumbTuck: 1,
|
|
445
|
+
thumbTo: { joint: "middlePip", offset: [0, -0.08, 0.12] }
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
two: {
|
|
449
|
+
label: "Show 2 fingers",
|
|
450
|
+
rule: { count: 2 },
|
|
451
|
+
hint: {
|
|
452
|
+
clip: "peace",
|
|
453
|
+
curl: $({ index: 0, middle: 0 }),
|
|
454
|
+
spread: 0.6,
|
|
455
|
+
thumbTuck: 1,
|
|
456
|
+
thumbTo: { joint: "ringPip", offset: [0, -0.08, 0.12] }
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
three: {
|
|
460
|
+
label: "Show 3 fingers",
|
|
461
|
+
rule: { count: 3 },
|
|
462
|
+
hint: {
|
|
463
|
+
clip: "three",
|
|
464
|
+
curl: $({ index: 0, middle: 0, ring: 0 }),
|
|
465
|
+
spread: 0.6,
|
|
466
|
+
thumbTuck: 1,
|
|
467
|
+
thumbTo: { joint: "pinkyPip", offset: [0, -0.08, 0.12] }
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
four: {
|
|
471
|
+
label: "Show 4 fingers",
|
|
472
|
+
rule: { count: 4 },
|
|
473
|
+
hint: {
|
|
474
|
+
clip: "four",
|
|
475
|
+
curl: { thumb: 1 },
|
|
476
|
+
spread: 0.6,
|
|
477
|
+
thumbTuck: 1,
|
|
478
|
+
thumbTo: { joint: "ringMcp", offset: [0, -0.2, 0.1] }
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
five: {
|
|
482
|
+
label: "Show 5 fingers",
|
|
483
|
+
rule: { count: 5 },
|
|
484
|
+
hint: { clip: "palm", spread: 0.8, thumbTuck: 0 }
|
|
485
|
+
},
|
|
486
|
+
rock: {
|
|
487
|
+
label: "Rock on",
|
|
488
|
+
rule: { digits: { index: !0, middle: !1, ring: !1, pinky: !0 } },
|
|
489
|
+
hint: {
|
|
490
|
+
clip: "rock",
|
|
491
|
+
yaw: 180,
|
|
492
|
+
curl: $({ index: 0, pinky: 0 }),
|
|
493
|
+
spread: 0.8,
|
|
494
|
+
thumbTuck: 1,
|
|
495
|
+
thumbTo: { joint: "middlePip", offset: [-0.05, -0.08, 0.12] }
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
loveYou: {
|
|
499
|
+
label: "Sign I love you",
|
|
500
|
+
rule: { digits: { thumb: !0, index: !0, middle: !1, ring: !1, pinky: !0 } },
|
|
501
|
+
hint: {
|
|
502
|
+
clip: "loveYou",
|
|
503
|
+
curl: $({ thumb: 0, index: 0, pinky: 0 }),
|
|
504
|
+
spread: 0.8,
|
|
505
|
+
thumbTuck: 0
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
callMe: {
|
|
509
|
+
label: "Call me",
|
|
510
|
+
rule: { digits: { thumb: !0, index: !1, middle: !1, ring: !1, pinky: !0 } },
|
|
511
|
+
// Held sideways like a phone at the ear: thumb up, pinky down.
|
|
512
|
+
hint: {
|
|
513
|
+
clip: "callMe",
|
|
514
|
+
roll: 103,
|
|
515
|
+
curl: $({ thumb: 0, pinky: 0 }),
|
|
516
|
+
spread: 0.8,
|
|
517
|
+
thumbTuck: 0
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
ok: {
|
|
521
|
+
label: "Make an OK sign",
|
|
522
|
+
rule: { thumbIndexTouch: !0, digits: { middle: !0, ring: !0, pinky: !0 } },
|
|
523
|
+
// Seen from the thumb side so the ring reads. Procedural fallback tuned on
|
|
524
|
+
// hand-v1 (grid search) so the thumb and index tips meet, 0.16 cm apart.
|
|
525
|
+
hint: {
|
|
526
|
+
clip: "ok",
|
|
527
|
+
yaw: 124,
|
|
528
|
+
curl: { thumb: 0.3, index: 0.5 },
|
|
529
|
+
spread: 0.6,
|
|
530
|
+
thumbTuck: 0.4
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}, an = Object.keys(Re), Yt = (t) => typeof t == "string" ? Re[t] : typeof t == "object" && "hint" in t ? t : void 0, pe = (t, n) => {
|
|
534
|
+
var e;
|
|
535
|
+
if (n.count !== void 0 && t.count !== n.count || n.thumbDirection && t.thumbDirection !== n.thumbDirection || n.thumbIndexTouch !== void 0 && t.thumbIndexTouch !== n.thumbIndexTouch)
|
|
536
|
+
return !1;
|
|
537
|
+
for (const o of bt) {
|
|
538
|
+
const s = (e = n.digits) == null ? void 0 : e[o];
|
|
539
|
+
if (s !== void 0 && t.extended[o] !== s) return !1;
|
|
540
|
+
}
|
|
541
|
+
return !0;
|
|
542
|
+
}, ve = (t, n, e) => {
|
|
543
|
+
if (typeof n == "function") return n(t, e);
|
|
544
|
+
const o = Yt(n);
|
|
545
|
+
return o ? o.rule && !pe(t, o.rule) ? !1 : o.match ? o.match(t, e) : !!o.rule : pe(t, n);
|
|
546
|
+
}, po = (t) => an.filter((n) => ve(t, n)), ge = {
|
|
547
|
+
finger: [85, 100, 70].map(i.MathUtils.degToRad),
|
|
548
|
+
thumb: [10, 45, 35].map(i.MathUtils.degToRad)
|
|
549
|
+
}, cn = { index: 12, middle: 3, ring: -8, pinky: -16 }, ln = i.MathUtils.degToRad(70), un = 0.65, hn = { 1: [1, 0.35], 2: [0.6, 1] }, mn = Object.fromEntries(
|
|
550
|
+
kt.map(({ name: t }) => [
|
|
551
|
+
t,
|
|
552
|
+
t.endsWith("Cmc") || t.endsWith("Mcp") && !t.startsWith("thumb") ? 0 : t === "thumbMcp" || t.endsWith("Pip") ? 1 : 2
|
|
553
|
+
])
|
|
554
|
+
), ye = (t) => bt.find((n) => t.startsWith(n)) ?? "index", _ = {
|
|
555
|
+
thumbAxis: new i.Vector3(),
|
|
556
|
+
thumbSide: new i.Vector3(),
|
|
557
|
+
cross: new i.Vector3(),
|
|
558
|
+
delta: new i.Quaternion(),
|
|
559
|
+
restInv: new i.Quaternion(),
|
|
560
|
+
q: new i.Quaternion(),
|
|
561
|
+
D: new i.Quaternion(),
|
|
562
|
+
axis: new i.Vector3(),
|
|
563
|
+
dir: new i.Vector3(),
|
|
564
|
+
/** Root-space rotation of each joint as it is posed (parents before children). */
|
|
565
|
+
live: Object.fromEntries(
|
|
566
|
+
["wrist", ...kt.map((t) => t.name)].map((t) => [t, new i.Quaternion()])
|
|
567
|
+
)
|
|
568
|
+
}, zt = (t, n) => i.MathUtils.clamp(typeof t == "number" ? t : t(n), 0, 1.1), dn = (t, n) => {
|
|
569
|
+
if (!(!t || !n)) {
|
|
570
|
+
for (const e of t) if (e.name === n) return e;
|
|
571
|
+
}
|
|
572
|
+
}, be = /* @__PURE__ */ new WeakMap(), fn = (t) => {
|
|
573
|
+
const n = be.get(t);
|
|
574
|
+
if (n) return n;
|
|
575
|
+
const e = {};
|
|
576
|
+
for (const o of t.tracks) {
|
|
577
|
+
const { nodeName: s, propertyName: r } = i.PropertyBinding.parseTrackName(o.name);
|
|
578
|
+
if (r !== "quaternion" || !(s in T)) continue;
|
|
579
|
+
const [a, c, l, d] = o.values;
|
|
580
|
+
e[s] = new i.Quaternion(a, c, l, d).normalize();
|
|
581
|
+
}
|
|
582
|
+
return be.set(t, e), e;
|
|
583
|
+
}, Ut = (t, n, e = 1, o) => {
|
|
584
|
+
var p;
|
|
585
|
+
const s = dn(o, n.clip);
|
|
586
|
+
if (s) {
|
|
587
|
+
const u = fn(s);
|
|
588
|
+
for (const { name: y } of kt) {
|
|
589
|
+
const M = t.bones[y], f = t.restLocal[y];
|
|
590
|
+
!M || !f || M.quaternion.copy(f).slerp(u[y] ?? f, zt(e, ye(y)));
|
|
591
|
+
}
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
const r = t.restPalmNormal, a = t.restPositions, c = _.thumbSide.subVectors(a[T.indexMcp], a[T.pinkyMcp]).normalize(), l = _.live;
|
|
595
|
+
l.wrist.copy(t.restQuaternions.wrist);
|
|
596
|
+
for (const { name: u, parent: y, child: M } of kt) {
|
|
597
|
+
const f = ye(u), b = zt(e, f), h = mn[u] ?? 0, g = (((p = n.curl) == null ? void 0 : p[f]) ?? 0) * b, m = (f === "thumb" ? ge.thumb : ge.finger)[h] * g;
|
|
598
|
+
_.restInv.copy(t.restQuaternions[y]).invert(), _.delta.copy(l[y]).multiply(_.restInv), _.dir.subVectors(a[T[M]], a[T[u]]).normalize(), _.axis.crossVectors(_.dir, r).normalize();
|
|
599
|
+
const w = Math.sign(_.cross.crossVectors(r, _.dir).dot(c)), x = _.D.identity();
|
|
600
|
+
if (f === "thumb") {
|
|
601
|
+
const v = -w || -1, [U, Q] = hn[h] ?? [0, 1];
|
|
602
|
+
_.q.setFromAxisAngle(
|
|
603
|
+
_.thumbAxis.copy(r).multiplyScalar(v * U).addScaledVector(_.axis, Q).normalize(),
|
|
604
|
+
m
|
|
605
|
+
), x.copy(_.q);
|
|
606
|
+
} else
|
|
607
|
+
x.setFromAxisAngle(_.axis, m);
|
|
608
|
+
if (h === 0 && f !== "thumb") {
|
|
609
|
+
const v = i.MathUtils.degToRad(cn[f]) * (n.spread ?? 0) * b;
|
|
610
|
+
x.premultiply(_.q.setFromAxisAngle(r, v * (w || 1)));
|
|
611
|
+
}
|
|
612
|
+
if (f === "thumb" && h === 0) {
|
|
613
|
+
const v = ln * (n.thumbTuck ?? 0) * b;
|
|
614
|
+
x.premultiply(_.q.setFromAxisAngle(r, -v * (w || 1))), x.premultiply(_.q.setFromAxisAngle(_.axis, v * un));
|
|
615
|
+
}
|
|
616
|
+
l[u].copy(_.delta).multiply(x).multiply(t.restQuaternions[u]);
|
|
617
|
+
const H = t.bones[u];
|
|
618
|
+
H && H.quaternion.copy(_.q.copy(l[y]).invert().multiply(l[u]));
|
|
619
|
+
}
|
|
620
|
+
const d = Math.min(zt(e, "thumb"), 1);
|
|
621
|
+
n.thumbTo && d > 0 && bn(t, n.thumbTo, d);
|
|
622
|
+
}, pn = {
|
|
623
|
+
thumbCmc: i.MathUtils.degToRad(75),
|
|
624
|
+
thumbMcp: i.MathUtils.degToRad(65),
|
|
625
|
+
thumbIp: i.MathUtils.degToRad(85)
|
|
626
|
+
}, gn = ["thumbIp", "thumbMcp", "thumbCmc"], O = {
|
|
627
|
+
inv: new i.Matrix4(),
|
|
628
|
+
head: new i.Vector3(),
|
|
629
|
+
eff: new i.Vector3(),
|
|
630
|
+
target: new i.Vector3(),
|
|
631
|
+
start: new i.Vector3(),
|
|
632
|
+
a: new i.Vector3(),
|
|
633
|
+
b: new i.Vector3(),
|
|
634
|
+
q: new i.Quaternion(),
|
|
635
|
+
pq: new i.Quaternion(),
|
|
636
|
+
pqInv: new i.Quaternion(),
|
|
637
|
+
rq: new i.Quaternion(),
|
|
638
|
+
limited: new i.Quaternion(),
|
|
639
|
+
up: new i.Vector3(),
|
|
640
|
+
side: new i.Vector3()
|
|
641
|
+
}, yn = [0, 0, 0], St = (t, n) => t.getWorldPosition(n).applyMatrix4(O.inv), bn = (t, n, e) => {
|
|
642
|
+
const o = t.root, s = t.restPositions, r = s[T.middleMcp].distanceTo(s[T.wrist]), a = O.up.subVectors(s[T.middleMcp], s[T.wrist]).normalize(), c = O.side.subVectors(s[T.indexMcp], s[T.pinkyMcp]);
|
|
643
|
+
c.addScaledVector(a, -c.dot(a)).normalize();
|
|
644
|
+
const [l, d, p] = n.offset ?? yn, u = t.bones.thumbTip ?? t.bones.thumbIp, y = t.bones[n.joint];
|
|
645
|
+
if (!y) return;
|
|
646
|
+
o.updateMatrixWorld(!0), O.inv.copy(o.matrixWorld).invert(), St(y, O.target).addScaledVector(c, l * r).addScaledVector(a, d * r).addScaledVector(t.restPalmNormal, p * r), St(u, O.start), O.target.lerp(O.start, 1 - e);
|
|
647
|
+
const M = o.getWorldQuaternion(O.rq).invert();
|
|
648
|
+
for (let f = 0; f < 10; f += 1)
|
|
649
|
+
for (const b of gn) {
|
|
650
|
+
const h = t.bones[b];
|
|
651
|
+
if (!(h != null && h.parent) || (o.updateMatrixWorld(!0), St(h, O.head), St(u, O.eff), O.a.subVectors(O.eff, O.head), O.b.subVectors(O.target, O.head), O.a.lengthSq() < 1e-10 || O.b.lengthSq() < 1e-10)) continue;
|
|
652
|
+
O.q.setFromUnitVectors(O.a.normalize(), O.b.normalize()), h.parent.getWorldQuaternion(O.pq).premultiply(M), h.quaternion.premultiply(O.pqInv.copy(O.pq).invert().multiply(O.q).multiply(O.pq));
|
|
653
|
+
const g = t.restLocal[b], m = pn[b] ?? Math.PI, w = h.quaternion.angleTo(g);
|
|
654
|
+
w > m && h.quaternion.copy(O.limited.copy(g).slerp(h.quaternion, m / w));
|
|
655
|
+
}
|
|
656
|
+
}, wn = 2 * Math.acos(2 / 3) / Math.PI, Qt = (t, { seconds: n = 2.4, hold: e = wn, from: o = 0, easing: s = it } = {}) => {
|
|
657
|
+
if (n <= 0) return { phase: 0.5, drive: 1, closing: !1, amount: 1 };
|
|
658
|
+
const r = t % n / n, a = 1 / Math.max(Math.cos(Math.PI * i.MathUtils.clamp(e, 0, 0.95) / 2), 1e-3), c = i.MathUtils.clamp(Math.sin(r * Math.PI) * a, 0, 1);
|
|
659
|
+
return { phase: r, drive: c, closing: r < 0.5, amount: o + (1 - o) * s(c) };
|
|
660
|
+
}, Mn = (t, n, e) => e > 0 ? Math.sin(t / e * Math.PI * 2) * i.MathUtils.degToRad(n) : 0, Xt = ({
|
|
661
|
+
height: t,
|
|
662
|
+
span: n,
|
|
663
|
+
mirrored: e = !1,
|
|
664
|
+
orbit: o = 0,
|
|
665
|
+
orbitSeconds: s = 6,
|
|
666
|
+
glow: r = null,
|
|
667
|
+
glowSize: a = 1.75,
|
|
668
|
+
renderOrder: c = 0,
|
|
669
|
+
children: l
|
|
670
|
+
}) => {
|
|
671
|
+
const d = D(null);
|
|
672
|
+
Z(({ clock: u }) => {
|
|
673
|
+
d.current && (d.current.rotation.y = Mn(u.elapsedTime, o, s));
|
|
674
|
+
});
|
|
675
|
+
const p = t / n;
|
|
676
|
+
return /* @__PURE__ */ Vt("group", { scale: [p * (e ? -1 : 1), p, p], children: [
|
|
677
|
+
r && // Behind the hint, not orbiting: drawn first in the band (before the depth pre-pass).
|
|
678
|
+
/* @__PURE__ */ S(
|
|
679
|
+
"mesh",
|
|
680
|
+
{
|
|
681
|
+
material: r,
|
|
682
|
+
position: [0, 0, -n * 0.6],
|
|
683
|
+
scale: n * a,
|
|
684
|
+
renderOrder: c - 0.75,
|
|
685
|
+
children: /* @__PURE__ */ S("planeGeometry", { args: [1, 1] })
|
|
686
|
+
}
|
|
687
|
+
),
|
|
688
|
+
/* @__PURE__ */ S("group", { ref: d, children: l })
|
|
689
|
+
] });
|
|
690
|
+
}, Tn = { width: 0.3, color: "#0f172a", opacity: 0.3 }, xn = { color: "#ffffff", size: 1.75, idle: 0.5, full: 0.85 }, Sn = { opacity: 0.9, whiten: 0.55, idle: 0.25 }, Wt = (t, n, e) => e === !1 || n === !1 && e === void 0 ? !1 : { ...t, ...n || {}, ...e || {} }, kn = (t, n = {}) => {
|
|
691
|
+
var o;
|
|
692
|
+
const e = {};
|
|
693
|
+
for (const [s, r] of Object.entries({ ...t.parts, ...n.parts }))
|
|
694
|
+
r && (e[s] = { ...((o = t.parts) == null ? void 0 : o[s]) ?? {}, ...r });
|
|
695
|
+
return {
|
|
696
|
+
ghost: { ...t.ghost, ...n.ghost },
|
|
697
|
+
parts: e,
|
|
698
|
+
halo: Wt(Tn, t.halo, n.halo),
|
|
699
|
+
glow: Wt(xn, t.glow, n.glow),
|
|
700
|
+
highlight: Wt(Sn, t.highlight, n.highlight),
|
|
701
|
+
matcap: n.matcap ?? t.matcap,
|
|
702
|
+
material: n.material ?? t.material
|
|
703
|
+
};
|
|
704
|
+
}, we = (t) => JSON.stringify(
|
|
705
|
+
t ?? {},
|
|
706
|
+
(n, e) => n === "matcap" || n === "material" ? void 0 : e
|
|
707
|
+
), Jt = (t, n, { base: e = {}, renderOrder: o } = {}) => {
|
|
708
|
+
const s = we(n) + we(e), r = R(
|
|
709
|
+
() => kn(e, n),
|
|
710
|
+
[s, n == null ? void 0 : n.matcap, n == null ? void 0 : n.material, e.matcap, e.material]
|
|
711
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
712
|
+
), { object: a, meshes: c } = R(() => {
|
|
713
|
+
const h = Ve(t);
|
|
714
|
+
return { object: h, meshes: Qe(h) };
|
|
715
|
+
}, [t]), l = R(() => en(a), [a]), d = R(() => r.matcap ? null : qe(), [r.matcap]);
|
|
716
|
+
q(() => () => d == null ? void 0 : d.dispose(), [d]);
|
|
717
|
+
const p = r.matcap ?? d, u = R(() => {
|
|
718
|
+
const h = /* @__PURE__ */ new Map();
|
|
719
|
+
if (r.material) return h;
|
|
720
|
+
const { highlight: g } = r;
|
|
721
|
+
for (const { mesh: m } of c) {
|
|
722
|
+
const w = m.material.name;
|
|
723
|
+
h.has(w) || h.set(
|
|
724
|
+
w,
|
|
725
|
+
Ke(p, {
|
|
726
|
+
vertexColors: l,
|
|
727
|
+
...g ? { highlightOpacity: g.opacity, highlightWhiten: g.whiten } : {},
|
|
728
|
+
...r.ghost,
|
|
729
|
+
...r.parts[w] ?? {}
|
|
730
|
+
})
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
return h;
|
|
734
|
+
}, [c, p, l, r]);
|
|
735
|
+
q(() => () => u.forEach((h) => h.dispose()), [u]);
|
|
736
|
+
const y = R(
|
|
737
|
+
() => new Map(
|
|
738
|
+
c.map(({ mesh: h }) => [
|
|
739
|
+
h,
|
|
740
|
+
r.material ?? u.get(h.material.name)
|
|
741
|
+
])
|
|
742
|
+
),
|
|
743
|
+
[c, u, r.material]
|
|
744
|
+
), M = R(() => Ye(), []);
|
|
745
|
+
q(() => () => M.dispose(), [M]);
|
|
746
|
+
const f = R(() => {
|
|
747
|
+
var m;
|
|
748
|
+
a.updateMatrixWorld(!0);
|
|
749
|
+
const h = ((m = c[0]) == null ? void 0 : m.mesh.getWorldScale(new i.Vector3()).x) || 1, g = r.halo || { width: 0, color: "#000000", opacity: 0 };
|
|
750
|
+
return $e({ ...g, width: g.width / h, vertexColors: l });
|
|
751
|
+
}, [a, c, l, r.halo]);
|
|
752
|
+
q(() => () => f.dispose(), [f]);
|
|
753
|
+
const b = R(
|
|
754
|
+
() => r.glow ? Ze(r.glow.color, r.glow.idle) : null,
|
|
755
|
+
[r.glow]
|
|
756
|
+
);
|
|
757
|
+
return q(
|
|
758
|
+
() => () => {
|
|
759
|
+
b && tn(b);
|
|
760
|
+
},
|
|
761
|
+
[b]
|
|
762
|
+
), q(() => {
|
|
763
|
+
Xe(a, {
|
|
764
|
+
main: (h) => y.get(h) ?? r.material ?? u.values().next().value,
|
|
765
|
+
prepass: M,
|
|
766
|
+
halo: f,
|
|
767
|
+
showHalo: r.halo !== !1,
|
|
768
|
+
renderOrder: o
|
|
769
|
+
});
|
|
770
|
+
}, [a, y, u, M, f, r, o]), R(() => {
|
|
771
|
+
const h = () => [...u.values()].map((g) => g.userData.ghost).filter((g) => !!g);
|
|
772
|
+
return {
|
|
773
|
+
object: a,
|
|
774
|
+
meshes: c,
|
|
775
|
+
materials: u,
|
|
776
|
+
glowMaterial: b,
|
|
777
|
+
look: r,
|
|
778
|
+
setHighlight: (g) => {
|
|
779
|
+
var m, w;
|
|
780
|
+
for (const x of h()) x.uHighlight.value.fill(0);
|
|
781
|
+
if (r.highlight)
|
|
782
|
+
for (const { mesh: x } of c) {
|
|
783
|
+
if (!(x instanceof i.SkinnedMesh)) continue;
|
|
784
|
+
const H = (w = (m = y.get(x)) == null ? void 0 : m.userData.ghost) == null ? void 0 : w.uHighlight;
|
|
785
|
+
H && x.skeleton.bones.forEach((v, U) => {
|
|
786
|
+
U < Ft && (H.value[U] = Math.max(H.value[U], g(v)));
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
setStrength: (g) => {
|
|
791
|
+
if (r.highlight) {
|
|
792
|
+
const { idle: m } = r.highlight;
|
|
793
|
+
for (const w of h()) w.uHighlightGain.value = m + (1 - m) * g;
|
|
794
|
+
}
|
|
795
|
+
if (b && r.glow) {
|
|
796
|
+
const m = r.glow.idle + (r.glow.full - r.glow.idle) * g;
|
|
797
|
+
b.userData.baseOpacity = m, b.opacity = m;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
}, [a, c, u, y, b, r]);
|
|
802
|
+
}, On = {
|
|
803
|
+
halo: { width: 0.35 },
|
|
804
|
+
glow: { size: 1.75 }
|
|
805
|
+
}, Me = { seconds: 2.2, from: 0.35, stagger: 0.21 }, Rn = {
|
|
806
|
+
thumb: ["thumbMcp", "thumbIp", "thumbTip"],
|
|
807
|
+
index: ["indexMcp", "indexPip", "indexDip", "indexTip"],
|
|
808
|
+
middle: ["middleMcp", "middlePip", "middleDip", "middleTip"],
|
|
809
|
+
ring: ["ringMcp", "ringPip", "ringDip", "ringTip"],
|
|
810
|
+
pinky: ["pinkyMcp", "pinkyPip", "pinkyDip", "pinkyTip"]
|
|
811
|
+
}, vn = (t, n) => {
|
|
812
|
+
const e = t == null ? void 0 : t.rule;
|
|
813
|
+
if (e != null && e.thumbIndexTouch) return ["thumb", "index"];
|
|
814
|
+
if (e != null && e.thumbDirection) return ["thumb"];
|
|
815
|
+
const o = bt.filter((s) => n[s]);
|
|
816
|
+
return o.length > 0 && o.length < bt.length ? o : [];
|
|
817
|
+
}, Hn = (t) => {
|
|
818
|
+
const e = t - 1;
|
|
819
|
+
return 1 + (0.9 + 1) * e * e * e + 0.9 * e * e;
|
|
820
|
+
}, Te = {
|
|
821
|
+
pinky: 0,
|
|
822
|
+
ring: 1 / 3,
|
|
823
|
+
middle: 2 / 3,
|
|
824
|
+
thumb: 0.81,
|
|
825
|
+
index: 1
|
|
826
|
+
}, In = ({
|
|
827
|
+
gesture: t,
|
|
828
|
+
model: n,
|
|
829
|
+
poses: e,
|
|
830
|
+
modelHand: o = "right",
|
|
831
|
+
showHand: s = "right",
|
|
832
|
+
height: r = 1,
|
|
833
|
+
loop: a,
|
|
834
|
+
look: c,
|
|
835
|
+
highlight: l,
|
|
836
|
+
orbit: d = 35,
|
|
837
|
+
orbitSeconds: p = 6,
|
|
838
|
+
renderOrder: u
|
|
839
|
+
}) => {
|
|
840
|
+
const y = typeof t == "string" || "label" in t ? Yt(t) : void 0, M = JSON.stringify(y ? y.hint : t), f = R(
|
|
841
|
+
() => y ? y.hint : t,
|
|
842
|
+
[M]
|
|
843
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
844
|
+
), b = JSON.stringify((y == null ? void 0 : y.rule) ?? null), h = Jt(n, c, { base: On, renderOrder: u }), g = h.object, m = R(() => Ae(g, o), [g, o]), w = (a == null ? void 0 : a.from) ?? Me.from, x = R(() => {
|
|
845
|
+
const k = (z) => m.restPositions[z], L = k(T.middleMcp).clone().sub(k(T.wrist)).normalize(), P = m.restPalmNormal.clone(), E = new i.Vector3().crossVectors(L, P).normalize(), W = new i.Vector3().crossVectors(P, E), A = new i.Matrix4().makeBasis(E, W, P).invert();
|
|
846
|
+
f.yaw && A.premultiply(new i.Matrix4().makeRotationY(-i.MathUtils.degToRad(f.yaw))), f.roll && A.premultiply(new i.Matrix4().makeRotationZ(i.MathUtils.degToRad(f.roll)));
|
|
847
|
+
const F = (z) => {
|
|
848
|
+
Ut(m, f, z, e), g.updateMatrixWorld(!0);
|
|
849
|
+
const C = g.matrixWorld.clone().invert(), X = Object.values(m.bones).filter((B) => !!B).map(
|
|
850
|
+
(B) => B.getWorldPosition(new i.Vector3()).applyMatrix4(C).applyMatrix4(A)
|
|
851
|
+
), dt = [];
|
|
852
|
+
return g.traverse((B) => {
|
|
853
|
+
if (!(B instanceof i.SkinnedMesh) || B.userData[Ot]) return;
|
|
854
|
+
B.skeleton.update(), B.computeBoundingBox();
|
|
855
|
+
const Y = B.boundingBox, ft = C.clone().multiply(B.matrixWorld);
|
|
856
|
+
for (const ot of [Y.min.x, Y.max.x])
|
|
857
|
+
for (const et of [Y.min.y, Y.max.y])
|
|
858
|
+
for (const pt of [Y.min.z, Y.max.z])
|
|
859
|
+
dt.push(new i.Vector3(ot, et, pt).applyMatrix4(ft).applyMatrix4(A));
|
|
860
|
+
}), [...X, ...dt];
|
|
861
|
+
}, G = F(1), nt = g.matrixWorld.clone().invert(), at = Oe(
|
|
862
|
+
Ce.map((z) => {
|
|
863
|
+
var X;
|
|
864
|
+
const C = (X = m.bones[z]) == null ? void 0 : X.getWorldPosition(new i.Vector3()).applyMatrix4(nt);
|
|
865
|
+
return { x: (C == null ? void 0 : C.x) ?? 0, y: (C == null ? void 0 : C.y) ?? 0, z: (C == null ? void 0 : C.z) ?? 0 };
|
|
866
|
+
})
|
|
867
|
+
), ct = (z) => G[Object.keys(m.bones).filter((C) => m.bones[C]).indexOf(z)];
|
|
868
|
+
let lt = 0;
|
|
869
|
+
if (f.aimThumb) {
|
|
870
|
+
const z = ct("thumbCmc"), C = ct(m.bones.thumbTip ? "thumbTip" : "thumbIp");
|
|
871
|
+
lt = (f.aimThumb === "up" ? Math.PI / 2 : -Math.PI / 2) - Math.atan2(C.y - z.y, C.x - z.x);
|
|
872
|
+
}
|
|
873
|
+
const tt = new i.Matrix4().makeRotationZ(lt), ut = [...F(w), ...F(0.7), ...G].map((z) => z.applyMatrix4(tt));
|
|
874
|
+
Ut(m, f, 0, e);
|
|
875
|
+
const ht = new i.Box3().setFromPoints(ut).getCenter(new i.Vector3()), mt = ht.clone().applyMatrix4(tt.clone().invert()), _t = $t(ut, ht, i.MathUtils.degToRad(d)) * 1.06;
|
|
876
|
+
return { matrix: new i.Matrix4().makeTranslation(-mt.x, -mt.y, -mt.z).multiply(A), span: _t, extended: at.extended };
|
|
877
|
+
}, [m, g, f, e, d, w]), H = l === !1 ? "off" : (l ?? []).join();
|
|
878
|
+
q(() => {
|
|
879
|
+
const k = b === "null" ? void 0 : JSON.parse(b), L = l === !1 ? [] : l ?? f.highlight ?? vn(k ? { rule: k } : void 0, x.extended), P = new Set(L.flatMap((E) => Rn[E]));
|
|
880
|
+
h.setHighlight((E) => P.has(E.name) ? 1 : 0);
|
|
881
|
+
}, [h, f, b, H, x]);
|
|
882
|
+
const v = D(null), U = R(() => ({ a: new i.Vector3(), b: new i.Vector3() }), []), Q = JSON.stringify(a ?? {}), I = R(
|
|
883
|
+
() => ({ ...Me, ...a }),
|
|
884
|
+
[Q, a == null ? void 0 : a.easing]
|
|
885
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
886
|
+
), N = R(() => {
|
|
887
|
+
const k = { drive: 0, closing: !0 };
|
|
888
|
+
return { state: k, amount: (P) => {
|
|
889
|
+
const E = i.MathUtils.clamp(I.stagger ?? 0, 0, 0.9), W = k.closing ? Te[P] : 1 - Te[P], A = i.MathUtils.clamp((k.drive - W * E) / (1 - E), 0, 1), F = I.easing ? I.easing(A) : k.closing ? Hn(A) : it(A), G = I.from ?? 0;
|
|
890
|
+
return G + (1 - G) * F;
|
|
891
|
+
} };
|
|
892
|
+
}, [I]);
|
|
893
|
+
Z(({ clock: k }) => {
|
|
894
|
+
const { drive: L, closing: P } = Qt(k.elapsedTime, I);
|
|
895
|
+
N.state.drive = L, N.state.closing = P, Ut(m, f, N.amount, e), h.setStrength(it(L));
|
|
896
|
+
const E = v.current;
|
|
897
|
+
if (E && (E.rotation.z = 0, f.aimThumb)) {
|
|
898
|
+
E.updateMatrixWorld(!0);
|
|
899
|
+
const W = m.bones.thumbCmc.getWorldPosition(U.a), A = (m.bones.thumbTip ?? m.bones.thumbIp).getWorldPosition(U.b);
|
|
900
|
+
E.worldToLocal(W), E.worldToLocal(A);
|
|
901
|
+
const F = Math.atan2(A.y - W.y, A.x - W.x);
|
|
902
|
+
E.rotation.z = (f.aimThumb === "up" ? Math.PI / 2 : -Math.PI / 2) - F;
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
const K = h.look.glow;
|
|
906
|
+
return /* @__PURE__ */ S(
|
|
907
|
+
Xt,
|
|
908
|
+
{
|
|
909
|
+
height: r,
|
|
910
|
+
span: x.span,
|
|
911
|
+
mirrored: s !== o,
|
|
912
|
+
orbit: d,
|
|
913
|
+
orbitSeconds: p,
|
|
914
|
+
glow: h.glowMaterial,
|
|
915
|
+
glowSize: K ? K.size : void 0,
|
|
916
|
+
renderOrder: u,
|
|
917
|
+
children: /* @__PURE__ */ S("group", { ref: v, children: /* @__PURE__ */ S("group", { matrixAutoUpdate: !1, matrix: x.matrix, children: /* @__PURE__ */ S("primitive", { object: g }) }) })
|
|
918
|
+
}
|
|
919
|
+
);
|
|
920
|
+
}, _n = (t, { hand: n = "any", limits: e, active: o = !0, ...s } = {}) => {
|
|
921
|
+
const { node: r } = ke(Se.HAND_TRACKER, void 0, o), a = st(t), c = qt(a, s), l = D({}), d = D(t);
|
|
922
|
+
d.current = t;
|
|
923
|
+
const p = JSON.stringify(e ?? null), u = R(() => ({ limits: e }), [p]), y = D(n);
|
|
924
|
+
y.current = n;
|
|
925
|
+
const M = jt(() => {
|
|
926
|
+
const f = l.current, b = y.current;
|
|
927
|
+
return b === "any" ? !!(f.left || f.right) : !!f[b];
|
|
928
|
+
}, []);
|
|
929
|
+
return Z(() => {
|
|
930
|
+
var b;
|
|
931
|
+
if (!o) return;
|
|
932
|
+
let f = !1;
|
|
933
|
+
for (const h of ["left", "right"]) {
|
|
934
|
+
const g = (b = r == null ? void 0 : r.poses) == null ? void 0 : b[h];
|
|
935
|
+
if (!g || g.held || g.world.length < 21) {
|
|
936
|
+
delete l.current[h];
|
|
937
|
+
continue;
|
|
938
|
+
}
|
|
939
|
+
const m = Oe(g.world, u);
|
|
940
|
+
l.current[h] = m, (n === "any" || n === h) && ve(m, d.current, h) && (f = !0);
|
|
941
|
+
}
|
|
942
|
+
c.step(f);
|
|
943
|
+
}), {
|
|
944
|
+
status: c.status,
|
|
945
|
+
holdRef: c.holdRef,
|
|
946
|
+
matchedRef: c.matchedRef,
|
|
947
|
+
isInView: M,
|
|
948
|
+
reset: c.reset,
|
|
949
|
+
shapesRef: l
|
|
950
|
+
};
|
|
951
|
+
}, go = Ht, Nn = "Show your hand to the camera", En = ({
|
|
952
|
+
gesture: t,
|
|
953
|
+
model: n,
|
|
954
|
+
poses: e,
|
|
955
|
+
modelHand: o = "right",
|
|
956
|
+
hand: s = "any",
|
|
957
|
+
holdMs: r,
|
|
958
|
+
graceMs: a,
|
|
959
|
+
limits: c,
|
|
960
|
+
orbit: l,
|
|
961
|
+
look: d,
|
|
962
|
+
loop: p,
|
|
963
|
+
highlight: u,
|
|
964
|
+
onComplete: y,
|
|
965
|
+
nudgeText: M = Nn,
|
|
966
|
+
...f
|
|
967
|
+
}) => {
|
|
968
|
+
const b = Kt(), h = _n(t, { hand: s, holdMs: r, graceMs: a, limits: c, onComplete: y }), g = Be(s === "any" ? "right" : s, b);
|
|
969
|
+
return /* @__PURE__ */ S(
|
|
970
|
+
It,
|
|
971
|
+
{
|
|
972
|
+
...f,
|
|
973
|
+
nudgeText: M,
|
|
974
|
+
detector: h,
|
|
975
|
+
symbol: (m, w) => /* @__PURE__ */ S(
|
|
976
|
+
In,
|
|
977
|
+
{
|
|
978
|
+
gesture: t,
|
|
979
|
+
model: n,
|
|
980
|
+
poses: e,
|
|
981
|
+
modelHand: o,
|
|
982
|
+
showHand: g,
|
|
983
|
+
height: m,
|
|
984
|
+
loop: p,
|
|
985
|
+
look: d,
|
|
986
|
+
highlight: u,
|
|
987
|
+
orbit: l,
|
|
988
|
+
renderOrder: w
|
|
989
|
+
}
|
|
990
|
+
)
|
|
991
|
+
}
|
|
992
|
+
);
|
|
993
|
+
}, yo = ({ active: t = !0, text: n, ...e }) => t ? /* @__PURE__ */ S(Rt, { children: /* @__PURE__ */ S(
|
|
994
|
+
En,
|
|
995
|
+
{
|
|
996
|
+
...e,
|
|
997
|
+
text: n ?? Yt(e.gesture).label
|
|
998
|
+
},
|
|
999
|
+
st(e.gesture)
|
|
1000
|
+
) }) : null, bo = (t) => {
|
|
1001
|
+
if (!t.rule && !t.match)
|
|
1002
|
+
throw new Error("defineFaceExpression needs a rule or a match function");
|
|
1003
|
+
return t;
|
|
1004
|
+
}, He = {
|
|
1005
|
+
smile: {
|
|
1006
|
+
label: "Give a big smile",
|
|
1007
|
+
rule: { atLeast: { mouthSmileLeft: 0.45, mouthSmileRight: 0.45 } },
|
|
1008
|
+
hint: { target: "smile" }
|
|
1009
|
+
},
|
|
1010
|
+
wink: {
|
|
1011
|
+
label: "Wink at the camera",
|
|
1012
|
+
rule: {
|
|
1013
|
+
anyOf: [
|
|
1014
|
+
{ atLeast: { eyeBlinkLeft: 0.55 }, atMost: { eyeBlinkRight: 0.3 } },
|
|
1015
|
+
{ atLeast: { eyeBlinkRight: 0.55 }, atMost: { eyeBlinkLeft: 0.3 } }
|
|
1016
|
+
]
|
|
1017
|
+
},
|
|
1018
|
+
hint: { target: "wink" }
|
|
1019
|
+
},
|
|
1020
|
+
surprised: {
|
|
1021
|
+
label: "Look surprised",
|
|
1022
|
+
rule: { atLeast: { jawOpen: 0.35, browInnerUp: 0.4 } },
|
|
1023
|
+
hint: { target: "surprised" }
|
|
1024
|
+
},
|
|
1025
|
+
kiss: {
|
|
1026
|
+
label: "Blow a kiss",
|
|
1027
|
+
rule: { atLeast: { mouthPucker: 0.5 }, atMost: { jawOpen: 0.3 } },
|
|
1028
|
+
hint: { target: "kiss" }
|
|
1029
|
+
},
|
|
1030
|
+
puffCheeks: {
|
|
1031
|
+
label: "Puff your cheeks",
|
|
1032
|
+
rule: { atLeast: { cheekPuff: 0.3 } },
|
|
1033
|
+
hint: { target: "puffCheeks" }
|
|
1034
|
+
},
|
|
1035
|
+
// Shares the brows-down signal with `scrunch`, so a scrunch also completes a
|
|
1036
|
+
// frown prompt — deliberate (both read as a cross face); `scrunch` alone
|
|
1037
|
+
// needs the nose sneer or the squint on top.
|
|
1038
|
+
frown: {
|
|
1039
|
+
label: "Frown",
|
|
1040
|
+
rule: { atLeast: { browDownLeft: 0.4, browDownRight: 0.4 } },
|
|
1041
|
+
hint: { target: "frown" }
|
|
1042
|
+
},
|
|
1043
|
+
scrunch: {
|
|
1044
|
+
label: "Scrunch your face",
|
|
1045
|
+
rule: {
|
|
1046
|
+
anyOf: [
|
|
1047
|
+
{ atLeast: { noseSneerLeft: 0.3, noseSneerRight: 0.3 } },
|
|
1048
|
+
{
|
|
1049
|
+
atLeast: {
|
|
1050
|
+
eyeSquintLeft: 0.45,
|
|
1051
|
+
eyeSquintRight: 0.45,
|
|
1052
|
+
browDownLeft: 0.3,
|
|
1053
|
+
browDownRight: 0.3
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
]
|
|
1057
|
+
},
|
|
1058
|
+
hint: { target: "scrunch" }
|
|
1059
|
+
}
|
|
1060
|
+
}, Dn = Object.keys(He), Gt = (t, n) => {
|
|
1061
|
+
for (const [e, o] of Object.entries(n.atLeast ?? {}))
|
|
1062
|
+
if ((t[e] ?? 0) < (o ?? 0)) return !1;
|
|
1063
|
+
for (const [e, o] of Object.entries(n.atMost ?? {}))
|
|
1064
|
+
if ((t[e] ?? 0) > (o ?? 1)) return !1;
|
|
1065
|
+
return !(n.anyOf && n.anyOf.length > 0 && !n.anyOf.some((e) => Gt(t, e)));
|
|
1066
|
+
}, Zt = (t) => typeof t == "string" ? He[t] : typeof t == "object" && "hint" in t ? t : void 0, Ie = (t, n, e) => {
|
|
1067
|
+
if (typeof n == "function") return n(t, e);
|
|
1068
|
+
const o = Zt(n);
|
|
1069
|
+
return o ? o.rule && !Gt(t, o.rule) ? !1 : o.match ? o.match(t, e) : !!o.rule : Gt(t, n);
|
|
1070
|
+
}, wo = (t) => Dn.filter((n) => Ie(t, n)), Pn = (t, n, e) => {
|
|
1071
|
+
const o = n ? he(n) : /* @__PURE__ */ new Map(), s = e ? he(e) : /* @__PURE__ */ new Map(), r = [];
|
|
1072
|
+
for (const d of /* @__PURE__ */ new Set([...o.keys(), ...s.keys()])) {
|
|
1073
|
+
const p = t.getObjectByName(d);
|
|
1074
|
+
if (!p) continue;
|
|
1075
|
+
const u = p.quaternion.clone();
|
|
1076
|
+
r.push({ node: p, from: o.get(d) ?? u, to: s.get(d) ?? u });
|
|
1077
|
+
}
|
|
1078
|
+
const a = n ? de(n) : /* @__PURE__ */ new Map(), c = e ? de(e) : /* @__PURE__ */ new Map(), l = [];
|
|
1079
|
+
for (const d of /* @__PURE__ */ new Set([...a.keys(), ...c.keys()])) {
|
|
1080
|
+
const p = t.getObjectByName(d);
|
|
1081
|
+
if (!p) continue;
|
|
1082
|
+
const u = p.position.clone();
|
|
1083
|
+
l.push({ node: p, from: a.get(d) ?? u, to: c.get(d) ?? u });
|
|
1084
|
+
}
|
|
1085
|
+
return {
|
|
1086
|
+
apply: (d) => {
|
|
1087
|
+
for (const p of r) p.node.quaternion.copy(p.from).slerp(p.to, d);
|
|
1088
|
+
for (const p of l) p.node.position.lerpVectors(p.from, p.to, d);
|
|
1089
|
+
}
|
|
1090
|
+
};
|
|
1091
|
+
}, Cn = (t, n) => {
|
|
1092
|
+
const e = t.filter((o) => o.morphTargetInfluences && o.morphTargetDictionary).map((o) => ({
|
|
1093
|
+
influences: o.morphTargetInfluences,
|
|
1094
|
+
weights: Object.entries(n).map(([s, r]) => [o.morphTargetDictionary[s] ?? -1, r]).filter(([s]) => s >= 0)
|
|
1095
|
+
}));
|
|
1096
|
+
return {
|
|
1097
|
+
apply: (o) => {
|
|
1098
|
+
for (const { influences: s, weights: r } of e) {
|
|
1099
|
+
s.fill(0);
|
|
1100
|
+
for (const [a, c] of r) s[a] = c * o;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
};
|
|
1104
|
+
}, An = {
|
|
1105
|
+
parts: {
|
|
1106
|
+
eye_white: { core: 0.62 },
|
|
1107
|
+
iris: { color: "#2a2732", core: 0.9, rim: 0.95, whiten: 0.12 },
|
|
1108
|
+
sparkle: { core: 0.95, rim: 0.95 },
|
|
1109
|
+
lash: { color: "#3b302c", core: 0.88, rim: 0.92, whiten: 0.12 },
|
|
1110
|
+
brow: { color: "#4a3a33", core: 0.85, rim: 0.92, whiten: 0.15 },
|
|
1111
|
+
lip: { color: "#c47878", core: 0.8, rim: 0.9, whiten: 0.2 },
|
|
1112
|
+
mouth_inside: { color: "#2b1517", core: 0.9, rim: 0.92, whiten: 0.08 },
|
|
1113
|
+
tongue: { color: "#e88a8a", core: 0.85, rim: 0.9, whiten: 0.15 }
|
|
1114
|
+
},
|
|
1115
|
+
halo: { width: 0.3 },
|
|
1116
|
+
glow: { size: 1.75 }
|
|
1117
|
+
}, Bn = { seconds: 2.4 }, Ln = ({
|
|
1118
|
+
expression: t,
|
|
1119
|
+
model: n,
|
|
1120
|
+
height: e = 1,
|
|
1121
|
+
loop: o,
|
|
1122
|
+
look: s,
|
|
1123
|
+
orbit: r = 30,
|
|
1124
|
+
orbitSeconds: a = 6,
|
|
1125
|
+
renderOrder: c
|
|
1126
|
+
}) => {
|
|
1127
|
+
const l = typeof t == "string" || "label" in t ? Zt(t).hint : t, d = JSON.stringify("targets" in l ? l.targets : { [l.target]: 1 }), p = Jt(n, s, { base: An, renderOrder: c }), u = p.object, y = R(
|
|
1128
|
+
() => Cn(
|
|
1129
|
+
p.meshes.flatMap(({ mesh: g, twins: m }) => [g, ...m]),
|
|
1130
|
+
JSON.parse(d)
|
|
1131
|
+
),
|
|
1132
|
+
[p.meshes, d]
|
|
1133
|
+
), M = R(() => {
|
|
1134
|
+
u.updateMatrixWorld(!0);
|
|
1135
|
+
const g = [];
|
|
1136
|
+
for (const { mesh: x } of p.meshes) {
|
|
1137
|
+
const H = x.geometry.getAttribute("position");
|
|
1138
|
+
for (let v = 0; v < H.count; v += 3)
|
|
1139
|
+
g.push(
|
|
1140
|
+
new i.Vector3().fromBufferAttribute(H, v).applyMatrix4(x.matrixWorld)
|
|
1141
|
+
);
|
|
1142
|
+
}
|
|
1143
|
+
const m = new i.Box3().setFromPoints(g).getCenter(new i.Vector3()), w = $t(g, m, i.MathUtils.degToRad(r)) * 1.08;
|
|
1144
|
+
return { offset: m.clone().negate(), span: w };
|
|
1145
|
+
}, [u, p.meshes, r]), f = JSON.stringify(o ?? {}), b = R(
|
|
1146
|
+
() => ({ ...Bn, ...o }),
|
|
1147
|
+
[f, o == null ? void 0 : o.easing]
|
|
1148
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
1149
|
+
);
|
|
1150
|
+
Z(({ clock: g }) => {
|
|
1151
|
+
const { amount: m } = Qt(g.elapsedTime, b);
|
|
1152
|
+
y.apply(m), p.setStrength(m);
|
|
1153
|
+
});
|
|
1154
|
+
const h = p.look.glow;
|
|
1155
|
+
return /* @__PURE__ */ S(
|
|
1156
|
+
Xt,
|
|
1157
|
+
{
|
|
1158
|
+
height: e,
|
|
1159
|
+
span: M.span,
|
|
1160
|
+
orbit: r,
|
|
1161
|
+
orbitSeconds: a,
|
|
1162
|
+
glow: p.glowMaterial,
|
|
1163
|
+
glowSize: h ? h.size : void 0,
|
|
1164
|
+
renderOrder: c,
|
|
1165
|
+
children: /* @__PURE__ */ S("group", { position: M.offset, children: /* @__PURE__ */ S("primitive", { object: u }) })
|
|
1166
|
+
}
|
|
1167
|
+
);
|
|
1168
|
+
}, zn = (t, { faceIndex: n = 0, active: e = !0, ...o } = {}) => {
|
|
1169
|
+
const s = R(() => ({ numFaces: n + 1 }), [n]), { node: r, ready: a } = ke(
|
|
1170
|
+
Se.FACE_TRACKER,
|
|
1171
|
+
s,
|
|
1172
|
+
e
|
|
1173
|
+
), { camera: c } = De();
|
|
1174
|
+
q(() => {
|
|
1175
|
+
r == null || r.setCamera(c, n);
|
|
1176
|
+
}, [c, n, r]);
|
|
1177
|
+
const l = qt(st(t), o), d = D(null), p = D(Fe()), u = D(t);
|
|
1178
|
+
u.current = t;
|
|
1179
|
+
const y = jt(() => d.current !== null, []);
|
|
1180
|
+
return Z(() => {
|
|
1181
|
+
if (!e) return;
|
|
1182
|
+
const M = a && r ? Ge(r, n, p.current) : null;
|
|
1183
|
+
d.current = M, l.step(!!M && Ie(M.blendshapes, u.current, M));
|
|
1184
|
+
}), {
|
|
1185
|
+
status: l.status,
|
|
1186
|
+
holdRef: l.holdRef,
|
|
1187
|
+
matchedRef: l.matchedRef,
|
|
1188
|
+
isInView: y,
|
|
1189
|
+
reset: l.reset,
|
|
1190
|
+
faceRef: d
|
|
1191
|
+
};
|
|
1192
|
+
}, Mo = Ht, Un = "Show your face to the camera", Wn = ({
|
|
1193
|
+
expression: t,
|
|
1194
|
+
model: n,
|
|
1195
|
+
faceIndex: e,
|
|
1196
|
+
holdMs: o,
|
|
1197
|
+
graceMs: s,
|
|
1198
|
+
orbit: r,
|
|
1199
|
+
look: a,
|
|
1200
|
+
loop: c,
|
|
1201
|
+
onComplete: l,
|
|
1202
|
+
nudgeText: d = Un,
|
|
1203
|
+
...p
|
|
1204
|
+
}) => {
|
|
1205
|
+
const u = zn(t, { faceIndex: e, holdMs: o, graceMs: s, onComplete: l });
|
|
1206
|
+
return /* @__PURE__ */ S(
|
|
1207
|
+
It,
|
|
1208
|
+
{
|
|
1209
|
+
...p,
|
|
1210
|
+
nudgeText: d,
|
|
1211
|
+
detector: u,
|
|
1212
|
+
symbol: (y, M) => /* @__PURE__ */ S(
|
|
1213
|
+
Ln,
|
|
1214
|
+
{
|
|
1215
|
+
expression: t,
|
|
1216
|
+
model: n,
|
|
1217
|
+
height: y,
|
|
1218
|
+
orbit: r,
|
|
1219
|
+
look: a,
|
|
1220
|
+
loop: c,
|
|
1221
|
+
renderOrder: M
|
|
1222
|
+
}
|
|
1223
|
+
)
|
|
1224
|
+
}
|
|
1225
|
+
);
|
|
1226
|
+
}, To = ({ active: t = !0, text: n, ...e }) => t ? /* @__PURE__ */ S(Rt, { children: /* @__PURE__ */ S(
|
|
1227
|
+
Wn,
|
|
1228
|
+
{
|
|
1229
|
+
...e,
|
|
1230
|
+
text: n ?? Zt(e.expression).label
|
|
1231
|
+
},
|
|
1232
|
+
st(e.expression)
|
|
1233
|
+
) }) : null, Vn = {
|
|
1234
|
+
parts: { joints: { color: "#7c8aa0", core: 0.7, rim: 0.9, whiten: 0.35 } },
|
|
1235
|
+
halo: { width: 1.2 },
|
|
1236
|
+
glow: { size: 1.3 }
|
|
1237
|
+
}, xe = /* @__PURE__ */ new Set(), Fn = { seconds: 2.6 }, Gn = (t) => {
|
|
1238
|
+
for (const [n, e] of [
|
|
1239
|
+
["left", "Left"],
|
|
1240
|
+
["right", "Right"]
|
|
1241
|
+
])
|
|
1242
|
+
if (t === `${e}Arm` || t === `${e}ForeArm` || t.startsWith(`${e}Hand`)) return n;
|
|
1243
|
+
return null;
|
|
1244
|
+
}, jn = (t) => {
|
|
1245
|
+
for (const [n, e] of [
|
|
1246
|
+
["left", "Left"],
|
|
1247
|
+
["right", "Right"]
|
|
1248
|
+
])
|
|
1249
|
+
if (t === `${e}UpLeg` || t === `${e}Leg` || t === `${e}Foot` || t.startsWith(`${e}Toe`))
|
|
1250
|
+
return n;
|
|
1251
|
+
return null;
|
|
1252
|
+
}, qn = ({
|
|
1253
|
+
pose: t,
|
|
1254
|
+
model: n,
|
|
1255
|
+
poses: e,
|
|
1256
|
+
idleClip: o = "idle",
|
|
1257
|
+
height: s = 1,
|
|
1258
|
+
mirrored: r = !1,
|
|
1259
|
+
loop: a,
|
|
1260
|
+
look: c,
|
|
1261
|
+
highlight: l = !0,
|
|
1262
|
+
boneSide: d = Gn,
|
|
1263
|
+
legBoneSide: p = jn,
|
|
1264
|
+
orbit: u = 25,
|
|
1265
|
+
orbitSeconds: y = 7,
|
|
1266
|
+
renderOrder: M
|
|
1267
|
+
}) => {
|
|
1268
|
+
const f = typeof t == "string" || "label" in t ? vt(t).hint : t, b = f.clip, h = (f.arms ?? []).join(), g = (f.legs ?? []).join(), m = Jt(n, c, { base: Vn, renderOrder: M }), w = m.object, x = R(
|
|
1269
|
+
() => Pn(
|
|
1270
|
+
w,
|
|
1271
|
+
e.find((I) => I.name === o),
|
|
1272
|
+
e.find((I) => I.name === b)
|
|
1273
|
+
),
|
|
1274
|
+
[w, e, o, b]
|
|
1275
|
+
);
|
|
1276
|
+
q(() => {
|
|
1277
|
+
const I = e.map((N) => N.name);
|
|
1278
|
+
for (const [N, K] of [
|
|
1279
|
+
[o, "rest"],
|
|
1280
|
+
[b, "pose"]
|
|
1281
|
+
])
|
|
1282
|
+
I.includes(N) || xe.has(N) || (xe.add(N), console.warn(
|
|
1283
|
+
`[BodyPoseHint] the model has no "${N}" clip (the ${K === "rest" ? "rest pose the hint loops from" : "pose to show"}); the figure uses its bind pose there instead. Clips found: ${I.join(", ") || "none"}.`
|
|
1284
|
+
));
|
|
1285
|
+
}, [e, o, b]), q(() => {
|
|
1286
|
+
const I = h ? h.split(",") : [], N = g ? g.split(",") : [];
|
|
1287
|
+
m.setHighlight((K) => {
|
|
1288
|
+
if (!l) return 0;
|
|
1289
|
+
const k = d(K.name);
|
|
1290
|
+
if (k && I.includes(k)) return 1;
|
|
1291
|
+
const L = p(K.name);
|
|
1292
|
+
return L && N.includes(L) ? 1 : 0;
|
|
1293
|
+
});
|
|
1294
|
+
}, [m, h, g, l, d, p]);
|
|
1295
|
+
const H = R(() => {
|
|
1296
|
+
const I = [], N = new i.Matrix4();
|
|
1297
|
+
for (const L of [0, 0.6, 1]) {
|
|
1298
|
+
x.apply(L), w.updateMatrixWorld(!0), N.copy(w.matrixWorld).invert();
|
|
1299
|
+
for (const { mesh: P } of m.meshes) {
|
|
1300
|
+
if (!(P instanceof i.SkinnedMesh)) continue;
|
|
1301
|
+
P.skeleton.update();
|
|
1302
|
+
const E = P.geometry.getAttribute("position");
|
|
1303
|
+
for (let W = 0; W < E.count; W += 12) {
|
|
1304
|
+
const A = new i.Vector3().fromBufferAttribute(E, W);
|
|
1305
|
+
P.applyBoneTransform(W, A), I.push(A.applyMatrix4(P.matrixWorld).applyMatrix4(N));
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
x.apply(0);
|
|
1310
|
+
const K = new i.Box3().setFromPoints(I).getCenter(new i.Vector3()), k = $t(I, K, i.MathUtils.degToRad(u)) * 1.06;
|
|
1311
|
+
return { offset: K.clone().negate(), span: k };
|
|
1312
|
+
}, [w, m.meshes, x, u]), v = JSON.stringify(a ?? {}), U = R(
|
|
1313
|
+
() => ({ ...Fn, ...a }),
|
|
1314
|
+
[v, a == null ? void 0 : a.easing]
|
|
1315
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
1316
|
+
);
|
|
1317
|
+
Z(({ clock: I }) => {
|
|
1318
|
+
const { amount: N } = Qt(I.elapsedTime, U);
|
|
1319
|
+
x.apply(N), m.setStrength(N);
|
|
1320
|
+
});
|
|
1321
|
+
const Q = m.look.glow;
|
|
1322
|
+
return /* @__PURE__ */ S(
|
|
1323
|
+
Xt,
|
|
1324
|
+
{
|
|
1325
|
+
height: s,
|
|
1326
|
+
span: H.span,
|
|
1327
|
+
mirrored: r,
|
|
1328
|
+
orbit: u,
|
|
1329
|
+
orbitSeconds: y,
|
|
1330
|
+
glow: m.glowMaterial,
|
|
1331
|
+
glowSize: Q ? Q.size : void 0,
|
|
1332
|
+
renderOrder: M,
|
|
1333
|
+
children: /* @__PURE__ */ S("group", { position: H.offset, children: /* @__PURE__ */ S("primitive", { object: w }) })
|
|
1334
|
+
}
|
|
1335
|
+
);
|
|
1336
|
+
}, Kn = (t, {
|
|
1337
|
+
bodyIndex: n = 0,
|
|
1338
|
+
bodyId: e,
|
|
1339
|
+
subject: o,
|
|
1340
|
+
numBodies: s,
|
|
1341
|
+
limits: r,
|
|
1342
|
+
active: a = !0,
|
|
1343
|
+
...c
|
|
1344
|
+
} = {}) => {
|
|
1345
|
+
const {
|
|
1346
|
+
node: l,
|
|
1347
|
+
ready: d,
|
|
1348
|
+
index: p
|
|
1349
|
+
} = je({ bodyIndex: n, bodyId: e, subject: o, numBodies: s, active: a }), u = Kt(), y = We(), M = qt(st(t), c), f = D(null), b = D(t);
|
|
1350
|
+
b.current = t;
|
|
1351
|
+
const h = JSON.stringify(r ?? null), g = R(() => r, [h]), m = jt(() => {
|
|
1352
|
+
var x;
|
|
1353
|
+
const w = f.current;
|
|
1354
|
+
return w != null && w.upperBodyVisible ? ((x = vt(b.current)) == null ? void 0 : x.view) !== "full" || w.lowerBodyVisible : !1;
|
|
1355
|
+
}, []);
|
|
1356
|
+
return Z(() => {
|
|
1357
|
+
var v;
|
|
1358
|
+
if (!a) return;
|
|
1359
|
+
const w = (d && l ? p() : null) ?? -1, x = w < 0 || l == null ? void 0 : l.getLandmarks2D(w), H = x && x.length >= Le ? ze(x, {
|
|
1360
|
+
mirrored: u,
|
|
1361
|
+
visibility: (v = l == null ? void 0 : l.getVisibility) == null ? void 0 : v.call(l, w),
|
|
1362
|
+
limits: g,
|
|
1363
|
+
aspect: y
|
|
1364
|
+
}) : null;
|
|
1365
|
+
f.current = H, M.step(!!H && H.upperBodyVisible && Ue(H, b.current));
|
|
1366
|
+
}), {
|
|
1367
|
+
status: M.status,
|
|
1368
|
+
holdRef: M.holdRef,
|
|
1369
|
+
matchedRef: M.matchedRef,
|
|
1370
|
+
isInView: m,
|
|
1371
|
+
reset: M.reset,
|
|
1372
|
+
shapeRef: f
|
|
1373
|
+
};
|
|
1374
|
+
}, xo = Ht, $n = (t) => {
|
|
1375
|
+
var n;
|
|
1376
|
+
return ((n = vt(t)) == null ? void 0 : n.view) === "full";
|
|
1377
|
+
}, Yn = 2.1, Qn = "Step back so your upper body is in view", Xn = "Step back so your whole body is in view", Jn = ({
|
|
1378
|
+
pose: t,
|
|
1379
|
+
model: n,
|
|
1380
|
+
poses: e,
|
|
1381
|
+
idleClip: o,
|
|
1382
|
+
bodyIndex: s,
|
|
1383
|
+
bodyId: r,
|
|
1384
|
+
subject: a,
|
|
1385
|
+
numBodies: c,
|
|
1386
|
+
holdMs: l,
|
|
1387
|
+
graceMs: d,
|
|
1388
|
+
limits: p,
|
|
1389
|
+
symbolAspect: u = Yn,
|
|
1390
|
+
orbit: y,
|
|
1391
|
+
look: M,
|
|
1392
|
+
loop: f,
|
|
1393
|
+
boneSide: b,
|
|
1394
|
+
legBoneSide: h,
|
|
1395
|
+
onComplete: g,
|
|
1396
|
+
nudgeText: m,
|
|
1397
|
+
...w
|
|
1398
|
+
}) => {
|
|
1399
|
+
const x = Kt(), H = Kn(t, {
|
|
1400
|
+
bodyIndex: s,
|
|
1401
|
+
bodyId: r,
|
|
1402
|
+
subject: a,
|
|
1403
|
+
numBodies: c,
|
|
1404
|
+
holdMs: l,
|
|
1405
|
+
graceMs: d,
|
|
1406
|
+
limits: p,
|
|
1407
|
+
onComplete: g
|
|
1408
|
+
});
|
|
1409
|
+
return /* @__PURE__ */ S(
|
|
1410
|
+
It,
|
|
1411
|
+
{
|
|
1412
|
+
...w,
|
|
1413
|
+
nudgeText: m !== void 0 ? m : $n(t) ? Xn : Qn,
|
|
1414
|
+
detector: H,
|
|
1415
|
+
symbolAspect: u,
|
|
1416
|
+
symbol: (v, U) => /* @__PURE__ */ S(
|
|
1417
|
+
qn,
|
|
1418
|
+
{
|
|
1419
|
+
pose: t,
|
|
1420
|
+
model: n,
|
|
1421
|
+
poses: e,
|
|
1422
|
+
idleClip: o,
|
|
1423
|
+
height: v,
|
|
1424
|
+
mirrored: x,
|
|
1425
|
+
orbit: y,
|
|
1426
|
+
look: M,
|
|
1427
|
+
loop: f,
|
|
1428
|
+
boneSide: b,
|
|
1429
|
+
legBoneSide: h,
|
|
1430
|
+
renderOrder: U
|
|
1431
|
+
}
|
|
1432
|
+
)
|
|
1433
|
+
}
|
|
1434
|
+
);
|
|
1435
|
+
}, So = ({ active: t = !0, text: n, ...e }) => t ? /* @__PURE__ */ S(Rt, { children: /* @__PURE__ */ S(
|
|
1436
|
+
Jn,
|
|
1437
|
+
{
|
|
1438
|
+
...e,
|
|
1439
|
+
text: n ?? vt(e.pose).label
|
|
1440
|
+
},
|
|
1441
|
+
st(e.pose)
|
|
1442
|
+
) }) : null;
|
|
1443
|
+
export {
|
|
1444
|
+
Vn as BODY_HINT_LOOK,
|
|
1445
|
+
Fn as BODY_HINT_LOOP,
|
|
1446
|
+
Xn as BODY_INSTRUCTION_FULL_NUDGE_TEXT,
|
|
1447
|
+
Qn as BODY_INSTRUCTION_NUDGE_TEXT,
|
|
1448
|
+
xo as BODY_INSTRUCTION_RENDER_ORDER,
|
|
1449
|
+
Le as BODY_LANDMARK_COUNT,
|
|
1450
|
+
Eo as BODY_LOWER_JOINTS,
|
|
1451
|
+
Do as BODY_POSES,
|
|
1452
|
+
Po as BODY_POSE_JOINTS,
|
|
1453
|
+
Co as BODY_POSE_NAMES,
|
|
1454
|
+
Ao as BODY_SHAPE_LIMITS,
|
|
1455
|
+
Yn as BODY_SYMBOL_ASPECT,
|
|
1456
|
+
Bo as BODY_UPPER_JOINTS,
|
|
1457
|
+
So as BodyInstruction,
|
|
1458
|
+
qn as BodyPoseHint,
|
|
1459
|
+
He as FACE_EXPRESSIONS,
|
|
1460
|
+
Dn as FACE_EXPRESSION_NAMES,
|
|
1461
|
+
An as FACE_HINT_LOOK,
|
|
1462
|
+
Bn as FACE_HINT_LOOP,
|
|
1463
|
+
Un as FACE_INSTRUCTION_NUDGE_TEXT,
|
|
1464
|
+
Mo as FACE_INSTRUCTION_RENDER_ORDER,
|
|
1465
|
+
Ln as FaceExpressionHint,
|
|
1466
|
+
To as FaceInstruction,
|
|
1467
|
+
Ro as GESTURE_HOLD_DEFAULT_MS,
|
|
1468
|
+
vo as GESTURE_HOLD_GRACE_MS,
|
|
1469
|
+
Ft as GHOST_MAX_BONES,
|
|
1470
|
+
bt as HAND_DIGITS,
|
|
1471
|
+
Re as HAND_GESTURES,
|
|
1472
|
+
an as HAND_GESTURE_NAMES,
|
|
1473
|
+
On as HAND_HINT_LOOK,
|
|
1474
|
+
Me as HAND_HINT_LOOP,
|
|
1475
|
+
Nn as HAND_INSTRUCTION_NUDGE_TEXT,
|
|
1476
|
+
go as HAND_INSTRUCTION_RENDER_ORDER,
|
|
1477
|
+
fe as HAND_SHAPE_LIMITS,
|
|
1478
|
+
wn as HINT_LOOP_HOLD,
|
|
1479
|
+
In as HandGestureHint,
|
|
1480
|
+
yo as HandInstruction,
|
|
1481
|
+
Xt as HintStage,
|
|
1482
|
+
Ht as INSTRUCTION_RENDER_ORDER,
|
|
1483
|
+
rn as INSTRUCTION_TEXT_STYLE,
|
|
1484
|
+
mo as Instruction,
|
|
1485
|
+
Qe as addHintTwins,
|
|
1486
|
+
ze as analyzeBodyShape,
|
|
1487
|
+
Oe as analyzeHandShape,
|
|
1488
|
+
Ut as applyHandHintPose,
|
|
1489
|
+
Xe as assignHintMaterials,
|
|
1490
|
+
Pn as createClipBlend,
|
|
1491
|
+
Ye as createDepthPrepassMaterial,
|
|
1492
|
+
Ho as createGestureHoldState,
|
|
1493
|
+
Ke as createGhostMaterial,
|
|
1494
|
+
Ze as createGlowMaterial,
|
|
1495
|
+
$e as createHaloMaterial,
|
|
1496
|
+
qe as createHintMatcap,
|
|
1497
|
+
Cn as createMorphBlend,
|
|
1498
|
+
Lo as defineBodyPose,
|
|
1499
|
+
bo as defineFaceExpression,
|
|
1500
|
+
fo as defineHandGesture,
|
|
1501
|
+
tn as disposeGlowMaterial,
|
|
1502
|
+
it as ease,
|
|
1503
|
+
en as hasVertexColors,
|
|
1504
|
+
Ue as matchBodyPose,
|
|
1505
|
+
Ie as matchFaceExpression,
|
|
1506
|
+
ve as matchHandGesture,
|
|
1507
|
+
zo as matchingBodyPoses,
|
|
1508
|
+
wo as matchingFaceExpressions,
|
|
1509
|
+
po as matchingHandGestures,
|
|
1510
|
+
kn as mergeHintLook,
|
|
1511
|
+
Gn as mixamoBoneSide,
|
|
1512
|
+
jn as mixamoLegBoneSide,
|
|
1513
|
+
$t as orbitSpan,
|
|
1514
|
+
he as readClipQuaternions,
|
|
1515
|
+
fn as readHandClipPose,
|
|
1516
|
+
vt as resolveBodyPose,
|
|
1517
|
+
Zt as resolveFaceExpression,
|
|
1518
|
+
Yt as resolveHandGesture,
|
|
1519
|
+
Qt as sampleHintLoop,
|
|
1520
|
+
Mn as sampleHintOrbit,
|
|
1521
|
+
Uo as squareLandmarks,
|
|
1522
|
+
Io as stepGestureHold,
|
|
1523
|
+
Kn as useBodyPose,
|
|
1524
|
+
zn as useFaceExpression,
|
|
1525
|
+
Jt as useGhostModel,
|
|
1526
|
+
_n as useHandGesture,
|
|
1527
|
+
_o as useInstructionHold
|
|
1528
|
+
};
|