@vincentt-xr/sdk 2.0.0-alpha.0 → 2.0.0-alpha.2
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 +1813 -27
- package/dist/{DebuggerUI-CEfdddkZ.cjs → DebuggerUI-B45_Gb9d.cjs} +1 -1
- package/dist/{DebuggerUI-Dgop6Q6o.js → DebuggerUI-Cq28c18s.js} +1 -1
- package/dist/FaceMeshRenderer-6t8OsQhK.js +1195 -0
- package/dist/FaceMeshRenderer-lQLhYIW-.cjs +155 -0
- package/dist/FaceRetouch-CDrL0pXg.js +551 -0
- package/dist/FaceRetouch-DtNl8-4e.cjs +134 -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/components/Axes/index.d.ts +6 -0
- package/dist/components/FaceMesh/FaceMeshRenderer.d.ts +17 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +22 -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 +9 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +2 -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 +5 -0
- 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 +9 -5
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +47 -0
- package/dist/components/FaceRetouch/index.d.ts +2 -6
- package/dist/components/FaceRetouch/landmarkMask.d.ts +4 -6
- package/dist/components/FaceRetouch/useFaceRetouchMask.d.ts +4 -7
- package/dist/components/FaceTracker/index.d.ts +5 -3
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +15 -0
- package/dist/components/FaceWarp3D/defaults.d.ts +37 -0
- package/dist/components/FaceWarp3D/index.d.ts +3 -0
- package/dist/components/FaceWarp3D/warp.d.ts +13 -0
- package/dist/components/HandJoints2D/index.d.ts +6 -0
- package/dist/components/HandTracker/index.d.ts +2 -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/LightObject/index.d.ts +20 -0
- package/dist/components/LookAt/index.d.ts +23 -0
- package/dist/components/MeshRenderer/index.d.ts +58 -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 +16 -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 +8 -0
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +9 -0
- package/dist/components/ScreenImage/materials/ScreenImageMatcap.d.ts +3 -0
- package/dist/components/ScreenImage/source.d.ts +16 -0
- package/dist/components/ScreenImage/types.d.ts +37 -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 +41 -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 +2 -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/SequentialRenderPasses/index.d.ts +6 -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 +227 -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 +6 -6
- package/dist/components/XRScene/index.d.ts +14 -3
- 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 +19 -0
- package/dist/contexts-BKvTIayr.cjs +1 -0
- package/dist/contexts-Bk5zz_VR.js +214 -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-warp-3d/index.d.ts +6 -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 +29 -0
- package/dist/debug-ui/index.d.ts +46 -0
- package/dist/debug-ui/layer-panel/index.d.ts +18 -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 +9 -0
- package/dist/debug-ui/media-source/session.d.ts +12 -0
- package/dist/debug-ui/media-source.cjs +1 -0
- package/dist/debug-ui/media-source.js +9 -0
- package/dist/debug-ui/mesh-renderer-settings/index.d.ts +6 -0
- package/dist/debug-ui/object-inspector-panel/index.d.ts +25 -0
- package/dist/debug-ui/pin-to-mesh-settings/index.d.ts +10 -0
- package/dist/debug-ui/scene-editor/context.d.ts +38 -0
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +9 -0
- package/dist/debug-ui/scene-editor/index.d.ts +11 -0
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +7 -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 +9 -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 +9 -0
- package/dist/debug-ui/settings-panel/index.d.ts +38 -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/transform-3d-settings/index.d.ts +11 -0
- package/dist/debug-ui.cjs +10 -0
- package/dist/debug-ui.js +8861 -0
- package/dist/drawNormalizedCrop-B-7zU-Xw.cjs +1 -0
- package/dist/drawNormalizedCrop-CRdIDyl1.js +44 -0
- package/dist/entries/all.d.ts +1 -0
- package/dist/entries/core.d.ts +55 -4
- package/dist/entries/face-effects.d.ts +12 -8
- package/dist/entries/internal.d.ts +1 -1
- package/dist/entries/low-level.d.ts +21 -4
- package/dist/entries/scene-object.d.ts +10 -0
- package/dist/entries/tracking.d.ts +25 -2
- package/dist/face-action/index.d.ts +34 -0
- package/dist/face-attribute-expression/index.d.ts +10 -0
- package/dist/face-effects.cjs +1 -252
- package/dist/face-effects.js +1404 -2613
- 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 +21 -0
- package/dist/face-info/types.d.ts +52 -0
- package/dist/getFaceInfo-CyPAKh3h.cjs +1 -0
- package/dist/getFaceInfo-hUKMLFcr.js +118 -0
- package/dist/hand/handJoints2d.d.ts +49 -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/hooks/faceResults.d.ts +1 -1
- 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 +7 -0
- package/dist/hooks/useFaceInfos.d.ts +15 -0
- package/dist/hooks/useFaceResultReader.d.ts +10 -0
- package/dist/hooks/useFrameCapture.d.ts +18 -0
- package/dist/hooks/useMediaRecorder.d.ts +14 -2
- package/dist/hooks/useOwnedTexture.d.ts +6 -0
- package/dist/hooks/useTrackerContext.d.ts +2 -2
- package/dist/hooks/useXRSession/facade.d.ts +3 -0
- package/dist/hooks/useXRSession/registry.d.ts +9 -0
- package/dist/index-82aENaRq.cjs +1 -0
- package/dist/{index-BD-JWMjE.js → index-BgQAX8rs.js} +198 -134
- package/dist/index-CEc1CAmB.cjs +1 -0
- package/dist/index-CTHeBQOs.js +178 -0
- package/dist/index-D4bLzBr6.cjs +1 -0
- package/dist/index-DSpzjuqd.cjs +1 -0
- package/dist/index-Di70KWuY.js +2049 -0
- package/dist/index-DzEzkBIH.cjs +17 -0
- package/dist/{index-CYMj26Ej.js → index-JygePOwo.js} +565 -498
- package/dist/index-UC0Ux38E.js +111 -0
- package/dist/{internal-KOKJDxCG.js → internal-DuMPpcbp.js} +86 -80
- package/dist/internal-i2JkM85N.cjs +1 -0
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +2 -2
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +959 -632
- package/dist/main.cjs +1 -1
- package/dist/main.js +556 -455
- 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/Body/index.d.ts +1 -1
- package/dist/models/Face/index.d.ts +1 -0
- package/dist/models/Face/rotation.d.ts +3 -0
- package/dist/models/Hand/HandTracking.d.ts +2 -0
- package/dist/render/layerStack.d.ts +29 -0
- package/dist/render/renderGroups.d.ts +47 -0
- package/dist/render/renderPasses.d.ts +18 -0
- package/dist/renderGroups-C9QJrAXu.js +152 -0
- package/dist/renderGroups-Dvm1J4lW.cjs +1 -0
- package/dist/renderLayers-lDtL0_43.cjs +1 -0
- package/dist/renderLayers-zrK2pv5O.js +13 -0
- package/dist/renderPasses-CT5iBwtg.cjs +21 -0
- package/dist/renderPasses-CjgG_6kQ.js +1500 -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 +87 -0
- package/dist/screen2d/index.d.ts +7 -0
- package/dist/screen2d/material-runtime.d.ts +32 -0
- package/dist/screen2d/screenTransform.d.ts +47 -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/{selectors-Bub0o3qy.cjs → selectors-2QvO5RYY.cjs} +1 -1
- package/dist/{selectors-BHO6TnoC.js → selectors-Dw3C-gSk.js} +5 -5
- package/dist/services/MetricsCollector/index.d.ts +7 -1
- package/dist/services/MetricsCollector/utils.d.ts +1 -1
- package/dist/session-BChR4TgK.cjs +31 -0
- package/dist/session-C1StwN0f.js +363 -0
- package/dist/texture/animatedTexture.d.ts +61 -0
- package/dist/texture/animationMath.d.ts +8 -0
- package/dist/texture/sourceResolver.d.ts +30 -0
- package/dist/tracking.cjs +1 -1
- package/dist/tracking.js +582 -298
- package/dist/types/face.d.ts +1 -13
- package/dist/types/hand-tracking.d.ts +8 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/nodes.d.ts +4 -1
- package/dist/types/session.d.ts +2 -0
- package/dist/types/tracking.d.ts +8 -2
- package/dist/types/util-types.d.ts +1 -1
- package/dist/useFaceInfo-C-WfMlYp.cjs +1 -0
- package/dist/useFaceInfo-CwsHZedC.js +62 -0
- package/dist/useFaceResults-CkFc1egZ.js +19 -0
- package/dist/useFaceResults-VcFdOUFV.cjs +1 -0
- package/dist/utils/drawNormalizedCrop.d.ts +22 -0
- package/dist/utils/integrity.d.ts +4 -25
- package/dist/utils/landmarkBounds.d.ts +1 -1
- package/dist/utils/logger.d.ts +2 -2
- 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 +1155 -0
- package/docs/api/audio.mdx +36 -0
- package/docs/api/behavior-components.mdx +164 -0
- package/docs/api/capture-recording.mdx +103 -0
- package/docs/api/debug-ui-scene-editor.mdx +249 -0
- package/docs/api/face-actions.mdx +104 -0
- package/docs/api/face-attribute-expression.mdx +87 -0
- package/docs/api/face-binding-anchors.mdx +53 -0
- package/docs/api/face-effects.mdx +19 -0
- package/docs/api/face-info.mdx +112 -0
- package/docs/api/face-mesh.mdx +98 -0
- package/docs/api/face-painting.mdx +33 -0
- package/docs/api/face-retouching.mdx +73 -0
- package/docs/api/material-render-state.mdx +132 -0
- package/docs/api/runtime-3d.mdx +311 -0
- package/docs/api/scene-object-store.mdx +213 -0
- package/docs/api/screen-image.mdx +41 -0
- package/docs/api/screen-shape.mdx +64 -0
- package/docs/api/screen-space-coordinates.mdx +41 -0
- package/docs/api/screen-text.mdx +39 -0
- package/docs/api/texture-sources.mdx +55 -0
- package/docs/api/trackers.mdx +46 -0
- package/docs/docs.json +70 -0
- package/docs/examples/scene-object-recipes.mdx +194 -0
- package/docs/guides/harness-debug-ui.mdx +139 -0
- package/docs/inspector/hierarchy-panel.mdx +51 -0
- package/docs/inspector/object-inspector-panel.mdx +51 -0
- package/docs/introduction.mdx +121 -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 +58 -0
- package/package.json +55 -7
- 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-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/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,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Audio"
|
|
3
|
+
description: "Silent-switch-safe background music, pooled sound effects, preload, and mute controls."
|
|
4
|
+
sidebarTitle: "Audio"
|
|
5
|
+
icon: "volume-2"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Use the core audio API instead of hand-rolling Web Audio or `new Audio()`.
|
|
9
|
+
It starts muted, uses HTML audio for iOS silent-switch behavior, and unlocks on
|
|
10
|
+
the user's unmute tap.
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import {
|
|
14
|
+
playOneShot,
|
|
15
|
+
prefetchMusic,
|
|
16
|
+
registerSound,
|
|
17
|
+
startMusic,
|
|
18
|
+
toggleMuted,
|
|
19
|
+
useMuted,
|
|
20
|
+
} from "@vincentt-xr/sdk";
|
|
21
|
+
|
|
22
|
+
await Promise.all([prefetchMusic(musicUrl), registerSound(hitUrl)]);
|
|
23
|
+
startMusic(musicUrl);
|
|
24
|
+
playOneShot(hitUrl);
|
|
25
|
+
|
|
26
|
+
function SoundToggle() {
|
|
27
|
+
const muted = useMuted();
|
|
28
|
+
return <button onClick={toggleMuted}>{muted ? "Muted" : "Sound on"}</button>;
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Music is one looping element. Sound effects use bounded voice pools and
|
|
33
|
+
per-URL coalescing, so repeated effects in one frame do not multiply playback.
|
|
34
|
+
Preload both during the loading gate. Prefer AAC/M4A assets. Use
|
|
35
|
+
`new AudioEngine()` only when an app genuinely needs an independent second
|
|
36
|
+
mixer; free functions share the default engine.
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "3D Behavior Components"
|
|
3
|
+
description: "LookAt and PinToMesh settings, target resolution, defaults, offsets, and current limitations."
|
|
4
|
+
sidebarTitle: "Behavior Components"
|
|
5
|
+
icon: "move-3d"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Behavior components are serialized scene-object components that affect another
|
|
9
|
+
runtime object. They are currently focused on editor/API prototyping.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { LookAt, PinToMesh } from "@vincentt-xr/sdk";
|
|
13
|
+
import { createDefaultComponent } from "@vincentt-xr/sdk/scene-object";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Target resolution
|
|
17
|
+
|
|
18
|
+
`LookAt` and `PinToMesh` can receive a direct Three.js `Object3D` target, but the
|
|
19
|
+
scene-object runtime path uses serialized target IDs:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
lookAt.settings.targetObjectId = "target-object-id";
|
|
23
|
+
pinToMesh.settings.targetObjectId = "base-plane";
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`SceneObjectRenderer` registers rendered 3D scene objects by ID. Behavior
|
|
27
|
+
components resolve `targetObjectId` against that runtime registry. Keep target
|
|
28
|
+
IDs stable in serialized scene data.
|
|
29
|
+
|
|
30
|
+
## `LookAt`
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
type LookAtSettings = {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
targetObjectId: string | null;
|
|
36
|
+
mode: "point" | "direction";
|
|
37
|
+
inheritChildren: boolean;
|
|
38
|
+
offsetRotation: { x: number; y: number; z: number };
|
|
39
|
+
};
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Default:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
{
|
|
46
|
+
enabled: false,
|
|
47
|
+
targetObjectId: null,
|
|
48
|
+
mode: "point",
|
|
49
|
+
inheritChildren: false,
|
|
50
|
+
offsetRotation: { x: 0, y: 0, z: 0 },
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Usage:
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
<LookAt target={targetObject} settings={lookAtSettings}>
|
|
58
|
+
<MeshRenderer value={meshRendererSettings} />
|
|
59
|
+
</LookAt>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Current scope:
|
|
63
|
+
|
|
64
|
+
- `mode: "point"` aims the child at the target object position.
|
|
65
|
+
- `mode: "direction"` is available as serialized API surface, but axis
|
|
66
|
+
conventions and world-up controls are still minimal.
|
|
67
|
+
- `offsetRotation` is in degrees.
|
|
68
|
+
|
|
69
|
+
## `PinToMesh`
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
type PinToMeshSettings = {
|
|
73
|
+
enabled: boolean;
|
|
74
|
+
targetObjectId: string | null;
|
|
75
|
+
orientation: "none" | "position" | "positionAndDirection";
|
|
76
|
+
uv: { x: number; y: number };
|
|
77
|
+
vertexNormal: boolean;
|
|
78
|
+
offsetSpace: "local" | "world";
|
|
79
|
+
offsetPosition: { x: number; y: number; z: number };
|
|
80
|
+
offsetRotation: { x: number; y: number; z: number };
|
|
81
|
+
};
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Default:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
{
|
|
88
|
+
enabled: false,
|
|
89
|
+
targetObjectId: null,
|
|
90
|
+
orientation: "none",
|
|
91
|
+
uv: { x: 0.5, y: 0.5 },
|
|
92
|
+
vertexNormal: false,
|
|
93
|
+
offsetSpace: "local",
|
|
94
|
+
offsetPosition: { x: 0, y: 0, z: 0 },
|
|
95
|
+
offsetRotation: { x: 0, y: 0, z: 0 },
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Usage:
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
<PinToMesh target={targetObject} settings={pinToMeshSettings}>
|
|
103
|
+
<Transform3D value={transformSettings}>
|
|
104
|
+
<MeshRenderer value={meshRendererSettings} />
|
|
105
|
+
</Transform3D>
|
|
106
|
+
</PinToMesh>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Pin behavior
|
|
110
|
+
|
|
111
|
+
- Pinning is disabled by default.
|
|
112
|
+
- If disabled, the runtime pin wrapper resets to local position `0,0,0` and
|
|
113
|
+
identity rotation.
|
|
114
|
+
- If the target is missing, the runtime pin wrapper also resets.
|
|
115
|
+
- The child `Transform3D` remains the authored transform source of truth.
|
|
116
|
+
- `orientation: "none"` and `orientation: "position"` use an identity pin-wrapper
|
|
117
|
+
rotation.
|
|
118
|
+
- `orientation: "positionAndDirection"` aligns the wrapper to the target surface
|
|
119
|
+
normal before applying offset rotation.
|
|
120
|
+
- `offsetRotation` is reapplied from a clean base every frame and does not
|
|
121
|
+
compound.
|
|
122
|
+
|
|
123
|
+
## Offset fields
|
|
124
|
+
|
|
125
|
+
`offsetPosition` and `offsetRotation` default to zero.
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
pinToMesh.settings.offsetSpace = "local";
|
|
129
|
+
pinToMesh.settings.offsetPosition = { x: 0, y: 0.2, z: 0 };
|
|
130
|
+
pinToMesh.settings.offsetRotation = { x: 0, y: 45, z: 0 };
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
`offsetSpace: "local"` applies position offset after the pin-wrapper orientation.
|
|
134
|
+
`offsetSpace: "world"` applies position offset in scene axes. Rotation offsets
|
|
135
|
+
are degrees.
|
|
136
|
+
|
|
137
|
+
## UV and vertex normal
|
|
138
|
+
|
|
139
|
+
`uv` selects the target mesh surface location. `vertexNormal` changes rotation
|
|
140
|
+
pinning to use interpolated vertex normals when orientation needs direction.
|
|
141
|
+
|
|
142
|
+
Current limitation: UV behavior is not final. Missing UV data falls back to the
|
|
143
|
+
target bounds center instead of surfacing a visible invalid-target state.
|
|
144
|
+
|
|
145
|
+
## Debug UI
|
|
146
|
+
|
|
147
|
+
Use `PinToMeshSettingsPanel` from `@vincentt-xr/sdk/debug-ui`.
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
<PinToMeshSettingsPanel
|
|
151
|
+
value={pinToMeshSettings}
|
|
152
|
+
targets={sceneObjects.map((object) => ({ id: object.id, name: object.name }))}
|
|
153
|
+
onChange={(next) => onComponentChange({ ...pinToMeshComponent, settings: next })}
|
|
154
|
+
/>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Input behavior follows the Transform editor:
|
|
158
|
+
|
|
159
|
+
- visible zero defaults
|
|
160
|
+
- text inputs, not browser number spinners
|
|
161
|
+
- decimal validation
|
|
162
|
+
- arrow step `0.1`
|
|
163
|
+
- Shift arrow step `1`
|
|
164
|
+
- Alt arrow step `0.01`
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Capture and Recording"
|
|
3
|
+
description: "Take XR photos and record, pause, resume, stop, preview, save, or upload canvas video with observable lifecycle state."
|
|
4
|
+
sidebarTitle: "Capture & Recording"
|
|
5
|
+
icon: "camera"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Use `useFrameCapture` for UI and effect logic. It wraps the current XR session
|
|
9
|
+
capture with observable status, result, error, and lifecycle events.
|
|
10
|
+
|
|
11
|
+
Search terms: photo capture, take photo, snapshot, screenshot, frame capture,
|
|
12
|
+
camera capture, video recording, canvas recorder, pause recording, resume
|
|
13
|
+
recording, recording indicator, capture status, recording status, captured
|
|
14
|
+
image, recorded video, and video Blob.
|
|
15
|
+
|
|
16
|
+
## Photo capture: `useFrameCapture`
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { dataURLtoFile, useFrameCapture } from "@vincentt-xr/sdk";
|
|
20
|
+
|
|
21
|
+
const photo = useFrameCapture({
|
|
22
|
+
onCaptureStart: () => console.log("capturing"),
|
|
23
|
+
onCaptureComplete: (dataUrl) => upload(dataURLtoFile(dataUrl, "photo.png")),
|
|
24
|
+
onError: reportError,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
await photo.capturePhoto();
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`CaptureStatus` is `idle | capturing | completed | error`. Call `clear()` to
|
|
31
|
+
return to `idle`. `capturePhoto()` resolves to the captured data URL, or `null`
|
|
32
|
+
after exposing a failure through `status`, `error`, and `onError`. For
|
|
33
|
+
synchronous low-level code, `session.captureFrame()` remains available through
|
|
34
|
+
`useXRContext` from `@vincentt-xr/sdk/low-level`.
|
|
35
|
+
|
|
36
|
+
| Returned field | Meaning |
|
|
37
|
+
| ---------------- | ------------------------------------------------------------ |
|
|
38
|
+
| `status` | `idle`, `capturing`, `completed`, or `error` |
|
|
39
|
+
| `capturePhoto()` | Capture now; resolves to a PNG data URL or `null` on failure |
|
|
40
|
+
| `clear()` | Reset status, data URL, and error |
|
|
41
|
+
| `dataUrl` | Latest captured image for preview, download, or conversion |
|
|
42
|
+
| `error` | Latest normalized capture error |
|
|
43
|
+
|
|
44
|
+
Events are `onCaptureStart`, `onCaptureComplete(dataUrl)`, and
|
|
45
|
+
`onError(error)`. Use `dataURLtoFile(dataUrl, filename)` when upload or sharing
|
|
46
|
+
requires a `File`.
|
|
47
|
+
|
|
48
|
+
## Video recording: `useMediaRecorder`
|
|
49
|
+
|
|
50
|
+
Use `useMediaRecorder` to record a canvas `MediaStream`. It selects the first
|
|
51
|
+
supported MP4 or WebM codec. Pass `audio: true` for microphone audio or provide
|
|
52
|
+
an existing audio stream.
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { useMediaRecorder } from "@vincentt-xr/sdk";
|
|
56
|
+
|
|
57
|
+
const recorder = useMediaRecorder({
|
|
58
|
+
audio: true,
|
|
59
|
+
onRecordingStart: () => console.log("recording"),
|
|
60
|
+
onRecordingPause: () => console.log("paused"),
|
|
61
|
+
onRecordingResume: () => console.log("recording"),
|
|
62
|
+
onRecordingStop: () => console.log("stopping"),
|
|
63
|
+
onRecordingComplete: uploadVideo,
|
|
64
|
+
onError: reportError,
|
|
65
|
+
});
|
|
66
|
+
await recorder.start(canvas.captureStream(30));
|
|
67
|
+
recorder.pause();
|
|
68
|
+
recorder.resume();
|
|
69
|
+
recorder.stop();
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`RecordingStatus` is
|
|
73
|
+
`idle | starting | recording | paused | stopping | completed | error`.
|
|
74
|
+
`isRecording` and `isPaused` remain as convenience booleans. `recordedBlob`
|
|
75
|
+
updates at `completed`; call `clear()` to release tracks and return to `idle`.
|
|
76
|
+
|
|
77
|
+
| Returned field or control | Meaning |
|
|
78
|
+
| --------------------------- | -------------------------------------------------------- |
|
|
79
|
+
| `status` | Single source of truth for the recording lifecycle |
|
|
80
|
+
| `start(stream, timeslice?)` | Start recording a canvas or supplied media stream |
|
|
81
|
+
| `pause()` / `resume()` | Pause or continue the active recorder |
|
|
82
|
+
| `stop()` | Enter `stopping`; completion publishes `recordedBlob` |
|
|
83
|
+
| `clear()` | Stop owned tracks and reset blob, status, and error |
|
|
84
|
+
| `recordedBlob` | Completed MP4/WebM data for preview, download, or upload |
|
|
85
|
+
| `error` | Latest normalized recorder error |
|
|
86
|
+
|
|
87
|
+
Options are `audio`, `mimeType`, `bitsPerSecond`, `onData`,
|
|
88
|
+
`passThroughStream`, `onRecordingStart`, `onRecordingPause`,
|
|
89
|
+
`onRecordingResume`, `onRecordingStop`, `onRecordingComplete`, and `onError`.
|
|
90
|
+
The old `onStop(blob)` callback remains deprecated; use
|
|
91
|
+
`onRecordingComplete(blob)`.
|
|
92
|
+
|
|
93
|
+
For an already composed stream, pass `passThroughStream` when creating the hook
|
|
94
|
+
and call `start()` with no stream argument.
|
|
95
|
+
|
|
96
|
+
Mount capture inside the active XR provider/session. Do not screenshot the DOM;
|
|
97
|
+
the session path uses the current grouped renderer and render order.
|
|
98
|
+
|
|
99
|
+
Use the verified `/capture-recording` example to exercise photo, start, pause,
|
|
100
|
+
resume, stop, completion, error, and clear states against the webcam canvas. It
|
|
101
|
+
shows a prominent recording-state HUD, elapsed recording time, captured-photo
|
|
102
|
+
preview, and recorded-video playback. These controls and states were verified
|
|
103
|
+
with a real webcam on 26 July 2026.
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Debug UI Scene Editor API"
|
|
3
|
+
description: "Reusable debug-ui primitives for temporary 3D scene authoring: provider, viewport, hierarchy, inspector, toolbar, and settings panels."
|
|
4
|
+
sidebarTitle: "Debug UI Scene Editor"
|
|
5
|
+
icon: "panel-right"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Import debug/authoring UI from `@vincentt-xr/sdk/debug-ui`.
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import {
|
|
12
|
+
FaceRetouchSettingsPanel,
|
|
13
|
+
MeshRendererSettingsPanel,
|
|
14
|
+
PinToMeshSettingsPanel,
|
|
15
|
+
SceneHierarchyPanel,
|
|
16
|
+
SceneInspectorPanel,
|
|
17
|
+
Transform3DSettingsSection,
|
|
18
|
+
ViewportToolbar,
|
|
19
|
+
XRSceneEditorProvider,
|
|
20
|
+
XRSceneViewport,
|
|
21
|
+
} from "@vincentt-xr/sdk/debug-ui";
|
|
22
|
+
import {
|
|
23
|
+
replaceSceneComponent,
|
|
24
|
+
replaceSceneObject,
|
|
25
|
+
type SceneComponent,
|
|
26
|
+
type SceneObject,
|
|
27
|
+
} from "@vincentt-xr/sdk/scene-object";
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Debug UI is optional. Use it for temporary client-app scene setup and remove it
|
|
31
|
+
from final preview/runtime surfaces.
|
|
32
|
+
|
|
33
|
+
## In-repo examples
|
|
34
|
+
|
|
35
|
+
- `/viewport-editor`: general 3D scene-object editor.
|
|
36
|
+
- `/unified-architecture`: unified face-tracking scene using
|
|
37
|
+
`XRSceneEditorProvider`, `XRSceneViewport`, hierarchy, inspector, toolbar, and
|
|
38
|
+
media switching.
|
|
39
|
+
- `/testing-hook`: multi-face face mesh setup backed by the same reusable
|
|
40
|
+
editor primitives.
|
|
41
|
+
- `/debugger`: debugger overlay mounted beside a minimal tracked scene.
|
|
42
|
+
|
|
43
|
+
## `XRSceneEditorProvider`
|
|
44
|
+
|
|
45
|
+
Shares editor context across viewport, hierarchy, inspector, and toolbar.
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
const handleComponentChange = (component: SceneComponent) => {
|
|
49
|
+
setStore((current) => replaceSceneComponent(current, component));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const handleObjectChange = (object: SceneObject) => {
|
|
53
|
+
setStore((current) => replaceSceneObject(current, object));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
<XRSceneEditorProvider
|
|
57
|
+
store={store}
|
|
58
|
+
selectedObjectId={selectedObjectId}
|
|
59
|
+
onSelectObject={setSelectedObjectId}
|
|
60
|
+
onStoreChange={setStore}
|
|
61
|
+
onComponentChange={handleComponentChange}
|
|
62
|
+
onObjectChange={handleObjectChange}
|
|
63
|
+
>
|
|
64
|
+
{children}
|
|
65
|
+
</XRSceneEditorProvider>;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Persistent data stays in `SceneObjectStore`. Selection, orbit controls, grid
|
|
69
|
+
visibility, video visibility, and editor camera state are transient editor state.
|
|
70
|
+
|
|
71
|
+
## `XRSceneViewport`
|
|
72
|
+
|
|
73
|
+
Optional viewport renderer.
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<XRSceneViewport
|
|
77
|
+
camera={{ position: { x: 0, y: 0.2, z: 5.5 }, fov: 42 }}
|
|
78
|
+
grid={{ size: 12, divisions: 12, position: { x: 0, y: -2.5, z: 0 } }}
|
|
79
|
+
/>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The viewport renders:
|
|
83
|
+
|
|
84
|
+
- `XRScene`
|
|
85
|
+
- editor-owned camera-texture plane with `depthTest` and `depthWrite`
|
|
86
|
+
- optional editor grid
|
|
87
|
+
- default perspective camera
|
|
88
|
+
- ambient light
|
|
89
|
+
- `SceneObjectRenderer` entries from `createRenderPlan`
|
|
90
|
+
- `SequentialRenderPasses`
|
|
91
|
+
- optional orbit controls
|
|
92
|
+
|
|
93
|
+
The editor-owned video plane is separate from core `VideoBackground`.
|
|
94
|
+
|
|
95
|
+
## `SceneHierarchyPanel`
|
|
96
|
+
|
|
97
|
+
Store-driven wrapper around `HierarchyPanel`.
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
<SceneHierarchyPanel />
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
It reads groups and objects from the editor provider, routes selection through
|
|
104
|
+
`onSelectObject`, and routes visibility changes back to the store. Dragging an
|
|
105
|
+
object onto another object parents it through
|
|
106
|
+
`setSceneObjectParentPreserveWorldTransform`; dragging a nested object back onto
|
|
107
|
+
the render group clears its parent. Drag parenting preserves the child's current
|
|
108
|
+
visual/world transform by recalculating its local Transform for the new parent.
|
|
109
|
+
Pass `rootOnly` to show combined parent objects without exposing their modular
|
|
110
|
+
children, as used by the face-binding rose example.
|
|
111
|
+
|
|
112
|
+
## `SceneInspectorPanel`
|
|
113
|
+
|
|
114
|
+
Store-driven wrapper around `ObjectInspectorPanel`.
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
<SceneInspectorPanel initialPosition={{ x: 980, y: 20 }} />
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
It renders sections for components present on the selected object:
|
|
121
|
+
|
|
122
|
+
- `Transform`
|
|
123
|
+
- `MeshRenderer`
|
|
124
|
+
- `Light`
|
|
125
|
+
- `LookAt`
|
|
126
|
+
- `PinToMesh`
|
|
127
|
+
- `ScreenShape`
|
|
128
|
+
- `TrackingAnchor`
|
|
129
|
+
|
|
130
|
+
All edits route through `onComponentChange` or `onObjectChange`.
|
|
131
|
+
|
|
132
|
+
## `ViewportToolbar`
|
|
133
|
+
|
|
134
|
+
Small optional toolbar for transient viewport controls.
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
<ViewportToolbar position="top-center" />
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Initial control:
|
|
141
|
+
|
|
142
|
+
- Orbit Controls on/off
|
|
143
|
+
|
|
144
|
+
This state is not serialized into `SceneObjectStore`.
|
|
145
|
+
|
|
146
|
+
## `MeshRendererSettingsPanel`
|
|
147
|
+
|
|
148
|
+
Edits `MeshRendererSettings`.
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
const handleMeshRendererChange = (next: MeshRendererSettings) => {
|
|
152
|
+
onComponentChange({ ...meshRendererComponent, settings: next });
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
<MeshRendererSettingsPanel value={meshRendererSettings} onChange={handleMeshRendererChange} />;
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Includes material render-state controls:
|
|
159
|
+
|
|
160
|
+
- Depth Test
|
|
161
|
+
- Depth Write
|
|
162
|
+
- Depth Function
|
|
163
|
+
- Color Write
|
|
164
|
+
- RGBA Color Mask
|
|
165
|
+
- Cull Mode
|
|
166
|
+
- Blend Mode
|
|
167
|
+
- Polygon Offset
|
|
168
|
+
|
|
169
|
+
## `PinToMeshSettingsPanel`
|
|
170
|
+
|
|
171
|
+
Edits `PinToMeshSettings`.
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
const handlePinToMeshChange = (next: PinToMeshSettings) => {
|
|
175
|
+
onComponentChange({ ...pinToMeshComponent, settings: next });
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
<PinToMeshSettingsPanel
|
|
179
|
+
value={pinToMeshSettings}
|
|
180
|
+
targets={[
|
|
181
|
+
{ id: "mic", name: "Mic" },
|
|
182
|
+
{ id: "emoji", name: "Thinking Emoji" },
|
|
183
|
+
]}
|
|
184
|
+
onChange={handlePinToMeshChange}
|
|
185
|
+
/>;
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Input behavior matches the Transform editor:
|
|
189
|
+
|
|
190
|
+
- visible zero defaults
|
|
191
|
+
- text inputs, not browser number spinners
|
|
192
|
+
- decimal validation
|
|
193
|
+
- arrow step `0.1`
|
|
194
|
+
- Shift arrow step `1`
|
|
195
|
+
- Alt arrow step `0.01`
|
|
196
|
+
|
|
197
|
+
## `FaceRetouchSettingsPanel`
|
|
198
|
+
|
|
199
|
+
Thin wrapper around the generic `SettingsPanel` for the legacy
|
|
200
|
+
`FaceRetouchControls` schema.
|
|
201
|
+
|
|
202
|
+
```tsx
|
|
203
|
+
import { FaceRetouchSettingsPanel } from "@vincentt-xr/sdk/debug-ui";
|
|
204
|
+
import {
|
|
205
|
+
patchFaceRetouchControls,
|
|
206
|
+
resolveFaceRetouchControls,
|
|
207
|
+
type FaceRetouchControls,
|
|
208
|
+
} from "@vincentt-xr/sdk/face-effects";
|
|
209
|
+
|
|
210
|
+
const [controls, setControls] = useState(() => resolveFaceRetouchControls());
|
|
211
|
+
|
|
212
|
+
const updateControls = (next: Partial<FaceRetouchControls>) => {
|
|
213
|
+
setControls((current) => patchFaceRetouchControls(current, next));
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
<FaceRetouchSettingsPanel value={controls} onChange={updateControls} />;
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
It owns no retouch defaults itself; labels, ranges, and normalization come from
|
|
220
|
+
`@vincentt-xr/sdk/face-effects`.
|
|
221
|
+
|
|
222
|
+
## Full editor composition
|
|
223
|
+
|
|
224
|
+
```tsx
|
|
225
|
+
const handleComponentChange = (component: SceneComponent) => {
|
|
226
|
+
setStore((current) => replaceSceneComponent(current, component));
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const handleObjectChange = (object: SceneObject) => {
|
|
230
|
+
setStore((current) => replaceSceneObject(current, object));
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
<XRSceneEditorProvider
|
|
234
|
+
store={store}
|
|
235
|
+
selectedObjectId={selectedObjectId}
|
|
236
|
+
onSelectObject={setSelectedObjectId}
|
|
237
|
+
onStoreChange={setStore}
|
|
238
|
+
onComponentChange={handleComponentChange}
|
|
239
|
+
onObjectChange={handleObjectChange}
|
|
240
|
+
>
|
|
241
|
+
<XRSceneViewport />
|
|
242
|
+
<ViewportToolbar />
|
|
243
|
+
<SceneHierarchyPanel />
|
|
244
|
+
<SceneInspectorPanel />
|
|
245
|
+
</XRSceneEditorProvider>;
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Each piece is optional. Client apps can provide their own layout and mount only
|
|
249
|
+
the viewport, only the panels, or only specific settings panels.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Face Actions"
|
|
3
|
+
description: "Semantic blink, brow, mouth, and calibrated head actions derived from FaceInfo."
|
|
4
|
+
sidebarTitle: "Face Actions"
|
|
5
|
+
icon: "face-smile"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Face Actions turn `FaceInfo` pose and blendshapes into stable, typed names. Use
|
|
9
|
+
them instead of guessing MediaPipe strings, pose signs, or thresholds.
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useFrameCapture } from "@vincentt-xr/sdk";
|
|
13
|
+
import { useFaceAction, useFaceInfo } from "@vincentt-xr/sdk/tracking";
|
|
14
|
+
|
|
15
|
+
function BlinkToCapture() {
|
|
16
|
+
const face = useFaceInfo();
|
|
17
|
+
const blink = useFaceAction(face, "eyeBlink");
|
|
18
|
+
const photo = useFrameCapture();
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (blink.justStarted) void photo.capturePhoto();
|
|
22
|
+
}, [blink.justStarted, photo.capturePhoto]);
|
|
23
|
+
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use `getFaceActionValue(face, action)` for continuous animation,
|
|
29
|
+
`hasFaceAction(face, action)` for a simple threshold check, and
|
|
30
|
+
`useFaceAction(face, action)` when start/end edges, hold timing, and hysteresis
|
|
31
|
+
matter.
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
const openness = getFaceActionValue(face, "mouthOpen");
|
|
35
|
+
const isPouting = hasFaceAction(face, "mouthPout");
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Actions
|
|
39
|
+
|
|
40
|
+
| Name | Meaning |
|
|
41
|
+
| ------------------------------- | ---------------------------- |
|
|
42
|
+
| `browRaise` | Either brow is raised |
|
|
43
|
+
| `eyeBlink` | Both eyes blink |
|
|
44
|
+
| `eyeBlinkEither` | Either eye blinks |
|
|
45
|
+
| `eyeBlinkLeft`, `eyeBlinkRight` | Viewer-left/right eye blinks |
|
|
46
|
+
| `mouthOpen` | Jaw opens |
|
|
47
|
+
| `mouthPout` | Lips pucker |
|
|
48
|
+
| `headUp`, `headDown` | Pitch from neutral |
|
|
49
|
+
| `headTurnLeft`, `headTurnRight` | Yaw from neutral |
|
|
50
|
+
| `headTiltLeft`, `headTiltRight` | Roll from neutral |
|
|
51
|
+
|
|
52
|
+
Blendshape values are in `[0, 1]`. Head values are non-negative radians. Up and
|
|
53
|
+
left follow the SDK convention and are positive before they are converted to an
|
|
54
|
+
action magnitude.
|
|
55
|
+
|
|
56
|
+
## Neutral head pose
|
|
57
|
+
|
|
58
|
+
Capture the resting rotation and pass it to head actions when the camera or
|
|
59
|
+
user's neutral posture is not centered:
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
const [neutralRotation, setNeutralRotation] = useState<FaceVector3>();
|
|
63
|
+
const turnLeft = useFaceAction(face, "headTurnLeft", { neutralRotation });
|
|
64
|
+
|
|
65
|
+
// Run from a "Set neutral pose" button while a face is visible.
|
|
66
|
+
setNeutralRotation(face ? { ...face.pose.rotation } : undefined);
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Initial SDK thresholds are `0.45–0.55` for expressions and 10° (`π / 18`) for
|
|
70
|
+
head actions. Head release is 6° (`π / 30`). Expression release is 0.15 below
|
|
71
|
+
its activation threshold. Expression hold is 50 ms and head hold is 80 ms.
|
|
72
|
+
Override `threshold`, `releaseThreshold`, or `holdMs` when an effect needs
|
|
73
|
+
different sensitivity.
|
|
74
|
+
|
|
75
|
+
`useFaceAction` returns `phase: "begin" | "stay" | "end" | "none"` in
|
|
76
|
+
addition to `active`, `justStarted`, `justEnded`, and `value`. For a multi-face
|
|
77
|
+
effect, select the strongest matching face without another tracking reader:
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
const faces = useFaceInfos({ numFaces: 5 });
|
|
81
|
+
const { face, value } = getStrongestFaceAction(faces, "mouthOpen");
|
|
82
|
+
const mouth = useFaceAction(face, "mouthOpen");
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Movement Mapping
|
|
86
|
+
|
|
87
|
+
Use `eyeBlinkLeft`, `eyeBlinkRight`, `eyeBlink`, and `eyeBlinkEither` for the
|
|
88
|
+
left, right, both, and either-eye movement cases. Use `mouthOpen`, `mouthPout`,
|
|
89
|
+
and `browRaise` for the matching physical movements. These actions report
|
|
90
|
+
observable pose/blendshape movement; they do not infer emotion.
|
|
91
|
+
|
|
92
|
+
Left/right blink names use the mirrored viewer-facing convention used by effect
|
|
93
|
+
editors. Raw `FaceInfo.blendshapes` retain MediaPipe's anatomical-side names.
|
|
94
|
+
The lifecycle guarantees one `stay` frame between `begin` and `end`, including
|
|
95
|
+
for a blink that drops below its release threshold on the next input frame.
|
|
96
|
+
|
|
97
|
+
For image-based happy, sad, angry, fear, disgust, surprise, neutral, and unknown
|
|
98
|
+
classification, use the separate `useFaceAttributeExpression` hook. The SDK
|
|
99
|
+
does not fabricate these labels from movement thresholds. The verified
|
|
100
|
+
`/facial-movement-expression` page exposes both independent surfaces.
|
|
101
|
+
|
|
102
|
+
Use `/face-actions` to view every value, calibrate neutral pose, adjust the
|
|
103
|
+
selected action, and repeat the live verification checklist. All actions and
|
|
104
|
+
the default thresholds were verified with the real-camera page on 26 July 2026.
|