@vincentt-xr/sdk 2.0.0-alpha.7 → 2.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GROUNDING.md +5651 -82
- package/README.md +1 -0
- package/dist/CanonicalHeadFrame-BHcWyaiK.js +1506 -0
- package/dist/CanonicalHeadFrame-D-_T1OMU.cjs +1 -0
- package/dist/DebuggerUI-7ngnJsBe.js +275 -0
- package/dist/DebuggerUI-CoglgKdO.cjs +1 -0
- package/dist/FaceRetouch-CLoTfrcs.js +1071 -0
- package/dist/FaceRetouch-J1lC1WbS.cjs +134 -0
- package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
- package/dist/FaceSurface-DmP9AEeC.js +27 -0
- package/dist/SegmentationOverlay-D_FWkcyP.cjs +35 -0
- package/dist/SegmentationOverlay-vn5x_knv.js +6237 -0
- package/dist/SkeletonUtils-C2r90MtN.js +21 -0
- package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
- package/dist/TextLabel-XE0rQSDn.cjs +2 -0
- package/dist/TextLabel-c9BCucOI.js +961 -0
- package/dist/assets/cache.d.ts +99 -0
- package/dist/assets/estimate.d.ts +11 -0
- package/dist/assets/gltfLoader.d.ts +16 -0
- package/dist/assets/index.d.ts +7 -0
- package/dist/assets/loaders.d.ts +43 -0
- package/dist/assets/react.d.ts +33 -0
- package/dist/body-pose/index.d.ts +521 -0
- package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
- package/dist/body-trigger/frame.d.ts +88 -0
- package/dist/body-trigger/index.d.ts +6 -0
- package/dist/body-trigger/moves.d.ts +235 -0
- package/dist/body-trigger/trigger.d.ts +75 -0
- package/dist/calibration/calibration.d.ts +75 -0
- package/dist/calibration/index.d.ts +6 -0
- package/dist/calibration/storage.d.ts +13 -0
- package/dist/calibration/types.d.ts +53 -0
- package/dist/calibration/useXRCalibration.d.ts +46 -0
- package/dist/camera/CameraPermissionGate.d.ts +26 -0
- package/dist/camera/devices.d.ts +26 -0
- package/dist/camera/index.d.ts +8 -0
- package/dist/camera/permission.d.ts +86 -0
- package/dist/camera/useCameraPermission.d.ts +35 -0
- package/dist/canonicalFace-BHwyCx1c.js +9 -0
- package/dist/canonicalFace-C83I225R.cjs +1 -0
- package/dist/capabilities/detect.d.ts +45 -0
- package/dist/capabilities/index.d.ts +5 -0
- package/dist/capabilities/types.d.ts +120 -0
- package/dist/capabilities/useXRCapabilities.d.ts +18 -0
- package/dist/compat/environment.d.ts +5 -0
- package/dist/compat/index.d.ts +4 -0
- package/dist/compat/run.d.ts +18 -0
- package/dist/compat/scenarios.d.ts +10 -0
- package/dist/compat/types.d.ts +101 -0
- package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
- package/dist/components/BodyInstruction/index.d.ts +69 -0
- package/dist/components/BodyInstruction/useBodyPose.d.ts +23 -0
- package/dist/components/BodyTracker/index.d.ts +17 -0
- package/dist/components/BodyTrigger/index.d.ts +49 -0
- package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
- package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
- package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
- package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
- package/dist/components/FaceAtlas/constants.d.ts +8 -0
- package/dist/components/FaceAtlas/index.d.ts +7 -0
- package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
- package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
- package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
- package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
- package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
- package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
- package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
- package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
- package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
- package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
- package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
- package/dist/components/FaceCharacter/index.d.ts +18 -0
- package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
- package/dist/components/FaceInset/FaceInset.d.ts +68 -0
- package/dist/components/FaceInset/frame.d.ts +94 -0
- package/dist/components/FaceInset/index.d.ts +6 -0
- package/dist/components/FaceInset/material.d.ts +40 -0
- package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
- package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
- package/dist/components/FaceInstruction/index.d.ts +56 -0
- package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
- package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
- package/dist/components/FaceLiquify/debug.d.ts +37 -0
- package/dist/components/FaceLiquify/frame.d.ts +55 -0
- package/dist/components/FaceLiquify/index.d.ts +10 -0
- package/dist/components/FaceLiquify/material.d.ts +39 -0
- package/dist/components/FaceLiquify/pass.d.ts +49 -0
- package/dist/components/FaceLiquify/presence.d.ts +25 -0
- package/dist/components/FaceLiquify/presets.d.ts +82 -0
- package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
- package/dist/components/FaceLiquify/target.d.ts +85 -0
- package/dist/components/FaceLiquify/warp.d.ts +72 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +37 -5
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +1 -1
- package/dist/components/FaceMesh/index.d.ts +2 -2
- package/dist/components/FaceRetouch/Background.d.ts +3 -1
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +5 -0
- package/dist/components/FaceRetouch/renderState.d.ts +19 -0
- package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
- package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
- package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
- package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
- package/dist/components/FaceSwap/index.d.ts +13 -0
- package/dist/components/FaceSwap/settings.d.ts +300 -0
- package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
- package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
- package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
- package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
- package/dist/components/FaceWarp3D/index.d.ts +2 -3
- package/dist/components/Faceless/Faceless.d.ts +51 -0
- package/dist/components/Faceless/index.d.ts +2 -0
- package/dist/components/GestureListener/index.d.ts +11 -0
- package/dist/components/HairLock/HairLock.d.ts +39 -0
- package/dist/components/HairLock/index.d.ts +2 -0
- package/dist/components/HairLock/lockGeometry.d.ts +15 -0
- package/dist/components/HandCutout/index.d.ts +35 -0
- package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
- package/dist/components/HandInstruction/index.d.ts +74 -0
- package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
- package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
- package/dist/components/HandRig/HandAttachment.d.ts +34 -0
- package/dist/components/HandRig/HandOccluder.d.ts +55 -0
- package/dist/components/HandRig/HandTattoo.d.ts +61 -0
- package/dist/components/HandRig/WristAttachment.d.ts +34 -0
- package/dist/components/HandRig/index.d.ts +101 -0
- package/dist/components/HandRig/useArmMask.d.ts +29 -0
- package/dist/components/HandRig/wristSolve.d.ts +69 -0
- package/dist/components/HandTouch/HandTouch.d.ts +62 -0
- package/dist/components/HandTouch/Touchable.d.ts +36 -0
- package/dist/components/HandTouch/index.d.ts +2 -0
- package/dist/components/HandTracker/index.d.ts +10 -0
- package/dist/components/HeadBinding/index.d.ts +14 -0
- package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
- package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
- package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
- package/dist/components/HeadOccluder/NeckOccluder.d.ts +64 -0
- package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
- package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
- package/dist/components/HeadOccluder/index.d.ts +57 -3
- package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
- package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
- package/dist/components/HolisticTracker/index.d.ts +69 -0
- package/dist/components/HolisticTracker/settings.d.ts +58 -0
- package/dist/components/HolisticTracker/signals.d.ts +49 -0
- package/dist/components/Instruction/HintStage.d.ts +29 -0
- package/dist/components/Instruction/InstructionCue.d.ts +126 -0
- package/dist/components/Instruction/gestureHold.d.ts +20 -0
- package/dist/components/Instruction/ghost.d.ts +129 -0
- package/dist/components/Instruction/hintBlend.d.ts +19 -0
- package/dist/components/Instruction/hintLook.d.ts +81 -0
- package/dist/components/Instruction/hintLoop.d.ts +36 -0
- package/dist/components/Instruction/index.d.ts +41 -0
- package/dist/components/Instruction/useGhostModel.d.ts +33 -0
- package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
- package/dist/components/IrisEffect/IrisMaterial.d.ts +73 -0
- package/dist/components/IrisEffect/index.d.ts +51 -0
- package/dist/components/IrisEffect/settings.d.ts +117 -0
- package/dist/components/LipEffect/LipEffect.d.ts +27 -1
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +95 -7
- package/dist/components/LipEffect/LipEffects.d.ts +12 -0
- package/dist/components/LipEffect/defaults.d.ts +46 -4
- package/dist/components/LipEffect/index.d.ts +11 -3
- package/dist/components/LipEffect/lipShading.d.ts +73 -0
- package/dist/components/LipEffect/settings.d.ts +375 -0
- package/dist/components/LipEffect/shader.d.ts +39 -0
- package/dist/components/LipEffect/types.d.ts +128 -9
- package/dist/components/LipEffect/useLipDesignTextures.d.ts +17 -0
- package/dist/components/LipEffect/uvGuide.d.ts +74 -0
- package/dist/components/Makeup/Blush.d.ts +18 -0
- package/dist/components/Makeup/Brows.d.ts +20 -0
- package/dist/components/Makeup/Contour.d.ts +17 -0
- package/dist/components/Makeup/Eyeliner.d.ts +20 -0
- package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
- package/dist/components/Makeup/Highlighter.d.ts +18 -0
- package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
- package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
- package/dist/components/Makeup/constants.d.ts +44 -0
- package/dist/components/Makeup/design.d.ts +106 -0
- package/dist/components/Makeup/designSamples.d.ts +42 -0
- package/dist/components/Makeup/eyes.d.ts +114 -0
- package/dist/components/Makeup/fields.d.ts +10 -0
- package/dist/components/Makeup/geometry.d.ts +106 -0
- package/dist/components/Makeup/index.d.ts +26 -0
- package/dist/components/Makeup/looks.d.ts +28 -0
- package/dist/components/Makeup/material.d.ts +239 -0
- package/dist/components/Makeup/settings.d.ts +54 -0
- package/dist/components/Makeup/shades.d.ts +143 -0
- package/dist/components/Makeup/shapes.d.ts +27 -0
- package/dist/components/Makeup/skinTone.d.ts +135 -0
- package/dist/components/Makeup/types.d.ts +110 -0
- package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
- package/dist/components/Necklace/Necklace.d.ts +44 -0
- package/dist/components/Necklace/index.d.ts +1 -0
- package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
- package/dist/components/ParticleEmitter/index.d.ts +1 -0
- package/dist/components/PersonCutout/index.d.ts +50 -0
- package/dist/components/PersonCutout/personCutout.d.ts +16 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +1 -1
- package/dist/components/ScreenImage/index.d.ts +3 -1
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +1 -1
- package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
- package/dist/components/ScreenImage/source.d.ts +6 -0
- package/dist/components/ScreenImage/types.d.ts +18 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlay.d.ts +37 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlayMaterial.d.ts +31 -0
- package/dist/components/SegmentationOverlay/index.d.ts +9 -0
- package/dist/components/SegmentationOverlay/maskTexture.d.ts +23 -0
- package/dist/components/SegmentationOverlay/providers.d.ts +72 -0
- package/dist/components/SegmentationOverlay/settings.d.ts +65 -0
- package/dist/components/ShoulderOccluder/index.d.ts +43 -0
- package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +24 -0
- package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
- package/dist/components/SpringSwing/index.d.ts +1 -0
- package/dist/components/XRProvider/index.d.ts +16 -2
- package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
- package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +1 -1
- package/dist/components/index.d.ts +11 -0
- package/dist/config/index.d.ts +0 -1
- package/dist/constants/index.d.ts +4 -1
- package/dist/context-DTxSQvp4.js +13 -0
- package/dist/context-hA0Rb2Xa.cjs +1 -0
- package/dist/contexts-BH7PdKFS.cjs +1 -0
- package/dist/contexts-jak8-tND.js +667 -0
- package/dist/coordinates/feed.d.ts +52 -0
- package/dist/coordinates/index.d.ts +7 -0
- package/dist/coordinates/side.d.ts +40 -0
- package/dist/coordinates/spaces.d.ts +49 -0
- package/dist/coordinates/viewport.d.ts +22 -0
- package/dist/coordinates/world.d.ts +15 -0
- package/dist/debug-ui/default-setting.cjs +2 -2
- package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
- package/dist/debug-ui/gesture-settings/index.d.ts +14 -0
- package/dist/debug-ui/hierarchy-panel/index.d.ts +3 -2
- package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
- package/dist/debug-ui/index.d.ts +18 -3
- package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
- package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
- package/dist/debug-ui/media-source/index.d.ts +1 -1
- package/dist/debug-ui/media-source/session.d.ts +30 -2
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui/object-inspector-panel/index.d.ts +3 -2
- package/dist/debug-ui/product-hotspots/index.d.ts +25 -0
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +3 -1
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +3 -1
- package/dist/debug-ui/screen-image-settings/index.d.ts +3 -1
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +1 -1
- package/dist/debug-ui/screen-text-settings/types.d.ts +2 -0
- package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
- package/dist/debug-ui/settings-panel/index.d.ts +6 -1
- package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
- package/dist/debug-ui/xr-diagnostics/index.d.ts +26 -0
- package/dist/debug-ui.cjs +3 -3
- package/dist/debug-ui.js +2695 -2547
- package/dist/detector-K8aej4MB.js +59 -0
- package/dist/detector-ijypGtse.cjs +1 -0
- package/dist/entries/all.d.ts +3 -1
- package/dist/entries/core.d.ts +20 -2
- package/dist/entries/face-effects.d.ts +123 -9
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +2 -1
- package/dist/entries/low-level.d.ts +49 -3
- package/dist/entries/particles.d.ts +11 -0
- package/dist/entries/product.d.ts +11 -0
- package/dist/entries/tracking.d.ts +60 -2
- package/dist/face-atlas/attributes.d.ts +30 -0
- package/dist/face-atlas/eyes.d.ts +272 -0
- package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
- package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
- package/dist/face-atlas/glsl/common.d.ts +55 -0
- package/dist/face-atlas/glsl/design.d.ts +49 -0
- package/dist/face-atlas/glsl/eyes.d.ts +73 -0
- package/dist/face-atlas/glsl/finish.d.ts +24 -0
- package/dist/face-atlas/glsl/format.d.ts +4 -0
- package/dist/face-atlas/glsl/index.d.ts +59 -0
- package/dist/face-atlas/glsl/shading.d.ts +15 -0
- package/dist/face-atlas/glsl/shapes.d.ts +66 -0
- package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
- package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
- package/dist/face-atlas/guide.d.ts +51 -0
- package/dist/face-atlas/index.d.ts +25 -0
- package/dist/face-atlas/lead.d.ts +117 -0
- package/dist/face-atlas/madeUpCamera.d.ts +125 -0
- package/dist/face-atlas/masks.d.ts +53 -0
- package/dist/face-atlas/obj.d.ts +69 -0
- package/dist/face-atlas/polylines.d.ts +63 -0
- package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
- package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
- package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
- package/dist/face-atlas/probe/constants.d.ts +137 -0
- package/dist/face-atlas/probe/glsl.d.ts +43 -0
- package/dist/face-atlas/probe/lightFit.d.ts +108 -0
- package/dist/face-atlas/probe/schedule.d.ts +44 -0
- package/dist/face-atlas/probe/selfTest.d.ts +87 -0
- package/dist/face-atlas/probe/stats.d.ts +143 -0
- package/dist/face-atlas/probe/targets.d.ts +70 -0
- package/dist/face-atlas/probe/unwrap.d.ts +76 -0
- package/dist/face-atlas/quality.d.ts +28 -0
- package/dist/face-atlas/regions.d.ts +31 -0
- package/dist/face-atlas/registry.d.ts +252 -0
- package/dist/face-atlas/renderState.d.ts +86 -0
- package/dist/face-atlas/selfOcclusion.d.ts +62 -0
- package/dist/face-atlas/shading.d.ts +406 -0
- package/dist/face-atlas/shapes.d.ts +86 -0
- package/dist/face-atlas/sides.d.ts +41 -0
- package/dist/face-atlas/skinMask.d.ts +35 -0
- package/dist/face-atlas/surface.d.ts +155 -0
- package/dist/face-atlas/topology.d.ts +44 -0
- package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
- package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
- package/dist/face-character/bindFaceModel.d.ts +106 -0
- package/dist/face-character/canonicalFace.d.ts +17 -0
- package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
- package/dist/face-character/canonicalFacePositions.d.ts +7 -0
- package/dist/face-character/driveFaceModel.d.ts +57 -0
- package/dist/face-character/expressionOutputs.d.ts +45 -0
- package/dist/face-character/faceExpressions.d.ts +104 -0
- package/dist/face-character/faceImageLandmarker.d.ts +93 -0
- package/dist/face-character/faceMeshBinding.d.ts +62 -0
- package/dist/face-character/faceMorph.d.ts +77 -0
- package/dist/face-character/faceMorphs.d.ts +46 -0
- package/dist/face-character/facePhoto.d.ts +138 -0
- package/dist/face-character/facePiercings.d.ts +116 -0
- package/dist/face-character/facePin.d.ts +131 -0
- package/dist/face-character/faceReprojection.d.ts +273 -0
- package/dist/face-character/faceReprojector.d.ts +171 -0
- package/dist/face-character/faceRig.d.ts +176 -0
- package/dist/face-character/faceSwapPresence.d.ts +85 -0
- package/dist/face-character/faceTexture.d.ts +169 -0
- package/dist/face-character/faceTextureBaker.d.ts +86 -0
- package/dist/face-character/faceTextureGuide.d.ts +106 -0
- package/dist/face-character/faceTextureStats.d.ts +298 -0
- package/dist/face-character/faceTransfer.d.ts +396 -0
- package/dist/face-character/faceTransferGeometry.d.ts +109 -0
- package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
- package/dist/face-character/faceWarp3D.d.ts +101 -0
- package/dist/face-character/faceless.d.ts +79 -0
- package/dist/face-character/featureWarp.d.ts +28 -0
- package/dist/face-character/liveFaceRegistry.d.ts +370 -0
- package/dist/face-character/liveValue.d.ts +12 -0
- package/dist/face-character/memo.d.ts +15 -0
- package/dist/face-effects.cjs +2324 -1
- package/dist/face-effects.js +14208 -2268
- package/dist/face-expression/index.d.ts +182 -0
- package/dist/face-info/landmarks.d.ts +17 -3
- package/dist/face-info/types.d.ts +20 -3
- package/dist/gestures/definitions.d.ts +98 -0
- package/dist/gestures/detector.d.ts +87 -0
- package/dist/gestures/index.d.ts +8 -0
- package/dist/gestures/measures.d.ts +114 -0
- package/dist/gestures/settings.d.ts +49 -0
- package/dist/getFaceInfo-B1otSDMX.cjs +1 -0
- package/dist/getFaceInfo-Cu4xDWiL.js +62 -0
- package/dist/hand/armFit.d.ts +46 -0
- package/dist/hand/armMask.d.ts +178 -0
- package/dist/hand/handCutout.d.ts +23 -0
- package/dist/hand/handCutoutRegistry.d.ts +7 -0
- package/dist/hand/handGestures.d.ts +524 -0
- package/dist/hand/handPose.d.ts +98 -0
- package/dist/hand/handRigSolver.d.ts +159 -0
- package/dist/hand/handTattoo.d.ts +81 -0
- package/dist/hand/handTouch.d.ts +240 -0
- package/dist/hand/wrist.d.ts +44 -0
- package/dist/hand/wristFilter.d.ts +44 -0
- package/dist/hooks/selectors.d.ts +76 -1
- package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
- package/dist/hooks/useFaceInfo.d.ts +13 -1
- package/dist/hooks/useFaceInfos.d.ts +1 -1
- package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
- package/dist/hooks/useGesture.d.ts +32 -0
- package/dist/hooks/useIrisTracking.d.ts +45 -0
- package/dist/hooks/useTrackerContext.d.ts +6 -0
- package/dist/hooks/useXRDiagnostics.d.ts +81 -0
- package/dist/hooks/useXRModel.d.ts +7 -0
- package/dist/hooks/useXRSession/facade.d.ts +42 -2
- package/dist/hooks/useXRSession/index.d.ts +2 -2
- package/dist/hooks/useXRSession/reason.d.ts +3 -1
- package/dist/hooks/useXRSession/registry.d.ts +14 -0
- package/dist/hooks/useXRSession/store.d.ts +52 -3
- package/dist/index-B1_TzJaI.js +1104 -0
- package/dist/index-BavF06C6.js +190 -0
- package/dist/index-BfFmpddl.cjs +21 -0
- package/dist/index-BuBzneeW.cjs +46 -0
- package/dist/index-CGsQWodV.cjs +1 -0
- package/dist/index-CIe7eCMH.js +3200 -0
- package/dist/index-CfSF8LXa.cjs +1 -0
- package/dist/index-D5GTzOzD.cjs +1 -0
- package/dist/index-DBhQzvVa.js +314 -0
- package/dist/index-DE17y0ZI.cjs +1 -0
- package/dist/index-JII7huPk.js +442 -0
- package/dist/index-tpCr9CLj.cjs +1 -0
- package/dist/index-w1S7fI2B.js +1432 -0
- package/dist/index-zGaqrz_K.js +188 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1507 -0
- package/dist/{internal-Dmk1cTXq.js → internal-B90P-clC.js} +138 -119
- package/dist/internal-Cjinca64.cjs +1 -0
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +15 -10
- package/dist/iris/compute.d.ts +27 -0
- package/dist/iris/index.d.ts +4 -0
- package/dist/iris/lead.d.ts +19 -0
- package/dist/iris/types.d.ts +89 -0
- package/dist/landmarkMask-BFDyBnKM.js +224 -0
- package/dist/landmarkMask-u7es2k4X.cjs +1 -0
- package/dist/landmarks-BlUqf5MZ.cjs +1 -0
- package/dist/landmarks-bftdwq6Z.js +76 -0
- package/dist/loaders-BGAUACsd.js +363 -0
- package/dist/loaders-BJ1_QCHt.cjs +1 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +1190 -675
- package/dist/main.cjs +1 -1
- package/dist/main.js +1190 -452
- package/dist/models/Base/index.d.ts +49 -0
- package/dist/models/Body/index.d.ts +3 -1
- package/dist/models/Face/constants.d.ts +8 -0
- package/dist/models/Face/index.d.ts +4 -12
- package/dist/models/Face/rotation.d.ts +18 -3
- package/dist/models/Hand/GestureTracking.d.ts +1 -1
- package/dist/models/Hand/HandTracking.d.ts +17 -1
- package/dist/models/Holistic/index.d.ts +49 -0
- package/dist/models/Holistic/result.d.ts +68 -0
- package/dist/models/Segmentation/index.d.ts +2 -0
- package/dist/models/SemanticSegmentation/index.d.ts +31 -0
- package/dist/models/SemanticSegmentation/presets.d.ts +28 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/nodeSource.d.ts +9 -0
- package/dist/particles/emission.d.ts +24 -0
- package/dist/particles/eyes.d.ts +24 -0
- package/dist/particles/glsl.d.ts +14 -0
- package/dist/particles/index.d.ts +10 -0
- package/dist/particles/motion.d.ts +42 -0
- package/dist/particles/presets.d.ts +12 -0
- package/dist/particles/ring.d.ts +58 -0
- package/dist/particles/selfTest.d.ts +53 -0
- package/dist/particles/settings.d.ts +127 -0
- package/dist/particles/shapes.d.ts +29 -0
- package/dist/particles/spawner.d.ts +60 -0
- package/dist/particles/system.d.ts +64 -0
- package/dist/particles.cjs +122 -0
- package/dist/particles.js +774 -0
- package/dist/product/ProductDimensions.d.ts +16 -0
- package/dist/product/ProductHotspot.d.ts +16 -0
- package/dist/product/ProductViewer.d.ts +9 -0
- package/dist/product/details.d.ts +53 -0
- package/dist/product/index.d.ts +14 -0
- package/dist/product/loadModelViewer.d.ts +4 -0
- package/dist/product/types.d.ts +71 -0
- package/dist/product/useProductAr.d.ts +37 -0
- package/dist/product/useProductDetails.d.ts +60 -0
- package/dist/product.cjs +1 -0
- package/dist/product.js +414 -0
- package/dist/providers-C8rE26Uf.js +366 -0
- package/dist/providers-DHsrhDI2.cjs +62 -0
- package/dist/quality/XRQualityController.d.ts +25 -0
- package/dist/quality/controller.d.ts +33 -0
- package/dist/quality/index.d.ts +6 -0
- package/dist/quality/types.d.ts +100 -0
- package/dist/quality/useXRQuality.d.ts +28 -0
- package/dist/render/renderPasses.d.ts +8 -0
- package/dist/render/sceneBeforeRender.d.ts +12 -0
- package/dist/{renderGroups-KZk6eRiY.js → renderGroups-B38pUaX2.js} +1 -1
- package/dist/{renderGroups-80H3DpTl.cjs → renderGroups-Cb_4Ar1Q.cjs} +1 -1
- package/dist/renderPasses-B6l8IpJv.js +1290 -0
- package/dist/renderPasses-dqmkft4P.cjs +158 -0
- package/dist/renderState-CJNmj5jz.js +39 -0
- package/dist/renderState-apSfg4eR.cjs +1 -0
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/segmentation-Cb3ouK6Z.js +1758 -0
- package/dist/segmentation-D9pYO6aR.cjs +1 -0
- package/dist/segmentation2d/faceMemory.d.ts +28 -0
- package/dist/segmentation2d/faceRegions.d.ts +24 -0
- package/dist/segmentation2d/index.d.ts +9 -0
- package/dist/segmentation2d/maskUv.d.ts +23 -0
- package/dist/segmentation2d/rasterize.d.ts +14 -0
- package/dist/segmentation2d/types.d.ts +52 -0
- package/dist/select-Ck5LGz-J.cjs +1 -0
- package/dist/select-pYRo_win.js +233 -0
- package/dist/selectors-C4X71aoD.cjs +1 -0
- package/dist/selectors-DmNaKIwE.js +196 -0
- package/dist/session-BrH8G7iJ.cjs +31 -0
- package/dist/session-DgA_z6O1.js +418 -0
- package/dist/settings-BJ7FMBsO.js +111 -0
- package/dist/settings-C63FMBlF.cjs +1 -0
- package/dist/similarityFit-BFqHND2e.cjs +1 -0
- package/dist/similarityFit-Bbz-R8AY.js +91 -0
- package/dist/spring/index.d.ts +2 -0
- package/dist/spring/spring.d.ts +69 -0
- package/dist/spring/swing.d.ts +54 -0
- package/dist/subjects/index.d.ts +2 -0
- package/dist/subjects/select.d.ts +62 -0
- package/dist/subjects/types.d.ts +55 -0
- package/dist/tracking-config/apply.d.ts +57 -0
- package/dist/tracking-config/index.d.ts +7 -0
- package/dist/tracking-config/resolve.d.ts +25 -0
- package/dist/tracking-config/storage.d.ts +8 -0
- package/dist/tracking-config/types.d.ts +106 -0
- package/dist/tracking-config/useXRTrackingConfig.d.ts +38 -0
- package/dist/tracking.cjs +10 -1
- package/dist/tracking.js +1326 -506
- package/dist/trigger-D0Pm9noT.cjs +49 -0
- package/dist/trigger-IQeys0oS.js +2128 -0
- package/dist/types/compositor.d.ts +21 -0
- package/dist/types/face.d.ts +20 -1
- package/dist/types/hand-tracking.d.ts +9 -0
- package/dist/types/holistic.d.ts +121 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/model.d.ts +22 -2
- package/dist/types/nodes.d.ts +47 -3
- package/dist/types/segmentation.d.ts +24 -0
- package/dist/types/session.d.ts +41 -3
- package/dist/updateThrottle-BseecYag.js +4 -0
- package/dist/updateThrottle-Of5Y4SVa.cjs +1 -0
- package/dist/useFaceInfo-BHDNCvsJ.cjs +1 -0
- package/dist/useFaceInfo-J4x7LsqL.js +76 -0
- package/dist/useFaceResultReader-BvEo5REG.js +61 -0
- package/dist/useFaceResultReader-DuaL1KJG.cjs +1 -0
- package/dist/useInstructionHold-DOu-RpCM.js +53 -0
- package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
- package/dist/useXRCapabilities-Cr3RzuAW.cjs +1 -0
- package/dist/useXRCapabilities-Cxmlmpbd.js +30 -0
- package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
- package/dist/utils/fns.d.ts +6 -3
- package/dist/utils/headOccluderFit.d.ts +42 -0
- package/dist/utils/integrity.d.ts +21 -1
- package/dist/utils/resolveNumFaces.d.ts +13 -0
- package/dist/utils/shoulderOccluderFit.d.ts +38 -0
- package/dist/utils/similarityFit.d.ts +23 -0
- package/dist/utils/updateThrottle.d.ts +2 -0
- package/dist/utils/useStableUniforms.d.ts +18 -0
- package/dist/uv-BMFt19bg.cjs +1 -0
- package/dist/{index-ByoNj0QP.js → uv-DJU_XfmN.js} +15 -247
- package/docs/SDK_DOCUMENTATION.md +1 -2
- package/docs/api/adaptive-quality.mdx +104 -0
- package/docs/api/asset-lifecycle.mdx +78 -0
- package/docs/api/body-instructions.mdx +285 -0
- package/docs/api/body-triggers.mdx +234 -0
- package/docs/api/camera-permission.mdx +142 -0
- package/docs/api/coordinate-spaces.mdx +168 -0
- package/docs/api/cross-camera.mdx +89 -0
- package/docs/api/debug-ui-scene-editor.mdx +23 -2
- package/docs/api/diagnostics-calibration.mdx +97 -0
- package/docs/api/external-face-mesh.mdx +231 -0
- package/docs/api/face-actions.mdx +20 -16
- package/docs/api/face-attribute-expression.mdx +1 -1
- package/docs/api/face-binding-anchors.mdx +4 -2
- package/docs/api/face-character.mdx +157 -0
- package/docs/api/face-effects.mdx +9 -0
- package/docs/api/face-expression-controller.mdx +153 -0
- package/docs/api/face-info.mdx +17 -11
- package/docs/api/face-inset.mdx +204 -0
- package/docs/api/face-instructions.mdx +183 -0
- package/docs/api/face-liquify.mdx +196 -0
- package/docs/api/face-mesh.mdx +8 -9
- package/docs/api/face-morph.mdx +117 -0
- package/docs/api/face-painting.mdx +7 -0
- package/docs/api/face-reprojection.mdx +154 -0
- package/docs/api/face-retouching.mdx +18 -10
- package/docs/api/face-swap.mdx +350 -0
- package/docs/api/face-warp-3d.mdx +166 -0
- package/docs/api/faceless.mdx +143 -0
- package/docs/api/gestures.mdx +209 -0
- package/docs/api/hair.mdx +97 -0
- package/docs/api/hand-instructions.mdx +222 -0
- package/docs/api/hand-rig.mdx +535 -0
- package/docs/api/hand-touch.mdx +162 -0
- package/docs/api/head-occluder.mdx +563 -0
- package/docs/api/holistic-tracker.mdx +164 -0
- package/docs/api/instructions.mdx +323 -0
- package/docs/api/iris-tracking.mdx +247 -0
- package/docs/api/made-up-camera.mdx +131 -0
- package/docs/api/makeup-skin-tone.mdx +135 -0
- package/docs/api/makeup.mdx +353 -0
- package/docs/api/multi-subject.mdx +98 -0
- package/docs/api/particles.mdx +155 -0
- package/docs/api/person-cutout.mdx +136 -0
- package/docs/api/pin-to-face-mesh.mdx +274 -0
- package/docs/api/product-ar.mdx +114 -0
- package/docs/api/product-details.mdx +78 -0
- package/docs/api/screen-space-coordinates.mdx +4 -1
- package/docs/api/segmentation-overlay.mdx +301 -0
- package/docs/api/session-lifecycle.mdx +136 -0
- package/docs/api/trackers.mdx +5 -0
- package/docs/api/tracking-config.mdx +108 -0
- package/docs/docs.json +51 -1
- package/docs/examples/lip-shaders.mdx +273 -0
- package/docs/guides/face-atlas-template.svg +1 -0
- package/docs/guides/face-atlas-textures.mdx +186 -0
- package/docs/guides/face-texture-template.svg +1 -0
- package/docs/guides/harness-debug-ui.mdx +4 -4
- package/docs/guides/lip-effect-textures.mdx +368 -0
- package/docs/guides/lip-uv-template.png +0 -0
- package/docs/guides/lip-uv-template.svg +1 -0
- package/docs/guides/makeup-design-textures.mdx +109 -0
- package/docs/introduction.mdx +1 -2
- package/package.json +23 -1
- package/dist/DebuggerUI-B6bP6P9r.cjs +0 -1
- package/dist/DebuggerUI-BjOMr8q_.js +0 -269
- package/dist/FaceMeshRenderer-C5l6VLdO.cjs +0 -155
- package/dist/FaceMeshRenderer-wjAHrJzP.js +0 -1270
- package/dist/FaceRetouch-BkJzoA79.cjs +0 -134
- package/dist/FaceRetouch-DwbKQJAN.js +0 -551
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +0 -15
- package/dist/components/FaceWarp3D/defaults.d.ts +0 -37
- package/dist/components/FaceWarp3D/warp.d.ts +0 -13
- package/dist/contexts-ByhzppYl.js +0 -663
- package/dist/contexts-Dr62It_K.cjs +0 -1
- package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
- package/dist/getFaceInfo-C4QpCQIY.js +0 -118
- package/dist/getFaceInfo-fA1bFBub.cjs +0 -1
- package/dist/index-9dlAQAhy.js +0 -1462
- package/dist/index-BjmTe9eM.cjs +0 -1
- package/dist/index-BpEf2BBb.cjs +0 -1
- package/dist/index-CyUUurQT.cjs +0 -1
- package/dist/index-DCiMbxC3.cjs +0 -1
- package/dist/index-DXT3WccE.js +0 -2089
- package/dist/index-DpI-qo5X.cjs +0 -17
- package/dist/index-DyVF4vEW.js +0 -111
- package/dist/index-VJ0SJwmG.js +0 -214
- package/dist/internal-Cq-TEQ5Y.cjs +0 -1
- package/dist/renderLayers-lDtL0_43.cjs +0 -1
- package/dist/renderLayers-zrK2pv5O.js +0 -13
- package/dist/renderPasses-BOoBSr8z.cjs +0 -21
- package/dist/renderPasses-BcquyVtu.js +0 -1500
- package/dist/selectors-B8H97CKA.js +0 -59
- package/dist/selectors-CZLKT2Iv.cjs +0 -1
- package/dist/session-CpkiK5YA.cjs +0 -31
- package/dist/session-DLFN_VII.js +0 -363
- package/dist/useFaceInfo-BJ8-_MOs.cjs +0 -1
- package/dist/useFaceInfo-Dk426LTu.js +0 -62
- package/dist/useFaceResults-CtetsO9M.js +0 -19
- package/dist/useFaceResults-wBJF3zyp.cjs +0 -1
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
const S = [
|
|
2
|
+
"bg",
|
|
3
|
+
"brows",
|
|
4
|
+
"eyes",
|
|
5
|
+
"face_skin",
|
|
6
|
+
"hair",
|
|
7
|
+
"lips",
|
|
8
|
+
"mouth",
|
|
9
|
+
"person"
|
|
10
|
+
], g = [
|
|
11
|
+
"normal",
|
|
12
|
+
"multiply",
|
|
13
|
+
"screen",
|
|
14
|
+
"overlay"
|
|
15
|
+
], O = {
|
|
16
|
+
label: "lips",
|
|
17
|
+
invert: !1,
|
|
18
|
+
color: "#e85d75",
|
|
19
|
+
opacity: 0.8,
|
|
20
|
+
blendMode: "multiply",
|
|
21
|
+
feather: 1,
|
|
22
|
+
mirrored: !1
|
|
23
|
+
}, p = (e, o, r, l) => typeof e == "number" && Number.isFinite(e) ? Math.min(r, Math.max(o, e)) : l, M = (e = {}) => {
|
|
24
|
+
const o = O;
|
|
25
|
+
return {
|
|
26
|
+
label: typeof e.label == "string" && e.label.trim() ? e.label : o.label,
|
|
27
|
+
invert: typeof e.invert == "boolean" ? e.invert : o.invert,
|
|
28
|
+
color: typeof e.color == "string" && e.color.trim() ? e.color : o.color,
|
|
29
|
+
opacity: p(e.opacity, 0, 1, o.opacity),
|
|
30
|
+
blendMode: g.includes(
|
|
31
|
+
e.blendMode
|
|
32
|
+
) ? e.blendMode : o.blendMode,
|
|
33
|
+
feather: p(e.feather, 0, 8, o.feather),
|
|
34
|
+
mirrored: typeof e.mirrored == "boolean" ? e.mirrored : o.mirrored
|
|
35
|
+
};
|
|
36
|
+
}, Y = (e, o) => M({ ...e, ...o }), w = (e) => (typeof e == "string" ? e.split(",") : e).map((o) => o.trim()).filter(Boolean), P = [
|
|
37
|
+
{
|
|
38
|
+
key: "label",
|
|
39
|
+
label: "Region",
|
|
40
|
+
type: "select",
|
|
41
|
+
options: S.map((e) => ({ label: e, value: e }))
|
|
42
|
+
},
|
|
43
|
+
{ key: "invert", label: "Invert selection", type: "boolean" },
|
|
44
|
+
{ key: "color", label: "Color", type: "color" },
|
|
45
|
+
{ key: "opacity", label: "Opacity", type: "number", min: 0, max: 1, step: 0.01 },
|
|
46
|
+
{
|
|
47
|
+
key: "blendMode",
|
|
48
|
+
label: "Blend",
|
|
49
|
+
type: "select",
|
|
50
|
+
options: g.map((e) => ({ label: e, value: e }))
|
|
51
|
+
},
|
|
52
|
+
{ key: "feather", label: "Feather (texels)", type: "number", min: 0, max: 8, step: 0.5 },
|
|
53
|
+
{ key: "mirrored", label: "Mirror mask", type: "boolean" }
|
|
54
|
+
], _ = 512, d = [
|
|
55
|
+
10,
|
|
56
|
+
338,
|
|
57
|
+
297,
|
|
58
|
+
332,
|
|
59
|
+
284,
|
|
60
|
+
251,
|
|
61
|
+
389,
|
|
62
|
+
356,
|
|
63
|
+
454,
|
|
64
|
+
323,
|
|
65
|
+
361,
|
|
66
|
+
288,
|
|
67
|
+
397,
|
|
68
|
+
365,
|
|
69
|
+
379,
|
|
70
|
+
378,
|
|
71
|
+
400,
|
|
72
|
+
377,
|
|
73
|
+
152,
|
|
74
|
+
148,
|
|
75
|
+
176,
|
|
76
|
+
149,
|
|
77
|
+
150,
|
|
78
|
+
136,
|
|
79
|
+
172,
|
|
80
|
+
58,
|
|
81
|
+
132,
|
|
82
|
+
93,
|
|
83
|
+
234,
|
|
84
|
+
127,
|
|
85
|
+
162,
|
|
86
|
+
21,
|
|
87
|
+
54,
|
|
88
|
+
103,
|
|
89
|
+
67,
|
|
90
|
+
109
|
|
91
|
+
], v = [
|
|
92
|
+
33,
|
|
93
|
+
246,
|
|
94
|
+
161,
|
|
95
|
+
160,
|
|
96
|
+
159,
|
|
97
|
+
158,
|
|
98
|
+
157,
|
|
99
|
+
173,
|
|
100
|
+
133,
|
|
101
|
+
155,
|
|
102
|
+
154,
|
|
103
|
+
153,
|
|
104
|
+
145,
|
|
105
|
+
144,
|
|
106
|
+
163,
|
|
107
|
+
7
|
|
108
|
+
], L = [
|
|
109
|
+
362,
|
|
110
|
+
398,
|
|
111
|
+
384,
|
|
112
|
+
385,
|
|
113
|
+
386,
|
|
114
|
+
387,
|
|
115
|
+
388,
|
|
116
|
+
466,
|
|
117
|
+
263,
|
|
118
|
+
249,
|
|
119
|
+
390,
|
|
120
|
+
373,
|
|
121
|
+
374,
|
|
122
|
+
380,
|
|
123
|
+
381,
|
|
124
|
+
382
|
|
125
|
+
], A = [
|
|
126
|
+
61,
|
|
127
|
+
146,
|
|
128
|
+
91,
|
|
129
|
+
181,
|
|
130
|
+
84,
|
|
131
|
+
17,
|
|
132
|
+
314,
|
|
133
|
+
405,
|
|
134
|
+
321,
|
|
135
|
+
375,
|
|
136
|
+
291,
|
|
137
|
+
409,
|
|
138
|
+
270,
|
|
139
|
+
269,
|
|
140
|
+
267,
|
|
141
|
+
0,
|
|
142
|
+
37,
|
|
143
|
+
39,
|
|
144
|
+
40,
|
|
145
|
+
185
|
|
146
|
+
], F = [
|
|
147
|
+
78,
|
|
148
|
+
95,
|
|
149
|
+
88,
|
|
150
|
+
178,
|
|
151
|
+
87,
|
|
152
|
+
14,
|
|
153
|
+
317,
|
|
154
|
+
402,
|
|
155
|
+
318,
|
|
156
|
+
324,
|
|
157
|
+
308,
|
|
158
|
+
415,
|
|
159
|
+
310,
|
|
160
|
+
311,
|
|
161
|
+
312,
|
|
162
|
+
13,
|
|
163
|
+
82,
|
|
164
|
+
81,
|
|
165
|
+
80,
|
|
166
|
+
191
|
|
167
|
+
], I = [70, 63, 105, 66, 107, 55, 65, 52, 53, 46], N = [336, 296, 334, 293, 300, 276, 283, 282, 295, 285], R = [
|
|
168
|
+
v,
|
|
169
|
+
L,
|
|
170
|
+
A,
|
|
171
|
+
F,
|
|
172
|
+
I,
|
|
173
|
+
N
|
|
174
|
+
], E = (e, o, r) => {
|
|
175
|
+
T(e, o, d, r);
|
|
176
|
+
}, h = (e, o, r) => {
|
|
177
|
+
const l = i(o, 10, r), a = i(o, 103, r), t = i(o, 332, r), s = i(o, 105, r), b = i(o, 334, r);
|
|
178
|
+
if (!l || !a || !t || !s || !b) return;
|
|
179
|
+
const y = (s.y + b.y) * 0.5, m = Math.abs(t.x - a.x), c = Math.max(Math.abs(y - l.y) * 0.72, m * 0.08), n = Math.max(0, l.y - c), f = c * 0.34;
|
|
180
|
+
e.beginPath(), e.moveTo(a.x, a.y - f), e.quadraticCurveTo((a.x + l.x) * 0.5, n, l.x, n), e.quadraticCurveTo(
|
|
181
|
+
(t.x + l.x) * 0.5,
|
|
182
|
+
n,
|
|
183
|
+
t.x,
|
|
184
|
+
t.y - f
|
|
185
|
+
), e.lineTo(b.x, y), e.quadraticCurveTo(l.x, y + c * 0.16, s.x, y), e.closePath(), e.fill();
|
|
186
|
+
}, C = (e, o, r) => {
|
|
187
|
+
R.forEach((l) => T(e, o, l, r));
|
|
188
|
+
}, i = (e, o, r) => {
|
|
189
|
+
const l = e[o];
|
|
190
|
+
return l ? {
|
|
191
|
+
x: l.x * r,
|
|
192
|
+
y: l.y * r
|
|
193
|
+
} : null;
|
|
194
|
+
}, T = (e, o, r, l) => {
|
|
195
|
+
const a = i(o, r[0], l);
|
|
196
|
+
if (a) {
|
|
197
|
+
e.beginPath(), e.moveTo(a.x, a.y);
|
|
198
|
+
for (let t = 1; t < r.length; t += 1) {
|
|
199
|
+
const s = i(o, r[t], l);
|
|
200
|
+
s && e.lineTo(s.x, s.y);
|
|
201
|
+
}
|
|
202
|
+
e.closePath(), e.fill();
|
|
203
|
+
}
|
|
204
|
+
}, u = (e, o, r = _, l = {}) => {
|
|
205
|
+
e.clearRect(0, 0, r, r), o != null && o.length && (e.save(), e.globalCompositeOperation = "lighter", e.fillStyle = "rgb(0, 0, 255)", E(e, o, r), l.foreheadCoverage && h(e, o, r), e.restore(), e.save(), e.globalCompositeOperation = "lighter", e.filter = "blur(8px)", e.fillStyle = "rgb(255, 0, 0)", E(e, o, r), l.foreheadCoverage && h(e, o, r), e.restore(), e.save(), e.globalCompositeOperation = "lighter", e.filter = "blur(3px)", e.fillStyle = "rgb(0, 255, 0)", C(e, o, r), e.restore());
|
|
206
|
+
};
|
|
207
|
+
export {
|
|
208
|
+
O as D,
|
|
209
|
+
d as F,
|
|
210
|
+
F as I,
|
|
211
|
+
I as L,
|
|
212
|
+
A as O,
|
|
213
|
+
N as R,
|
|
214
|
+
g as S,
|
|
215
|
+
v as a,
|
|
216
|
+
L as b,
|
|
217
|
+
_ as c,
|
|
218
|
+
u as d,
|
|
219
|
+
Y as e,
|
|
220
|
+
P as f,
|
|
221
|
+
S as g,
|
|
222
|
+
w as p,
|
|
223
|
+
M as r
|
|
224
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const O=["bg","brows","eyes","face_skin","hair","lips","mouth","person"],T=["normal","multiply","screen","overlay"],p={label:"lips",invert:!1,color:"#e85d75",opacity:.8,blendMode:"multiply",feather:1,mirrored:!1},S=(e,o,r,l)=>typeof e=="number"&&Number.isFinite(e)?Math.min(r,Math.max(o,e)):l,h=(e={})=>{const o=p;return{label:typeof e.label=="string"&&e.label.trim()?e.label:o.label,invert:typeof e.invert=="boolean"?e.invert:o.invert,color:typeof e.color=="string"&&e.color.trim()?e.color:o.color,opacity:S(e.opacity,0,1,o.opacity),blendMode:T.includes(e.blendMode)?e.blendMode:o.blendMode,feather:S(e.feather,0,8,o.feather),mirrored:typeof e.mirrored=="boolean"?e.mirrored:o.mirrored}},F=(e,o)=>h({...e,...o}),Y=e=>(typeof e=="string"?e.split(","):e).map(o=>o.trim()).filter(Boolean),C=[{key:"label",label:"Region",type:"select",options:O.map(e=>({label:e,value:e}))},{key:"invert",label:"Invert selection",type:"boolean"},{key:"color",label:"Color",type:"color"},{key:"opacity",label:"Opacity",type:"number",min:0,max:1,step:.01},{key:"blendMode",label:"Blend",type:"select",options:T.map(e=>({label:e,value:e}))},{key:"feather",label:"Feather (texels)",type:"number",min:0,max:8,step:.5},{key:"mirrored",label:"Mirror mask",type:"boolean"}],g=512,M=[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109],A=[33,246,161,160,159,158,157,173,133,155,154,153,145,144,163,7],m=[362,398,384,385,386,387,388,466,263,249,390,373,374,380,381,382],L=[61,146,91,181,84,17,314,405,321,375,291,409,270,269,267,0,37,39,40,185],N=[78,95,88,178,87,14,317,402,318,324,308,415,310,311,312,13,82,81,80,191],I=[70,63,105,66,107,55,65,52,53,46],v=[336,296,334,293,300,276,283,282,295,285],G=[A,m,L,N,I,v],_=(e,o,r)=>{R(e,o,M,r)},f=(e,o,r)=>{const l=i(o,10,r),t=i(o,103,r),a=i(o,332,r),E=i(o,105,r),y=i(o,334,r);if(!l||!t||!a||!E||!y)return;const s=(E.y+y.y)*.5,d=Math.abs(a.x-t.x),n=Math.max(Math.abs(s-l.y)*.72,d*.08),b=Math.max(0,l.y-n),c=n*.34;e.beginPath(),e.moveTo(t.x,t.y-c),e.quadraticCurveTo((t.x+l.x)*.5,b,l.x,b),e.quadraticCurveTo((a.x+l.x)*.5,b,a.x,a.y-c),e.lineTo(y.x,s),e.quadraticCurveTo(l.x,s+n*.16,E.x,s),e.closePath(),e.fill()},B=(e,o,r)=>{G.forEach(l=>R(e,o,l,r))},i=(e,o,r)=>{const l=e[o];return l?{x:l.x*r,y:l.y*r}:null},R=(e,o,r,l)=>{const t=i(o,r[0],l);if(t){e.beginPath(),e.moveTo(t.x,t.y);for(let a=1;a<r.length;a+=1){const E=i(o,r[a],l);E&&e.lineTo(E.x,E.y)}e.closePath(),e.fill()}},u=(e,o,r=g,l={})=>{e.clearRect(0,0,r,r),o!=null&&o.length&&(e.save(),e.globalCompositeOperation="lighter",e.fillStyle="rgb(0, 0, 255)",_(e,o,r),l.foreheadCoverage&&f(e,o,r),e.restore(),e.save(),e.globalCompositeOperation="lighter",e.filter="blur(8px)",e.fillStyle="rgb(255, 0, 0)",_(e,o,r),l.foreheadCoverage&&f(e,o,r),e.restore(),e.save(),e.globalCompositeOperation="lighter",e.filter="blur(3px)",e.fillStyle="rgb(0, 255, 0)",B(e,o,r),e.restore())};exports.DEFAULT_SEGMENTATION_OVERLAY_SETTINGS=p;exports.FACE_MASK_SIZE=g;exports.FACE_OVAL=M;exports.INNER_MOUTH=N;exports.LEFT_EYE=A;exports.LEFT_EYEBROW=I;exports.OUTER_LIPS=L;exports.RIGHT_EYE=m;exports.RIGHT_EYEBROW=v;exports.SEGMENTATION_OVERLAY_BLEND_MODES=T;exports.SEGMENTATION_OVERLAY_SETTINGS_FIELDS=C;exports.SEMANTIC_MASK_LABELS=O;exports.drawFaceRetouchMask=u;exports.parseOverlayLabels=Y;exports.patchSegmentationOverlaySettings=F;exports.resolveSegmentationOverlaySettings=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("react"),M=require("./index-CfSF8LXa.cjs");function _(n){return JSON.stringify(n??{})}function d(n,i,E=!0){const{session:e}=M.useXRContext(),c=o.useId(),[r,h]=o.useState(null),l=_(i),f=o.useRef(i);f.current=i,o.useEffect(()=>{let y=!1;return h(null),e.registry.acquire(n,c,f.current).catch(t=>{y||h(t instanceof Error?t:new Error(String(t)))}),()=>{y=!0,e.registry.release(n,c)}},[e,n,c,l]),o.useEffect(()=>{e.registry.setActive(n,c,E)},[e,n,c,E]);const u=e.store,s=o.useSyncExternalStore(y=>u.subscribe(y),()=>u.getSnapshot().pipeline.get(n)??null,()=>null),a=o.useMemo(()=>s?s.getModelNode():null,[s]),x=o.useMemo(()=>r?M.mapModelErrorToReason(r):null,[r]);return{ready:s!==null&&r===null,node:a,error:r,fallback:x}}const S={"face.forehead":10,"face.noseTip":1,"face.chin":152,"face.leftEyeOuter":263,"face.rightEyeOuter":33,"face.leftCheek":425,"face.rightCheek":205,"face.mouthCenter":13,"face.leftEarlobe":454,"face.rightEarlobe":234},R={"face.center":[10,152,234,454],"face.leftEye":[263,362,387,373],"face.rightEye":[33,133,158,145]},I=(n,i=0)=>Number.isFinite(n)?n:i,C=n=>Math.max(-1,Math.min(1,I(n))),O={x:0,y:0,z:0},z=(n,i,E=O,e={x:0,y:0,z:0,visibility:0},c=!1)=>{const r=M.feedSidedName(n,c),h=S[r];if(h!==void 0){const t=i[h];return t?Object.assign(e,t):null}const l=R[r];if(l){e.x=0,e.y=0,e.z=0;for(const t of l){const A=i[t];if(!A)return null;e.x+=A.x,e.y+=A.y,e.z+=A.z}return e.x/=l.length,e.y/=l.length,e.z/=l.length,e.visibility=1,e}if(n!=="face.custom"||i.length===0)return null;let f=1/0,u=1/0,s=-1/0,a=-1/0,x=0;for(const t of i)f=Math.min(f,t.x),u=Math.min(u,t.y),s=Math.max(s,t.x),a=Math.max(a,t.y),x+=t.z;const y=s-f;return e.x=(f+s)*.5-M.personLeftSign(c)*C(E.x)*y*.5,e.y=(u+a)*.5-C(E.y)*(a-u)*.5,e.z=x/i.length-I(E.z)*y,e.visibility=1,e},b={left:S["face.leftEyeOuter"],right:S["face.rightEyeOuter"]};exports.FACE_EYE_DISTANCE_LANDMARKS=b;exports.FACE_LANDMARK_INDICES=S;exports.resolveFaceAnchorPoint=z;exports.useXRModel=d;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useId as C, useState as I, useRef as O, useEffect as S, useSyncExternalStore as m, useMemo as d } from "react";
|
|
2
|
+
import { u as z, m as b, f as _, p as R } from "./index-CIe7eCMH.js";
|
|
3
|
+
function F(n) {
|
|
4
|
+
return JSON.stringify(n ?? {});
|
|
5
|
+
}
|
|
6
|
+
function L(n, i, a = !0) {
|
|
7
|
+
const { session: e } = z(), r = C(), [o, h] = I(null), c = F(i), l = O(i);
|
|
8
|
+
l.current = i, S(() => {
|
|
9
|
+
let u = !1;
|
|
10
|
+
return h(null), e.registry.acquire(n, r, l.current).catch((t) => {
|
|
11
|
+
u || h(t instanceof Error ? t : new Error(String(t)));
|
|
12
|
+
}), () => {
|
|
13
|
+
u = !0, e.registry.release(n, r);
|
|
14
|
+
};
|
|
15
|
+
}, [e, n, r, c]), S(() => {
|
|
16
|
+
e.registry.setActive(n, r, a);
|
|
17
|
+
}, [e, n, r, a]);
|
|
18
|
+
const f = e.store, s = m(
|
|
19
|
+
(u) => f.subscribe(u),
|
|
20
|
+
() => f.getSnapshot().pipeline.get(n) ?? null,
|
|
21
|
+
() => null
|
|
22
|
+
), y = d(() => s ? s.getModelNode() : null, [s]), E = d(() => o ? b(o) : null, [o]);
|
|
23
|
+
return {
|
|
24
|
+
ready: s !== null && o === null,
|
|
25
|
+
node: y,
|
|
26
|
+
error: o,
|
|
27
|
+
fallback: E
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const M = {
|
|
31
|
+
"face.forehead": 10,
|
|
32
|
+
"face.noseTip": 1,
|
|
33
|
+
"face.chin": 152,
|
|
34
|
+
"face.leftEyeOuter": 263,
|
|
35
|
+
"face.rightEyeOuter": 33,
|
|
36
|
+
"face.leftCheek": 425,
|
|
37
|
+
"face.rightCheek": 205,
|
|
38
|
+
"face.mouthCenter": 13,
|
|
39
|
+
"face.leftEarlobe": 454,
|
|
40
|
+
"face.rightEarlobe": 234
|
|
41
|
+
}, T = {
|
|
42
|
+
"face.center": [10, 152, 234, 454],
|
|
43
|
+
"face.leftEye": [263, 362, 387, 373],
|
|
44
|
+
"face.rightEye": [33, 133, 158, 145]
|
|
45
|
+
}, A = (n, i = 0) => Number.isFinite(n) ? n : i, p = (n) => Math.max(-1, Math.min(1, A(n))), g = { x: 0, y: 0, z: 0 }, v = (n, i, a = g, e = { x: 0, y: 0, z: 0, visibility: 0 }, r = !1) => {
|
|
46
|
+
const o = _(n, r), h = M[o];
|
|
47
|
+
if (h !== void 0) {
|
|
48
|
+
const t = i[h];
|
|
49
|
+
return t ? Object.assign(e, t) : null;
|
|
50
|
+
}
|
|
51
|
+
const c = T[o];
|
|
52
|
+
if (c) {
|
|
53
|
+
e.x = 0, e.y = 0, e.z = 0;
|
|
54
|
+
for (const t of c) {
|
|
55
|
+
const x = i[t];
|
|
56
|
+
if (!x) return null;
|
|
57
|
+
e.x += x.x, e.y += x.y, e.z += x.z;
|
|
58
|
+
}
|
|
59
|
+
return e.x /= c.length, e.y /= c.length, e.z /= c.length, e.visibility = 1, e;
|
|
60
|
+
}
|
|
61
|
+
if (n !== "face.custom" || i.length === 0) return null;
|
|
62
|
+
let l = 1 / 0, f = 1 / 0, s = -1 / 0, y = -1 / 0, E = 0;
|
|
63
|
+
for (const t of i)
|
|
64
|
+
l = Math.min(l, t.x), f = Math.min(f, t.y), s = Math.max(s, t.x), y = Math.max(y, t.y), E += t.z;
|
|
65
|
+
const u = s - l;
|
|
66
|
+
return e.x = (l + s) * 0.5 - R(r) * p(a.x) * u * 0.5, e.y = (f + y) * 0.5 - p(a.y) * (y - f) * 0.5, e.z = E / i.length - A(a.z) * u, e.visibility = 1, e;
|
|
67
|
+
}, K = {
|
|
68
|
+
left: M["face.leftEyeOuter"],
|
|
69
|
+
right: M["face.rightEyeOuter"]
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
K as F,
|
|
73
|
+
M as a,
|
|
74
|
+
v as r,
|
|
75
|
+
L as u
|
|
76
|
+
};
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var k = (o, e, t) => e in o ? x(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var d = (o, e, t) => k(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { useMemo as g, useCallback as p } from "react";
|
|
5
|
+
import { u as B, r as w, e as T, l as C, g as U, E as _, h as O, j as $ } from "./index-CIe7eCMH.js";
|
|
6
|
+
import { u as L, a as Q } from "./selectors-DmNaKIwE.js";
|
|
7
|
+
import * as u from "three";
|
|
8
|
+
import { p as F } from "./segmentation-Cb3ouK6Z.js";
|
|
9
|
+
const H = (o) => {
|
|
10
|
+
const { session: e } = B(), t = L(), r = Q(), i = JSON.stringify(o ?? null), s = g(
|
|
11
|
+
() => o ? w(o) : r ?? w(),
|
|
12
|
+
[i, r]
|
|
13
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
14
|
+
), n = s.tiers, a = p(
|
|
15
|
+
(l) => {
|
|
16
|
+
const f = e.store.getSnapshot().quality;
|
|
17
|
+
f && e._setQuality(T(f, s, l, performance.now()));
|
|
18
|
+
},
|
|
19
|
+
[e, s]
|
|
20
|
+
), c = p(
|
|
21
|
+
(l) => {
|
|
22
|
+
const f = e.store.getSnapshot().quality;
|
|
23
|
+
f && e._setQuality(C(f, s, l, performance.now()));
|
|
24
|
+
},
|
|
25
|
+
[e, s]
|
|
26
|
+
), h = p(() => {
|
|
27
|
+
const l = e.store.getSnapshot().quality;
|
|
28
|
+
e._setQuality(
|
|
29
|
+
U(s, (l == null ? void 0 : l.signals) ?? _, performance.now())
|
|
30
|
+
);
|
|
31
|
+
}, [e, s]);
|
|
32
|
+
return g(
|
|
33
|
+
() => ({
|
|
34
|
+
tier: (t == null ? void 0 : t.decision.tier) ?? null,
|
|
35
|
+
index: (t == null ? void 0 : t.index) ?? -1,
|
|
36
|
+
tiers: n,
|
|
37
|
+
decision: (t == null ? void 0 : t.decision) ?? null,
|
|
38
|
+
history: (t == null ? void 0 : t.history) ?? [],
|
|
39
|
+
signals: (t == null ? void 0 : t.signals) ?? null,
|
|
40
|
+
locked: (t == null ? void 0 : t.locked) ?? !1,
|
|
41
|
+
setTier: a,
|
|
42
|
+
lock: () => c(!0),
|
|
43
|
+
unlock: () => c(!1),
|
|
44
|
+
reset: h,
|
|
45
|
+
state: t
|
|
46
|
+
}),
|
|
47
|
+
[t, n, a, c, h]
|
|
48
|
+
);
|
|
49
|
+
}, P = 256 * 1024 * 1024;
|
|
50
|
+
class D {
|
|
51
|
+
constructor(e = {}) {
|
|
52
|
+
d(this, "entries", /* @__PURE__ */ new Map());
|
|
53
|
+
d(this, "listeners", /* @__PURE__ */ new Set());
|
|
54
|
+
d(this, "budget");
|
|
55
|
+
d(this, "now");
|
|
56
|
+
d(this, "evictions", 0);
|
|
57
|
+
d(this, "hits", 0);
|
|
58
|
+
d(this, "misses", 0);
|
|
59
|
+
/** Memoised `getStats()` result; cleared on every change so `useSyncExternalStore` sees a stable snapshot. */
|
|
60
|
+
d(this, "statsSnapshot", null);
|
|
61
|
+
this.budget = e.budgetBytes ?? P, this.now = e.now ?? (() => typeof performance < "u" ? performance.now() : Date.now());
|
|
62
|
+
}
|
|
63
|
+
/** Acquire `asset` on behalf of `ownerId`; shares an in-flight or loaded value. */
|
|
64
|
+
acquire(e, t) {
|
|
65
|
+
let r = this.entries.get(e.key);
|
|
66
|
+
if (r && r.status === "error" && (this.entries.delete(e.key), r = void 0), !r) {
|
|
67
|
+
this.misses += 1;
|
|
68
|
+
const i = typeof AbortController < "u" ? new AbortController() : null, s = {
|
|
69
|
+
definition: e,
|
|
70
|
+
status: "loading",
|
|
71
|
+
value: void 0,
|
|
72
|
+
bytes: 0,
|
|
73
|
+
owners: /* @__PURE__ */ new Set([t]),
|
|
74
|
+
promise: null,
|
|
75
|
+
controller: i,
|
|
76
|
+
error: null,
|
|
77
|
+
lastUsed: this.now(),
|
|
78
|
+
disposed: !1
|
|
79
|
+
};
|
|
80
|
+
return s.promise = e.load((i == null ? void 0 : i.signal) ?? new AbortController().signal).then((n) => {
|
|
81
|
+
var a, c;
|
|
82
|
+
if (s.disposed || this.entries.get(e.key) !== s)
|
|
83
|
+
throw (a = e.dispose) == null || a.call(e, n), new Error(`Asset "${e.key}" was released before it loaded`);
|
|
84
|
+
return s.value = n, s.bytes = Math.max(0, Math.round(((c = e.bytes) == null ? void 0 : c.call(e, n)) ?? 0)), s.status = "ready", s.promise = null, this.notify(), this.enforceBudget(), n;
|
|
85
|
+
}).catch((n) => {
|
|
86
|
+
const a = n instanceof Error ? n : new Error(String(n));
|
|
87
|
+
throw this.entries.get(e.key) === s && !s.disposed && (s.status = "error", s.error = a, s.promise = null, this.notify()), a;
|
|
88
|
+
}), this.entries.set(e.key, s), this.notify(), s.promise;
|
|
89
|
+
}
|
|
90
|
+
return this.hits += 1, r.owners.add(t), r.lastUsed = this.now(), this.notify(), r.status === "ready" ? Promise.resolve(r.value) : r.promise;
|
|
91
|
+
}
|
|
92
|
+
/** Start loading without holding a reference (warm the cache). */
|
|
93
|
+
preload(e) {
|
|
94
|
+
const t = "__preload__";
|
|
95
|
+
return this.acquire(e, t).finally(() => this.release(e.key, t));
|
|
96
|
+
}
|
|
97
|
+
/** Drop `ownerId`'s reference. The value stays cached until evicted or disposed. */
|
|
98
|
+
release(e, t) {
|
|
99
|
+
var i;
|
|
100
|
+
const r = this.entries.get(e);
|
|
101
|
+
!r || !r.owners.delete(t) || (r.lastUsed = this.now(), r.owners.size === 0 && r.status === "loading" && ((i = r.controller) == null || i.abort(), r.disposed = !0, this.entries.delete(e)), this.notify(), this.enforceBudget());
|
|
102
|
+
}
|
|
103
|
+
/** Synchronous read of a loaded value (or `undefined`). Does not take a reference. */
|
|
104
|
+
get(e) {
|
|
105
|
+
const t = this.entries.get(e);
|
|
106
|
+
return (t == null ? void 0 : t.status) === "ready" ? t.value : void 0;
|
|
107
|
+
}
|
|
108
|
+
has(e) {
|
|
109
|
+
return this.entries.has(e);
|
|
110
|
+
}
|
|
111
|
+
entry(e) {
|
|
112
|
+
const t = this.entries.get(e);
|
|
113
|
+
return t ? v(e, t) : void 0;
|
|
114
|
+
}
|
|
115
|
+
list() {
|
|
116
|
+
return Array.from(this.entries, ([e, t]) => v(e, t));
|
|
117
|
+
}
|
|
118
|
+
setBudget(e) {
|
|
119
|
+
this.budget = e, this.enforceBudget(), this.notify();
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Dispose unreferenced values, least recently used first, until usage is
|
|
123
|
+
* within the budget (or `bytesToFree` is reclaimed). Referenced values are
|
|
124
|
+
* never touched. Returns the bytes reclaimed.
|
|
125
|
+
*/
|
|
126
|
+
evict(e) {
|
|
127
|
+
const t = e ?? Math.max(0, this.usage() - (Number.isFinite(this.budget) ? this.budget : 1 / 0));
|
|
128
|
+
if (t <= 0) return 0;
|
|
129
|
+
const r = Array.from(this.entries).filter(([, s]) => s.owners.size === 0 && s.status === "ready").sort((s, n) => s[1].lastUsed - n[1].lastUsed);
|
|
130
|
+
let i = 0;
|
|
131
|
+
for (const [s, n] of r) {
|
|
132
|
+
if (i >= t) break;
|
|
133
|
+
i += n.bytes, this.disposeEntry(s, n), this.evictions += 1;
|
|
134
|
+
}
|
|
135
|
+
return i > 0 && this.notify(), i;
|
|
136
|
+
}
|
|
137
|
+
/** Dispose every unreferenced value (route change, scene teardown). Returns the bytes freed. */
|
|
138
|
+
disposeUnreferenced() {
|
|
139
|
+
let e = 0;
|
|
140
|
+
for (const [t, r] of Array.from(this.entries))
|
|
141
|
+
r.owners.size === 0 && (e += r.bytes, this.disposeEntry(t, r));
|
|
142
|
+
return e > 0 && this.notify(), e;
|
|
143
|
+
}
|
|
144
|
+
/** Dispose everything, referenced or not (app / session shutdown). Owners are forgotten. */
|
|
145
|
+
disposeAll() {
|
|
146
|
+
for (const [e, t] of Array.from(this.entries)) this.disposeEntry(e, t);
|
|
147
|
+
this.notify();
|
|
148
|
+
}
|
|
149
|
+
/** Current statistics. The object is reused until the cache changes, so it is safe as a store snapshot. */
|
|
150
|
+
getStats() {
|
|
151
|
+
if (this.statsSnapshot) return this.statsSnapshot;
|
|
152
|
+
let e = 0, t = 0, r = 0, i = 0, s = 0;
|
|
153
|
+
for (const n of this.entries.values())
|
|
154
|
+
n.owners.size > 0 && (e += 1), n.status === "loading" && (t += 1), n.status === "error" && (r += 1), n.status === "ready" && (i += n.bytes, n.owners.size === 0 && (s += n.bytes));
|
|
155
|
+
return this.statsSnapshot = {
|
|
156
|
+
assets: this.entries.size,
|
|
157
|
+
referencedAssets: e,
|
|
158
|
+
loadingAssets: t,
|
|
159
|
+
erroredAssets: r,
|
|
160
|
+
usageBytes: i,
|
|
161
|
+
reclaimableBytes: s,
|
|
162
|
+
budgetBytes: this.budget,
|
|
163
|
+
overBudget: i > this.budget,
|
|
164
|
+
evictions: this.evictions,
|
|
165
|
+
hits: this.hits,
|
|
166
|
+
misses: this.misses
|
|
167
|
+
}, this.statsSnapshot;
|
|
168
|
+
}
|
|
169
|
+
subscribe(e) {
|
|
170
|
+
return this.listeners.add(e), () => {
|
|
171
|
+
this.listeners.delete(e);
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
usage() {
|
|
175
|
+
let e = 0;
|
|
176
|
+
for (const t of this.entries.values()) t.status === "ready" && (e += t.bytes);
|
|
177
|
+
return e;
|
|
178
|
+
}
|
|
179
|
+
enforceBudget() {
|
|
180
|
+
Number.isFinite(this.budget) && this.usage() > this.budget && this.evict();
|
|
181
|
+
}
|
|
182
|
+
disposeEntry(e, t) {
|
|
183
|
+
var r, i, s;
|
|
184
|
+
if (!t.disposed) {
|
|
185
|
+
if (t.disposed = !0, (r = t.controller) == null || r.abort(), t.status === "ready" && t.value !== void 0)
|
|
186
|
+
try {
|
|
187
|
+
(s = (i = t.definition).dispose) == null || s.call(i, t.value);
|
|
188
|
+
} catch (n) {
|
|
189
|
+
console.warn(`[xr-sdk assets] dispose threw for ${e}`, n);
|
|
190
|
+
}
|
|
191
|
+
this.entries.delete(e);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
notify() {
|
|
195
|
+
this.statsSnapshot = null, this.listeners.forEach((e) => e());
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
const v = (o, e) => ({
|
|
199
|
+
key: o,
|
|
200
|
+
status: e.status,
|
|
201
|
+
bytes: e.bytes,
|
|
202
|
+
owners: e.owners.size,
|
|
203
|
+
lastUsed: e.lastUsed,
|
|
204
|
+
error: e.error
|
|
205
|
+
}), R = (o) => new D(o);
|
|
206
|
+
let y;
|
|
207
|
+
const J = () => (y || (y = R()), y), b = (o) => {
|
|
208
|
+
if (!o) return 0;
|
|
209
|
+
const e = o.image;
|
|
210
|
+
if (!e) return 0;
|
|
211
|
+
const t = e.videoWidth || e.width || 0, r = e.videoHeight || e.height || 0;
|
|
212
|
+
if (!t || !r) return 0;
|
|
213
|
+
const i = o.isCompressedTexture, s = i ? 0.5 : o.type === u.FloatType ? 16 : 4, n = t * r * s;
|
|
214
|
+
return Math.round(o.generateMipmaps && !i ? n * 1.3334 : n);
|
|
215
|
+
}, z = (o) => {
|
|
216
|
+
if (!o) return 0;
|
|
217
|
+
let e = 0;
|
|
218
|
+
for (const t of Object.values(o.attributes)) {
|
|
219
|
+
const r = t.array;
|
|
220
|
+
r && (e += r.byteLength);
|
|
221
|
+
}
|
|
222
|
+
return o.index && (e += o.index.array.byteLength), e;
|
|
223
|
+
}, G = [
|
|
224
|
+
"map",
|
|
225
|
+
"alphaMap",
|
|
226
|
+
"aoMap",
|
|
227
|
+
"bumpMap",
|
|
228
|
+
"displacementMap",
|
|
229
|
+
"emissiveMap",
|
|
230
|
+
"envMap",
|
|
231
|
+
"lightMap",
|
|
232
|
+
"metalnessMap",
|
|
233
|
+
"normalMap",
|
|
234
|
+
"roughnessMap",
|
|
235
|
+
"specularMap"
|
|
236
|
+
], E = (o) => {
|
|
237
|
+
const e = [], t = o;
|
|
238
|
+
for (const i of G) {
|
|
239
|
+
const s = t[i];
|
|
240
|
+
s && s.isTexture && e.push(s);
|
|
241
|
+
}
|
|
242
|
+
const r = o.uniforms;
|
|
243
|
+
if (r)
|
|
244
|
+
for (const i of Object.values(r)) {
|
|
245
|
+
const s = i == null ? void 0 : i.value;
|
|
246
|
+
s && s.isTexture && e.push(s);
|
|
247
|
+
}
|
|
248
|
+
return e;
|
|
249
|
+
}, X = (o) => {
|
|
250
|
+
if (!o) return 0;
|
|
251
|
+
const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
|
|
252
|
+
o.traverse((i) => {
|
|
253
|
+
const s = i;
|
|
254
|
+
s.geometry && e.add(s.geometry);
|
|
255
|
+
const n = Array.isArray(s.material) ? s.material : s.material ? [s.material] : [];
|
|
256
|
+
for (const a of n) E(a).forEach((c) => t.add(c));
|
|
257
|
+
});
|
|
258
|
+
let r = 0;
|
|
259
|
+
return e.forEach((i) => {
|
|
260
|
+
r += z(i);
|
|
261
|
+
}), t.forEach((i) => {
|
|
262
|
+
r += b(i);
|
|
263
|
+
}), r;
|
|
264
|
+
}, A = (o) => {
|
|
265
|
+
if (!o) return;
|
|
266
|
+
const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
267
|
+
o.traverse((i) => {
|
|
268
|
+
const s = i;
|
|
269
|
+
s.geometry && e.add(s.geometry);
|
|
270
|
+
const n = Array.isArray(s.material) ? s.material : s.material ? [s.material] : [];
|
|
271
|
+
for (const a of n)
|
|
272
|
+
t.add(a), E(a).forEach((c) => r.add(c));
|
|
273
|
+
}), r.forEach((i) => i.dispose()), t.forEach((i) => i.dispose()), e.forEach((i) => i.dispose()), o.removeFromParent();
|
|
274
|
+
};
|
|
275
|
+
class m extends Error {
|
|
276
|
+
constructor(t, r) {
|
|
277
|
+
super(t);
|
|
278
|
+
/** The underlying error, when there was one. */
|
|
279
|
+
d(this, "cause");
|
|
280
|
+
this.name = "AssetFetchError", this.cause = r;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
const Y = (o) => (o == null ? void 0 : o.name) === "AbortError", S = async (o, e) => {
|
|
284
|
+
try {
|
|
285
|
+
if (O(o)) return await $(o, { signal: e });
|
|
286
|
+
const t = await fetch(o, { signal: e });
|
|
287
|
+
if (!t.ok) throw new m(`Asset fetch failed (${t.status}): ${o}`);
|
|
288
|
+
return await t.arrayBuffer();
|
|
289
|
+
} catch (t) {
|
|
290
|
+
if (t instanceof m || Y(t) || e.aborted) throw t;
|
|
291
|
+
const r = t instanceof Error ? t.message : String(t);
|
|
292
|
+
throw new m(`Asset fetch failed: ${o}: ${r}`, t);
|
|
293
|
+
}
|
|
294
|
+
}, M = (o) => new Promise((e, t) => {
|
|
295
|
+
const r = () => t(new DOMException("Asset load aborted", "AbortError"));
|
|
296
|
+
o.aborted ? r() : o.addEventListener("abort", r, { once: !0 });
|
|
297
|
+
}), K = (o, e = {}) => ({
|
|
298
|
+
key: `texture:${o}${e.variant ? `#${e.variant}` : ""}`,
|
|
299
|
+
load: async (t) => {
|
|
300
|
+
const r = await S(o, t), i = new Blob([r]), s = createImageBitmap(i, {
|
|
301
|
+
imageOrientation: e.flipY === !1 ? "none" : "flipY"
|
|
302
|
+
}), n = await Promise.race([s, M(t)]).catch((c) => {
|
|
303
|
+
throw s.then((h) => h.close()).catch(() => {
|
|
304
|
+
}), c;
|
|
305
|
+
}), a = new u.Texture(n);
|
|
306
|
+
return a.flipY = !1, a.colorSpace = e.colorSpace ?? u.SRGBColorSpace, a.generateMipmaps = e.generateMipmaps ?? !0, a.minFilter = a.generateMipmaps ? u.LinearMipmapLinearFilter : u.LinearFilter, a.needsUpdate = !0, a;
|
|
307
|
+
},
|
|
308
|
+
dispose: (t) => {
|
|
309
|
+
var i;
|
|
310
|
+
const r = t.image;
|
|
311
|
+
t.dispose(), (i = r == null ? void 0 : r.close) == null || i.call(r);
|
|
312
|
+
},
|
|
313
|
+
bytes: b
|
|
314
|
+
}), W = (o) => ({
|
|
315
|
+
key: `gltf:${o}`,
|
|
316
|
+
load: async (e) => {
|
|
317
|
+
const t = await S(o, e), r = o.slice(0, o.lastIndexOf("/") + 1), i = F(t, r, o);
|
|
318
|
+
return Promise.race([i, M(e)]).catch((s) => {
|
|
319
|
+
throw i.then((n) => A(n.scene)).catch(() => {
|
|
320
|
+
}), s;
|
|
321
|
+
});
|
|
322
|
+
},
|
|
323
|
+
dispose: (e) => A(e.scene),
|
|
324
|
+
bytes: (e) => X(e.scene)
|
|
325
|
+
}), Z = (o, e = {}) => ({
|
|
326
|
+
key: `video:${o}`,
|
|
327
|
+
load: (t) => new Promise((r, i) => {
|
|
328
|
+
const s = document.createElement("video");
|
|
329
|
+
s.src = o, s.loop = e.loop ?? !0, s.muted = e.muted ?? !0, s.playsInline = !0, s.crossOrigin = e.crossOrigin ?? "anonymous", s.preload = "auto";
|
|
330
|
+
const n = (a) => {
|
|
331
|
+
s.removeAttribute("src"), s.load(), i(a instanceof Error ? a : new Error(`Video failed to load: ${o}`));
|
|
332
|
+
};
|
|
333
|
+
t.addEventListener(
|
|
334
|
+
"abort",
|
|
335
|
+
() => n(new DOMException("Asset load aborted", "AbortError")),
|
|
336
|
+
{
|
|
337
|
+
once: !0
|
|
338
|
+
}
|
|
339
|
+
), s.onerror = () => n(s.error), s.onloadeddata = () => {
|
|
340
|
+
const a = new u.VideoTexture(s);
|
|
341
|
+
a.colorSpace = u.SRGBColorSpace, r({ video: s, texture: a });
|
|
342
|
+
}, s.load();
|
|
343
|
+
}),
|
|
344
|
+
dispose: ({ video: t, texture: r }) => {
|
|
345
|
+
r.dispose(), t.pause(), t.removeAttribute("src"), t.load();
|
|
346
|
+
},
|
|
347
|
+
bytes: ({ texture: t }) => b(t)
|
|
348
|
+
});
|
|
349
|
+
export {
|
|
350
|
+
m as A,
|
|
351
|
+
P as D,
|
|
352
|
+
D as X,
|
|
353
|
+
K as a,
|
|
354
|
+
Z as b,
|
|
355
|
+
R as c,
|
|
356
|
+
W as d,
|
|
357
|
+
A as e,
|
|
358
|
+
z as f,
|
|
359
|
+
J as g,
|
|
360
|
+
X as h,
|
|
361
|
+
b as i,
|
|
362
|
+
H as u
|
|
363
|
+
};
|