@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
package/dist/face-effects.js
CHANGED
|
@@ -1,1415 +1,198 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { l as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
difference: 10,
|
|
22
|
-
exclusion: 11
|
|
23
|
-
}, Ve = /* @__PURE__ */ new Set([
|
|
24
|
-
61,
|
|
25
|
-
146,
|
|
26
|
-
91,
|
|
27
|
-
181,
|
|
28
|
-
84,
|
|
29
|
-
17,
|
|
30
|
-
314,
|
|
31
|
-
405,
|
|
32
|
-
321,
|
|
33
|
-
375,
|
|
34
|
-
291,
|
|
35
|
-
78,
|
|
36
|
-
95,
|
|
37
|
-
88,
|
|
38
|
-
178,
|
|
39
|
-
87,
|
|
40
|
-
14,
|
|
41
|
-
317,
|
|
42
|
-
402,
|
|
43
|
-
318,
|
|
44
|
-
324,
|
|
45
|
-
308,
|
|
46
|
-
191,
|
|
47
|
-
80,
|
|
48
|
-
81,
|
|
49
|
-
82,
|
|
50
|
-
13,
|
|
51
|
-
312,
|
|
52
|
-
311,
|
|
53
|
-
310,
|
|
54
|
-
415
|
|
55
|
-
]), We = /* @__PURE__ */ new Set([
|
|
56
|
-
33,
|
|
57
|
-
7,
|
|
58
|
-
163,
|
|
59
|
-
144,
|
|
60
|
-
145,
|
|
61
|
-
153,
|
|
62
|
-
154,
|
|
63
|
-
155,
|
|
64
|
-
133,
|
|
65
|
-
173,
|
|
66
|
-
157,
|
|
67
|
-
158,
|
|
68
|
-
159,
|
|
69
|
-
160,
|
|
70
|
-
161,
|
|
71
|
-
246
|
|
72
|
-
]), ze = /* @__PURE__ */ new Set([
|
|
73
|
-
362,
|
|
74
|
-
382,
|
|
75
|
-
381,
|
|
76
|
-
380,
|
|
77
|
-
374,
|
|
78
|
-
373,
|
|
79
|
-
390,
|
|
80
|
-
249,
|
|
81
|
-
263,
|
|
82
|
-
466,
|
|
83
|
-
388,
|
|
84
|
-
387,
|
|
85
|
-
386,
|
|
86
|
-
385,
|
|
87
|
-
384,
|
|
88
|
-
398
|
|
89
|
-
]), Xn = /* @__PURE__ */ new Set([814, 815, 816, 817, 818, 819, 830, 831, 832, 833]), Kn = (i, e, t) => {
|
|
90
|
-
const s = Ve.has(i) && Ve.has(e) && Ve.has(t), n = We.has(i) && We.has(e) && We.has(t), r = ze.has(i) && ze.has(e) && ze.has(t);
|
|
91
|
-
return s ? "mouth" : n || r ? "eye" : "base";
|
|
92
|
-
}, Yn = (i) => {
|
|
93
|
-
const e = [], t = [], s = [], n = [], r = [], o = [];
|
|
94
|
-
let c = 0, a = 0;
|
|
95
|
-
i.split(`
|
|
96
|
-
`).forEach((u) => {
|
|
97
|
-
const h = u.trim();
|
|
98
|
-
if (!h) return;
|
|
99
|
-
if (h.startsWith("v ")) {
|
|
100
|
-
c += 1;
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
if (h.startsWith("vt ")) {
|
|
104
|
-
const [, A, m] = h.split(/\s+/);
|
|
105
|
-
r.push([Number(A), Number(m)]);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (!h.startsWith("f ")) return;
|
|
109
|
-
const d = a;
|
|
110
|
-
a += 1;
|
|
111
|
-
const [, ...p] = h.split(/\s+/), g = p.map((A) => {
|
|
112
|
-
const [m, f] = A.split("/"), x = Number(m) - 1, v = Number(f) - 1;
|
|
113
|
-
return v >= 0 && r[v] && !o[x] && (o[x] = r[v]), x;
|
|
114
|
-
});
|
|
115
|
-
if (!(g.length < 3))
|
|
116
|
-
for (let A = 1; A < g.length - 1; A += 1) {
|
|
117
|
-
const m = g[0], f = g[A], x = g[A + 1], v = Kn(m, f, x);
|
|
118
|
-
Xn.has(d) ? n.push(m, f, x) : v === "mouth" ? t.push(m, f, x) : v === "eye" ? s.push(m, f, x) : e.push(m, f, x);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
const l = [];
|
|
122
|
-
for (let u = 0; u < c; u += 1) {
|
|
123
|
-
const [h, d] = o[u] ?? [0, 0];
|
|
124
|
-
l.push(h, d);
|
|
125
|
-
}
|
|
126
|
-
return {
|
|
127
|
-
baseIndices: new Uint16Array(e),
|
|
128
|
-
mouthIndices: new Uint16Array(t),
|
|
129
|
-
eyeIndices: new Uint16Array(s),
|
|
130
|
-
noseIndices: new Uint16Array(n),
|
|
131
|
-
uvs: new Float32Array(l),
|
|
132
|
-
vertexCount: c
|
|
133
|
-
};
|
|
134
|
-
}, Vn = "canonical_face_model.obj", Wn = new TextDecoder("utf-8"), qe = /* @__PURE__ */ new Map(), zn = (i) => {
|
|
135
|
-
const e = qe.get(i);
|
|
136
|
-
if (e) return e;
|
|
137
|
-
const t = Bt(i).then((s) => Yn(Wn.decode(s))).catch((s) => {
|
|
138
|
-
throw qe.delete(i), s;
|
|
139
|
-
});
|
|
140
|
-
return qe.set(i, t), t;
|
|
141
|
-
}, qn = (i) => {
|
|
142
|
-
const { mesh: e, url: t } = i ?? {}, s = t ?? `${Pe.sdkAssetsBaseUrl}/${Vn}`, [n, r] = at(e ?? null);
|
|
143
|
-
return $(() => {
|
|
144
|
-
if (e) {
|
|
145
|
-
r(e);
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
let o = !1;
|
|
149
|
-
return zn(s).then((c) => {
|
|
150
|
-
o || r(c);
|
|
151
|
-
}).catch((c) => {
|
|
152
|
-
o || console.error(`${Pe.loggerPrefix} canonical face mesh load failed`, c);
|
|
153
|
-
}), () => {
|
|
154
|
-
o = !0;
|
|
155
|
-
};
|
|
156
|
-
}, [e, s]), n;
|
|
157
|
-
}, Zn = {
|
|
158
|
-
front: R.FrontSide,
|
|
159
|
-
back: R.BackSide,
|
|
160
|
-
double: R.DoubleSide
|
|
161
|
-
}, Qn = `
|
|
162
|
-
attribute vec2 faceUv;
|
|
163
|
-
varying vec2 vUv;
|
|
164
|
-
varying vec2 vFaceUv;
|
|
165
|
-
varying vec3 vNormal;
|
|
166
|
-
|
|
167
|
-
void main() {
|
|
168
|
-
vUv = uv;
|
|
169
|
-
vFaceUv = faceUv;
|
|
170
|
-
vNormal = normalize(normalMatrix * normal);
|
|
171
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
172
|
-
}
|
|
173
|
-
`, $n = `
|
|
174
|
-
uniform sampler2D cameraTexture;
|
|
175
|
-
uniform sampler2D canonicalTexture;
|
|
176
|
-
uniform sampler2D alphaMask;
|
|
177
|
-
uniform vec3 textureTint;
|
|
178
|
-
uniform float opacity;
|
|
179
|
-
uniform float blendMode;
|
|
180
|
-
uniform float useCanonicalTexture;
|
|
181
|
-
uniform float useAlphaMask;
|
|
182
|
-
uniform float alphaOpacity;
|
|
183
|
-
uniform float compositeShading;
|
|
184
|
-
uniform vec3 lightDirection;
|
|
185
|
-
uniform float ambientStrength;
|
|
186
|
-
uniform float directionalStrength;
|
|
187
|
-
varying vec2 vUv;
|
|
188
|
-
varying vec2 vFaceUv;
|
|
189
|
-
varying vec3 vNormal;
|
|
190
|
-
|
|
191
|
-
vec3 linearToSrgb(vec3 value) {
|
|
192
|
-
vec3 low = value * 12.92;
|
|
193
|
-
vec3 high = 1.055 * pow(max(value, vec3(0.0)), vec3(1.0 / 2.4)) - 0.055;
|
|
194
|
-
return mix(high, low, step(value, vec3(0.0031308)));
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
vec3 srgbToLinear(vec3 value) {
|
|
198
|
-
vec3 low = value / 12.92;
|
|
199
|
-
vec3 high = pow(max((value + 0.055) / 1.055, vec3(0.0)), vec3(2.4));
|
|
200
|
-
return mix(high, low, step(value, vec3(0.04045)));
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
float overlayChannel(float base, float blend) {
|
|
204
|
-
return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
float hardLightChannel(float base, float blend) {
|
|
208
|
-
return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
float softLightChannel(float base, float blend) {
|
|
212
|
-
if (blend <= 0.5) {
|
|
213
|
-
return base - (1.0 - 2.0 * blend) * base * (1.0 - base);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
float d = base <= 0.25
|
|
217
|
-
? ((16.0 * base - 12.0) * base + 4.0) * base
|
|
218
|
-
: sqrt(base);
|
|
219
|
-
|
|
220
|
-
return base + (2.0 * blend - 1.0) * (d - base);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
vec3 applyBlendMode(vec3 base, vec3 blend, float mode) {
|
|
224
|
-
if (mode < 0.5) return blend;
|
|
225
|
-
if (mode < 1.5) return min(base + blend, 1.0);
|
|
226
|
-
if (mode < 2.5) return max(base - blend, 0.0);
|
|
227
|
-
if (mode < 3.5) return base * blend;
|
|
228
|
-
if (mode < 4.5) return 1.0 - (1.0 - base) * (1.0 - blend);
|
|
229
|
-
if (mode < 5.5) {
|
|
230
|
-
return vec3(
|
|
231
|
-
overlayChannel(base.r, blend.r),
|
|
232
|
-
overlayChannel(base.g, blend.g),
|
|
233
|
-
overlayChannel(base.b, blend.b)
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
if (mode < 6.5) {
|
|
237
|
-
return vec3(
|
|
238
|
-
softLightChannel(base.r, blend.r),
|
|
239
|
-
softLightChannel(base.g, blend.g),
|
|
240
|
-
softLightChannel(base.b, blend.b)
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
if (mode < 7.5) {
|
|
244
|
-
return vec3(
|
|
245
|
-
hardLightChannel(base.r, blend.r),
|
|
246
|
-
hardLightChannel(base.g, blend.g),
|
|
247
|
-
hardLightChannel(base.b, blend.b)
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
if (mode < 8.5) return max(base, blend);
|
|
251
|
-
if (mode < 9.5) return min(base, blend);
|
|
252
|
-
if (mode < 10.5) return abs(base - blend);
|
|
253
|
-
return base + blend - 2.0 * base * blend;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
void main() {
|
|
257
|
-
vec3 base = linearToSrgb(texture2D(cameraTexture, vFaceUv).rgb);
|
|
258
|
-
vec4 textureSample = texture2D(canonicalTexture, vUv);
|
|
259
|
-
vec3 blend = linearToSrgb(textureSample.rgb) * textureTint;
|
|
260
|
-
float light = ambientStrength + max(dot(normalize(vNormal), normalize(lightDirection)), 0.0) * directionalStrength;
|
|
261
|
-
blend *= mix(1.0, clamp(light, 0.35, 1.35), compositeShading);
|
|
262
|
-
float maskSample = texture2D(alphaMask, vUv).r;
|
|
263
|
-
float mask = useAlphaMask > 0.5 ? mix(1.0, maskSample, alphaOpacity) : 1.0;
|
|
264
|
-
float textureAlpha = useCanonicalTexture > 0.5 ? textureSample.a : 1.0;
|
|
265
|
-
vec3 color = useCanonicalTexture > 0.5 ? applyBlendMode(base, blend, blendMode) : base;
|
|
266
|
-
gl_FragColor = vec4(srgbToLinear(color), opacity * mask * textureAlpha);
|
|
267
|
-
}
|
|
268
|
-
`, Jn = `
|
|
269
|
-
varying vec2 vUv;
|
|
270
|
-
varying vec3 vNormal;
|
|
271
|
-
|
|
272
|
-
void main() {
|
|
273
|
-
vUv = uv;
|
|
274
|
-
vNormal = normalize(normalMatrix * normal);
|
|
275
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
276
|
-
}
|
|
277
|
-
`, es = `
|
|
278
|
-
uniform vec3 color;
|
|
279
|
-
uniform float opacity;
|
|
280
|
-
varying vec3 vNormal;
|
|
281
|
-
|
|
282
|
-
void main() {
|
|
283
|
-
vec3 normalTint = 0.5 + 0.5 * normalize(vNormal);
|
|
284
|
-
vec3 base = color * mix(vec3(1.0), normalTint, 0.35);
|
|
285
|
-
|
|
286
|
-
gl_FragColor = vec4(base, opacity);
|
|
287
|
-
}
|
|
288
|
-
`, ts = () => {
|
|
289
|
-
const i = new Uint8Array([
|
|
290
|
-
32,
|
|
291
|
-
32,
|
|
292
|
-
32,
|
|
293
|
-
255,
|
|
294
|
-
96,
|
|
295
|
-
96,
|
|
296
|
-
96,
|
|
297
|
-
255,
|
|
298
|
-
176,
|
|
299
|
-
176,
|
|
300
|
-
176,
|
|
301
|
-
255,
|
|
302
|
-
255,
|
|
303
|
-
255,
|
|
304
|
-
255,
|
|
305
|
-
255
|
|
306
|
-
]), e = new R.DataTexture(i, 4, 1, R.RGBAFormat);
|
|
307
|
-
return e.minFilter = R.NearestFilter, e.magFilter = R.NearestFilter, e.generateMipmaps = !1, e.needsUpdate = !0, e;
|
|
308
|
-
}, ns = () => {
|
|
309
|
-
const i = document.createElement("canvas");
|
|
310
|
-
i.width = 256, i.height = 256;
|
|
311
|
-
const e = i.getContext("2d");
|
|
312
|
-
if (!e)
|
|
313
|
-
return new R.CanvasTexture(i);
|
|
314
|
-
const t = e.createRadialGradient(96, 80, 10, 128, 128, 128);
|
|
315
|
-
t.addColorStop(0, "#ffffff"), t.addColorStop(0.18, "#f7d794"), t.addColorStop(0.45, "#d97706"), t.addColorStop(0.72, "#78350f"), t.addColorStop(1, "#120701"), e.fillStyle = t, e.fillRect(0, 0, i.width, i.height);
|
|
316
|
-
const s = new R.CanvasTexture(i);
|
|
317
|
-
return s.needsUpdate = !0, s;
|
|
318
|
-
}, Cr = ({
|
|
319
|
-
faceIndex: i = 0,
|
|
320
|
-
color: e = "#38bdf8",
|
|
321
|
-
opacity: t = 0.45,
|
|
322
|
-
materialType: s = "basic",
|
|
323
|
-
shaderPreset: n = "basicShader",
|
|
324
|
-
textureMap: r = "none",
|
|
325
|
-
alphaMap: o = "none",
|
|
326
|
-
alphaOpacity: c = 0,
|
|
327
|
-
side: a = "front",
|
|
328
|
-
blendMode: l = "normal",
|
|
329
|
-
showMouthMask: u = !0,
|
|
330
|
-
showEyeMask: h = !0,
|
|
331
|
-
showNoseMask: d = !0,
|
|
332
|
-
maskTextureSource: p = "none",
|
|
333
|
-
maskColor: g = "#111111",
|
|
334
|
-
maskOpacity: A = 0,
|
|
335
|
-
faceTextureUrl: m = "",
|
|
336
|
-
faceTextureStyle2Url: f = "",
|
|
337
|
-
faceAlphaMaskUrl: x = "",
|
|
338
|
-
compositeShading: v = !1,
|
|
339
|
-
mesh: b,
|
|
340
|
-
meshUrl: y
|
|
341
|
-
}) => {
|
|
342
|
-
const L = Un(Bn.FACE_TRACKER), _ = Ut(), { camera: D } = kt(), M = qn({ mesh: b, url: y }), P = Ke(R.TextureLoader, m || "/placeholder.png"), re = Ke(
|
|
343
|
-
R.TextureLoader,
|
|
344
|
-
f || m || "/placeholder.png"
|
|
345
|
-
), I = Ke(R.TextureLoader, x || "/placeholder.png"), W = j(() => ts(), []), S = j(() => ns(), []), oe = N(null), z = N(null), q = N(null), ue = N(null), he = N(null), de = N(null), fe = N(null), ie = N(null), ae = N(null), pe = N(null), me = N(null), be = N(null), qt = N(new R.Vector3()), Ee = N(!1), J = Zn[a], ce = {
|
|
346
|
-
side: J,
|
|
347
|
-
transparent: !0,
|
|
348
|
-
opacity: t,
|
|
349
|
-
wireframe: !1
|
|
350
|
-
}, Fe = r === "style2" ? re : P, ge = r !== "none", Re = j(
|
|
351
|
-
() => ({
|
|
352
|
-
color: { value: new R.Color(e) },
|
|
353
|
-
opacity: { value: t }
|
|
354
|
-
}),
|
|
355
|
-
[]
|
|
356
|
-
), F = j(
|
|
357
|
-
() => ({
|
|
358
|
-
cameraTexture: { value: null },
|
|
359
|
-
canonicalTexture: { value: null },
|
|
360
|
-
alphaMask: { value: null },
|
|
361
|
-
textureTint: { value: new R.Color(e) },
|
|
362
|
-
opacity: { value: t },
|
|
363
|
-
blendMode: { value: Tt[l] },
|
|
364
|
-
useCanonicalTexture: { value: ge ? 1 : 0 },
|
|
365
|
-
useAlphaMask: { value: o === "canonical" ? 1 : 0 },
|
|
366
|
-
alphaOpacity: { value: c },
|
|
367
|
-
compositeShading: { value: v ? 1 : 0 },
|
|
368
|
-
lightDirection: { value: new R.Vector3(0.3, 0.65, 0.7).normalize() },
|
|
369
|
-
ambientStrength: { value: 0.78 },
|
|
370
|
-
directionalStrength: { value: 0.38 }
|
|
371
|
-
}),
|
|
372
|
-
[]
|
|
373
|
-
);
|
|
374
|
-
$(() => {
|
|
375
|
-
Re.color.value.set(e), Re.opacity.value = t;
|
|
376
|
-
}, [e, t, Re]), $(() => {
|
|
377
|
-
F.cameraTexture.value = _ ?? P, F.canonicalTexture.value = Fe, F.alphaMask.value = I, F.textureTint.value.set(e), F.opacity.value = t, F.blendMode.value = Tt[l], F.useCanonicalTexture.value = ge ? 1 : 0, F.useAlphaMask.value = o === "canonical" ? 1 : 0, F.alphaOpacity.value = c, F.compositeShading.value = v ? 1 : 0;
|
|
378
|
-
}, [
|
|
379
|
-
o,
|
|
380
|
-
I,
|
|
381
|
-
c,
|
|
382
|
-
l,
|
|
383
|
-
_,
|
|
384
|
-
e,
|
|
385
|
-
v,
|
|
386
|
-
F,
|
|
387
|
-
P,
|
|
388
|
-
ge,
|
|
389
|
-
t,
|
|
390
|
-
Fe,
|
|
391
|
-
r
|
|
392
|
-
]);
|
|
393
|
-
const Me = (C) => {
|
|
394
|
-
if (C)
|
|
395
|
-
return p === "canonical" ? /* @__PURE__ */ T(
|
|
396
|
-
"meshBasicMaterial",
|
|
397
|
-
{
|
|
398
|
-
color: g,
|
|
399
|
-
alphaMap: I,
|
|
400
|
-
transparent: !0,
|
|
401
|
-
opacity: A,
|
|
402
|
-
side: J,
|
|
403
|
-
depthWrite: !1,
|
|
404
|
-
depthTest: !1,
|
|
405
|
-
toneMapped: !1
|
|
406
|
-
},
|
|
407
|
-
"masked-canonical-material"
|
|
408
|
-
) : /* @__PURE__ */ T(
|
|
409
|
-
"meshBasicMaterial",
|
|
410
|
-
{
|
|
411
|
-
color: g,
|
|
412
|
-
transparent: !0,
|
|
413
|
-
opacity: A,
|
|
414
|
-
side: J,
|
|
415
|
-
depthWrite: !1,
|
|
416
|
-
depthTest: !1,
|
|
417
|
-
toneMapped: !1
|
|
418
|
-
},
|
|
419
|
-
"masked-solid-material"
|
|
420
|
-
);
|
|
421
|
-
if (s === "wireframe")
|
|
422
|
-
return /* @__PURE__ */ T(
|
|
423
|
-
"meshBasicMaterial",
|
|
424
|
-
{
|
|
425
|
-
color: e,
|
|
426
|
-
transparent: !0,
|
|
427
|
-
opacity: t,
|
|
428
|
-
side: J,
|
|
429
|
-
depthWrite: !1,
|
|
430
|
-
depthTest: !1,
|
|
431
|
-
wireframe: !0,
|
|
432
|
-
toneMapped: !1
|
|
433
|
-
},
|
|
434
|
-
"wireframe-material"
|
|
435
|
-
);
|
|
436
|
-
if (s === "shader" && _ && (n === "originalFace" || n === "composite" && r === "none"))
|
|
437
|
-
return /* @__PURE__ */ T(
|
|
438
|
-
"meshBasicMaterial",
|
|
439
|
-
{
|
|
440
|
-
map: _,
|
|
441
|
-
alphaMap: I,
|
|
442
|
-
transparent: !0,
|
|
443
|
-
opacity: t,
|
|
444
|
-
side: J,
|
|
445
|
-
depthWrite: !1,
|
|
446
|
-
depthTest: !0,
|
|
447
|
-
toneMapped: !1
|
|
448
|
-
},
|
|
449
|
-
"use-original-face-material"
|
|
450
|
-
);
|
|
451
|
-
if (s === "shader" && n === "composite" && ge && _)
|
|
452
|
-
return /* @__PURE__ */ T(
|
|
453
|
-
"shaderMaterial",
|
|
454
|
-
{
|
|
455
|
-
uniforms: F,
|
|
456
|
-
vertexShader: Qn,
|
|
457
|
-
fragmentShader: $n,
|
|
458
|
-
transparent: !0,
|
|
459
|
-
side: J,
|
|
460
|
-
depthWrite: !1,
|
|
461
|
-
depthTest: !0,
|
|
462
|
-
toneMapped: !1
|
|
463
|
-
},
|
|
464
|
-
"composite-material"
|
|
465
|
-
);
|
|
466
|
-
const k = ge ? Fe : null, B = o === "canonical" && c > 0 ? I : null, U = `${s}-${r}-${o}-${c > 0 ? "alpha-on" : "alpha-off"}`;
|
|
467
|
-
return s === "standard" ? /* @__PURE__ */ T(
|
|
468
|
-
"meshStandardMaterial",
|
|
469
|
-
{
|
|
470
|
-
...ce,
|
|
471
|
-
color: e,
|
|
472
|
-
map: k ?? void 0,
|
|
473
|
-
alphaMap: B ?? void 0,
|
|
474
|
-
depthWrite: !0,
|
|
475
|
-
depthTest: !0,
|
|
476
|
-
metalness: 0.05,
|
|
477
|
-
roughness: 0.72
|
|
478
|
-
},
|
|
479
|
-
U
|
|
480
|
-
) : s === "physical" ? /* @__PURE__ */ T(
|
|
481
|
-
"meshPhysicalMaterial",
|
|
482
|
-
{
|
|
483
|
-
...ce,
|
|
484
|
-
color: e,
|
|
485
|
-
map: k ?? void 0,
|
|
486
|
-
alphaMap: B ?? void 0,
|
|
487
|
-
depthWrite: !0,
|
|
488
|
-
depthTest: !0,
|
|
489
|
-
roughness: 0.58,
|
|
490
|
-
metalness: 0.08,
|
|
491
|
-
clearcoat: 0.35,
|
|
492
|
-
clearcoatRoughness: 0.4
|
|
493
|
-
},
|
|
494
|
-
U
|
|
495
|
-
) : s === "toon" ? /* @__PURE__ */ T(
|
|
496
|
-
"meshToonMaterial",
|
|
497
|
-
{
|
|
498
|
-
...ce,
|
|
499
|
-
color: e,
|
|
500
|
-
map: k ?? void 0,
|
|
501
|
-
alphaMap: B ?? void 0,
|
|
502
|
-
gradientMap: W,
|
|
503
|
-
depthWrite: !0,
|
|
504
|
-
depthTest: !0
|
|
505
|
-
},
|
|
506
|
-
U
|
|
507
|
-
) : s === "normal" ? /* @__PURE__ */ T(
|
|
508
|
-
"meshNormalMaterial",
|
|
509
|
-
{
|
|
510
|
-
...ce,
|
|
511
|
-
depthWrite: !0,
|
|
512
|
-
depthTest: !0,
|
|
513
|
-
flatShading: !1
|
|
514
|
-
},
|
|
515
|
-
"normal-material"
|
|
516
|
-
) : s === "matcap" ? /* @__PURE__ */ T(
|
|
517
|
-
"meshMatcapMaterial",
|
|
518
|
-
{
|
|
519
|
-
...ce,
|
|
520
|
-
color: e,
|
|
521
|
-
matcap: S,
|
|
522
|
-
depthWrite: !0,
|
|
523
|
-
depthTest: !0
|
|
524
|
-
},
|
|
525
|
-
"matcap-material"
|
|
526
|
-
) : s === "shader" ? /* @__PURE__ */ T(
|
|
527
|
-
"shaderMaterial",
|
|
528
|
-
{
|
|
529
|
-
uniforms: Re,
|
|
530
|
-
vertexShader: Jn,
|
|
531
|
-
fragmentShader: es,
|
|
532
|
-
transparent: !0,
|
|
533
|
-
side: J,
|
|
534
|
-
depthWrite: !1,
|
|
535
|
-
depthTest: !0,
|
|
536
|
-
toneMapped: !1
|
|
537
|
-
},
|
|
538
|
-
"generic-shader-material"
|
|
539
|
-
) : /* @__PURE__ */ T(
|
|
540
|
-
"meshBasicMaterial",
|
|
541
|
-
{
|
|
542
|
-
...ce,
|
|
543
|
-
color: e,
|
|
544
|
-
map: k ?? void 0,
|
|
545
|
-
alphaMap: B ?? void 0,
|
|
546
|
-
depthWrite: !1,
|
|
547
|
-
depthTest: r !== "none" || o !== "none",
|
|
548
|
-
toneMapped: !1
|
|
549
|
-
},
|
|
550
|
-
U
|
|
551
|
-
);
|
|
552
|
-
}, Zt = (C) => Gn(C, D, qt.current);
|
|
553
|
-
return kn(() => {
|
|
554
|
-
var ht, dt;
|
|
555
|
-
const C = oe.current, k = z.current, B = q.current, U = ue.current, Oe = he.current, De = de.current, ke = fe.current, Be = ie.current, we = (dt = (ht = L == null ? void 0 : L.detectionResults) == null ? void 0 : ht.faceLandmarks) == null ? void 0 : dt[i];
|
|
556
|
-
if (!M || !C || !k || !B || !U || !Oe || !De || !ke || !Be)
|
|
557
|
-
return;
|
|
558
|
-
if (!we || we.length < M.vertexCount) {
|
|
559
|
-
Oe.visible = !1, De.visible = !1, ke.visible = !1, Be.visible = !1;
|
|
560
|
-
return;
|
|
561
|
-
}
|
|
562
|
-
if (be.current !== M) {
|
|
563
|
-
ae.current = new Float32Array(M.vertexCount * 3), pe.current = new Float32Array(M.uvs), me.current = new Float32Array(M.vertexCount * 2);
|
|
564
|
-
const H = new R.BufferAttribute(ae.current, 3), G = new R.BufferAttribute(pe.current, 2), Z = new R.BufferAttribute(me.current, 2);
|
|
565
|
-
C.setAttribute("position", H), C.setAttribute("uv", G), C.setAttribute("faceUv", Z), C.setIndex(new R.BufferAttribute(M.baseIndices, 1)), k.setAttribute("position", H), k.setAttribute("uv", G), k.setAttribute("faceUv", Z), k.setIndex(new R.BufferAttribute(M.mouthIndices, 1)), B.setAttribute("position", H), B.setAttribute("uv", G), B.setAttribute("faceUv", Z), B.setIndex(new R.BufferAttribute(M.eyeIndices, 1)), U.setAttribute("position", H), U.setAttribute("uv", G), U.setAttribute("faceUv", Z), U.setIndex(new R.BufferAttribute(M.noseIndices, 1)), G.needsUpdate = !0, be.current = M, Ee.current = !1;
|
|
566
|
-
}
|
|
567
|
-
const Se = ae.current, Ue = me.current, ye = pe.current;
|
|
568
|
-
if (!Se || !Ue || !ye) return;
|
|
569
|
-
const ut = s === "shader" && (n === "originalFace" || n === "composite" && r === "none"), Qt = Math.min(we.length, M.vertexCount);
|
|
570
|
-
for (let H = 0; H < Qt; H++) {
|
|
571
|
-
const G = we[H], Z = H * 3, _e = H * 2, Ge = Zt(G);
|
|
572
|
-
Se[Z] = Ge.x, Se[Z + 1] = Ge.y, Se[Z + 2] = Ge.z, Ue[_e] = G.x, Ue[_e + 1] = 1 - G.y, ut && (ye[_e] = G.x, ye[_e + 1] = 1 - G.y);
|
|
573
|
-
}
|
|
574
|
-
ut ? (C.attributes.uv.needsUpdate = !0, Ee.current = !0) : Ee.current && (ye.set(M.uvs), C.attributes.uv.needsUpdate = !0, Ee.current = !1), Oe.visible = !0, De.visible = !0, ke.visible = !0, Be.visible = !0, C.attributes.position.needsUpdate = !0, C.attributes.faceUv.needsUpdate = !0, C.computeVertexNormals(), k.computeVertexNormals(), B.computeVertexNormals(), U.computeVertexNormals();
|
|
575
|
-
}), /* @__PURE__ */ w(rt, { children: [
|
|
576
|
-
/* @__PURE__ */ w("mesh", { ref: he, renderOrder: 10, frustumCulled: !1, children: [
|
|
577
|
-
/* @__PURE__ */ T("bufferGeometry", { ref: oe }),
|
|
578
|
-
Me(!1)
|
|
579
|
-
] }),
|
|
580
|
-
/* @__PURE__ */ w("mesh", { ref: de, renderOrder: 12, frustumCulled: !1, children: [
|
|
581
|
-
/* @__PURE__ */ T("bufferGeometry", { ref: z }),
|
|
582
|
-
Me(u)
|
|
583
|
-
] }),
|
|
584
|
-
/* @__PURE__ */ w("mesh", { ref: fe, renderOrder: 12, frustumCulled: !1, children: [
|
|
585
|
-
/* @__PURE__ */ T("bufferGeometry", { ref: q }),
|
|
586
|
-
Me(h)
|
|
587
|
-
] }),
|
|
588
|
-
/* @__PURE__ */ w("mesh", { ref: ie, renderOrder: 12, frustumCulled: !1, children: [
|
|
589
|
-
/* @__PURE__ */ T("bufferGeometry", { ref: ue }),
|
|
590
|
-
Me(d)
|
|
591
|
-
] })
|
|
592
|
-
] });
|
|
593
|
-
}, Nr = {
|
|
594
|
-
materialType: "basic",
|
|
595
|
-
shaderPreset: "basicShader",
|
|
596
|
-
textureMap: "none",
|
|
597
|
-
alphaMap: "none",
|
|
598
|
-
alphaOpacity: 1,
|
|
599
|
-
side: "front",
|
|
600
|
-
blendMode: "normal",
|
|
601
|
-
baseColor: "#38bdf8",
|
|
602
|
-
opacity: 0.45
|
|
603
|
-
}, Pr = {
|
|
604
|
-
mouth: !0,
|
|
605
|
-
eyes: !0,
|
|
606
|
-
nose: !0
|
|
607
|
-
}, Fr = [
|
|
608
|
-
{ label: "Wireframe", value: "wireframe" },
|
|
609
|
-
{ label: "Basic", value: "basic" },
|
|
610
|
-
{ label: "Standard", value: "standard" },
|
|
611
|
-
{ label: "Physical", value: "physical" },
|
|
612
|
-
{ label: "Toon", value: "toon" },
|
|
613
|
-
{ label: "Normal", value: "normal" },
|
|
614
|
-
{ label: "Matcap", value: "matcap" },
|
|
615
|
-
{ label: "Shader", value: "shader" }
|
|
616
|
-
], Or = [
|
|
617
|
-
{ label: "Basic Shader", value: "basicShader" },
|
|
618
|
-
{ label: "Original Face", value: "originalFace" },
|
|
619
|
-
{ label: "Composite", value: "composite" }
|
|
620
|
-
], Dr = [
|
|
621
|
-
{ label: "Front", value: "front" },
|
|
622
|
-
{ label: "Back", value: "back" },
|
|
623
|
-
{ label: "Double", value: "double" }
|
|
624
|
-
], kr = [
|
|
625
|
-
{ label: "None", value: "none" },
|
|
626
|
-
{ label: "UV Map 1", value: "canonical" },
|
|
627
|
-
{ label: "UV Map 2", value: "style2" }
|
|
628
|
-
], Br = [
|
|
629
|
-
{ label: "None", value: "none" },
|
|
630
|
-
{ label: "Default Mask", value: "canonical" }
|
|
631
|
-
], Ur = [
|
|
632
|
-
{ label: "Normal", value: "normal" },
|
|
633
|
-
{ label: "Add", value: "add" },
|
|
634
|
-
{ label: "Subtract", value: "subtract" },
|
|
635
|
-
{ label: "Multiply", value: "multiply" },
|
|
636
|
-
{ label: "Screen", value: "screen" },
|
|
637
|
-
{ label: "Overlay", value: "overlay" },
|
|
638
|
-
{ label: "Soft Light", value: "softLight" },
|
|
639
|
-
{ label: "Hard Light", value: "hardLight" },
|
|
640
|
-
{ label: "Lighten", value: "lighten" },
|
|
641
|
-
{ label: "Darken", value: "darken" },
|
|
642
|
-
{ label: "Difference", value: "difference" },
|
|
643
|
-
{ label: "Exclusion", value: "exclusion" }
|
|
644
|
-
], Gr = (i, e) => i === "basic" || i === "standard" || i === "physical" || i === "toon" || i === "shader" && e === "composite", Hr = (i, e) => i === "shader" && e === "composite", ss = `
|
|
645
|
-
varying vec2 vUv;
|
|
646
|
-
|
|
647
|
-
void main() {
|
|
648
|
-
vUv = uv;
|
|
649
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
650
|
-
}
|
|
651
|
-
`, rs = `
|
|
652
|
-
uniform sampler2D cameraTexture;
|
|
653
|
-
uniform sampler2D retouchMaskTexture;
|
|
654
|
-
uniform sampler2D mouthMaskTexture;
|
|
655
|
-
uniform vec2 texelSize;
|
|
656
|
-
uniform float retouchAmount;
|
|
657
|
-
uniform float blurRadius;
|
|
658
|
-
uniform float teethWhitening;
|
|
659
|
-
uniform float previewMask;
|
|
660
|
-
uniform float protectLandmarks;
|
|
661
|
-
varying vec2 vUv;
|
|
662
|
-
|
|
663
|
-
vec3 sampleCamera(vec2 uv) {
|
|
664
|
-
return texture2D(cameraTexture, clamp(uv, vec2(0.0), vec2(1.0))).rgb;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
vec3 readRetouchMask(vec2 uv) {
|
|
668
|
-
vec4 mask = texture2D(retouchMaskTexture, uv);
|
|
669
|
-
float faceRegion = clamp(mask.b, 0.0, 1.0);
|
|
670
|
-
float softFaceRegion = min(mask.r, faceRegion);
|
|
671
|
-
float protectedRegion = min(mask.g, faceRegion) * protectLandmarks;
|
|
672
|
-
float hardProtectedRegion = step(0.08, protectedRegion);
|
|
673
|
-
float softRetouchRegion = softFaceRegion * (1.0 - protectedRegion);
|
|
674
|
-
float hardRetouchRegion = step(0.5, faceRegion) * (1.0 - hardProtectedRegion);
|
|
675
|
-
|
|
676
|
-
return vec3(
|
|
677
|
-
clamp(softRetouchRegion, 0.0, 1.0),
|
|
678
|
-
clamp(protectedRegion, 0.0, 1.0),
|
|
679
|
-
clamp(hardRetouchRegion, 0.0, 1.0)
|
|
680
|
-
);
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
float readMouthMask(vec2 uv) {
|
|
684
|
-
return clamp(texture2D(mouthMaskTexture, uv).r, 0.0, 1.0);
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
float retouchCoverage(vec2 uv) {
|
|
688
|
-
return step(0.001, readRetouchMask(uv).x);
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
void addMaskedBlurSample(inout vec3 color, inout float weightSum, vec2 centerUv, vec2 sampleUv, float weight) {
|
|
692
|
-
float coverage = retouchCoverage(sampleUv);
|
|
693
|
-
vec3 sampleColor = mix(sampleCamera(centerUv), sampleCamera(sampleUv), coverage);
|
|
694
|
-
color += sampleColor * weight;
|
|
695
|
-
weightSum += weight;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
vec3 maskedBlurCamera(vec2 uv, float radius) {
|
|
699
|
-
vec2 r = texelSize * radius;
|
|
700
|
-
vec3 color = sampleCamera(uv) * 0.2;
|
|
701
|
-
float weightSum = 0.2;
|
|
702
|
-
|
|
703
|
-
addMaskedBlurSample(color, weightSum, uv, uv + vec2(r.x, 0.0), 0.1);
|
|
704
|
-
addMaskedBlurSample(color, weightSum, uv, uv - vec2(r.x, 0.0), 0.1);
|
|
705
|
-
addMaskedBlurSample(color, weightSum, uv, uv + vec2(0.0, r.y), 0.1);
|
|
706
|
-
addMaskedBlurSample(color, weightSum, uv, uv - vec2(0.0, r.y), 0.1);
|
|
707
|
-
addMaskedBlurSample(color, weightSum, uv, uv + r, 0.075);
|
|
708
|
-
addMaskedBlurSample(color, weightSum, uv, uv - r, 0.075);
|
|
709
|
-
addMaskedBlurSample(color, weightSum, uv, uv + vec2(r.x, -r.y), 0.075);
|
|
710
|
-
addMaskedBlurSample(color, weightSum, uv, uv + vec2(-r.x, r.y), 0.075);
|
|
711
|
-
addMaskedBlurSample(color, weightSum, uv, uv + r * 2.0, 0.05);
|
|
712
|
-
addMaskedBlurSample(color, weightSum, uv, uv - r * 2.0, 0.05);
|
|
713
|
-
|
|
714
|
-
return color / max(weightSum, 0.001);
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
vec3 whitenTeeth(vec3 color, float amount, float mouthRegion) {
|
|
718
|
-
float maxChannel = max(max(color.r, color.g), color.b);
|
|
719
|
-
float minChannel = min(min(color.r, color.g), color.b);
|
|
720
|
-
float saturation = maxChannel - minChannel;
|
|
721
|
-
float brightness = dot(color, vec3(0.299, 0.587, 0.114));
|
|
722
|
-
float redness = max(color.r - max(color.g, color.b), 0.0);
|
|
723
|
-
float greenBlueBalance = 1.0 - smoothstep(0.08, 0.24, abs(color.g - color.b));
|
|
724
|
-
float candidate =
|
|
725
|
-
smoothstep(0.34, 0.62, brightness) *
|
|
726
|
-
(1.0 - smoothstep(0.14, 0.32, redness)) *
|
|
727
|
-
(1.0 - smoothstep(0.18, 0.42, saturation)) *
|
|
728
|
-
greenBlueBalance;
|
|
729
|
-
float whiteningMask = clamp(mouthRegion * candidate, 0.0, 1.0);
|
|
730
|
-
vec3 desaturated = mix(color, vec3(brightness), 0.42);
|
|
731
|
-
vec3 brightened = min(desaturated + vec3(0.16), vec3(1.0));
|
|
732
|
-
|
|
733
|
-
return mix(color, brightened, clamp(amount * whiteningMask * 0.38, 0.0, 1.0));
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
void main() {
|
|
737
|
-
vec3 original = sampleCamera(vUv);
|
|
738
|
-
vec3 masks = readRetouchMask(vUv);
|
|
739
|
-
float mouthMask = readMouthMask(vUv);
|
|
740
|
-
|
|
741
|
-
if (previewMask > 0.5) {
|
|
742
|
-
float sharpPreview = 1.0 - step(0.001, retouchAmount + blurRadius);
|
|
743
|
-
float retouchPreview = mix(masks.x, masks.z, sharpPreview);
|
|
744
|
-
float protectedPreview = mix(masks.y, step(0.08, masks.y), sharpPreview);
|
|
745
|
-
float whiteningPreview = mouthMask * teethWhitening;
|
|
746
|
-
vec3 facePreview = vec3(retouchPreview, 0.08, 0.08);
|
|
747
|
-
vec3 featurePreview = vec3(0.05, protectedPreview, 0.1);
|
|
748
|
-
vec3 whiteningMaskPreview = vec3(whiteningPreview, whiteningPreview, 0.05);
|
|
749
|
-
vec3 maskPreview = max(max(facePreview, featurePreview), whiteningMaskPreview);
|
|
750
|
-
vec3 debugColor = mix(original * 0.18, maskPreview, max(max(retouchPreview, protectedPreview), whiteningPreview));
|
|
751
|
-
gl_FragColor = vec4(debugColor, 1.0);
|
|
752
|
-
#include <colorspace_fragment>
|
|
753
|
-
return;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
float effectiveBlurRadius = min(blurRadius, 7.0);
|
|
757
|
-
vec3 smallBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius * 0.45));
|
|
758
|
-
vec3 largeBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius));
|
|
759
|
-
vec3 detail = original - smallBlur;
|
|
760
|
-
float detailAmount = mix(0.5, 0.9, masks.y);
|
|
761
|
-
vec3 smoothed = clamp(largeBlur + detail * detailAmount, 0.0, 1.0);
|
|
762
|
-
vec3 color = mix(original, smoothed, min(retouchAmount, 0.72) * masks.x);
|
|
763
|
-
color = whitenTeeth(color, teethWhitening, mouthMask);
|
|
764
|
-
gl_FragColor = vec4(color, 1.0);
|
|
765
|
-
#include <colorspace_fragment>
|
|
766
|
-
}
|
|
767
|
-
`, jr = ({
|
|
768
|
-
retouchMask: i,
|
|
769
|
-
mouthMask: e,
|
|
770
|
-
retouchAmount: t,
|
|
771
|
-
blurRadius: s,
|
|
772
|
-
teethWhitening: n,
|
|
773
|
-
previewMask: r,
|
|
774
|
-
protectLandmarks: o
|
|
775
|
-
}) => {
|
|
776
|
-
const { camera: c, size: a } = kt(), l = Ut(), u = j(
|
|
777
|
-
() => ({
|
|
778
|
-
cameraTexture: { value: null },
|
|
779
|
-
retouchMaskTexture: { value: i },
|
|
780
|
-
mouthMaskTexture: { value: e },
|
|
781
|
-
texelSize: { value: new R.Vector2(1 / 1280, 1 / 720) },
|
|
782
|
-
retouchAmount: { value: t },
|
|
783
|
-
blurRadius: { value: s },
|
|
784
|
-
teethWhitening: { value: n },
|
|
785
|
-
previewMask: { value: 0 },
|
|
786
|
-
protectLandmarks: { value: 1 }
|
|
787
|
-
}),
|
|
788
|
-
[e, i]
|
|
789
|
-
), h = j(() => {
|
|
790
|
-
if (!(c instanceof R.PerspectiveCamera))
|
|
791
|
-
return [10, 10];
|
|
792
|
-
const g = (c.position.z || 5) - -1, A = R.MathUtils.degToRad(c.fov), m = 2 * Math.tan(A / 2) * g;
|
|
793
|
-
return [m * (a.width / a.height), m];
|
|
794
|
-
}, [c, a]);
|
|
795
|
-
return $(() => {
|
|
796
|
-
u.cameraTexture.value = l ?? null, u.retouchMaskTexture.value = i, u.mouthMaskTexture.value = e, u.texelSize.value.set(1 / Math.max(a.width, 1), 1 / Math.max(a.height, 1)), u.retouchAmount.value = t, u.blurRadius.value = s, u.teethWhitening.value = n, u.previewMask.value = r ? 1 : 0, u.protectLandmarks.value = o ? 1 : 0;
|
|
797
|
-
}, [
|
|
798
|
-
s,
|
|
799
|
-
l,
|
|
800
|
-
r,
|
|
801
|
-
o,
|
|
802
|
-
t,
|
|
803
|
-
e,
|
|
804
|
-
i,
|
|
805
|
-
n,
|
|
806
|
-
a.height,
|
|
807
|
-
a.width,
|
|
808
|
-
u
|
|
809
|
-
]), l ? /* @__PURE__ */ T("group", { position: [0, 0, -1], children: /* @__PURE__ */ w("mesh", { renderOrder: -1e3, children: [
|
|
810
|
-
/* @__PURE__ */ T("planeGeometry", { args: h }),
|
|
811
|
-
/* @__PURE__ */ T(
|
|
812
|
-
"shaderMaterial",
|
|
813
|
-
{
|
|
814
|
-
uniforms: u,
|
|
815
|
-
vertexShader: ss,
|
|
816
|
-
fragmentShader: rs,
|
|
817
|
-
depthTest: !1,
|
|
818
|
-
depthWrite: !1,
|
|
819
|
-
toneMapped: !1
|
|
820
|
-
}
|
|
821
|
-
)
|
|
822
|
-
] }) }) : null;
|
|
823
|
-
}, ct = 512, Gt = [
|
|
824
|
-
10,
|
|
825
|
-
338,
|
|
826
|
-
297,
|
|
827
|
-
332,
|
|
828
|
-
284,
|
|
829
|
-
251,
|
|
830
|
-
389,
|
|
831
|
-
356,
|
|
832
|
-
454,
|
|
833
|
-
323,
|
|
834
|
-
361,
|
|
835
|
-
288,
|
|
836
|
-
397,
|
|
837
|
-
365,
|
|
838
|
-
379,
|
|
839
|
-
378,
|
|
840
|
-
400,
|
|
841
|
-
377,
|
|
842
|
-
152,
|
|
843
|
-
148,
|
|
844
|
-
176,
|
|
845
|
-
149,
|
|
846
|
-
150,
|
|
847
|
-
136,
|
|
848
|
-
172,
|
|
849
|
-
58,
|
|
850
|
-
132,
|
|
851
|
-
93,
|
|
852
|
-
234,
|
|
853
|
-
127,
|
|
854
|
-
162,
|
|
855
|
-
21,
|
|
856
|
-
54,
|
|
857
|
-
103,
|
|
858
|
-
67,
|
|
859
|
-
109
|
|
860
|
-
], os = [
|
|
861
|
-
33,
|
|
862
|
-
246,
|
|
863
|
-
161,
|
|
864
|
-
160,
|
|
865
|
-
159,
|
|
866
|
-
158,
|
|
867
|
-
157,
|
|
868
|
-
173,
|
|
869
|
-
133,
|
|
870
|
-
155,
|
|
871
|
-
154,
|
|
872
|
-
153,
|
|
873
|
-
145,
|
|
874
|
-
144,
|
|
875
|
-
163,
|
|
876
|
-
7
|
|
877
|
-
], is = [
|
|
878
|
-
362,
|
|
879
|
-
398,
|
|
880
|
-
384,
|
|
881
|
-
385,
|
|
882
|
-
386,
|
|
883
|
-
387,
|
|
884
|
-
388,
|
|
885
|
-
466,
|
|
886
|
-
263,
|
|
887
|
-
249,
|
|
888
|
-
390,
|
|
889
|
-
373,
|
|
890
|
-
374,
|
|
891
|
-
380,
|
|
892
|
-
381,
|
|
893
|
-
382
|
|
894
|
-
], as = [
|
|
895
|
-
61,
|
|
896
|
-
146,
|
|
897
|
-
91,
|
|
898
|
-
181,
|
|
899
|
-
84,
|
|
900
|
-
17,
|
|
901
|
-
314,
|
|
902
|
-
405,
|
|
903
|
-
321,
|
|
904
|
-
375,
|
|
905
|
-
291,
|
|
906
|
-
409,
|
|
907
|
-
270,
|
|
908
|
-
269,
|
|
909
|
-
267,
|
|
910
|
-
0,
|
|
911
|
-
37,
|
|
912
|
-
39,
|
|
913
|
-
40,
|
|
914
|
-
185
|
|
915
|
-
], Ht = [
|
|
916
|
-
78,
|
|
917
|
-
95,
|
|
918
|
-
88,
|
|
919
|
-
178,
|
|
920
|
-
87,
|
|
921
|
-
14,
|
|
922
|
-
317,
|
|
923
|
-
402,
|
|
924
|
-
318,
|
|
925
|
-
324,
|
|
926
|
-
308,
|
|
927
|
-
415,
|
|
928
|
-
310,
|
|
929
|
-
311,
|
|
930
|
-
312,
|
|
931
|
-
13,
|
|
932
|
-
82,
|
|
933
|
-
81,
|
|
934
|
-
80,
|
|
935
|
-
191
|
|
936
|
-
], cs = [70, 63, 105, 66, 107, 55, 65, 52, 53, 46], ls = [336, 296, 334, 293, 300, 276, 283, 282, 295, 285], us = [
|
|
937
|
-
os,
|
|
938
|
-
is,
|
|
939
|
-
as,
|
|
940
|
-
Ht,
|
|
941
|
-
cs,
|
|
942
|
-
ls
|
|
943
|
-
], xt = (i, e, t) => {
|
|
944
|
-
lt(i, e, Gt, t);
|
|
945
|
-
}, hs = (i, e, t) => {
|
|
946
|
-
us.forEach((s) => lt(i, e, s, t));
|
|
947
|
-
}, vt = (i, e, t) => {
|
|
948
|
-
const s = i[e];
|
|
949
|
-
return s ? {
|
|
950
|
-
x: s.x * t,
|
|
951
|
-
y: s.y * t
|
|
952
|
-
} : null;
|
|
953
|
-
}, lt = (i, e, t, s) => {
|
|
954
|
-
const n = vt(e, t[0], s);
|
|
955
|
-
if (n) {
|
|
956
|
-
i.beginPath(), i.moveTo(n.x, n.y);
|
|
957
|
-
for (let r = 1; r < t.length; r += 1) {
|
|
958
|
-
const o = vt(e, t[r], s);
|
|
959
|
-
o && i.lineTo(o.x, o.y);
|
|
960
|
-
}
|
|
961
|
-
i.closePath(), i.fill();
|
|
962
|
-
}
|
|
963
|
-
}, ds = (i, e, t = ct) => {
|
|
964
|
-
i.clearRect(0, 0, t, t), e != null && e.length && (i.save(), i.globalCompositeOperation = "lighter", i.fillStyle = "rgb(0, 0, 255)", xt(i, e, t), i.restore(), i.save(), i.globalCompositeOperation = "lighter", i.filter = "blur(8px)", i.fillStyle = "rgb(255, 0, 0)", xt(i, e, t), i.restore(), i.save(), i.globalCompositeOperation = "lighter", i.filter = "blur(3px)", i.fillStyle = "rgb(0, 255, 0)", hs(i, e, t), i.restore());
|
|
965
|
-
}, fs = (i, e, t = ct) => {
|
|
966
|
-
i.clearRect(0, 0, t, t), e != null && e.length && (i.save(), i.filter = "blur(2px)", i.fillStyle = "rgb(255, 255, 255)", lt(i, e, Ht, t), i.restore());
|
|
967
|
-
}, ps = 0.1, ms = 0.48, gs = 0.012, As = 1, Ts = 1.1, xs = 1.15, vs = 0.04, bs = [
|
|
968
|
-
61,
|
|
969
|
-
146,
|
|
970
|
-
91,
|
|
971
|
-
181,
|
|
972
|
-
84,
|
|
973
|
-
17,
|
|
974
|
-
314,
|
|
975
|
-
405,
|
|
976
|
-
321,
|
|
977
|
-
375,
|
|
978
|
-
291,
|
|
979
|
-
78,
|
|
980
|
-
95,
|
|
981
|
-
88,
|
|
982
|
-
178,
|
|
983
|
-
87,
|
|
984
|
-
14,
|
|
985
|
-
317,
|
|
986
|
-
402,
|
|
987
|
-
318,
|
|
988
|
-
324,
|
|
989
|
-
308,
|
|
990
|
-
191,
|
|
991
|
-
80,
|
|
992
|
-
81,
|
|
993
|
-
82,
|
|
994
|
-
13,
|
|
995
|
-
312,
|
|
996
|
-
311,
|
|
997
|
-
310,
|
|
998
|
-
415
|
|
999
|
-
], Es = [
|
|
1000
|
-
33,
|
|
1001
|
-
7,
|
|
1002
|
-
163,
|
|
1003
|
-
144,
|
|
1004
|
-
145,
|
|
1005
|
-
153,
|
|
1006
|
-
154,
|
|
1007
|
-
155,
|
|
1008
|
-
133,
|
|
1009
|
-
173,
|
|
1010
|
-
157,
|
|
1011
|
-
158,
|
|
1012
|
-
159,
|
|
1013
|
-
160,
|
|
1014
|
-
161,
|
|
1015
|
-
246
|
|
1016
|
-
], Rs = [
|
|
1017
|
-
362,
|
|
1018
|
-
382,
|
|
1019
|
-
381,
|
|
1020
|
-
380,
|
|
1021
|
-
374,
|
|
1022
|
-
373,
|
|
1023
|
-
390,
|
|
1024
|
-
249,
|
|
1025
|
-
263,
|
|
1026
|
-
466,
|
|
1027
|
-
388,
|
|
1028
|
-
387,
|
|
1029
|
-
386,
|
|
1030
|
-
385,
|
|
1031
|
-
384,
|
|
1032
|
-
398
|
|
1033
|
-
], Ms = [70, 63, 105, 66, 107, 55, 65, 52, 53, 46], ws = [336, 296, 334, 293, 300, 285, 295, 282, 283, 276], Ss = [
|
|
1034
|
-
1,
|
|
1035
|
-
2,
|
|
1036
|
-
4,
|
|
1037
|
-
5,
|
|
1038
|
-
6,
|
|
1039
|
-
19,
|
|
1040
|
-
94,
|
|
1041
|
-
97,
|
|
1042
|
-
98,
|
|
1043
|
-
99,
|
|
1044
|
-
102,
|
|
1045
|
-
129,
|
|
1046
|
-
168,
|
|
1047
|
-
195,
|
|
1048
|
-
197,
|
|
1049
|
-
240,
|
|
1050
|
-
279,
|
|
1051
|
-
326,
|
|
1052
|
-
327,
|
|
1053
|
-
328,
|
|
1054
|
-
331,
|
|
1055
|
-
344,
|
|
1056
|
-
358,
|
|
1057
|
-
440
|
|
1058
|
-
], ys = [
|
|
1059
|
-
bs,
|
|
1060
|
-
Es,
|
|
1061
|
-
Rs,
|
|
1062
|
-
Ms,
|
|
1063
|
-
ws,
|
|
1064
|
-
Ss
|
|
1065
|
-
], _s = [
|
|
1066
|
-
61,
|
|
1067
|
-
91,
|
|
1068
|
-
84,
|
|
1069
|
-
17,
|
|
1070
|
-
314,
|
|
1071
|
-
321,
|
|
1072
|
-
291,
|
|
1073
|
-
78,
|
|
1074
|
-
178,
|
|
1075
|
-
14,
|
|
1076
|
-
402,
|
|
1077
|
-
308,
|
|
1078
|
-
80,
|
|
1079
|
-
13,
|
|
1080
|
-
312,
|
|
1081
|
-
0,
|
|
1082
|
-
33,
|
|
1083
|
-
144,
|
|
1084
|
-
145,
|
|
1085
|
-
153,
|
|
1086
|
-
155,
|
|
1087
|
-
133,
|
|
1088
|
-
157,
|
|
1089
|
-
159,
|
|
1090
|
-
161,
|
|
1091
|
-
246,
|
|
1092
|
-
362,
|
|
1093
|
-
382,
|
|
1094
|
-
374,
|
|
1095
|
-
373,
|
|
1096
|
-
263,
|
|
1097
|
-
466,
|
|
1098
|
-
388,
|
|
1099
|
-
386,
|
|
1100
|
-
384,
|
|
1101
|
-
398,
|
|
1102
|
-
70,
|
|
1103
|
-
105,
|
|
1104
|
-
107,
|
|
1105
|
-
55,
|
|
1106
|
-
52,
|
|
1107
|
-
46,
|
|
1108
|
-
336,
|
|
1109
|
-
334,
|
|
1110
|
-
300,
|
|
1111
|
-
285,
|
|
1112
|
-
282,
|
|
1113
|
-
276,
|
|
1114
|
-
1,
|
|
1115
|
-
4,
|
|
1116
|
-
5,
|
|
1117
|
-
94,
|
|
1118
|
-
97,
|
|
1119
|
-
98,
|
|
1120
|
-
327,
|
|
1121
|
-
326,
|
|
1122
|
-
2,
|
|
1123
|
-
195
|
|
1124
|
-
], Le = (i) => Math.min(Math.max(i, 0), 1), bt = (i, e, t, s, n, r) => {
|
|
1125
|
-
let o = 1, c = 1, a = 0, l = 0, u = 0;
|
|
1126
|
-
if (e.forEach((v) => {
|
|
1127
|
-
const b = i[v];
|
|
1128
|
-
b && (o = Math.min(o, b.x), c = Math.min(c, b.y), a = Math.max(a, b.x), l = Math.max(l, b.y), u += 1);
|
|
1129
|
-
}), u === 0) return null;
|
|
1130
|
-
const h = a - o, d = l - c, p = Math.max(h * t, r), g = Math.max(d * t, r), A = Le(o - p), m = Le(c - g), f = Le(a + p), x = Le(l + g);
|
|
1131
|
-
return {
|
|
1132
|
-
centerX: (A + f) * 0.5,
|
|
1133
|
-
centerY: (m + x) * 0.5,
|
|
1134
|
-
radiusX: Math.max((f - A) * 0.5, r),
|
|
1135
|
-
radiusY: Math.max((x - m) * 0.5, r),
|
|
1136
|
-
strength: s,
|
|
1137
|
-
kind: n
|
|
1138
|
-
};
|
|
1139
|
-
}, Ls = (i, e, t) => i ? {
|
|
1140
|
-
centerX: i.x,
|
|
1141
|
-
centerY: i.y,
|
|
1142
|
-
radiusX: e,
|
|
1143
|
-
radiusY: e,
|
|
1144
|
-
strength: t,
|
|
1145
|
-
kind: "feature"
|
|
1146
|
-
} : null, Is = (i, e) => {
|
|
1147
|
-
if (!(i != null && i.length)) return [];
|
|
1148
|
-
const t = (e == null ? void 0 : e.faceOvalIndices) ?? Gt, s = (e == null ? void 0 : e.featureGroups) ?? ys, n = (e == null ? void 0 : e.featurePointIndices) ?? _s, r = (e == null ? void 0 : e.faceBoundsExpansion) ?? ps, o = (e == null ? void 0 : e.featureBoundsExpansion) ?? ms, c = (e == null ? void 0 : e.minRegionRadius) ?? gs, a = (e == null ? void 0 : e.faceRegionStrength) ?? As, l = (e == null ? void 0 : e.featureRegionStrength) ?? Ts, u = (e == null ? void 0 : e.featurePointRegionStrength) ?? xs, h = (e == null ? void 0 : e.featurePointRadiusRatio) ?? vs, d = [], p = bt(
|
|
1149
|
-
i,
|
|
1150
|
-
t,
|
|
1151
|
-
r,
|
|
1152
|
-
a,
|
|
1153
|
-
"face",
|
|
1154
|
-
c
|
|
1155
|
-
);
|
|
1156
|
-
p && d.push(p);
|
|
1157
|
-
const g = Math.max(
|
|
1158
|
-
Math.max((p == null ? void 0 : p.radiusX) ?? 0, (p == null ? void 0 : p.radiusY) ?? 0) * h,
|
|
1159
|
-
c * 1.35
|
|
1160
|
-
);
|
|
1161
|
-
return s.forEach((A) => {
|
|
1162
|
-
const m = bt(
|
|
1163
|
-
i,
|
|
1164
|
-
A,
|
|
1165
|
-
o,
|
|
1166
|
-
l,
|
|
1167
|
-
"feature",
|
|
1168
|
-
c
|
|
1169
|
-
);
|
|
1170
|
-
m && d.push(m);
|
|
1171
|
-
}), n.forEach((A) => {
|
|
1172
|
-
const m = Ls(
|
|
1173
|
-
i[A],
|
|
1174
|
-
g,
|
|
1175
|
-
u
|
|
1176
|
-
);
|
|
1177
|
-
m && d.push(m);
|
|
1178
|
-
}), d;
|
|
1179
|
-
}, Et = (i) => {
|
|
1180
|
-
const e = document.createElement("canvas");
|
|
1181
|
-
e.width = i, e.height = i;
|
|
1182
|
-
const t = e.getContext("2d", { willReadFrequently: !1 });
|
|
1183
|
-
if (!t) throw new Error("Unable to create face retouch mask context");
|
|
1184
|
-
const s = new R.CanvasTexture(e);
|
|
1185
|
-
return s.colorSpace = R.NoColorSpace, s.minFilter = R.LinearFilter, s.magFilter = R.LinearFilter, s.generateMipmaps = !1, s.needsUpdate = !0, { canvas: e, context: t, texture: s };
|
|
1186
|
-
}, Xr = (i, e = ct) => {
|
|
1187
|
-
const { mask: t, mouthMask: s } = j(() => ({
|
|
1188
|
-
mask: Et(e),
|
|
1189
|
-
mouthMask: Et(e)
|
|
1190
|
-
}), [e]);
|
|
1191
|
-
return $(() => {
|
|
1192
|
-
let n = 0;
|
|
1193
|
-
const r = () => {
|
|
1194
|
-
var c, a;
|
|
1195
|
-
n = requestAnimationFrame(r);
|
|
1196
|
-
const o = (a = (c = i == null ? void 0 : i.detectionResults) == null ? void 0 : c.faceLandmarks) == null ? void 0 : a[0];
|
|
1197
|
-
ds(t.context, o, e), fs(s.context, o, e), t.texture.needsUpdate = !0, s.texture.needsUpdate = !0;
|
|
1198
|
-
};
|
|
1199
|
-
return r(), () => {
|
|
1200
|
-
cancelAnimationFrame(n);
|
|
1201
|
-
};
|
|
1202
|
-
}, [i, t.context, t.texture, s.context, s.texture, e]), { canvas: t.canvas, texture: t.texture, mouthTexture: s.texture };
|
|
1203
|
-
}, Cs = (i) => i.map(
|
|
1204
|
-
(e) => [
|
|
1205
|
-
e.centerX.toFixed(4),
|
|
1206
|
-
e.centerY.toFixed(4),
|
|
1207
|
-
e.radiusX.toFixed(4),
|
|
1208
|
-
e.radiusY.toFixed(4),
|
|
1209
|
-
e.strength.toFixed(2),
|
|
1210
|
-
e.kind
|
|
1211
|
-
].join(",")
|
|
1212
|
-
).join("|"), Kr = (i, e) => {
|
|
1213
|
-
const [t, s] = at([]);
|
|
1214
|
-
return $(() => {
|
|
1215
|
-
let n = 0, r = "";
|
|
1216
|
-
const o = () => {
|
|
1217
|
-
var u, h;
|
|
1218
|
-
n = requestAnimationFrame(o);
|
|
1219
|
-
const c = (h = (u = i == null ? void 0 : i.detectionResults) == null ? void 0 : u.faceLandmarks) == null ? void 0 : h[0], a = Is(c, e), l = Cs(a);
|
|
1220
|
-
l !== r && (r = l, s(a));
|
|
1221
|
-
};
|
|
1222
|
-
return o(), () => {
|
|
1223
|
-
cancelAnimationFrame(n);
|
|
1224
|
-
};
|
|
1225
|
-
}, [i]), t;
|
|
1226
|
-
};
|
|
1227
|
-
function Rt(i, e) {
|
|
1228
|
-
if (e === $t)
|
|
1229
|
-
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), i;
|
|
1230
|
-
if (e === tt || e === _t) {
|
|
1231
|
-
let t = i.getIndex();
|
|
1232
|
-
if (t === null) {
|
|
1233
|
-
const o = [], c = i.getAttribute("position");
|
|
1234
|
-
if (c !== void 0) {
|
|
1235
|
-
for (let a = 0; a < c.count; a++)
|
|
1236
|
-
o.push(a);
|
|
1237
|
-
i.setIndex(o), t = i.getIndex();
|
|
1
|
+
import { jsx as R, jsxs as S, Fragment as Me } from "react/jsx-runtime";
|
|
2
|
+
import { useState as tt, useEffect as we, useMemo as Ae } from "react";
|
|
3
|
+
import * as K from "three";
|
|
4
|
+
import { TrianglesDrawMode as nt, TriangleFanDrawMode as de, TriangleStripDrawMode as He, Loader as st, LoaderUtils as q, FileLoader as Be, MeshPhysicalMaterial as N, Vector2 as ke, Color as v, LinearSRGBColorSpace as D, SRGBColorSpace as Z, SpotLight as rt, PointLight as it, DirectionalLight as ot, Matrix4 as ee, Vector3 as G, Quaternion as Ge, InstancedMesh as at, InstancedBufferAttribute as ct, Object3D as Ue, TextureLoader as lt, ImageBitmapLoader as ut, BufferAttribute as se, InterleavedBuffer as ht, InterleavedBufferAttribute as dt, LinearMipmapLinearFilter as ve, NearestMipmapLinearFilter as ft, LinearMipmapNearestFilter as pt, NearestMipmapNearestFilter as mt, LinearFilter as fe, NearestFilter as je, RepeatWrapping as pe, MirroredRepeatWrapping as gt, ClampToEdgeWrapping as At, PointsMaterial as Tt, Material as re, LineBasicMaterial as Et, MeshStandardMaterial as Ke, DoubleSide as J, MeshBasicMaterial as W, PropertyBinding as xt, BufferGeometry as Rt, SkinnedMesh as _t, Mesh as Mt, LineSegments as wt, Line as St, LineLoop as yt, Points as Lt, Group as ie, PerspectiveCamera as bt, MathUtils as It, OrthographicCamera as Nt, Skeleton as Ct, AnimationClip as Pt, Bone as Ft, InterpolateDiscrete as Ot, InterpolateLinear as Xe, Texture as Se, VectorKeyframeTrack as ye, NumberKeyframeTrack as Le, QuaternionKeyframeTrack as be, ColorManagement as Ie, FrontSide as Dt, Interpolant as Ht, Box3 as Bt, Sphere as kt, Euler as Gt } from "three";
|
|
5
|
+
import { b as Ut, c as vt } from "./index-BgQAX8rs.js";
|
|
6
|
+
import { l as Ne, f as jt } from "./index-JygePOwo.js";
|
|
7
|
+
import { Text as oe } from "@react-three/drei";
|
|
8
|
+
import { q as Qn, C as Jn, D as $n, a as es, c as ts, d as ns, F as ss, e as rs, f as is, g as os, h as as, i as cs, j as ls, l as us, m as hs, b as ds, n as fs, o as ps, p as ms, r as gs, v as As, t as Ts, k as Es, s as xs, u as Rs } from "./FaceMeshRenderer-6t8OsQhK.js";
|
|
9
|
+
import { D as Ms, d as ws, e as Ss, F as ys, f as Ls, b as bs, c as Is, m as Ns, p as Cs, r as Ps, s as Fs, a as Os, t as Ds } from "./FaceRetouch-CDrL0pXg.js";
|
|
10
|
+
function Ce(l, t) {
|
|
11
|
+
if (t === nt)
|
|
12
|
+
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), l;
|
|
13
|
+
if (t === de || t === He) {
|
|
14
|
+
let e = l.getIndex();
|
|
15
|
+
if (e === null) {
|
|
16
|
+
const s = [], a = l.getAttribute("position");
|
|
17
|
+
if (a !== void 0) {
|
|
18
|
+
for (let o = 0; o < a.count; o++)
|
|
19
|
+
s.push(o);
|
|
20
|
+
l.setIndex(s), e = l.getIndex();
|
|
1238
21
|
} else
|
|
1239
|
-
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),
|
|
22
|
+
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), l;
|
|
1240
23
|
}
|
|
1241
|
-
const
|
|
1242
|
-
if (
|
|
1243
|
-
for (let
|
|
1244
|
-
n.push(
|
|
24
|
+
const r = e.count - 2, n = [];
|
|
25
|
+
if (t === de)
|
|
26
|
+
for (let s = 1; s <= r; s++)
|
|
27
|
+
n.push(e.getX(0)), n.push(e.getX(s)), n.push(e.getX(s + 1));
|
|
1245
28
|
else
|
|
1246
|
-
for (let
|
|
1247
|
-
|
|
1248
|
-
n.length / 3 !==
|
|
1249
|
-
const
|
|
1250
|
-
return
|
|
29
|
+
for (let s = 0; s < r; s++)
|
|
30
|
+
s % 2 === 0 ? (n.push(e.getX(s)), n.push(e.getX(s + 1)), n.push(e.getX(s + 2))) : (n.push(e.getX(s + 2)), n.push(e.getX(s + 1)), n.push(e.getX(s)));
|
|
31
|
+
n.length / 3 !== r && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
|
|
32
|
+
const i = l.clone();
|
|
33
|
+
return i.setIndex(n), i.clearGroups(), i;
|
|
1251
34
|
} else
|
|
1252
|
-
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",
|
|
35
|
+
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", t), l;
|
|
1253
36
|
}
|
|
1254
|
-
class
|
|
1255
|
-
constructor(
|
|
1256
|
-
super(
|
|
1257
|
-
return new
|
|
1258
|
-
}), this.register(function(
|
|
1259
|
-
return new
|
|
1260
|
-
}), this.register(function(
|
|
1261
|
-
return new
|
|
1262
|
-
}), this.register(function(
|
|
1263
|
-
return new
|
|
1264
|
-
}), this.register(function(
|
|
1265
|
-
return new
|
|
1266
|
-
}), this.register(function(
|
|
1267
|
-
return new
|
|
1268
|
-
}), this.register(function(
|
|
1269
|
-
return new
|
|
1270
|
-
}), this.register(function(
|
|
1271
|
-
return new
|
|
1272
|
-
}), this.register(function(
|
|
1273
|
-
return new
|
|
1274
|
-
}), this.register(function(
|
|
1275
|
-
return new
|
|
1276
|
-
}), this.register(function(
|
|
1277
|
-
return new
|
|
1278
|
-
}), this.register(function(
|
|
1279
|
-
return new
|
|
1280
|
-
}), this.register(function(
|
|
1281
|
-
return new
|
|
1282
|
-
}), this.register(function(
|
|
1283
|
-
return new
|
|
1284
|
-
}), this.register(function(
|
|
1285
|
-
return new
|
|
1286
|
-
}), this.register(function(
|
|
1287
|
-
return new
|
|
1288
|
-
}), this.register(function(
|
|
1289
|
-
return new
|
|
37
|
+
class Kt extends st {
|
|
38
|
+
constructor(t) {
|
|
39
|
+
super(t), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(e) {
|
|
40
|
+
return new Wt(e);
|
|
41
|
+
}), this.register(function(e) {
|
|
42
|
+
return new qt(e);
|
|
43
|
+
}), this.register(function(e) {
|
|
44
|
+
return new rn(e);
|
|
45
|
+
}), this.register(function(e) {
|
|
46
|
+
return new on(e);
|
|
47
|
+
}), this.register(function(e) {
|
|
48
|
+
return new an(e);
|
|
49
|
+
}), this.register(function(e) {
|
|
50
|
+
return new Qt(e);
|
|
51
|
+
}), this.register(function(e) {
|
|
52
|
+
return new Jt(e);
|
|
53
|
+
}), this.register(function(e) {
|
|
54
|
+
return new $t(e);
|
|
55
|
+
}), this.register(function(e) {
|
|
56
|
+
return new en(e);
|
|
57
|
+
}), this.register(function(e) {
|
|
58
|
+
return new zt(e);
|
|
59
|
+
}), this.register(function(e) {
|
|
60
|
+
return new tn(e);
|
|
61
|
+
}), this.register(function(e) {
|
|
62
|
+
return new Zt(e);
|
|
63
|
+
}), this.register(function(e) {
|
|
64
|
+
return new sn(e);
|
|
65
|
+
}), this.register(function(e) {
|
|
66
|
+
return new nn(e);
|
|
67
|
+
}), this.register(function(e) {
|
|
68
|
+
return new Yt(e);
|
|
69
|
+
}), this.register(function(e) {
|
|
70
|
+
return new cn(e);
|
|
71
|
+
}), this.register(function(e) {
|
|
72
|
+
return new ln(e);
|
|
1290
73
|
});
|
|
1291
74
|
}
|
|
1292
|
-
load(
|
|
1293
|
-
const
|
|
1294
|
-
let
|
|
75
|
+
load(t, e, r, n) {
|
|
76
|
+
const i = this;
|
|
77
|
+
let s;
|
|
1295
78
|
if (this.resourcePath !== "")
|
|
1296
|
-
|
|
79
|
+
s = this.resourcePath;
|
|
1297
80
|
else if (this.path !== "") {
|
|
1298
|
-
const
|
|
1299
|
-
|
|
81
|
+
const c = q.extractUrlBase(t);
|
|
82
|
+
s = q.resolveURL(c, this.path);
|
|
1300
83
|
} else
|
|
1301
|
-
|
|
1302
|
-
this.manager.itemStart(
|
|
1303
|
-
const
|
|
1304
|
-
n ? n(
|
|
1305
|
-
},
|
|
1306
|
-
|
|
84
|
+
s = q.extractUrlBase(t);
|
|
85
|
+
this.manager.itemStart(t);
|
|
86
|
+
const a = function(c) {
|
|
87
|
+
n ? n(c) : console.error(c), i.manager.itemError(t), i.manager.itemEnd(t);
|
|
88
|
+
}, o = new Be(this.manager);
|
|
89
|
+
o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(t, function(c) {
|
|
1307
90
|
try {
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
},
|
|
1311
|
-
} catch (
|
|
1312
|
-
|
|
91
|
+
i.parse(c, s, function(h) {
|
|
92
|
+
e(h), i.manager.itemEnd(t);
|
|
93
|
+
}, a);
|
|
94
|
+
} catch (h) {
|
|
95
|
+
a(h);
|
|
1313
96
|
}
|
|
1314
|
-
},
|
|
97
|
+
}, r, a);
|
|
1315
98
|
}
|
|
1316
|
-
setDRACOLoader(
|
|
1317
|
-
return this.dracoLoader =
|
|
99
|
+
setDRACOLoader(t) {
|
|
100
|
+
return this.dracoLoader = t, this;
|
|
1318
101
|
}
|
|
1319
|
-
setKTX2Loader(
|
|
1320
|
-
return this.ktx2Loader =
|
|
102
|
+
setKTX2Loader(t) {
|
|
103
|
+
return this.ktx2Loader = t, this;
|
|
1321
104
|
}
|
|
1322
|
-
setMeshoptDecoder(
|
|
1323
|
-
return this.meshoptDecoder =
|
|
105
|
+
setMeshoptDecoder(t) {
|
|
106
|
+
return this.meshoptDecoder = t, this;
|
|
1324
107
|
}
|
|
1325
|
-
register(
|
|
1326
|
-
return this.pluginCallbacks.indexOf(
|
|
108
|
+
register(t) {
|
|
109
|
+
return this.pluginCallbacks.indexOf(t) === -1 && this.pluginCallbacks.push(t), this;
|
|
1327
110
|
}
|
|
1328
|
-
unregister(
|
|
1329
|
-
return this.pluginCallbacks.indexOf(
|
|
111
|
+
unregister(t) {
|
|
112
|
+
return this.pluginCallbacks.indexOf(t) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t), 1), this;
|
|
1330
113
|
}
|
|
1331
|
-
parse(
|
|
1332
|
-
let
|
|
1333
|
-
const
|
|
1334
|
-
if (typeof
|
|
1335
|
-
|
|
1336
|
-
else if (
|
|
1337
|
-
if (
|
|
114
|
+
parse(t, e, r, n) {
|
|
115
|
+
let i;
|
|
116
|
+
const s = {}, a = {}, o = new TextDecoder();
|
|
117
|
+
if (typeof t == "string")
|
|
118
|
+
i = JSON.parse(t);
|
|
119
|
+
else if (t instanceof ArrayBuffer)
|
|
120
|
+
if (o.decode(new Uint8Array(t, 0, 4)) === Ye) {
|
|
1338
121
|
try {
|
|
1339
|
-
|
|
1340
|
-
} catch (
|
|
1341
|
-
n && n(
|
|
122
|
+
s[T.KHR_BINARY_GLTF] = new un(t);
|
|
123
|
+
} catch (u) {
|
|
124
|
+
n && n(u);
|
|
1342
125
|
return;
|
|
1343
126
|
}
|
|
1344
|
-
|
|
127
|
+
i = JSON.parse(s[T.KHR_BINARY_GLTF].content);
|
|
1345
128
|
} else
|
|
1346
|
-
|
|
129
|
+
i = JSON.parse(o.decode(t));
|
|
1347
130
|
else
|
|
1348
|
-
|
|
1349
|
-
if (
|
|
131
|
+
i = t;
|
|
132
|
+
if (i.asset === void 0 || i.asset.version[0] < 2) {
|
|
1350
133
|
n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
1351
134
|
return;
|
|
1352
135
|
}
|
|
1353
|
-
const
|
|
1354
|
-
path:
|
|
136
|
+
const c = new Mn(i, {
|
|
137
|
+
path: e || this.resourcePath || "",
|
|
1355
138
|
crossOrigin: this.crossOrigin,
|
|
1356
139
|
requestHeader: this.requestHeader,
|
|
1357
140
|
manager: this.manager,
|
|
1358
141
|
ktx2Loader: this.ktx2Loader,
|
|
1359
142
|
meshoptDecoder: this.meshoptDecoder
|
|
1360
143
|
});
|
|
1361
|
-
|
|
1362
|
-
for (let
|
|
1363
|
-
const
|
|
1364
|
-
|
|
144
|
+
c.fileLoader.setRequestHeader(this.requestHeader);
|
|
145
|
+
for (let h = 0; h < this.pluginCallbacks.length; h++) {
|
|
146
|
+
const u = this.pluginCallbacks[h](c);
|
|
147
|
+
u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[u.name] = u, s[u.name] = !0;
|
|
1365
148
|
}
|
|
1366
|
-
if (
|
|
1367
|
-
for (let
|
|
1368
|
-
const
|
|
1369
|
-
switch (
|
|
1370
|
-
case
|
|
1371
|
-
|
|
149
|
+
if (i.extensionsUsed)
|
|
150
|
+
for (let h = 0; h < i.extensionsUsed.length; ++h) {
|
|
151
|
+
const u = i.extensionsUsed[h], d = i.extensionsRequired || [];
|
|
152
|
+
switch (u) {
|
|
153
|
+
case T.KHR_MATERIALS_UNLIT:
|
|
154
|
+
s[u] = new Vt();
|
|
1372
155
|
break;
|
|
1373
|
-
case
|
|
1374
|
-
|
|
156
|
+
case T.KHR_DRACO_MESH_COMPRESSION:
|
|
157
|
+
s[u] = new hn(i, this.dracoLoader);
|
|
1375
158
|
break;
|
|
1376
|
-
case
|
|
1377
|
-
|
|
159
|
+
case T.KHR_TEXTURE_TRANSFORM:
|
|
160
|
+
s[u] = new dn();
|
|
1378
161
|
break;
|
|
1379
|
-
case
|
|
1380
|
-
|
|
162
|
+
case T.KHR_MESH_QUANTIZATION:
|
|
163
|
+
s[u] = new fn();
|
|
1381
164
|
break;
|
|
1382
165
|
default:
|
|
1383
|
-
d.indexOf(
|
|
166
|
+
d.indexOf(u) >= 0 && a[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');
|
|
1384
167
|
}
|
|
1385
168
|
}
|
|
1386
|
-
|
|
169
|
+
c.setExtensions(s), c.setPlugins(a), c.parse(r, n);
|
|
1387
170
|
}
|
|
1388
|
-
parseAsync(
|
|
1389
|
-
const
|
|
1390
|
-
return new Promise(function(n,
|
|
1391
|
-
|
|
171
|
+
parseAsync(t, e) {
|
|
172
|
+
const r = this;
|
|
173
|
+
return new Promise(function(n, i) {
|
|
174
|
+
r.parse(t, e, n, i);
|
|
1392
175
|
});
|
|
1393
176
|
}
|
|
1394
177
|
}
|
|
1395
|
-
function
|
|
1396
|
-
let
|
|
178
|
+
function Xt() {
|
|
179
|
+
let l = {};
|
|
1397
180
|
return {
|
|
1398
|
-
get: function(
|
|
1399
|
-
return
|
|
181
|
+
get: function(t) {
|
|
182
|
+
return l[t];
|
|
1400
183
|
},
|
|
1401
|
-
add: function(
|
|
1402
|
-
|
|
184
|
+
add: function(t, e) {
|
|
185
|
+
l[t] = e;
|
|
1403
186
|
},
|
|
1404
|
-
remove: function(
|
|
1405
|
-
delete
|
|
187
|
+
remove: function(t) {
|
|
188
|
+
delete l[t];
|
|
1406
189
|
},
|
|
1407
190
|
removeAll: function() {
|
|
1408
|
-
|
|
191
|
+
l = {};
|
|
1409
192
|
}
|
|
1410
193
|
};
|
|
1411
194
|
}
|
|
1412
|
-
const
|
|
195
|
+
const T = {
|
|
1413
196
|
KHR_BINARY_GLTF: "KHR_binary_glTF",
|
|
1414
197
|
KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
|
|
1415
198
|
KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
|
|
@@ -1433,498 +216,498 @@ const E = {
|
|
|
1433
216
|
EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
|
|
1434
217
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
1435
218
|
};
|
|
1436
|
-
class
|
|
1437
|
-
constructor(
|
|
1438
|
-
this.parser =
|
|
219
|
+
class Yt {
|
|
220
|
+
constructor(t) {
|
|
221
|
+
this.parser = t, this.name = T.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
1439
222
|
}
|
|
1440
223
|
_markDefs() {
|
|
1441
|
-
const
|
|
1442
|
-
for (let
|
|
1443
|
-
const
|
|
1444
|
-
|
|
224
|
+
const t = this.parser, e = this.parser.json.nodes || [];
|
|
225
|
+
for (let r = 0, n = e.length; r < n; r++) {
|
|
226
|
+
const i = e[r];
|
|
227
|
+
i.extensions && i.extensions[this.name] && i.extensions[this.name].light !== void 0 && t._addNodeRef(this.cache, i.extensions[this.name].light);
|
|
1445
228
|
}
|
|
1446
229
|
}
|
|
1447
|
-
_loadLight(
|
|
1448
|
-
const
|
|
1449
|
-
let n =
|
|
230
|
+
_loadLight(t) {
|
|
231
|
+
const e = this.parser, r = "light:" + t;
|
|
232
|
+
let n = e.cache.get(r);
|
|
1450
233
|
if (n) return n;
|
|
1451
|
-
const
|
|
1452
|
-
let
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
const
|
|
1456
|
-
switch (
|
|
234
|
+
const i = e.json, o = ((i.extensions && i.extensions[this.name] || {}).lights || [])[t];
|
|
235
|
+
let c;
|
|
236
|
+
const h = new v(16777215);
|
|
237
|
+
o.color !== void 0 && h.setRGB(o.color[0], o.color[1], o.color[2], D);
|
|
238
|
+
const u = o.range !== void 0 ? o.range : 0;
|
|
239
|
+
switch (o.type) {
|
|
1457
240
|
case "directional":
|
|
1458
|
-
|
|
241
|
+
c = new ot(h), c.target.position.set(0, 0, -1), c.add(c.target);
|
|
1459
242
|
break;
|
|
1460
243
|
case "point":
|
|
1461
|
-
|
|
244
|
+
c = new it(h), c.distance = u;
|
|
1462
245
|
break;
|
|
1463
246
|
case "spot":
|
|
1464
|
-
|
|
247
|
+
c = new rt(h), c.distance = u, o.spot = o.spot || {}, o.spot.innerConeAngle = o.spot.innerConeAngle !== void 0 ? o.spot.innerConeAngle : 0, o.spot.outerConeAngle = o.spot.outerConeAngle !== void 0 ? o.spot.outerConeAngle : Math.PI / 4, c.angle = o.spot.outerConeAngle, c.penumbra = 1 - o.spot.innerConeAngle / o.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
|
|
1465
248
|
break;
|
|
1466
249
|
default:
|
|
1467
|
-
throw new Error("THREE.GLTFLoader: Unexpected light type: " +
|
|
250
|
+
throw new Error("THREE.GLTFLoader: Unexpected light type: " + o.type);
|
|
1468
251
|
}
|
|
1469
|
-
return
|
|
252
|
+
return c.position.set(0, 0, 0), F(c, o), o.intensity !== void 0 && (c.intensity = o.intensity), c.name = e.createUniqueName(o.name || "light_" + t), n = Promise.resolve(c), e.cache.add(r, n), n;
|
|
1470
253
|
}
|
|
1471
|
-
getDependency(
|
|
1472
|
-
if (
|
|
1473
|
-
return this._loadLight(
|
|
254
|
+
getDependency(t, e) {
|
|
255
|
+
if (t === "light")
|
|
256
|
+
return this._loadLight(e);
|
|
1474
257
|
}
|
|
1475
|
-
createNodeAttachment(
|
|
1476
|
-
const
|
|
1477
|
-
return
|
|
1478
|
-
return
|
|
258
|
+
createNodeAttachment(t) {
|
|
259
|
+
const e = this, r = this.parser, i = r.json.nodes[t], a = (i.extensions && i.extensions[this.name] || {}).light;
|
|
260
|
+
return a === void 0 ? null : this._loadLight(a).then(function(o) {
|
|
261
|
+
return r._getNodeRef(e.cache, a, o);
|
|
1479
262
|
});
|
|
1480
263
|
}
|
|
1481
264
|
}
|
|
1482
|
-
class
|
|
265
|
+
class Vt {
|
|
1483
266
|
constructor() {
|
|
1484
|
-
this.name =
|
|
267
|
+
this.name = T.KHR_MATERIALS_UNLIT;
|
|
1485
268
|
}
|
|
1486
269
|
getMaterialType() {
|
|
1487
|
-
return
|
|
270
|
+
return W;
|
|
1488
271
|
}
|
|
1489
|
-
extendParams(
|
|
272
|
+
extendParams(t, e, r) {
|
|
1490
273
|
const n = [];
|
|
1491
|
-
|
|
1492
|
-
const
|
|
1493
|
-
if (
|
|
1494
|
-
if (Array.isArray(
|
|
1495
|
-
const
|
|
1496
|
-
|
|
274
|
+
t.color = new v(1, 1, 1), t.opacity = 1;
|
|
275
|
+
const i = e.pbrMetallicRoughness;
|
|
276
|
+
if (i) {
|
|
277
|
+
if (Array.isArray(i.baseColorFactor)) {
|
|
278
|
+
const s = i.baseColorFactor;
|
|
279
|
+
t.color.setRGB(s[0], s[1], s[2], D), t.opacity = s[3];
|
|
1497
280
|
}
|
|
1498
|
-
|
|
281
|
+
i.baseColorTexture !== void 0 && n.push(r.assignTexture(t, "map", i.baseColorTexture, Z));
|
|
1499
282
|
}
|
|
1500
283
|
return Promise.all(n);
|
|
1501
284
|
}
|
|
1502
285
|
}
|
|
1503
|
-
class
|
|
1504
|
-
constructor(
|
|
1505
|
-
this.parser =
|
|
286
|
+
class zt {
|
|
287
|
+
constructor(t) {
|
|
288
|
+
this.parser = t, this.name = T.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
1506
289
|
}
|
|
1507
|
-
extendMaterialParams(
|
|
1508
|
-
const n = this.parser.json.materials[
|
|
290
|
+
extendMaterialParams(t, e) {
|
|
291
|
+
const n = this.parser.json.materials[t];
|
|
1509
292
|
if (!n.extensions || !n.extensions[this.name])
|
|
1510
293
|
return Promise.resolve();
|
|
1511
|
-
const
|
|
1512
|
-
return
|
|
294
|
+
const i = n.extensions[this.name].emissiveStrength;
|
|
295
|
+
return i !== void 0 && (e.emissiveIntensity = i), Promise.resolve();
|
|
1513
296
|
}
|
|
1514
297
|
}
|
|
1515
|
-
class
|
|
1516
|
-
constructor(
|
|
1517
|
-
this.parser =
|
|
298
|
+
class Wt {
|
|
299
|
+
constructor(t) {
|
|
300
|
+
this.parser = t, this.name = T.KHR_MATERIALS_CLEARCOAT;
|
|
1518
301
|
}
|
|
1519
|
-
getMaterialType(
|
|
1520
|
-
const
|
|
1521
|
-
return !
|
|
302
|
+
getMaterialType(t) {
|
|
303
|
+
const r = this.parser.json.materials[t];
|
|
304
|
+
return !r.extensions || !r.extensions[this.name] ? null : N;
|
|
1522
305
|
}
|
|
1523
|
-
extendMaterialParams(
|
|
1524
|
-
const
|
|
306
|
+
extendMaterialParams(t, e) {
|
|
307
|
+
const r = this.parser, n = r.json.materials[t];
|
|
1525
308
|
if (!n.extensions || !n.extensions[this.name])
|
|
1526
309
|
return Promise.resolve();
|
|
1527
|
-
const
|
|
1528
|
-
if (
|
|
1529
|
-
const
|
|
1530
|
-
|
|
310
|
+
const i = [], s = n.extensions[this.name];
|
|
311
|
+
if (s.clearcoatFactor !== void 0 && (e.clearcoat = s.clearcoatFactor), s.clearcoatTexture !== void 0 && i.push(r.assignTexture(e, "clearcoatMap", s.clearcoatTexture)), s.clearcoatRoughnessFactor !== void 0 && (e.clearcoatRoughness = s.clearcoatRoughnessFactor), s.clearcoatRoughnessTexture !== void 0 && i.push(r.assignTexture(e, "clearcoatRoughnessMap", s.clearcoatRoughnessTexture)), s.clearcoatNormalTexture !== void 0 && (i.push(r.assignTexture(e, "clearcoatNormalMap", s.clearcoatNormalTexture)), s.clearcoatNormalTexture.scale !== void 0)) {
|
|
312
|
+
const a = s.clearcoatNormalTexture.scale;
|
|
313
|
+
e.clearcoatNormalScale = new ke(a, a);
|
|
1531
314
|
}
|
|
1532
|
-
return Promise.all(
|
|
315
|
+
return Promise.all(i);
|
|
1533
316
|
}
|
|
1534
317
|
}
|
|
1535
|
-
class
|
|
1536
|
-
constructor(
|
|
1537
|
-
this.parser =
|
|
318
|
+
class qt {
|
|
319
|
+
constructor(t) {
|
|
320
|
+
this.parser = t, this.name = T.KHR_MATERIALS_DISPERSION;
|
|
1538
321
|
}
|
|
1539
|
-
getMaterialType(
|
|
1540
|
-
const
|
|
1541
|
-
return !
|
|
322
|
+
getMaterialType(t) {
|
|
323
|
+
const r = this.parser.json.materials[t];
|
|
324
|
+
return !r.extensions || !r.extensions[this.name] ? null : N;
|
|
1542
325
|
}
|
|
1543
|
-
extendMaterialParams(
|
|
1544
|
-
const n = this.parser.json.materials[
|
|
326
|
+
extendMaterialParams(t, e) {
|
|
327
|
+
const n = this.parser.json.materials[t];
|
|
1545
328
|
if (!n.extensions || !n.extensions[this.name])
|
|
1546
329
|
return Promise.resolve();
|
|
1547
|
-
const
|
|
1548
|
-
return
|
|
330
|
+
const i = n.extensions[this.name];
|
|
331
|
+
return e.dispersion = i.dispersion !== void 0 ? i.dispersion : 0, Promise.resolve();
|
|
1549
332
|
}
|
|
1550
333
|
}
|
|
1551
|
-
class
|
|
1552
|
-
constructor(
|
|
1553
|
-
this.parser =
|
|
334
|
+
class Zt {
|
|
335
|
+
constructor(t) {
|
|
336
|
+
this.parser = t, this.name = T.KHR_MATERIALS_IRIDESCENCE;
|
|
1554
337
|
}
|
|
1555
|
-
getMaterialType(
|
|
1556
|
-
const
|
|
1557
|
-
return !
|
|
338
|
+
getMaterialType(t) {
|
|
339
|
+
const r = this.parser.json.materials[t];
|
|
340
|
+
return !r.extensions || !r.extensions[this.name] ? null : N;
|
|
1558
341
|
}
|
|
1559
|
-
extendMaterialParams(
|
|
1560
|
-
const
|
|
342
|
+
extendMaterialParams(t, e) {
|
|
343
|
+
const r = this.parser, n = r.json.materials[t];
|
|
1561
344
|
if (!n.extensions || !n.extensions[this.name])
|
|
1562
345
|
return Promise.resolve();
|
|
1563
|
-
const
|
|
1564
|
-
return
|
|
346
|
+
const i = [], s = n.extensions[this.name];
|
|
347
|
+
return s.iridescenceFactor !== void 0 && (e.iridescence = s.iridescenceFactor), s.iridescenceTexture !== void 0 && i.push(r.assignTexture(e, "iridescenceMap", s.iridescenceTexture)), s.iridescenceIor !== void 0 && (e.iridescenceIOR = s.iridescenceIor), e.iridescenceThicknessRange === void 0 && (e.iridescenceThicknessRange = [100, 400]), s.iridescenceThicknessMinimum !== void 0 && (e.iridescenceThicknessRange[0] = s.iridescenceThicknessMinimum), s.iridescenceThicknessMaximum !== void 0 && (e.iridescenceThicknessRange[1] = s.iridescenceThicknessMaximum), s.iridescenceThicknessTexture !== void 0 && i.push(r.assignTexture(e, "iridescenceThicknessMap", s.iridescenceThicknessTexture)), Promise.all(i);
|
|
1565
348
|
}
|
|
1566
349
|
}
|
|
1567
|
-
class
|
|
1568
|
-
constructor(
|
|
1569
|
-
this.parser =
|
|
350
|
+
class Qt {
|
|
351
|
+
constructor(t) {
|
|
352
|
+
this.parser = t, this.name = T.KHR_MATERIALS_SHEEN;
|
|
1570
353
|
}
|
|
1571
|
-
getMaterialType(
|
|
1572
|
-
const
|
|
1573
|
-
return !
|
|
354
|
+
getMaterialType(t) {
|
|
355
|
+
const r = this.parser.json.materials[t];
|
|
356
|
+
return !r.extensions || !r.extensions[this.name] ? null : N;
|
|
1574
357
|
}
|
|
1575
|
-
extendMaterialParams(
|
|
1576
|
-
const
|
|
358
|
+
extendMaterialParams(t, e) {
|
|
359
|
+
const r = this.parser, n = r.json.materials[t];
|
|
1577
360
|
if (!n.extensions || !n.extensions[this.name])
|
|
1578
361
|
return Promise.resolve();
|
|
1579
|
-
const
|
|
1580
|
-
|
|
1581
|
-
const
|
|
1582
|
-
if (
|
|
1583
|
-
const
|
|
1584
|
-
|
|
362
|
+
const i = [];
|
|
363
|
+
e.sheenColor = new v(0, 0, 0), e.sheenRoughness = 0, e.sheen = 1;
|
|
364
|
+
const s = n.extensions[this.name];
|
|
365
|
+
if (s.sheenColorFactor !== void 0) {
|
|
366
|
+
const a = s.sheenColorFactor;
|
|
367
|
+
e.sheenColor.setRGB(a[0], a[1], a[2], D);
|
|
1585
368
|
}
|
|
1586
|
-
return
|
|
369
|
+
return s.sheenRoughnessFactor !== void 0 && (e.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && i.push(r.assignTexture(e, "sheenColorMap", s.sheenColorTexture, Z)), s.sheenRoughnessTexture !== void 0 && i.push(r.assignTexture(e, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(i);
|
|
1587
370
|
}
|
|
1588
371
|
}
|
|
1589
|
-
class
|
|
1590
|
-
constructor(
|
|
1591
|
-
this.parser =
|
|
372
|
+
class Jt {
|
|
373
|
+
constructor(t) {
|
|
374
|
+
this.parser = t, this.name = T.KHR_MATERIALS_TRANSMISSION;
|
|
1592
375
|
}
|
|
1593
|
-
getMaterialType(
|
|
1594
|
-
const
|
|
1595
|
-
return !
|
|
376
|
+
getMaterialType(t) {
|
|
377
|
+
const r = this.parser.json.materials[t];
|
|
378
|
+
return !r.extensions || !r.extensions[this.name] ? null : N;
|
|
1596
379
|
}
|
|
1597
|
-
extendMaterialParams(
|
|
1598
|
-
const
|
|
380
|
+
extendMaterialParams(t, e) {
|
|
381
|
+
const r = this.parser, n = r.json.materials[t];
|
|
1599
382
|
if (!n.extensions || !n.extensions[this.name])
|
|
1600
383
|
return Promise.resolve();
|
|
1601
|
-
const
|
|
1602
|
-
return
|
|
384
|
+
const i = [], s = n.extensions[this.name];
|
|
385
|
+
return s.transmissionFactor !== void 0 && (e.transmission = s.transmissionFactor), s.transmissionTexture !== void 0 && i.push(r.assignTexture(e, "transmissionMap", s.transmissionTexture)), Promise.all(i);
|
|
1603
386
|
}
|
|
1604
387
|
}
|
|
1605
|
-
class
|
|
1606
|
-
constructor(
|
|
1607
|
-
this.parser =
|
|
388
|
+
class $t {
|
|
389
|
+
constructor(t) {
|
|
390
|
+
this.parser = t, this.name = T.KHR_MATERIALS_VOLUME;
|
|
1608
391
|
}
|
|
1609
|
-
getMaterialType(
|
|
1610
|
-
const
|
|
1611
|
-
return !
|
|
392
|
+
getMaterialType(t) {
|
|
393
|
+
const r = this.parser.json.materials[t];
|
|
394
|
+
return !r.extensions || !r.extensions[this.name] ? null : N;
|
|
1612
395
|
}
|
|
1613
|
-
extendMaterialParams(
|
|
1614
|
-
const
|
|
396
|
+
extendMaterialParams(t, e) {
|
|
397
|
+
const r = this.parser, n = r.json.materials[t];
|
|
1615
398
|
if (!n.extensions || !n.extensions[this.name])
|
|
1616
399
|
return Promise.resolve();
|
|
1617
|
-
const
|
|
1618
|
-
|
|
1619
|
-
const
|
|
1620
|
-
return
|
|
400
|
+
const i = [], s = n.extensions[this.name];
|
|
401
|
+
e.thickness = s.thicknessFactor !== void 0 ? s.thicknessFactor : 0, s.thicknessTexture !== void 0 && i.push(r.assignTexture(e, "thicknessMap", s.thicknessTexture)), e.attenuationDistance = s.attenuationDistance || 1 / 0;
|
|
402
|
+
const a = s.attenuationColor || [1, 1, 1];
|
|
403
|
+
return e.attenuationColor = new v().setRGB(a[0], a[1], a[2], D), Promise.all(i);
|
|
1621
404
|
}
|
|
1622
405
|
}
|
|
1623
|
-
class
|
|
1624
|
-
constructor(
|
|
1625
|
-
this.parser =
|
|
406
|
+
class en {
|
|
407
|
+
constructor(t) {
|
|
408
|
+
this.parser = t, this.name = T.KHR_MATERIALS_IOR;
|
|
1626
409
|
}
|
|
1627
|
-
getMaterialType(
|
|
1628
|
-
const
|
|
1629
|
-
return !
|
|
410
|
+
getMaterialType(t) {
|
|
411
|
+
const r = this.parser.json.materials[t];
|
|
412
|
+
return !r.extensions || !r.extensions[this.name] ? null : N;
|
|
1630
413
|
}
|
|
1631
|
-
extendMaterialParams(
|
|
1632
|
-
const n = this.parser.json.materials[
|
|
414
|
+
extendMaterialParams(t, e) {
|
|
415
|
+
const n = this.parser.json.materials[t];
|
|
1633
416
|
if (!n.extensions || !n.extensions[this.name])
|
|
1634
417
|
return Promise.resolve();
|
|
1635
|
-
const
|
|
1636
|
-
return
|
|
418
|
+
const i = n.extensions[this.name];
|
|
419
|
+
return e.ior = i.ior !== void 0 ? i.ior : 1.5, Promise.resolve();
|
|
1637
420
|
}
|
|
1638
421
|
}
|
|
1639
|
-
class
|
|
1640
|
-
constructor(
|
|
1641
|
-
this.parser =
|
|
422
|
+
class tn {
|
|
423
|
+
constructor(t) {
|
|
424
|
+
this.parser = t, this.name = T.KHR_MATERIALS_SPECULAR;
|
|
1642
425
|
}
|
|
1643
|
-
getMaterialType(
|
|
1644
|
-
const
|
|
1645
|
-
return !
|
|
426
|
+
getMaterialType(t) {
|
|
427
|
+
const r = this.parser.json.materials[t];
|
|
428
|
+
return !r.extensions || !r.extensions[this.name] ? null : N;
|
|
1646
429
|
}
|
|
1647
|
-
extendMaterialParams(
|
|
1648
|
-
const
|
|
430
|
+
extendMaterialParams(t, e) {
|
|
431
|
+
const r = this.parser, n = r.json.materials[t];
|
|
1649
432
|
if (!n.extensions || !n.extensions[this.name])
|
|
1650
433
|
return Promise.resolve();
|
|
1651
|
-
const
|
|
1652
|
-
|
|
1653
|
-
const
|
|
1654
|
-
return
|
|
434
|
+
const i = [], s = n.extensions[this.name];
|
|
435
|
+
e.specularIntensity = s.specularFactor !== void 0 ? s.specularFactor : 1, s.specularTexture !== void 0 && i.push(r.assignTexture(e, "specularIntensityMap", s.specularTexture));
|
|
436
|
+
const a = s.specularColorFactor || [1, 1, 1];
|
|
437
|
+
return e.specularColor = new v().setRGB(a[0], a[1], a[2], D), s.specularColorTexture !== void 0 && i.push(r.assignTexture(e, "specularColorMap", s.specularColorTexture, Z)), Promise.all(i);
|
|
1655
438
|
}
|
|
1656
439
|
}
|
|
1657
|
-
class
|
|
1658
|
-
constructor(
|
|
1659
|
-
this.parser =
|
|
440
|
+
class nn {
|
|
441
|
+
constructor(t) {
|
|
442
|
+
this.parser = t, this.name = T.EXT_MATERIALS_BUMP;
|
|
1660
443
|
}
|
|
1661
|
-
getMaterialType(
|
|
1662
|
-
const
|
|
1663
|
-
return !
|
|
444
|
+
getMaterialType(t) {
|
|
445
|
+
const r = this.parser.json.materials[t];
|
|
446
|
+
return !r.extensions || !r.extensions[this.name] ? null : N;
|
|
1664
447
|
}
|
|
1665
|
-
extendMaterialParams(
|
|
1666
|
-
const
|
|
448
|
+
extendMaterialParams(t, e) {
|
|
449
|
+
const r = this.parser, n = r.json.materials[t];
|
|
1667
450
|
if (!n.extensions || !n.extensions[this.name])
|
|
1668
451
|
return Promise.resolve();
|
|
1669
|
-
const
|
|
1670
|
-
return
|
|
452
|
+
const i = [], s = n.extensions[this.name];
|
|
453
|
+
return e.bumpScale = s.bumpFactor !== void 0 ? s.bumpFactor : 1, s.bumpTexture !== void 0 && i.push(r.assignTexture(e, "bumpMap", s.bumpTexture)), Promise.all(i);
|
|
1671
454
|
}
|
|
1672
455
|
}
|
|
1673
|
-
class
|
|
1674
|
-
constructor(
|
|
1675
|
-
this.parser =
|
|
456
|
+
class sn {
|
|
457
|
+
constructor(t) {
|
|
458
|
+
this.parser = t, this.name = T.KHR_MATERIALS_ANISOTROPY;
|
|
1676
459
|
}
|
|
1677
|
-
getMaterialType(
|
|
1678
|
-
const
|
|
1679
|
-
return !
|
|
460
|
+
getMaterialType(t) {
|
|
461
|
+
const r = this.parser.json.materials[t];
|
|
462
|
+
return !r.extensions || !r.extensions[this.name] ? null : N;
|
|
1680
463
|
}
|
|
1681
|
-
extendMaterialParams(
|
|
1682
|
-
const
|
|
464
|
+
extendMaterialParams(t, e) {
|
|
465
|
+
const r = this.parser, n = r.json.materials[t];
|
|
1683
466
|
if (!n.extensions || !n.extensions[this.name])
|
|
1684
467
|
return Promise.resolve();
|
|
1685
|
-
const
|
|
1686
|
-
return
|
|
468
|
+
const i = [], s = n.extensions[this.name];
|
|
469
|
+
return s.anisotropyStrength !== void 0 && (e.anisotropy = s.anisotropyStrength), s.anisotropyRotation !== void 0 && (e.anisotropyRotation = s.anisotropyRotation), s.anisotropyTexture !== void 0 && i.push(r.assignTexture(e, "anisotropyMap", s.anisotropyTexture)), Promise.all(i);
|
|
1687
470
|
}
|
|
1688
471
|
}
|
|
1689
|
-
class
|
|
1690
|
-
constructor(
|
|
1691
|
-
this.parser =
|
|
472
|
+
class rn {
|
|
473
|
+
constructor(t) {
|
|
474
|
+
this.parser = t, this.name = T.KHR_TEXTURE_BASISU;
|
|
1692
475
|
}
|
|
1693
|
-
loadTexture(
|
|
1694
|
-
const
|
|
476
|
+
loadTexture(t) {
|
|
477
|
+
const e = this.parser, r = e.json, n = r.textures[t];
|
|
1695
478
|
if (!n.extensions || !n.extensions[this.name])
|
|
1696
479
|
return null;
|
|
1697
|
-
const
|
|
1698
|
-
if (!
|
|
1699
|
-
if (
|
|
480
|
+
const i = n.extensions[this.name], s = e.options.ktx2Loader;
|
|
481
|
+
if (!s) {
|
|
482
|
+
if (r.extensionsRequired && r.extensionsRequired.indexOf(this.name) >= 0)
|
|
1700
483
|
throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
|
|
1701
484
|
return null;
|
|
1702
485
|
}
|
|
1703
|
-
return
|
|
486
|
+
return e.loadTextureImage(t, i.source, s);
|
|
1704
487
|
}
|
|
1705
488
|
}
|
|
1706
|
-
class
|
|
1707
|
-
constructor(
|
|
1708
|
-
this.parser =
|
|
489
|
+
class on {
|
|
490
|
+
constructor(t) {
|
|
491
|
+
this.parser = t, this.name = T.EXT_TEXTURE_WEBP, this.isSupported = null;
|
|
1709
492
|
}
|
|
1710
|
-
loadTexture(
|
|
1711
|
-
const
|
|
1712
|
-
if (!
|
|
493
|
+
loadTexture(t) {
|
|
494
|
+
const e = this.name, r = this.parser, n = r.json, i = n.textures[t];
|
|
495
|
+
if (!i.extensions || !i.extensions[e])
|
|
1713
496
|
return null;
|
|
1714
|
-
const
|
|
1715
|
-
let
|
|
1716
|
-
if (
|
|
1717
|
-
const
|
|
1718
|
-
|
|
497
|
+
const s = i.extensions[e], a = n.images[s.source];
|
|
498
|
+
let o = r.textureLoader;
|
|
499
|
+
if (a.uri) {
|
|
500
|
+
const c = r.options.manager.getHandler(a.uri);
|
|
501
|
+
c !== null && (o = c);
|
|
1719
502
|
}
|
|
1720
|
-
return this.detectSupport().then(function(
|
|
1721
|
-
if (
|
|
1722
|
-
if (n.extensionsRequired && n.extensionsRequired.indexOf(
|
|
503
|
+
return this.detectSupport().then(function(c) {
|
|
504
|
+
if (c) return r.loadTextureImage(t, s.source, o);
|
|
505
|
+
if (n.extensionsRequired && n.extensionsRequired.indexOf(e) >= 0)
|
|
1723
506
|
throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");
|
|
1724
|
-
return
|
|
507
|
+
return r.loadTexture(t);
|
|
1725
508
|
});
|
|
1726
509
|
}
|
|
1727
510
|
detectSupport() {
|
|
1728
|
-
return this.isSupported || (this.isSupported = new Promise(function(
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1731
|
-
e
|
|
511
|
+
return this.isSupported || (this.isSupported = new Promise(function(t) {
|
|
512
|
+
const e = new Image();
|
|
513
|
+
e.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", e.onload = e.onerror = function() {
|
|
514
|
+
t(e.height === 1);
|
|
1732
515
|
};
|
|
1733
516
|
})), this.isSupported;
|
|
1734
517
|
}
|
|
1735
518
|
}
|
|
1736
|
-
class
|
|
1737
|
-
constructor(
|
|
1738
|
-
this.parser =
|
|
519
|
+
class an {
|
|
520
|
+
constructor(t) {
|
|
521
|
+
this.parser = t, this.name = T.EXT_TEXTURE_AVIF, this.isSupported = null;
|
|
1739
522
|
}
|
|
1740
|
-
loadTexture(
|
|
1741
|
-
const
|
|
1742
|
-
if (!
|
|
523
|
+
loadTexture(t) {
|
|
524
|
+
const e = this.name, r = this.parser, n = r.json, i = n.textures[t];
|
|
525
|
+
if (!i.extensions || !i.extensions[e])
|
|
1743
526
|
return null;
|
|
1744
|
-
const
|
|
1745
|
-
let
|
|
1746
|
-
if (
|
|
1747
|
-
const
|
|
1748
|
-
|
|
527
|
+
const s = i.extensions[e], a = n.images[s.source];
|
|
528
|
+
let o = r.textureLoader;
|
|
529
|
+
if (a.uri) {
|
|
530
|
+
const c = r.options.manager.getHandler(a.uri);
|
|
531
|
+
c !== null && (o = c);
|
|
1749
532
|
}
|
|
1750
|
-
return this.detectSupport().then(function(
|
|
1751
|
-
if (
|
|
1752
|
-
if (n.extensionsRequired && n.extensionsRequired.indexOf(
|
|
533
|
+
return this.detectSupport().then(function(c) {
|
|
534
|
+
if (c) return r.loadTextureImage(t, s.source, o);
|
|
535
|
+
if (n.extensionsRequired && n.extensionsRequired.indexOf(e) >= 0)
|
|
1753
536
|
throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");
|
|
1754
|
-
return
|
|
537
|
+
return r.loadTexture(t);
|
|
1755
538
|
});
|
|
1756
539
|
}
|
|
1757
540
|
detectSupport() {
|
|
1758
|
-
return this.isSupported || (this.isSupported = new Promise(function(
|
|
1759
|
-
const
|
|
1760
|
-
|
|
1761
|
-
e
|
|
541
|
+
return this.isSupported || (this.isSupported = new Promise(function(t) {
|
|
542
|
+
const e = new Image();
|
|
543
|
+
e.src = "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=", e.onload = e.onerror = function() {
|
|
544
|
+
t(e.height === 1);
|
|
1762
545
|
};
|
|
1763
546
|
})), this.isSupported;
|
|
1764
547
|
}
|
|
1765
548
|
}
|
|
1766
|
-
class
|
|
1767
|
-
constructor(
|
|
1768
|
-
this.name =
|
|
1769
|
-
}
|
|
1770
|
-
loadBufferView(
|
|
1771
|
-
const
|
|
1772
|
-
if (
|
|
1773
|
-
const n =
|
|
1774
|
-
if (!
|
|
1775
|
-
if (
|
|
549
|
+
class cn {
|
|
550
|
+
constructor(t) {
|
|
551
|
+
this.name = T.EXT_MESHOPT_COMPRESSION, this.parser = t;
|
|
552
|
+
}
|
|
553
|
+
loadBufferView(t) {
|
|
554
|
+
const e = this.parser.json, r = e.bufferViews[t];
|
|
555
|
+
if (r.extensions && r.extensions[this.name]) {
|
|
556
|
+
const n = r.extensions[this.name], i = this.parser.getDependency("buffer", n.buffer), s = this.parser.options.meshoptDecoder;
|
|
557
|
+
if (!s || !s.supported) {
|
|
558
|
+
if (e.extensionsRequired && e.extensionsRequired.indexOf(this.name) >= 0)
|
|
1776
559
|
throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
|
|
1777
560
|
return null;
|
|
1778
561
|
}
|
|
1779
|
-
return
|
|
1780
|
-
const
|
|
1781
|
-
return
|
|
562
|
+
return i.then(function(a) {
|
|
563
|
+
const o = n.byteOffset || 0, c = n.byteLength || 0, h = n.count, u = n.byteStride, d = new Uint8Array(a, o, c);
|
|
564
|
+
return s.decodeGltfBufferAsync ? s.decodeGltfBufferAsync(h, u, d, n.mode, n.filter).then(function(p) {
|
|
1782
565
|
return p.buffer;
|
|
1783
|
-
}) :
|
|
1784
|
-
const p = new ArrayBuffer(
|
|
1785
|
-
return
|
|
566
|
+
}) : s.ready.then(function() {
|
|
567
|
+
const p = new ArrayBuffer(h * u);
|
|
568
|
+
return s.decodeGltfBuffer(new Uint8Array(p), h, u, d, n.mode, n.filter), p;
|
|
1786
569
|
});
|
|
1787
570
|
});
|
|
1788
571
|
} else
|
|
1789
572
|
return null;
|
|
1790
573
|
}
|
|
1791
574
|
}
|
|
1792
|
-
class
|
|
1793
|
-
constructor(
|
|
1794
|
-
this.name =
|
|
575
|
+
class ln {
|
|
576
|
+
constructor(t) {
|
|
577
|
+
this.name = T.EXT_MESH_GPU_INSTANCING, this.parser = t;
|
|
1795
578
|
}
|
|
1796
|
-
createNodeMesh(
|
|
1797
|
-
const
|
|
1798
|
-
if (!
|
|
579
|
+
createNodeMesh(t) {
|
|
580
|
+
const e = this.parser.json, r = e.nodes[t];
|
|
581
|
+
if (!r.extensions || !r.extensions[this.name] || r.mesh === void 0)
|
|
1799
582
|
return null;
|
|
1800
|
-
const n =
|
|
1801
|
-
for (const
|
|
1802
|
-
if (
|
|
583
|
+
const n = e.meshes[r.mesh];
|
|
584
|
+
for (const c of n.primitives)
|
|
585
|
+
if (c.mode !== I.TRIANGLES && c.mode !== I.TRIANGLE_STRIP && c.mode !== I.TRIANGLE_FAN && c.mode !== void 0)
|
|
1803
586
|
return null;
|
|
1804
|
-
const
|
|
1805
|
-
for (const
|
|
1806
|
-
|
|
1807
|
-
return
|
|
1808
|
-
const
|
|
1809
|
-
for (const g of
|
|
1810
|
-
const A = new
|
|
1811
|
-
for (let
|
|
1812
|
-
|
|
1813
|
-
for (const
|
|
1814
|
-
if (
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1817
|
-
} else
|
|
1818
|
-
|
|
587
|
+
const s = r.extensions[this.name].attributes, a = [], o = {};
|
|
588
|
+
for (const c in s)
|
|
589
|
+
a.push(this.parser.getDependency("accessor", s[c]).then((h) => (o[c] = h, o[c])));
|
|
590
|
+
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(t)), Promise.all(a).then((c) => {
|
|
591
|
+
const h = c.pop(), u = h.isGroup ? h.children : [h], d = c[0].count, p = [];
|
|
592
|
+
for (const g of u) {
|
|
593
|
+
const A = new ee(), m = new G(), f = new Ge(), E = new G(1, 1, 1), _ = new at(g.geometry, g.material, d);
|
|
594
|
+
for (let x = 0; x < d; x++)
|
|
595
|
+
o.TRANSLATION && m.fromBufferAttribute(o.TRANSLATION, x), o.ROTATION && f.fromBufferAttribute(o.ROTATION, x), o.SCALE && E.fromBufferAttribute(o.SCALE, x), _.setMatrixAt(x, A.compose(m, f, E));
|
|
596
|
+
for (const x in o)
|
|
597
|
+
if (x === "_COLOR_0") {
|
|
598
|
+
const w = o[x];
|
|
599
|
+
_.instanceColor = new ct(w.array, w.itemSize, w.normalized);
|
|
600
|
+
} else x !== "TRANSLATION" && x !== "ROTATION" && x !== "SCALE" && g.geometry.setAttribute(x, o[x]);
|
|
601
|
+
Ue.prototype.copy.call(_, g), this.parser.assignFinalMaterial(_), p.push(_);
|
|
1819
602
|
}
|
|
1820
|
-
return
|
|
603
|
+
return h.isGroup ? (h.clear(), h.add(...p), h) : p[0];
|
|
1821
604
|
}));
|
|
1822
605
|
}
|
|
1823
606
|
}
|
|
1824
|
-
const
|
|
1825
|
-
class
|
|
1826
|
-
constructor(
|
|
1827
|
-
this.name =
|
|
1828
|
-
const
|
|
607
|
+
const Ye = "glTF", z = 12, Pe = { JSON: 1313821514, BIN: 5130562 };
|
|
608
|
+
class un {
|
|
609
|
+
constructor(t) {
|
|
610
|
+
this.name = T.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
611
|
+
const e = new DataView(t, 0, z), r = new TextDecoder();
|
|
1829
612
|
if (this.header = {
|
|
1830
|
-
magic:
|
|
1831
|
-
version:
|
|
1832
|
-
length:
|
|
1833
|
-
}, this.header.magic !==
|
|
613
|
+
magic: r.decode(new Uint8Array(t.slice(0, 4))),
|
|
614
|
+
version: e.getUint32(4, !0),
|
|
615
|
+
length: e.getUint32(8, !0)
|
|
616
|
+
}, this.header.magic !== Ye)
|
|
1834
617
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
1835
618
|
if (this.header.version < 2)
|
|
1836
619
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
1837
|
-
const n = this.header.length -
|
|
1838
|
-
let
|
|
1839
|
-
for (;
|
|
1840
|
-
const
|
|
1841
|
-
|
|
1842
|
-
const
|
|
1843
|
-
if (
|
|
1844
|
-
const
|
|
1845
|
-
this.content =
|
|
1846
|
-
} else if (
|
|
1847
|
-
const
|
|
1848
|
-
this.body =
|
|
620
|
+
const n = this.header.length - z, i = new DataView(t, z);
|
|
621
|
+
let s = 0;
|
|
622
|
+
for (; s < n; ) {
|
|
623
|
+
const a = i.getUint32(s, !0);
|
|
624
|
+
s += 4;
|
|
625
|
+
const o = i.getUint32(s, !0);
|
|
626
|
+
if (s += 4, o === Pe.JSON) {
|
|
627
|
+
const c = new Uint8Array(t, z + s, a);
|
|
628
|
+
this.content = r.decode(c);
|
|
629
|
+
} else if (o === Pe.BIN) {
|
|
630
|
+
const c = z + s;
|
|
631
|
+
this.body = t.slice(c, c + a);
|
|
1849
632
|
}
|
|
1850
|
-
|
|
633
|
+
s += a;
|
|
1851
634
|
}
|
|
1852
635
|
if (this.content === null)
|
|
1853
636
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
1854
637
|
}
|
|
1855
638
|
}
|
|
1856
|
-
class
|
|
1857
|
-
constructor(
|
|
1858
|
-
if (!
|
|
639
|
+
class hn {
|
|
640
|
+
constructor(t, e) {
|
|
641
|
+
if (!e)
|
|
1859
642
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
1860
|
-
this.name =
|
|
643
|
+
this.name = T.KHR_DRACO_MESH_COMPRESSION, this.json = t, this.dracoLoader = e, this.dracoLoader.preload();
|
|
1861
644
|
}
|
|
1862
|
-
decodePrimitive(
|
|
1863
|
-
const
|
|
1864
|
-
for (const
|
|
1865
|
-
const
|
|
1866
|
-
|
|
645
|
+
decodePrimitive(t, e) {
|
|
646
|
+
const r = this.json, n = this.dracoLoader, i = t.extensions[this.name].bufferView, s = t.extensions[this.name].attributes, a = {}, o = {}, c = {};
|
|
647
|
+
for (const h in s) {
|
|
648
|
+
const u = me[h] || h.toLowerCase();
|
|
649
|
+
a[u] = s[h];
|
|
1867
650
|
}
|
|
1868
|
-
for (const
|
|
1869
|
-
const
|
|
1870
|
-
if (
|
|
1871
|
-
const d =
|
|
1872
|
-
|
|
651
|
+
for (const h in t.attributes) {
|
|
652
|
+
const u = me[h] || h.toLowerCase();
|
|
653
|
+
if (s[h] !== void 0) {
|
|
654
|
+
const d = r.accessors[t.attributes[h]], p = X[d.componentType];
|
|
655
|
+
c[u] = p.name, o[u] = d.normalized === !0;
|
|
1873
656
|
}
|
|
1874
657
|
}
|
|
1875
|
-
return
|
|
1876
|
-
return new Promise(function(
|
|
1877
|
-
n.decodeDracoFile(
|
|
658
|
+
return e.getDependency("bufferView", i).then(function(h) {
|
|
659
|
+
return new Promise(function(u, d) {
|
|
660
|
+
n.decodeDracoFile(h, function(p) {
|
|
1878
661
|
for (const g in p.attributes) {
|
|
1879
|
-
const A = p.attributes[g], m =
|
|
662
|
+
const A = p.attributes[g], m = o[g];
|
|
1880
663
|
m !== void 0 && (A.normalized = m);
|
|
1881
664
|
}
|
|
1882
|
-
|
|
1883
|
-
},
|
|
665
|
+
u(p);
|
|
666
|
+
}, a, c, D, d);
|
|
1884
667
|
});
|
|
1885
668
|
});
|
|
1886
669
|
}
|
|
1887
670
|
}
|
|
1888
|
-
class
|
|
671
|
+
class dn {
|
|
1889
672
|
constructor() {
|
|
1890
|
-
this.name =
|
|
673
|
+
this.name = T.KHR_TEXTURE_TRANSFORM;
|
|
1891
674
|
}
|
|
1892
|
-
extendTexture(
|
|
1893
|
-
return (
|
|
675
|
+
extendTexture(t, e) {
|
|
676
|
+
return (e.texCoord === void 0 || e.texCoord === t.channel) && e.offset === void 0 && e.rotation === void 0 && e.scale === void 0 || (t = t.clone(), e.texCoord !== void 0 && (t.channel = e.texCoord), e.offset !== void 0 && t.offset.fromArray(e.offset), e.rotation !== void 0 && (t.rotation = e.rotation), e.scale !== void 0 && t.repeat.fromArray(e.scale), t.needsUpdate = !0), t;
|
|
1894
677
|
}
|
|
1895
678
|
}
|
|
1896
|
-
class
|
|
679
|
+
class fn {
|
|
1897
680
|
constructor() {
|
|
1898
|
-
this.name =
|
|
681
|
+
this.name = T.KHR_MESH_QUANTIZATION;
|
|
1899
682
|
}
|
|
1900
683
|
}
|
|
1901
|
-
class
|
|
1902
|
-
constructor(
|
|
1903
|
-
super(
|
|
1904
|
-
}
|
|
1905
|
-
copySampleValue_(
|
|
1906
|
-
const
|
|
1907
|
-
for (let
|
|
1908
|
-
|
|
1909
|
-
return
|
|
1910
|
-
}
|
|
1911
|
-
interpolate_(
|
|
1912
|
-
const
|
|
1913
|
-
for (let
|
|
1914
|
-
const
|
|
1915
|
-
|
|
684
|
+
class Ve extends Ht {
|
|
685
|
+
constructor(t, e, r, n) {
|
|
686
|
+
super(t, e, r, n);
|
|
687
|
+
}
|
|
688
|
+
copySampleValue_(t) {
|
|
689
|
+
const e = this.resultBuffer, r = this.sampleValues, n = this.valueSize, i = t * n * 3 + n;
|
|
690
|
+
for (let s = 0; s !== n; s++)
|
|
691
|
+
e[s] = r[i + s];
|
|
692
|
+
return e;
|
|
693
|
+
}
|
|
694
|
+
interpolate_(t, e, r, n) {
|
|
695
|
+
const i = this.resultBuffer, s = this.sampleValues, a = this.valueSize, o = a * 2, c = a * 3, h = n - e, u = (r - e) / h, d = u * u, p = d * u, g = t * c, A = g - c, m = -2 * p + 3 * d, f = p - d, E = 1 - m, _ = f - d + u;
|
|
696
|
+
for (let x = 0; x !== a; x++) {
|
|
697
|
+
const w = s[A + x + a], b = s[A + x + o] * h, y = s[g + x + a], C = s[g + x] * h;
|
|
698
|
+
i[x] = E * w + _ * b + m * y + f * C;
|
|
1916
699
|
}
|
|
1917
|
-
return
|
|
700
|
+
return i;
|
|
1918
701
|
}
|
|
1919
702
|
}
|
|
1920
|
-
const
|
|
1921
|
-
class
|
|
1922
|
-
interpolate_(
|
|
1923
|
-
const
|
|
1924
|
-
return
|
|
703
|
+
const pn = new Ge();
|
|
704
|
+
class mn extends Ve {
|
|
705
|
+
interpolate_(t, e, r, n) {
|
|
706
|
+
const i = super.interpolate_(t, e, r, n);
|
|
707
|
+
return pn.fromArray(i).normalize().toArray(i), i;
|
|
1925
708
|
}
|
|
1926
709
|
}
|
|
1927
|
-
const
|
|
710
|
+
const I = {
|
|
1928
711
|
POINTS: 0,
|
|
1929
712
|
LINES: 1,
|
|
1930
713
|
LINE_LOOP: 2,
|
|
@@ -1932,25 +715,25 @@ const O = {
|
|
|
1932
715
|
TRIANGLES: 4,
|
|
1933
716
|
TRIANGLE_STRIP: 5,
|
|
1934
717
|
TRIANGLE_FAN: 6
|
|
1935
|
-
},
|
|
718
|
+
}, X = {
|
|
1936
719
|
5120: Int8Array,
|
|
1937
720
|
5121: Uint8Array,
|
|
1938
721
|
5122: Int16Array,
|
|
1939
722
|
5123: Uint16Array,
|
|
1940
723
|
5125: Uint32Array,
|
|
1941
724
|
5126: Float32Array
|
|
1942
|
-
},
|
|
1943
|
-
9728:
|
|
1944
|
-
9729:
|
|
1945
|
-
9984:
|
|
1946
|
-
9985:
|
|
1947
|
-
9986:
|
|
1948
|
-
9987:
|
|
1949
|
-
},
|
|
1950
|
-
33071:
|
|
1951
|
-
33648:
|
|
1952
|
-
10497:
|
|
1953
|
-
},
|
|
725
|
+
}, Fe = {
|
|
726
|
+
9728: je,
|
|
727
|
+
9729: fe,
|
|
728
|
+
9984: mt,
|
|
729
|
+
9985: pt,
|
|
730
|
+
9986: ft,
|
|
731
|
+
9987: ve
|
|
732
|
+
}, Oe = {
|
|
733
|
+
33071: At,
|
|
734
|
+
33648: gt,
|
|
735
|
+
10497: pe
|
|
736
|
+
}, ae = {
|
|
1954
737
|
SCALAR: 1,
|
|
1955
738
|
VEC2: 2,
|
|
1956
739
|
VEC3: 3,
|
|
@@ -1958,7 +741,7 @@ const O = {
|
|
|
1958
741
|
MAT2: 4,
|
|
1959
742
|
MAT3: 9,
|
|
1960
743
|
MAT4: 16
|
|
1961
|
-
},
|
|
744
|
+
}, me = {
|
|
1962
745
|
POSITION: "position",
|
|
1963
746
|
NORMAL: "normal",
|
|
1964
747
|
TANGENT: "tangent",
|
|
@@ -1969,103 +752,103 @@ const O = {
|
|
|
1969
752
|
COLOR_0: "color",
|
|
1970
753
|
WEIGHTS_0: "skinWeight",
|
|
1971
754
|
JOINTS_0: "skinIndex"
|
|
1972
|
-
},
|
|
755
|
+
}, B = {
|
|
1973
756
|
scale: "scale",
|
|
1974
757
|
translation: "position",
|
|
1975
758
|
rotation: "quaternion",
|
|
1976
759
|
weights: "morphTargetInfluences"
|
|
1977
|
-
},
|
|
760
|
+
}, gn = {
|
|
1978
761
|
CUBICSPLINE: void 0,
|
|
1979
762
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
1980
763
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
1981
|
-
LINEAR:
|
|
1982
|
-
STEP:
|
|
1983
|
-
},
|
|
764
|
+
LINEAR: Xe,
|
|
765
|
+
STEP: Ot
|
|
766
|
+
}, ce = {
|
|
1984
767
|
OPAQUE: "OPAQUE",
|
|
1985
768
|
MASK: "MASK",
|
|
1986
769
|
BLEND: "BLEND"
|
|
1987
770
|
};
|
|
1988
|
-
function
|
|
1989
|
-
return
|
|
771
|
+
function An(l) {
|
|
772
|
+
return l.DefaultMaterial === void 0 && (l.DefaultMaterial = new Ke({
|
|
1990
773
|
color: 16777215,
|
|
1991
774
|
emissive: 0,
|
|
1992
775
|
metalness: 1,
|
|
1993
776
|
roughness: 1,
|
|
1994
777
|
transparent: !1,
|
|
1995
778
|
depthTest: !0,
|
|
1996
|
-
side:
|
|
1997
|
-
})),
|
|
779
|
+
side: Dt
|
|
780
|
+
})), l.DefaultMaterial;
|
|
1998
781
|
}
|
|
1999
|
-
function
|
|
2000
|
-
for (const
|
|
2001
|
-
|
|
782
|
+
function k(l, t, e) {
|
|
783
|
+
for (const r in e.extensions)
|
|
784
|
+
l[r] === void 0 && (t.userData.gltfExtensions = t.userData.gltfExtensions || {}, t.userData.gltfExtensions[r] = e.extensions[r]);
|
|
2002
785
|
}
|
|
2003
|
-
function
|
|
2004
|
-
|
|
786
|
+
function F(l, t) {
|
|
787
|
+
t.extras !== void 0 && (typeof t.extras == "object" ? Object.assign(l.userData, t.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + t.extras));
|
|
2005
788
|
}
|
|
2006
|
-
function
|
|
2007
|
-
let
|
|
2008
|
-
for (let
|
|
2009
|
-
const
|
|
2010
|
-
if (
|
|
2011
|
-
}
|
|
2012
|
-
if (!
|
|
2013
|
-
const
|
|
2014
|
-
for (let
|
|
2015
|
-
const
|
|
2016
|
-
if (
|
|
2017
|
-
const d =
|
|
2018
|
-
|
|
789
|
+
function Tn(l, t, e) {
|
|
790
|
+
let r = !1, n = !1, i = !1;
|
|
791
|
+
for (let c = 0, h = t.length; c < h; c++) {
|
|
792
|
+
const u = t[c];
|
|
793
|
+
if (u.POSITION !== void 0 && (r = !0), u.NORMAL !== void 0 && (n = !0), u.COLOR_0 !== void 0 && (i = !0), r && n && i) break;
|
|
794
|
+
}
|
|
795
|
+
if (!r && !n && !i) return Promise.resolve(l);
|
|
796
|
+
const s = [], a = [], o = [];
|
|
797
|
+
for (let c = 0, h = t.length; c < h; c++) {
|
|
798
|
+
const u = t[c];
|
|
799
|
+
if (r) {
|
|
800
|
+
const d = u.POSITION !== void 0 ? e.getDependency("accessor", u.POSITION) : l.attributes.position;
|
|
801
|
+
s.push(d);
|
|
2019
802
|
}
|
|
2020
803
|
if (n) {
|
|
2021
|
-
const d =
|
|
2022
|
-
c.push(d);
|
|
2023
|
-
}
|
|
2024
|
-
if (r) {
|
|
2025
|
-
const d = h.COLOR_0 !== void 0 ? t.getDependency("accessor", h.COLOR_0) : i.attributes.color;
|
|
804
|
+
const d = u.NORMAL !== void 0 ? e.getDependency("accessor", u.NORMAL) : l.attributes.normal;
|
|
2026
805
|
a.push(d);
|
|
2027
806
|
}
|
|
807
|
+
if (i) {
|
|
808
|
+
const d = u.COLOR_0 !== void 0 ? e.getDependency("accessor", u.COLOR_0) : l.attributes.color;
|
|
809
|
+
o.push(d);
|
|
810
|
+
}
|
|
2028
811
|
}
|
|
2029
812
|
return Promise.all([
|
|
2030
|
-
Promise.all(
|
|
2031
|
-
Promise.all(
|
|
2032
|
-
Promise.all(
|
|
2033
|
-
]).then(function(
|
|
2034
|
-
const
|
|
2035
|
-
return
|
|
813
|
+
Promise.all(s),
|
|
814
|
+
Promise.all(a),
|
|
815
|
+
Promise.all(o)
|
|
816
|
+
]).then(function(c) {
|
|
817
|
+
const h = c[0], u = c[1], d = c[2];
|
|
818
|
+
return r && (l.morphAttributes.position = h), n && (l.morphAttributes.normal = u), i && (l.morphAttributes.color = d), l.morphTargetsRelative = !0, l;
|
|
2036
819
|
});
|
|
2037
820
|
}
|
|
2038
|
-
function
|
|
2039
|
-
if (
|
|
2040
|
-
for (let
|
|
2041
|
-
|
|
2042
|
-
if (
|
|
2043
|
-
const
|
|
2044
|
-
if (
|
|
2045
|
-
|
|
2046
|
-
for (let
|
|
2047
|
-
|
|
821
|
+
function En(l, t) {
|
|
822
|
+
if (l.updateMorphTargets(), t.weights !== void 0)
|
|
823
|
+
for (let e = 0, r = t.weights.length; e < r; e++)
|
|
824
|
+
l.morphTargetInfluences[e] = t.weights[e];
|
|
825
|
+
if (t.extras && Array.isArray(t.extras.targetNames)) {
|
|
826
|
+
const e = t.extras.targetNames;
|
|
827
|
+
if (l.morphTargetInfluences.length === e.length) {
|
|
828
|
+
l.morphTargetDictionary = {};
|
|
829
|
+
for (let r = 0, n = e.length; r < n; r++)
|
|
830
|
+
l.morphTargetDictionary[e[r]] = r;
|
|
2048
831
|
} else
|
|
2049
832
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
2050
833
|
}
|
|
2051
834
|
}
|
|
2052
|
-
function
|
|
2053
|
-
let
|
|
2054
|
-
const
|
|
2055
|
-
if (
|
|
2056
|
-
for (let
|
|
2057
|
-
|
|
2058
|
-
return
|
|
835
|
+
function xn(l) {
|
|
836
|
+
let t;
|
|
837
|
+
const e = l.extensions && l.extensions[T.KHR_DRACO_MESH_COMPRESSION];
|
|
838
|
+
if (e ? t = "draco:" + e.bufferView + ":" + e.indices + ":" + le(e.attributes) : t = l.indices + ":" + le(l.attributes) + ":" + l.mode, l.targets !== void 0)
|
|
839
|
+
for (let r = 0, n = l.targets.length; r < n; r++)
|
|
840
|
+
t += ":" + le(l.targets[r]);
|
|
841
|
+
return t;
|
|
2059
842
|
}
|
|
2060
|
-
function
|
|
2061
|
-
let
|
|
2062
|
-
const
|
|
2063
|
-
for (let
|
|
2064
|
-
|
|
2065
|
-
return
|
|
843
|
+
function le(l) {
|
|
844
|
+
let t = "";
|
|
845
|
+
const e = Object.keys(l).sort();
|
|
846
|
+
for (let r = 0, n = e.length; r < n; r++)
|
|
847
|
+
t += e[r] + ":" + l[e[r]] + ";";
|
|
848
|
+
return t;
|
|
2066
849
|
}
|
|
2067
|
-
function
|
|
2068
|
-
switch (
|
|
850
|
+
function ge(l) {
|
|
851
|
+
switch (l) {
|
|
2069
852
|
case Int8Array:
|
|
2070
853
|
return 1 / 127;
|
|
2071
854
|
case Uint8Array:
|
|
@@ -2078,72 +861,72 @@ function it(i) {
|
|
|
2078
861
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
2079
862
|
}
|
|
2080
863
|
}
|
|
2081
|
-
function
|
|
2082
|
-
return
|
|
864
|
+
function Rn(l) {
|
|
865
|
+
return l.search(/\.jpe?g($|\?)/i) > 0 || l.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : l.search(/\.webp($|\?)/i) > 0 || l.search(/^data\:image\/webp/) === 0 ? "image/webp" : l.search(/\.ktx2($|\?)/i) > 0 || l.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
2083
866
|
}
|
|
2084
|
-
const
|
|
2085
|
-
class
|
|
2086
|
-
constructor(
|
|
2087
|
-
this.json =
|
|
2088
|
-
let
|
|
867
|
+
const _n = new ee();
|
|
868
|
+
class Mn {
|
|
869
|
+
constructor(t = {}, e = {}) {
|
|
870
|
+
this.json = t, this.extensions = {}, this.plugins = {}, this.options = e, this.cache = new Xt(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
871
|
+
let r = !1, n = -1, i = !1, s = -1;
|
|
2089
872
|
if (typeof navigator < "u") {
|
|
2090
|
-
const
|
|
2091
|
-
|
|
2092
|
-
const
|
|
2093
|
-
n =
|
|
873
|
+
const a = navigator.userAgent;
|
|
874
|
+
r = /^((?!chrome|android).)*safari/i.test(a) === !0;
|
|
875
|
+
const o = a.match(/Version\/(\d+)/);
|
|
876
|
+
n = r && o ? parseInt(o[1], 10) : -1, i = a.indexOf("Firefox") > -1, s = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
2094
877
|
}
|
|
2095
|
-
typeof createImageBitmap > "u" ||
|
|
878
|
+
typeof createImageBitmap > "u" || r && n < 17 || i && s < 98 ? this.textureLoader = new lt(this.options.manager) : this.textureLoader = new ut(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Be(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
2096
879
|
}
|
|
2097
|
-
setExtensions(
|
|
2098
|
-
this.extensions =
|
|
880
|
+
setExtensions(t) {
|
|
881
|
+
this.extensions = t;
|
|
2099
882
|
}
|
|
2100
|
-
setPlugins(
|
|
2101
|
-
this.plugins =
|
|
883
|
+
setPlugins(t) {
|
|
884
|
+
this.plugins = t;
|
|
2102
885
|
}
|
|
2103
|
-
parse(
|
|
2104
|
-
const
|
|
2105
|
-
this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(
|
|
2106
|
-
return
|
|
2107
|
-
}), Promise.all(this._invokeAll(function(
|
|
2108
|
-
return
|
|
886
|
+
parse(t, e) {
|
|
887
|
+
const r = this, n = this.json, i = this.extensions;
|
|
888
|
+
this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(s) {
|
|
889
|
+
return s._markDefs && s._markDefs();
|
|
890
|
+
}), Promise.all(this._invokeAll(function(s) {
|
|
891
|
+
return s.beforeRoot && s.beforeRoot();
|
|
2109
892
|
})).then(function() {
|
|
2110
893
|
return Promise.all([
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
894
|
+
r.getDependencies("scene"),
|
|
895
|
+
r.getDependencies("animation"),
|
|
896
|
+
r.getDependencies("camera")
|
|
2114
897
|
]);
|
|
2115
|
-
}).then(function(
|
|
2116
|
-
const
|
|
2117
|
-
scene:
|
|
2118
|
-
scenes:
|
|
2119
|
-
animations:
|
|
2120
|
-
cameras:
|
|
898
|
+
}).then(function(s) {
|
|
899
|
+
const a = {
|
|
900
|
+
scene: s[0][n.scene || 0],
|
|
901
|
+
scenes: s[0],
|
|
902
|
+
animations: s[1],
|
|
903
|
+
cameras: s[2],
|
|
2121
904
|
asset: n.asset,
|
|
2122
|
-
parser:
|
|
905
|
+
parser: r,
|
|
2123
906
|
userData: {}
|
|
2124
907
|
};
|
|
2125
|
-
return
|
|
2126
|
-
return
|
|
908
|
+
return k(i, a, n), F(a, n), Promise.all(r._invokeAll(function(o) {
|
|
909
|
+
return o.afterRoot && o.afterRoot(a);
|
|
2127
910
|
})).then(function() {
|
|
2128
|
-
for (const
|
|
2129
|
-
|
|
2130
|
-
|
|
911
|
+
for (const o of a.scenes)
|
|
912
|
+
o.updateMatrixWorld();
|
|
913
|
+
t(a);
|
|
2131
914
|
});
|
|
2132
|
-
}).catch(
|
|
915
|
+
}).catch(e);
|
|
2133
916
|
}
|
|
2134
917
|
/**
|
|
2135
918
|
* Marks the special nodes/meshes in json for efficient parse.
|
|
2136
919
|
*/
|
|
2137
920
|
_markDefs() {
|
|
2138
|
-
const
|
|
2139
|
-
for (let n = 0,
|
|
2140
|
-
const
|
|
2141
|
-
for (let
|
|
2142
|
-
|
|
921
|
+
const t = this.json.nodes || [], e = this.json.skins || [], r = this.json.meshes || [];
|
|
922
|
+
for (let n = 0, i = e.length; n < i; n++) {
|
|
923
|
+
const s = e[n].joints;
|
|
924
|
+
for (let a = 0, o = s.length; a < o; a++)
|
|
925
|
+
t[s[a]].isBone = !0;
|
|
2143
926
|
}
|
|
2144
|
-
for (let n = 0,
|
|
2145
|
-
const
|
|
2146
|
-
|
|
927
|
+
for (let n = 0, i = t.length; n < i; n++) {
|
|
928
|
+
const s = t[n];
|
|
929
|
+
s.mesh !== void 0 && (this._addNodeRef(this.meshCache, s.mesh), s.skin !== void 0 && (r[s.mesh].isSkinnedMesh = !0)), s.camera !== void 0 && this._addNodeRef(this.cameraCache, s.camera);
|
|
2147
930
|
}
|
|
2148
931
|
}
|
|
2149
932
|
/**
|
|
@@ -2158,8 +941,8 @@ class hr {
|
|
|
2158
941
|
* @param {Object} cache
|
|
2159
942
|
* @param {Object3D} index
|
|
2160
943
|
*/
|
|
2161
|
-
_addNodeRef(
|
|
2162
|
-
|
|
944
|
+
_addNodeRef(t, e) {
|
|
945
|
+
e !== void 0 && (t.refs[e] === void 0 && (t.refs[e] = t.uses[e] = 0), t.refs[e]++);
|
|
2163
946
|
}
|
|
2164
947
|
/**
|
|
2165
948
|
* Returns a reference to a shared resource, cloning it if necessary.
|
|
@@ -2169,34 +952,34 @@ class hr {
|
|
|
2169
952
|
* @param {Object} object
|
|
2170
953
|
* @return {Object}
|
|
2171
954
|
*/
|
|
2172
|
-
_getNodeRef(
|
|
2173
|
-
if (
|
|
2174
|
-
const n =
|
|
2175
|
-
const
|
|
2176
|
-
|
|
2177
|
-
for (const [
|
|
2178
|
-
|
|
955
|
+
_getNodeRef(t, e, r) {
|
|
956
|
+
if (t.refs[e] <= 1) return r;
|
|
957
|
+
const n = r.clone(), i = (s, a) => {
|
|
958
|
+
const o = this.associations.get(s);
|
|
959
|
+
o != null && this.associations.set(a, o);
|
|
960
|
+
for (const [c, h] of s.children.entries())
|
|
961
|
+
i(h, a.children[c]);
|
|
2179
962
|
};
|
|
2180
|
-
return r
|
|
963
|
+
return i(r, n), n.name += "_instance_" + t.uses[e]++, n;
|
|
2181
964
|
}
|
|
2182
|
-
_invokeOne(
|
|
2183
|
-
const
|
|
2184
|
-
|
|
2185
|
-
for (let
|
|
2186
|
-
const n = e
|
|
965
|
+
_invokeOne(t) {
|
|
966
|
+
const e = Object.values(this.plugins);
|
|
967
|
+
e.push(this);
|
|
968
|
+
for (let r = 0; r < e.length; r++) {
|
|
969
|
+
const n = t(e[r]);
|
|
2187
970
|
if (n) return n;
|
|
2188
971
|
}
|
|
2189
972
|
return null;
|
|
2190
973
|
}
|
|
2191
|
-
_invokeAll(
|
|
2192
|
-
const
|
|
2193
|
-
|
|
2194
|
-
const
|
|
2195
|
-
for (let n = 0; n <
|
|
2196
|
-
const
|
|
2197
|
-
|
|
974
|
+
_invokeAll(t) {
|
|
975
|
+
const e = Object.values(this.plugins);
|
|
976
|
+
e.unshift(this);
|
|
977
|
+
const r = [];
|
|
978
|
+
for (let n = 0; n < e.length; n++) {
|
|
979
|
+
const i = t(e[n]);
|
|
980
|
+
i && r.push(i);
|
|
2198
981
|
}
|
|
2199
|
-
return
|
|
982
|
+
return r;
|
|
2200
983
|
}
|
|
2201
984
|
/**
|
|
2202
985
|
* Requests the specified dependency asynchronously, with caching.
|
|
@@ -2204,64 +987,64 @@ class hr {
|
|
|
2204
987
|
* @param {number} index
|
|
2205
988
|
* @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
|
|
2206
989
|
*/
|
|
2207
|
-
getDependency(
|
|
2208
|
-
const
|
|
2209
|
-
let n = this.cache.get(
|
|
990
|
+
getDependency(t, e) {
|
|
991
|
+
const r = t + ":" + e;
|
|
992
|
+
let n = this.cache.get(r);
|
|
2210
993
|
if (!n) {
|
|
2211
|
-
switch (
|
|
994
|
+
switch (t) {
|
|
2212
995
|
case "scene":
|
|
2213
|
-
n = this.loadScene(
|
|
996
|
+
n = this.loadScene(e);
|
|
2214
997
|
break;
|
|
2215
998
|
case "node":
|
|
2216
|
-
n = this._invokeOne(function(
|
|
2217
|
-
return
|
|
999
|
+
n = this._invokeOne(function(i) {
|
|
1000
|
+
return i.loadNode && i.loadNode(e);
|
|
2218
1001
|
});
|
|
2219
1002
|
break;
|
|
2220
1003
|
case "mesh":
|
|
2221
|
-
n = this._invokeOne(function(
|
|
2222
|
-
return
|
|
1004
|
+
n = this._invokeOne(function(i) {
|
|
1005
|
+
return i.loadMesh && i.loadMesh(e);
|
|
2223
1006
|
});
|
|
2224
1007
|
break;
|
|
2225
1008
|
case "accessor":
|
|
2226
|
-
n = this.loadAccessor(
|
|
1009
|
+
n = this.loadAccessor(e);
|
|
2227
1010
|
break;
|
|
2228
1011
|
case "bufferView":
|
|
2229
|
-
n = this._invokeOne(function(
|
|
2230
|
-
return
|
|
1012
|
+
n = this._invokeOne(function(i) {
|
|
1013
|
+
return i.loadBufferView && i.loadBufferView(e);
|
|
2231
1014
|
});
|
|
2232
1015
|
break;
|
|
2233
1016
|
case "buffer":
|
|
2234
|
-
n = this.loadBuffer(
|
|
1017
|
+
n = this.loadBuffer(e);
|
|
2235
1018
|
break;
|
|
2236
1019
|
case "material":
|
|
2237
|
-
n = this._invokeOne(function(
|
|
2238
|
-
return
|
|
1020
|
+
n = this._invokeOne(function(i) {
|
|
1021
|
+
return i.loadMaterial && i.loadMaterial(e);
|
|
2239
1022
|
});
|
|
2240
1023
|
break;
|
|
2241
1024
|
case "texture":
|
|
2242
|
-
n = this._invokeOne(function(
|
|
2243
|
-
return
|
|
1025
|
+
n = this._invokeOne(function(i) {
|
|
1026
|
+
return i.loadTexture && i.loadTexture(e);
|
|
2244
1027
|
});
|
|
2245
1028
|
break;
|
|
2246
1029
|
case "skin":
|
|
2247
|
-
n = this.loadSkin(
|
|
1030
|
+
n = this.loadSkin(e);
|
|
2248
1031
|
break;
|
|
2249
1032
|
case "animation":
|
|
2250
|
-
n = this._invokeOne(function(
|
|
2251
|
-
return
|
|
1033
|
+
n = this._invokeOne(function(i) {
|
|
1034
|
+
return i.loadAnimation && i.loadAnimation(e);
|
|
2252
1035
|
});
|
|
2253
1036
|
break;
|
|
2254
1037
|
case "camera":
|
|
2255
|
-
n = this.loadCamera(
|
|
1038
|
+
n = this.loadCamera(e);
|
|
2256
1039
|
break;
|
|
2257
1040
|
default:
|
|
2258
|
-
if (n = this._invokeOne(function(
|
|
2259
|
-
return
|
|
1041
|
+
if (n = this._invokeOne(function(i) {
|
|
1042
|
+
return i != this && i.getDependency && i.getDependency(t, e);
|
|
2260
1043
|
}), !n)
|
|
2261
|
-
throw new Error("Unknown type: " +
|
|
1044
|
+
throw new Error("Unknown type: " + t);
|
|
2262
1045
|
break;
|
|
2263
1046
|
}
|
|
2264
|
-
this.cache.add(
|
|
1047
|
+
this.cache.add(r, n);
|
|
2265
1048
|
}
|
|
2266
1049
|
return n;
|
|
2267
1050
|
}
|
|
@@ -2270,31 +1053,31 @@ class hr {
|
|
|
2270
1053
|
* @param {string} type
|
|
2271
1054
|
* @return {Promise<Array<Object>>}
|
|
2272
1055
|
*/
|
|
2273
|
-
getDependencies(
|
|
2274
|
-
let
|
|
2275
|
-
if (!
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2278
|
-
return
|
|
2279
|
-
})), this.cache.add(
|
|
1056
|
+
getDependencies(t) {
|
|
1057
|
+
let e = this.cache.get(t);
|
|
1058
|
+
if (!e) {
|
|
1059
|
+
const r = this, n = this.json[t + (t === "mesh" ? "es" : "s")] || [];
|
|
1060
|
+
e = Promise.all(n.map(function(i, s) {
|
|
1061
|
+
return r.getDependency(t, s);
|
|
1062
|
+
})), this.cache.add(t, e);
|
|
2280
1063
|
}
|
|
2281
|
-
return
|
|
1064
|
+
return e;
|
|
2282
1065
|
}
|
|
2283
1066
|
/**
|
|
2284
1067
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views
|
|
2285
1068
|
* @param {number} bufferIndex
|
|
2286
1069
|
* @return {Promise<ArrayBuffer>}
|
|
2287
1070
|
*/
|
|
2288
|
-
loadBuffer(
|
|
2289
|
-
const
|
|
2290
|
-
if (
|
|
2291
|
-
throw new Error("THREE.GLTFLoader: " +
|
|
2292
|
-
if (
|
|
2293
|
-
return Promise.resolve(this.extensions[
|
|
1071
|
+
loadBuffer(t) {
|
|
1072
|
+
const e = this.json.buffers[t], r = this.fileLoader;
|
|
1073
|
+
if (e.type && e.type !== "arraybuffer")
|
|
1074
|
+
throw new Error("THREE.GLTFLoader: " + e.type + " buffer type is not supported.");
|
|
1075
|
+
if (e.uri === void 0 && t === 0)
|
|
1076
|
+
return Promise.resolve(this.extensions[T.KHR_BINARY_GLTF].body);
|
|
2294
1077
|
const n = this.options;
|
|
2295
|
-
return new Promise(function(
|
|
2296
|
-
|
|
2297
|
-
|
|
1078
|
+
return new Promise(function(i, s) {
|
|
1079
|
+
r.load(q.resolveURL(e.uri, n.path), i, void 0, function() {
|
|
1080
|
+
s(new Error('THREE.GLTFLoader: Failed to load buffer "' + e.uri + '".'));
|
|
2298
1081
|
});
|
|
2299
1082
|
});
|
|
2300
1083
|
}
|
|
@@ -2303,11 +1086,11 @@ class hr {
|
|
|
2303
1086
|
* @param {number} bufferViewIndex
|
|
2304
1087
|
* @return {Promise<ArrayBuffer>}
|
|
2305
1088
|
*/
|
|
2306
|
-
loadBufferView(
|
|
2307
|
-
const
|
|
2308
|
-
return this.getDependency("buffer",
|
|
2309
|
-
const n =
|
|
2310
|
-
return
|
|
1089
|
+
loadBufferView(t) {
|
|
1090
|
+
const e = this.json.bufferViews[t];
|
|
1091
|
+
return this.getDependency("buffer", e.buffer).then(function(r) {
|
|
1092
|
+
const n = e.byteLength || 0, i = e.byteOffset || 0;
|
|
1093
|
+
return r.slice(i, i + n);
|
|
2311
1094
|
});
|
|
2312
1095
|
}
|
|
2313
1096
|
/**
|
|
@@ -2315,28 +1098,28 @@ class hr {
|
|
|
2315
1098
|
* @param {number} accessorIndex
|
|
2316
1099
|
* @return {Promise<BufferAttribute|InterleavedBufferAttribute>}
|
|
2317
1100
|
*/
|
|
2318
|
-
loadAccessor(
|
|
2319
|
-
const
|
|
1101
|
+
loadAccessor(t) {
|
|
1102
|
+
const e = this, r = this.json, n = this.json.accessors[t];
|
|
2320
1103
|
if (n.bufferView === void 0 && n.sparse === void 0) {
|
|
2321
|
-
const
|
|
2322
|
-
return Promise.resolve(new
|
|
1104
|
+
const s = ae[n.type], a = X[n.componentType], o = n.normalized === !0, c = new a(n.count * s);
|
|
1105
|
+
return Promise.resolve(new se(c, s, o));
|
|
2323
1106
|
}
|
|
2324
|
-
const
|
|
2325
|
-
return n.bufferView !== void 0 ?
|
|
2326
|
-
const
|
|
1107
|
+
const i = [];
|
|
1108
|
+
return n.bufferView !== void 0 ? i.push(this.getDependency("bufferView", n.bufferView)) : i.push(null), n.sparse !== void 0 && (i.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(i).then(function(s) {
|
|
1109
|
+
const a = s[0], o = ae[n.type], c = X[n.componentType], h = c.BYTES_PER_ELEMENT, u = h * o, d = n.byteOffset || 0, p = n.bufferView !== void 0 ? r.bufferViews[n.bufferView].byteStride : void 0, g = n.normalized === !0;
|
|
2327
1110
|
let A, m;
|
|
2328
|
-
if (p && p !==
|
|
2329
|
-
const f = Math.floor(d / p),
|
|
2330
|
-
let
|
|
2331
|
-
|
|
1111
|
+
if (p && p !== u) {
|
|
1112
|
+
const f = Math.floor(d / p), E = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + f + ":" + n.count;
|
|
1113
|
+
let _ = e.cache.get(E);
|
|
1114
|
+
_ || (A = new c(a, f * p, n.count * p / h), _ = new ht(A, p / h), e.cache.add(E, _)), m = new dt(_, o, d % p / h, g);
|
|
2332
1115
|
} else
|
|
2333
|
-
|
|
1116
|
+
a === null ? A = new c(n.count * o) : A = new c(a, d, n.count * o), m = new se(A, o, g);
|
|
2334
1117
|
if (n.sparse !== void 0) {
|
|
2335
|
-
const f =
|
|
2336
|
-
|
|
2337
|
-
for (let
|
|
2338
|
-
const
|
|
2339
|
-
if (m.setX(
|
|
1118
|
+
const f = ae.SCALAR, E = X[n.sparse.indices.componentType], _ = n.sparse.indices.byteOffset || 0, x = n.sparse.values.byteOffset || 0, w = new E(s[1], _, n.sparse.count * f), b = new c(s[2], x, n.sparse.count * o);
|
|
1119
|
+
a !== null && (m = new se(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
|
|
1120
|
+
for (let y = 0, C = w.length; y < C; y++) {
|
|
1121
|
+
const L = w[y];
|
|
1122
|
+
if (m.setX(L, b[y * o]), o >= 2 && m.setY(L, b[y * o + 1]), o >= 3 && m.setZ(L, b[y * o + 2]), o >= 4 && m.setW(L, b[y * o + 3]), o >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
2340
1123
|
}
|
|
2341
1124
|
m.normalized = g;
|
|
2342
1125
|
}
|
|
@@ -2348,56 +1131,56 @@ class hr {
|
|
|
2348
1131
|
* @param {number} textureIndex
|
|
2349
1132
|
* @return {Promise<THREE.Texture|null>}
|
|
2350
1133
|
*/
|
|
2351
|
-
loadTexture(
|
|
2352
|
-
const
|
|
2353
|
-
let
|
|
2354
|
-
if (
|
|
2355
|
-
const
|
|
2356
|
-
|
|
1134
|
+
loadTexture(t) {
|
|
1135
|
+
const e = this.json, r = this.options, i = e.textures[t].source, s = e.images[i];
|
|
1136
|
+
let a = this.textureLoader;
|
|
1137
|
+
if (s.uri) {
|
|
1138
|
+
const o = r.manager.getHandler(s.uri);
|
|
1139
|
+
o !== null && (a = o);
|
|
2357
1140
|
}
|
|
2358
|
-
return this.loadTextureImage(
|
|
2359
|
-
}
|
|
2360
|
-
loadTextureImage(
|
|
2361
|
-
const n = this,
|
|
2362
|
-
if (this.textureCache[
|
|
2363
|
-
return this.textureCache[
|
|
2364
|
-
const
|
|
2365
|
-
|
|
2366
|
-
const d = (
|
|
2367
|
-
return
|
|
1141
|
+
return this.loadTextureImage(t, i, a);
|
|
1142
|
+
}
|
|
1143
|
+
loadTextureImage(t, e, r) {
|
|
1144
|
+
const n = this, i = this.json, s = i.textures[t], a = i.images[e], o = (a.uri || a.bufferView) + ":" + s.sampler;
|
|
1145
|
+
if (this.textureCache[o])
|
|
1146
|
+
return this.textureCache[o];
|
|
1147
|
+
const c = this.loadImageSource(e, r).then(function(h) {
|
|
1148
|
+
h.flipY = !1, h.name = s.name || a.name || "", h.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (h.name = a.uri);
|
|
1149
|
+
const d = (i.samplers || {})[s.sampler] || {};
|
|
1150
|
+
return h.magFilter = Fe[d.magFilter] || fe, h.minFilter = Fe[d.minFilter] || ve, h.wrapS = Oe[d.wrapS] || pe, h.wrapT = Oe[d.wrapT] || pe, h.generateMipmaps = !h.isCompressedTexture && h.minFilter !== je && h.minFilter !== fe, n.associations.set(h, { textures: t }), h;
|
|
2368
1151
|
}).catch(function() {
|
|
2369
1152
|
return null;
|
|
2370
1153
|
});
|
|
2371
|
-
return this.textureCache[
|
|
2372
|
-
}
|
|
2373
|
-
loadImageSource(
|
|
2374
|
-
const
|
|
2375
|
-
if (this.sourceCache[
|
|
2376
|
-
return this.sourceCache[
|
|
2377
|
-
const
|
|
2378
|
-
let
|
|
2379
|
-
if (
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
const d = new Blob([
|
|
2383
|
-
return
|
|
1154
|
+
return this.textureCache[o] = c, c;
|
|
1155
|
+
}
|
|
1156
|
+
loadImageSource(t, e) {
|
|
1157
|
+
const r = this, n = this.json, i = this.options;
|
|
1158
|
+
if (this.sourceCache[t] !== void 0)
|
|
1159
|
+
return this.sourceCache[t].then((u) => u.clone());
|
|
1160
|
+
const s = n.images[t], a = self.URL || self.webkitURL;
|
|
1161
|
+
let o = s.uri || "", c = !1;
|
|
1162
|
+
if (s.bufferView !== void 0)
|
|
1163
|
+
o = r.getDependency("bufferView", s.bufferView).then(function(u) {
|
|
1164
|
+
c = !0;
|
|
1165
|
+
const d = new Blob([u], { type: s.mimeType });
|
|
1166
|
+
return o = a.createObjectURL(d), o;
|
|
2384
1167
|
});
|
|
2385
|
-
else if (
|
|
2386
|
-
throw new Error("THREE.GLTFLoader: Image " +
|
|
2387
|
-
const
|
|
1168
|
+
else if (s.uri === void 0)
|
|
1169
|
+
throw new Error("THREE.GLTFLoader: Image " + t + " is missing URI and bufferView");
|
|
1170
|
+
const h = Promise.resolve(o).then(function(u) {
|
|
2388
1171
|
return new Promise(function(d, p) {
|
|
2389
1172
|
let g = d;
|
|
2390
|
-
|
|
2391
|
-
const m = new
|
|
1173
|
+
e.isImageBitmapLoader === !0 && (g = function(A) {
|
|
1174
|
+
const m = new Se(A);
|
|
2392
1175
|
m.needsUpdate = !0, d(m);
|
|
2393
|
-
}),
|
|
1176
|
+
}), e.load(q.resolveURL(u, i.path), g, void 0, p);
|
|
2394
1177
|
});
|
|
2395
|
-
}).then(function(
|
|
2396
|
-
return
|
|
2397
|
-
}).catch(function(
|
|
2398
|
-
throw console.error("THREE.GLTFLoader: Couldn't load texture",
|
|
1178
|
+
}).then(function(u) {
|
|
1179
|
+
return c === !0 && a.revokeObjectURL(o), F(u, s), u.userData.mimeType = s.mimeType || Rn(s.uri), u;
|
|
1180
|
+
}).catch(function(u) {
|
|
1181
|
+
throw console.error("THREE.GLTFLoader: Couldn't load texture", o), u;
|
|
2399
1182
|
});
|
|
2400
|
-
return this.sourceCache[
|
|
1183
|
+
return this.sourceCache[t] = h, h;
|
|
2401
1184
|
}
|
|
2402
1185
|
/**
|
|
2403
1186
|
* Asynchronously assigns a texture to the given material parameters.
|
|
@@ -2408,18 +1191,18 @@ class hr {
|
|
|
2408
1191
|
* @param {string} colorSpace
|
|
2409
1192
|
* @return {Promise<Texture>}
|
|
2410
1193
|
*/
|
|
2411
|
-
assignTexture(
|
|
2412
|
-
const
|
|
2413
|
-
return this.getDependency("texture",
|
|
2414
|
-
if (!
|
|
2415
|
-
if (
|
|
2416
|
-
const
|
|
2417
|
-
if (
|
|
2418
|
-
const
|
|
2419
|
-
|
|
1194
|
+
assignTexture(t, e, r, n) {
|
|
1195
|
+
const i = this;
|
|
1196
|
+
return this.getDependency("texture", r.index).then(function(s) {
|
|
1197
|
+
if (!s) return null;
|
|
1198
|
+
if (r.texCoord !== void 0 && r.texCoord > 0 && (s = s.clone(), s.channel = r.texCoord), i.extensions[T.KHR_TEXTURE_TRANSFORM]) {
|
|
1199
|
+
const a = r.extensions !== void 0 ? r.extensions[T.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
1200
|
+
if (a) {
|
|
1201
|
+
const o = i.associations.get(s);
|
|
1202
|
+
s = i.extensions[T.KHR_TEXTURE_TRANSFORM].extendTexture(s, a), i.associations.set(s, o);
|
|
2420
1203
|
}
|
|
2421
1204
|
}
|
|
2422
|
-
return n !== void 0 && (
|
|
1205
|
+
return n !== void 0 && (s.colorSpace = n), t[e] = s, s;
|
|
2423
1206
|
});
|
|
2424
1207
|
}
|
|
2425
1208
|
/**
|
|
@@ -2430,67 +1213,67 @@ class hr {
|
|
|
2430
1213
|
* be created if necessary, and reused from a cache.
|
|
2431
1214
|
* @param {Object3D} mesh Mesh, Line, or Points instance.
|
|
2432
1215
|
*/
|
|
2433
|
-
assignFinalMaterial(
|
|
2434
|
-
const
|
|
2435
|
-
let
|
|
2436
|
-
const n =
|
|
2437
|
-
if (
|
|
2438
|
-
const
|
|
2439
|
-
let
|
|
2440
|
-
|
|
2441
|
-
} else if (
|
|
2442
|
-
const
|
|
2443
|
-
let
|
|
2444
|
-
|
|
1216
|
+
assignFinalMaterial(t) {
|
|
1217
|
+
const e = t.geometry;
|
|
1218
|
+
let r = t.material;
|
|
1219
|
+
const n = e.attributes.tangent === void 0, i = e.attributes.color !== void 0, s = e.attributes.normal === void 0;
|
|
1220
|
+
if (t.isPoints) {
|
|
1221
|
+
const a = "PointsMaterial:" + r.uuid;
|
|
1222
|
+
let o = this.cache.get(a);
|
|
1223
|
+
o || (o = new Tt(), re.prototype.copy.call(o, r), o.color.copy(r.color), o.map = r.map, o.sizeAttenuation = !1, this.cache.add(a, o)), r = o;
|
|
1224
|
+
} else if (t.isLine) {
|
|
1225
|
+
const a = "LineBasicMaterial:" + r.uuid;
|
|
1226
|
+
let o = this.cache.get(a);
|
|
1227
|
+
o || (o = new Et(), re.prototype.copy.call(o, r), o.color.copy(r.color), o.map = r.map, this.cache.add(a, o)), r = o;
|
|
2445
1228
|
}
|
|
2446
|
-
if (n ||
|
|
2447
|
-
let
|
|
2448
|
-
n && (
|
|
2449
|
-
let
|
|
2450
|
-
|
|
1229
|
+
if (n || i || s) {
|
|
1230
|
+
let a = "ClonedMaterial:" + r.uuid + ":";
|
|
1231
|
+
n && (a += "derivative-tangents:"), i && (a += "vertex-colors:"), s && (a += "flat-shading:");
|
|
1232
|
+
let o = this.cache.get(a);
|
|
1233
|
+
o || (o = r.clone(), i && (o.vertexColors = !0), s && (o.flatShading = !0), n && (o.normalScale && (o.normalScale.y *= -1), o.clearcoatNormalScale && (o.clearcoatNormalScale.y *= -1)), this.cache.add(a, o), this.associations.set(o, this.associations.get(r))), r = o;
|
|
2451
1234
|
}
|
|
2452
|
-
|
|
1235
|
+
t.material = r;
|
|
2453
1236
|
}
|
|
2454
1237
|
getMaterialType() {
|
|
2455
|
-
return
|
|
1238
|
+
return Ke;
|
|
2456
1239
|
}
|
|
2457
1240
|
/**
|
|
2458
1241
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
2459
1242
|
* @param {number} materialIndex
|
|
2460
1243
|
* @return {Promise<Material>}
|
|
2461
1244
|
*/
|
|
2462
|
-
loadMaterial(
|
|
2463
|
-
const
|
|
2464
|
-
let
|
|
2465
|
-
const
|
|
2466
|
-
if (
|
|
2467
|
-
const
|
|
2468
|
-
|
|
1245
|
+
loadMaterial(t) {
|
|
1246
|
+
const e = this, r = this.json, n = this.extensions, i = r.materials[t];
|
|
1247
|
+
let s;
|
|
1248
|
+
const a = {}, o = i.extensions || {}, c = [];
|
|
1249
|
+
if (o[T.KHR_MATERIALS_UNLIT]) {
|
|
1250
|
+
const u = n[T.KHR_MATERIALS_UNLIT];
|
|
1251
|
+
s = u.getMaterialType(), c.push(u.extendParams(a, i, e));
|
|
2469
1252
|
} else {
|
|
2470
|
-
const
|
|
2471
|
-
if (
|
|
2472
|
-
const d =
|
|
2473
|
-
|
|
1253
|
+
const u = i.pbrMetallicRoughness || {};
|
|
1254
|
+
if (a.color = new v(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) {
|
|
1255
|
+
const d = u.baseColorFactor;
|
|
1256
|
+
a.color.setRGB(d[0], d[1], d[2], D), a.opacity = d[3];
|
|
2474
1257
|
}
|
|
2475
|
-
|
|
2476
|
-
return d.getMaterialType && d.getMaterialType(
|
|
2477
|
-
}),
|
|
2478
|
-
return d.extendMaterialParams && d.extendMaterialParams(
|
|
1258
|
+
u.baseColorTexture !== void 0 && c.push(e.assignTexture(a, "map", u.baseColorTexture, Z)), a.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, a.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (c.push(e.assignTexture(a, "metalnessMap", u.metallicRoughnessTexture)), c.push(e.assignTexture(a, "roughnessMap", u.metallicRoughnessTexture))), s = this._invokeOne(function(d) {
|
|
1259
|
+
return d.getMaterialType && d.getMaterialType(t);
|
|
1260
|
+
}), c.push(Promise.all(this._invokeAll(function(d) {
|
|
1261
|
+
return d.extendMaterialParams && d.extendMaterialParams(t, a);
|
|
2479
1262
|
})));
|
|
2480
1263
|
}
|
|
2481
|
-
|
|
2482
|
-
const
|
|
2483
|
-
if (
|
|
2484
|
-
const
|
|
2485
|
-
|
|
1264
|
+
i.doubleSided === !0 && (a.side = J);
|
|
1265
|
+
const h = i.alphaMode || ce.OPAQUE;
|
|
1266
|
+
if (h === ce.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, h === ce.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && s !== W && (c.push(e.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new ke(1, 1), i.normalTexture.scale !== void 0)) {
|
|
1267
|
+
const u = i.normalTexture.scale;
|
|
1268
|
+
a.normalScale.set(u, u);
|
|
2486
1269
|
}
|
|
2487
|
-
if (
|
|
2488
|
-
const
|
|
2489
|
-
|
|
1270
|
+
if (i.occlusionTexture !== void 0 && s !== W && (c.push(e.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && s !== W) {
|
|
1271
|
+
const u = i.emissiveFactor;
|
|
1272
|
+
a.emissive = new v().setRGB(u[0], u[1], u[2], D);
|
|
2490
1273
|
}
|
|
2491
|
-
return
|
|
2492
|
-
const
|
|
2493
|
-
return
|
|
1274
|
+
return i.emissiveTexture !== void 0 && s !== W && c.push(e.assignTexture(a, "emissiveMap", i.emissiveTexture, Z)), Promise.all(c).then(function() {
|
|
1275
|
+
const u = new s(a);
|
|
1276
|
+
return i.name && (u.name = i.name), F(u, i), e.associations.set(u, { materials: t }), i.extensions && k(n, u, i), u;
|
|
2494
1277
|
});
|
|
2495
1278
|
}
|
|
2496
1279
|
/**
|
|
@@ -2499,9 +1282,9 @@ class hr {
|
|
|
2499
1282
|
* @param {String} originalName
|
|
2500
1283
|
* @return {String}
|
|
2501
1284
|
*/
|
|
2502
|
-
createUniqueName(
|
|
2503
|
-
const
|
|
2504
|
-
return
|
|
1285
|
+
createUniqueName(t) {
|
|
1286
|
+
const e = xt.sanitizeNodeName(t || "");
|
|
1287
|
+
return e in this.nodeNamesUsed ? e + "_" + ++this.nodeNamesUsed[e] : (this.nodeNamesUsed[e] = 0, e);
|
|
2505
1288
|
}
|
|
2506
1289
|
/**
|
|
2507
1290
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry
|
|
@@ -2511,67 +1294,67 @@ class hr {
|
|
|
2511
1294
|
* @param {Array<GLTF.Primitive>} primitives
|
|
2512
1295
|
* @return {Promise<Array<BufferGeometry>>}
|
|
2513
1296
|
*/
|
|
2514
|
-
loadGeometries(
|
|
2515
|
-
const
|
|
2516
|
-
function
|
|
2517
|
-
return
|
|
2518
|
-
return
|
|
1297
|
+
loadGeometries(t) {
|
|
1298
|
+
const e = this, r = this.extensions, n = this.primitiveCache;
|
|
1299
|
+
function i(a) {
|
|
1300
|
+
return r[T.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, e).then(function(o) {
|
|
1301
|
+
return De(o, a, e);
|
|
2519
1302
|
});
|
|
2520
1303
|
}
|
|
2521
|
-
const
|
|
2522
|
-
for (let
|
|
2523
|
-
const
|
|
2524
|
-
if (
|
|
2525
|
-
|
|
1304
|
+
const s = [];
|
|
1305
|
+
for (let a = 0, o = t.length; a < o; a++) {
|
|
1306
|
+
const c = t[a], h = xn(c), u = n[h];
|
|
1307
|
+
if (u)
|
|
1308
|
+
s.push(u.promise);
|
|
2526
1309
|
else {
|
|
2527
1310
|
let d;
|
|
2528
|
-
|
|
1311
|
+
c.extensions && c.extensions[T.KHR_DRACO_MESH_COMPRESSION] ? d = i(c) : d = De(new Rt(), c, e), n[h] = { primitive: c, promise: d }, s.push(d);
|
|
2529
1312
|
}
|
|
2530
1313
|
}
|
|
2531
|
-
return Promise.all(
|
|
1314
|
+
return Promise.all(s);
|
|
2532
1315
|
}
|
|
2533
1316
|
/**
|
|
2534
1317
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
|
|
2535
1318
|
* @param {number} meshIndex
|
|
2536
1319
|
* @return {Promise<Group|Mesh|SkinnedMesh>}
|
|
2537
1320
|
*/
|
|
2538
|
-
loadMesh(
|
|
2539
|
-
const
|
|
2540
|
-
for (let
|
|
2541
|
-
const
|
|
2542
|
-
|
|
1321
|
+
loadMesh(t) {
|
|
1322
|
+
const e = this, r = this.json, n = this.extensions, i = r.meshes[t], s = i.primitives, a = [];
|
|
1323
|
+
for (let o = 0, c = s.length; o < c; o++) {
|
|
1324
|
+
const h = s[o].material === void 0 ? An(this.cache) : this.getDependency("material", s[o].material);
|
|
1325
|
+
a.push(h);
|
|
2543
1326
|
}
|
|
2544
|
-
return
|
|
2545
|
-
const
|
|
2546
|
-
for (let p = 0, g =
|
|
2547
|
-
const A =
|
|
1327
|
+
return a.push(e.loadGeometries(s)), Promise.all(a).then(function(o) {
|
|
1328
|
+
const c = o.slice(0, o.length - 1), h = o[o.length - 1], u = [];
|
|
1329
|
+
for (let p = 0, g = h.length; p < g; p++) {
|
|
1330
|
+
const A = h[p], m = s[p];
|
|
2548
1331
|
let f;
|
|
2549
|
-
const
|
|
2550
|
-
if (m.mode ===
|
|
2551
|
-
f =
|
|
2552
|
-
else if (m.mode ===
|
|
2553
|
-
f = new
|
|
2554
|
-
else if (m.mode ===
|
|
2555
|
-
f = new
|
|
2556
|
-
else if (m.mode ===
|
|
2557
|
-
f = new
|
|
2558
|
-
else if (m.mode ===
|
|
2559
|
-
f = new
|
|
1332
|
+
const E = c[p];
|
|
1333
|
+
if (m.mode === I.TRIANGLES || m.mode === I.TRIANGLE_STRIP || m.mode === I.TRIANGLE_FAN || m.mode === void 0)
|
|
1334
|
+
f = i.isSkinnedMesh === !0 ? new _t(A, E) : new Mt(A, E), f.isSkinnedMesh === !0 && f.normalizeSkinWeights(), m.mode === I.TRIANGLE_STRIP ? f.geometry = Ce(f.geometry, He) : m.mode === I.TRIANGLE_FAN && (f.geometry = Ce(f.geometry, de));
|
|
1335
|
+
else if (m.mode === I.LINES)
|
|
1336
|
+
f = new wt(A, E);
|
|
1337
|
+
else if (m.mode === I.LINE_STRIP)
|
|
1338
|
+
f = new St(A, E);
|
|
1339
|
+
else if (m.mode === I.LINE_LOOP)
|
|
1340
|
+
f = new yt(A, E);
|
|
1341
|
+
else if (m.mode === I.POINTS)
|
|
1342
|
+
f = new Lt(A, E);
|
|
2560
1343
|
else
|
|
2561
1344
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
|
|
2562
|
-
Object.keys(f.geometry.morphAttributes).length > 0 &&
|
|
1345
|
+
Object.keys(f.geometry.morphAttributes).length > 0 && En(f, i), f.name = e.createUniqueName(i.name || "mesh_" + t), F(f, i), m.extensions && k(n, f, m), e.assignFinalMaterial(f), u.push(f);
|
|
2563
1346
|
}
|
|
2564
|
-
for (let p = 0, g =
|
|
2565
|
-
|
|
2566
|
-
meshes:
|
|
1347
|
+
for (let p = 0, g = u.length; p < g; p++)
|
|
1348
|
+
e.associations.set(u[p], {
|
|
1349
|
+
meshes: t,
|
|
2567
1350
|
primitives: p
|
|
2568
1351
|
});
|
|
2569
|
-
if (
|
|
2570
|
-
return
|
|
2571
|
-
const d = new
|
|
2572
|
-
|
|
2573
|
-
for (let p = 0, g =
|
|
2574
|
-
d.add(
|
|
1352
|
+
if (u.length === 1)
|
|
1353
|
+
return i.extensions && k(n, u[0], i), u[0];
|
|
1354
|
+
const d = new ie();
|
|
1355
|
+
i.extensions && k(n, d, i), e.associations.set(d, { meshes: t });
|
|
1356
|
+
for (let p = 0, g = u.length; p < g; p++)
|
|
1357
|
+
d.add(u[p]);
|
|
2575
1358
|
return d;
|
|
2576
1359
|
});
|
|
2577
1360
|
}
|
|
@@ -2580,36 +1363,36 @@ class hr {
|
|
|
2580
1363
|
* @param {number} cameraIndex
|
|
2581
1364
|
* @return {Promise<THREE.Camera>}
|
|
2582
1365
|
*/
|
|
2583
|
-
loadCamera(
|
|
2584
|
-
let
|
|
2585
|
-
const
|
|
1366
|
+
loadCamera(t) {
|
|
1367
|
+
let e;
|
|
1368
|
+
const r = this.json.cameras[t], n = r[r.type];
|
|
2586
1369
|
if (!n) {
|
|
2587
1370
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
2588
1371
|
return;
|
|
2589
1372
|
}
|
|
2590
|
-
return
|
|
1373
|
+
return r.type === "perspective" ? e = new bt(It.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : r.type === "orthographic" && (e = new Nt(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), r.name && (e.name = this.createUniqueName(r.name)), F(e, r), Promise.resolve(e);
|
|
2591
1374
|
}
|
|
2592
1375
|
/**
|
|
2593
1376
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
2594
1377
|
* @param {number} skinIndex
|
|
2595
1378
|
* @return {Promise<Skeleton>}
|
|
2596
1379
|
*/
|
|
2597
|
-
loadSkin(
|
|
2598
|
-
const
|
|
2599
|
-
for (let n = 0,
|
|
2600
|
-
|
|
2601
|
-
return
|
|
2602
|
-
const
|
|
2603
|
-
for (let
|
|
2604
|
-
const
|
|
2605
|
-
if (
|
|
2606
|
-
|
|
2607
|
-
const d = new
|
|
2608
|
-
|
|
1380
|
+
loadSkin(t) {
|
|
1381
|
+
const e = this.json.skins[t], r = [];
|
|
1382
|
+
for (let n = 0, i = e.joints.length; n < i; n++)
|
|
1383
|
+
r.push(this._loadNodeShallow(e.joints[n]));
|
|
1384
|
+
return e.inverseBindMatrices !== void 0 ? r.push(this.getDependency("accessor", e.inverseBindMatrices)) : r.push(null), Promise.all(r).then(function(n) {
|
|
1385
|
+
const i = n.pop(), s = n, a = [], o = [];
|
|
1386
|
+
for (let c = 0, h = s.length; c < h; c++) {
|
|
1387
|
+
const u = s[c];
|
|
1388
|
+
if (u) {
|
|
1389
|
+
a.push(u);
|
|
1390
|
+
const d = new ee();
|
|
1391
|
+
i !== null && d.fromArray(i.array, c * 16), o.push(d);
|
|
2609
1392
|
} else
|
|
2610
|
-
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',
|
|
1393
|
+
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', e.joints[c]);
|
|
2611
1394
|
}
|
|
2612
|
-
return new
|
|
1395
|
+
return new Ct(a, o);
|
|
2613
1396
|
});
|
|
2614
1397
|
}
|
|
2615
1398
|
/**
|
|
@@ -2617,41 +1400,41 @@ class hr {
|
|
|
2617
1400
|
* @param {number} animationIndex
|
|
2618
1401
|
* @return {Promise<AnimationClip>}
|
|
2619
1402
|
*/
|
|
2620
|
-
loadAnimation(
|
|
2621
|
-
const
|
|
2622
|
-
for (let
|
|
2623
|
-
const p = n.channels[
|
|
2624
|
-
A.node !== void 0 && (
|
|
1403
|
+
loadAnimation(t) {
|
|
1404
|
+
const e = this.json, r = this, n = e.animations[t], i = n.name ? n.name : "animation_" + t, s = [], a = [], o = [], c = [], h = [];
|
|
1405
|
+
for (let u = 0, d = n.channels.length; u < d; u++) {
|
|
1406
|
+
const p = n.channels[u], g = n.samplers[p.sampler], A = p.target, m = A.node, f = n.parameters !== void 0 ? n.parameters[g.input] : g.input, E = n.parameters !== void 0 ? n.parameters[g.output] : g.output;
|
|
1407
|
+
A.node !== void 0 && (s.push(this.getDependency("node", m)), a.push(this.getDependency("accessor", f)), o.push(this.getDependency("accessor", E)), c.push(g), h.push(A));
|
|
2625
1408
|
}
|
|
2626
1409
|
return Promise.all([
|
|
1410
|
+
Promise.all(s),
|
|
1411
|
+
Promise.all(a),
|
|
2627
1412
|
Promise.all(o),
|
|
2628
1413
|
Promise.all(c),
|
|
2629
|
-
Promise.all(
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
for (let P = 0; P < M.length; P++)
|
|
2641
|
-
f.push(M[P]);
|
|
1414
|
+
Promise.all(h)
|
|
1415
|
+
]).then(function(u) {
|
|
1416
|
+
const d = u[0], p = u[1], g = u[2], A = u[3], m = u[4], f = [];
|
|
1417
|
+
for (let E = 0, _ = d.length; E < _; E++) {
|
|
1418
|
+
const x = d[E], w = p[E], b = g[E], y = A[E], C = m[E];
|
|
1419
|
+
if (x === void 0) continue;
|
|
1420
|
+
x.updateMatrix && x.updateMatrix();
|
|
1421
|
+
const L = r._createAnimationTracks(x, w, b, y, C);
|
|
1422
|
+
if (L)
|
|
1423
|
+
for (let P = 0; P < L.length; P++)
|
|
1424
|
+
f.push(L[P]);
|
|
2642
1425
|
}
|
|
2643
|
-
return new
|
|
1426
|
+
return new Pt(i, void 0, f);
|
|
2644
1427
|
});
|
|
2645
1428
|
}
|
|
2646
|
-
createNodeMesh(
|
|
2647
|
-
const
|
|
2648
|
-
return n.mesh === void 0 ? null :
|
|
2649
|
-
const
|
|
2650
|
-
return n.weights !== void 0 &&
|
|
2651
|
-
if (
|
|
2652
|
-
for (let
|
|
2653
|
-
|
|
2654
|
-
}),
|
|
1429
|
+
createNodeMesh(t) {
|
|
1430
|
+
const e = this.json, r = this, n = e.nodes[t];
|
|
1431
|
+
return n.mesh === void 0 ? null : r.getDependency("mesh", n.mesh).then(function(i) {
|
|
1432
|
+
const s = r._getNodeRef(r.meshCache, n.mesh, i);
|
|
1433
|
+
return n.weights !== void 0 && s.traverse(function(a) {
|
|
1434
|
+
if (a.isMesh)
|
|
1435
|
+
for (let o = 0, c = n.weights.length; o < c; o++)
|
|
1436
|
+
a.morphTargetInfluences[o] = n.weights[o];
|
|
1437
|
+
}), s;
|
|
2655
1438
|
});
|
|
2656
1439
|
}
|
|
2657
1440
|
/**
|
|
@@ -2659,149 +1442,149 @@ class hr {
|
|
|
2659
1442
|
* @param {number} nodeIndex
|
|
2660
1443
|
* @return {Promise<Object3D>}
|
|
2661
1444
|
*/
|
|
2662
|
-
loadNode(
|
|
2663
|
-
const
|
|
2664
|
-
for (let
|
|
2665
|
-
|
|
2666
|
-
const
|
|
1445
|
+
loadNode(t) {
|
|
1446
|
+
const e = this.json, r = this, n = e.nodes[t], i = r._loadNodeShallow(t), s = [], a = n.children || [];
|
|
1447
|
+
for (let c = 0, h = a.length; c < h; c++)
|
|
1448
|
+
s.push(r.getDependency("node", a[c]));
|
|
1449
|
+
const o = n.skin === void 0 ? Promise.resolve(null) : r.getDependency("skin", n.skin);
|
|
2667
1450
|
return Promise.all([
|
|
2668
|
-
|
|
2669
|
-
Promise.all(
|
|
2670
|
-
|
|
2671
|
-
]).then(function(
|
|
2672
|
-
const
|
|
2673
|
-
d !== null &&
|
|
2674
|
-
p.isSkinnedMesh && p.bind(d,
|
|
1451
|
+
i,
|
|
1452
|
+
Promise.all(s),
|
|
1453
|
+
o
|
|
1454
|
+
]).then(function(c) {
|
|
1455
|
+
const h = c[0], u = c[1], d = c[2];
|
|
1456
|
+
d !== null && h.traverse(function(p) {
|
|
1457
|
+
p.isSkinnedMesh && p.bind(d, _n);
|
|
2675
1458
|
});
|
|
2676
|
-
for (let p = 0, g =
|
|
2677
|
-
|
|
2678
|
-
return
|
|
1459
|
+
for (let p = 0, g = u.length; p < g; p++)
|
|
1460
|
+
h.add(u[p]);
|
|
1461
|
+
return h;
|
|
2679
1462
|
});
|
|
2680
1463
|
}
|
|
2681
1464
|
// ._loadNodeShallow() parses a single node.
|
|
2682
1465
|
// skin and child nodes are created and added in .loadNode() (no '_' prefix).
|
|
2683
|
-
_loadNodeShallow(
|
|
2684
|
-
const
|
|
2685
|
-
if (this.nodeCache[
|
|
2686
|
-
return this.nodeCache[
|
|
2687
|
-
const
|
|
2688
|
-
return
|
|
1466
|
+
_loadNodeShallow(t) {
|
|
1467
|
+
const e = this.json, r = this.extensions, n = this;
|
|
1468
|
+
if (this.nodeCache[t] !== void 0)
|
|
1469
|
+
return this.nodeCache[t];
|
|
1470
|
+
const i = e.nodes[t], s = i.name ? n.createUniqueName(i.name) : "", a = [], o = n._invokeOne(function(c) {
|
|
1471
|
+
return c.createNodeMesh && c.createNodeMesh(t);
|
|
2689
1472
|
});
|
|
2690
|
-
return
|
|
2691
|
-
return n._getNodeRef(n.cameraCache,
|
|
2692
|
-
})), n._invokeAll(function(
|
|
2693
|
-
return
|
|
2694
|
-
}).forEach(function(
|
|
2695
|
-
|
|
2696
|
-
}), this.nodeCache[
|
|
2697
|
-
let
|
|
2698
|
-
if (
|
|
2699
|
-
for (let
|
|
2700
|
-
|
|
2701
|
-
if (
|
|
2702
|
-
const
|
|
2703
|
-
|
|
1473
|
+
return o && a.push(o), i.camera !== void 0 && a.push(n.getDependency("camera", i.camera).then(function(c) {
|
|
1474
|
+
return n._getNodeRef(n.cameraCache, i.camera, c);
|
|
1475
|
+
})), n._invokeAll(function(c) {
|
|
1476
|
+
return c.createNodeAttachment && c.createNodeAttachment(t);
|
|
1477
|
+
}).forEach(function(c) {
|
|
1478
|
+
a.push(c);
|
|
1479
|
+
}), this.nodeCache[t] = Promise.all(a).then(function(c) {
|
|
1480
|
+
let h;
|
|
1481
|
+
if (i.isBone === !0 ? h = new Ft() : c.length > 1 ? h = new ie() : c.length === 1 ? h = c[0] : h = new Ue(), h !== c[0])
|
|
1482
|
+
for (let u = 0, d = c.length; u < d; u++)
|
|
1483
|
+
h.add(c[u]);
|
|
1484
|
+
if (i.name && (h.userData.name = i.name, h.name = s), F(h, i), i.extensions && k(r, h, i), i.matrix !== void 0) {
|
|
1485
|
+
const u = new ee();
|
|
1486
|
+
u.fromArray(i.matrix), h.applyMatrix4(u);
|
|
2704
1487
|
} else
|
|
2705
|
-
|
|
2706
|
-
return n.associations.has(
|
|
2707
|
-
}), this.nodeCache[
|
|
1488
|
+
i.translation !== void 0 && h.position.fromArray(i.translation), i.rotation !== void 0 && h.quaternion.fromArray(i.rotation), i.scale !== void 0 && h.scale.fromArray(i.scale);
|
|
1489
|
+
return n.associations.has(h) || n.associations.set(h, {}), n.associations.get(h).nodes = t, h;
|
|
1490
|
+
}), this.nodeCache[t];
|
|
2708
1491
|
}
|
|
2709
1492
|
/**
|
|
2710
1493
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes
|
|
2711
1494
|
* @param {number} sceneIndex
|
|
2712
1495
|
* @return {Promise<Group>}
|
|
2713
1496
|
*/
|
|
2714
|
-
loadScene(
|
|
2715
|
-
const
|
|
2716
|
-
|
|
2717
|
-
const
|
|
2718
|
-
for (let
|
|
2719
|
-
|
|
2720
|
-
return Promise.all(
|
|
2721
|
-
for (let
|
|
2722
|
-
|
|
2723
|
-
const
|
|
2724
|
-
const
|
|
1497
|
+
loadScene(t) {
|
|
1498
|
+
const e = this.extensions, r = this.json.scenes[t], n = this, i = new ie();
|
|
1499
|
+
r.name && (i.name = n.createUniqueName(r.name)), F(i, r), r.extensions && k(e, i, r);
|
|
1500
|
+
const s = r.nodes || [], a = [];
|
|
1501
|
+
for (let o = 0, c = s.length; o < c; o++)
|
|
1502
|
+
a.push(n.getDependency("node", s[o]));
|
|
1503
|
+
return Promise.all(a).then(function(o) {
|
|
1504
|
+
for (let h = 0, u = o.length; h < u; h++)
|
|
1505
|
+
i.add(o[h]);
|
|
1506
|
+
const c = (h) => {
|
|
1507
|
+
const u = /* @__PURE__ */ new Map();
|
|
2725
1508
|
for (const [d, p] of n.associations)
|
|
2726
|
-
(d instanceof
|
|
2727
|
-
return
|
|
1509
|
+
(d instanceof re || d instanceof Se) && u.set(d, p);
|
|
1510
|
+
return h.traverse((d) => {
|
|
2728
1511
|
const p = n.associations.get(d);
|
|
2729
|
-
p != null &&
|
|
2730
|
-
}),
|
|
1512
|
+
p != null && u.set(d, p);
|
|
1513
|
+
}), u;
|
|
2731
1514
|
};
|
|
2732
|
-
return n.associations =
|
|
1515
|
+
return n.associations = c(i), i;
|
|
2733
1516
|
});
|
|
2734
1517
|
}
|
|
2735
|
-
_createAnimationTracks(
|
|
2736
|
-
const
|
|
2737
|
-
|
|
2738
|
-
d.morphTargetInfluences &&
|
|
2739
|
-
}) :
|
|
2740
|
-
let
|
|
2741
|
-
switch (
|
|
2742
|
-
case
|
|
2743
|
-
|
|
1518
|
+
_createAnimationTracks(t, e, r, n, i) {
|
|
1519
|
+
const s = [], a = t.name ? t.name : t.uuid, o = [];
|
|
1520
|
+
B[i.path] === B.weights ? t.traverse(function(d) {
|
|
1521
|
+
d.morphTargetInfluences && o.push(d.name ? d.name : d.uuid);
|
|
1522
|
+
}) : o.push(a);
|
|
1523
|
+
let c;
|
|
1524
|
+
switch (B[i.path]) {
|
|
1525
|
+
case B.weights:
|
|
1526
|
+
c = Le;
|
|
2744
1527
|
break;
|
|
2745
|
-
case
|
|
2746
|
-
|
|
1528
|
+
case B.rotation:
|
|
1529
|
+
c = be;
|
|
2747
1530
|
break;
|
|
2748
|
-
case
|
|
2749
|
-
case
|
|
2750
|
-
|
|
1531
|
+
case B.position:
|
|
1532
|
+
case B.scale:
|
|
1533
|
+
c = ye;
|
|
2751
1534
|
break;
|
|
2752
1535
|
default:
|
|
2753
|
-
switch (
|
|
1536
|
+
switch (r.itemSize) {
|
|
2754
1537
|
case 1:
|
|
2755
|
-
|
|
1538
|
+
c = Le;
|
|
2756
1539
|
break;
|
|
2757
1540
|
case 2:
|
|
2758
1541
|
case 3:
|
|
2759
1542
|
default:
|
|
2760
|
-
|
|
1543
|
+
c = ye;
|
|
2761
1544
|
break;
|
|
2762
1545
|
}
|
|
2763
1546
|
break;
|
|
2764
1547
|
}
|
|
2765
|
-
const
|
|
2766
|
-
for (let d = 0, p =
|
|
2767
|
-
const g = new
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
1548
|
+
const h = n.interpolation !== void 0 ? gn[n.interpolation] : Xe, u = this._getArrayFromAccessor(r);
|
|
1549
|
+
for (let d = 0, p = o.length; d < p; d++) {
|
|
1550
|
+
const g = new c(
|
|
1551
|
+
o[d] + "." + B[i.path],
|
|
1552
|
+
e.array,
|
|
1553
|
+
u,
|
|
1554
|
+
h
|
|
2772
1555
|
);
|
|
2773
|
-
n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(g),
|
|
1556
|
+
n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(g), s.push(g);
|
|
2774
1557
|
}
|
|
2775
|
-
return
|
|
2776
|
-
}
|
|
2777
|
-
_getArrayFromAccessor(
|
|
2778
|
-
let
|
|
2779
|
-
if (
|
|
2780
|
-
const
|
|
2781
|
-
for (let
|
|
2782
|
-
n[
|
|
2783
|
-
|
|
1558
|
+
return s;
|
|
1559
|
+
}
|
|
1560
|
+
_getArrayFromAccessor(t) {
|
|
1561
|
+
let e = t.array;
|
|
1562
|
+
if (t.normalized) {
|
|
1563
|
+
const r = ge(e.constructor), n = new Float32Array(e.length);
|
|
1564
|
+
for (let i = 0, s = e.length; i < s; i++)
|
|
1565
|
+
n[i] = e[i] * r;
|
|
1566
|
+
e = n;
|
|
2784
1567
|
}
|
|
2785
|
-
return
|
|
1568
|
+
return e;
|
|
2786
1569
|
}
|
|
2787
|
-
_createCubicSplineTrackInterpolant(
|
|
2788
|
-
|
|
2789
|
-
const n = this instanceof
|
|
2790
|
-
return new n(this.times, this.values, this.getValueSize() / 3,
|
|
2791
|
-
},
|
|
1570
|
+
_createCubicSplineTrackInterpolant(t) {
|
|
1571
|
+
t.createInterpolant = function(r) {
|
|
1572
|
+
const n = this instanceof be ? mn : Ve;
|
|
1573
|
+
return new n(this.times, this.values, this.getValueSize() / 3, r);
|
|
1574
|
+
}, t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
2792
1575
|
}
|
|
2793
1576
|
}
|
|
2794
|
-
function
|
|
2795
|
-
const
|
|
2796
|
-
if (
|
|
2797
|
-
const
|
|
2798
|
-
if (
|
|
1577
|
+
function wn(l, t, e) {
|
|
1578
|
+
const r = t.attributes, n = new Bt();
|
|
1579
|
+
if (r.POSITION !== void 0) {
|
|
1580
|
+
const a = e.json.accessors[r.POSITION], o = a.min, c = a.max;
|
|
1581
|
+
if (o !== void 0 && c !== void 0) {
|
|
2799
1582
|
if (n.set(
|
|
2800
|
-
new
|
|
2801
|
-
new
|
|
2802
|
-
),
|
|
2803
|
-
const
|
|
2804
|
-
n.min.multiplyScalar(
|
|
1583
|
+
new G(o[0], o[1], o[2]),
|
|
1584
|
+
new G(c[0], c[1], c[2])
|
|
1585
|
+
), a.normalized) {
|
|
1586
|
+
const h = ge(X[a.componentType]);
|
|
1587
|
+
n.min.multiplyScalar(h), n.max.multiplyScalar(h);
|
|
2805
1588
|
}
|
|
2806
1589
|
} else {
|
|
2807
1590
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
@@ -2809,351 +1592,351 @@ function dr(i, e, t) {
|
|
|
2809
1592
|
}
|
|
2810
1593
|
} else
|
|
2811
1594
|
return;
|
|
2812
|
-
const
|
|
2813
|
-
if (
|
|
2814
|
-
const
|
|
2815
|
-
for (let
|
|
2816
|
-
const
|
|
2817
|
-
if (
|
|
2818
|
-
const d =
|
|
1595
|
+
const i = t.targets;
|
|
1596
|
+
if (i !== void 0) {
|
|
1597
|
+
const a = new G(), o = new G();
|
|
1598
|
+
for (let c = 0, h = i.length; c < h; c++) {
|
|
1599
|
+
const u = i[c];
|
|
1600
|
+
if (u.POSITION !== void 0) {
|
|
1601
|
+
const d = e.json.accessors[u.POSITION], p = d.min, g = d.max;
|
|
2819
1602
|
if (p !== void 0 && g !== void 0) {
|
|
2820
|
-
if (
|
|
2821
|
-
const A =
|
|
2822
|
-
|
|
1603
|
+
if (o.setX(Math.max(Math.abs(p[0]), Math.abs(g[0]))), o.setY(Math.max(Math.abs(p[1]), Math.abs(g[1]))), o.setZ(Math.max(Math.abs(p[2]), Math.abs(g[2]))), d.normalized) {
|
|
1604
|
+
const A = ge(X[d.componentType]);
|
|
1605
|
+
o.multiplyScalar(A);
|
|
2823
1606
|
}
|
|
2824
|
-
|
|
1607
|
+
a.max(o);
|
|
2825
1608
|
} else
|
|
2826
1609
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
2827
1610
|
}
|
|
2828
1611
|
}
|
|
2829
|
-
n.expandByVector(
|
|
1612
|
+
n.expandByVector(a);
|
|
2830
1613
|
}
|
|
2831
|
-
|
|
2832
|
-
const
|
|
2833
|
-
n.getCenter(
|
|
1614
|
+
l.boundingBox = n;
|
|
1615
|
+
const s = new kt();
|
|
1616
|
+
n.getCenter(s.center), s.radius = n.min.distanceTo(n.max) / 2, l.boundingSphere = s;
|
|
2834
1617
|
}
|
|
2835
|
-
function
|
|
2836
|
-
const
|
|
2837
|
-
function
|
|
2838
|
-
return
|
|
2839
|
-
|
|
1618
|
+
function De(l, t, e) {
|
|
1619
|
+
const r = t.attributes, n = [];
|
|
1620
|
+
function i(s, a) {
|
|
1621
|
+
return e.getDependency("accessor", s).then(function(o) {
|
|
1622
|
+
l.setAttribute(a, o);
|
|
2840
1623
|
});
|
|
2841
1624
|
}
|
|
2842
|
-
for (const
|
|
2843
|
-
const
|
|
2844
|
-
|
|
1625
|
+
for (const s in r) {
|
|
1626
|
+
const a = me[s] || s.toLowerCase();
|
|
1627
|
+
a in l.attributes || n.push(i(r[s], a));
|
|
2845
1628
|
}
|
|
2846
|
-
if (
|
|
2847
|
-
const
|
|
2848
|
-
|
|
1629
|
+
if (t.indices !== void 0 && !l.index) {
|
|
1630
|
+
const s = e.getDependency("accessor", t.indices).then(function(a) {
|
|
1631
|
+
l.setIndex(a);
|
|
2849
1632
|
});
|
|
2850
|
-
n.push(
|
|
1633
|
+
n.push(s);
|
|
2851
1634
|
}
|
|
2852
|
-
return
|
|
2853
|
-
return
|
|
1635
|
+
return Ie.workingColorSpace !== D && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Ie.workingColorSpace}" not supported.`), F(l, t), wn(l, t, e), Promise.all(n).then(function() {
|
|
1636
|
+
return t.targets !== void 0 ? Tn(l, t.targets, e) : l;
|
|
2854
1637
|
});
|
|
2855
1638
|
}
|
|
2856
|
-
const
|
|
2857
|
-
const
|
|
2858
|
-
if (
|
|
2859
|
-
const
|
|
2860
|
-
(n) => new Promise((
|
|
2861
|
-
|
|
1639
|
+
const $ = [0, 0, -10], U = [0.5, 0.5, 0.5], ze = 1, ue = /* @__PURE__ */ new Map(), Sn = (l) => {
|
|
1640
|
+
const t = ue.get(l);
|
|
1641
|
+
if (t) return t;
|
|
1642
|
+
const e = new Kt(), r = jt(l).then(
|
|
1643
|
+
(n) => new Promise((i, s) => {
|
|
1644
|
+
e.parse(n, "", i, s);
|
|
2862
1645
|
})
|
|
2863
1646
|
).catch((n) => {
|
|
2864
|
-
throw
|
|
1647
|
+
throw ue.delete(l), n;
|
|
2865
1648
|
});
|
|
2866
|
-
return
|
|
2867
|
-
},
|
|
2868
|
-
position:
|
|
2869
|
-
rotation:
|
|
2870
|
-
scale:
|
|
2871
|
-
url:
|
|
1649
|
+
return ue.set(l, r), r;
|
|
1650
|
+
}, We = ({
|
|
1651
|
+
position: l,
|
|
1652
|
+
rotation: t,
|
|
1653
|
+
scale: e,
|
|
1654
|
+
url: r,
|
|
2872
1655
|
showDebugMaterial: n = !1,
|
|
2873
|
-
opacity:
|
|
1656
|
+
opacity: i = ze
|
|
2874
1657
|
}) => {
|
|
2875
|
-
const
|
|
2876
|
-
|
|
2877
|
-
let
|
|
2878
|
-
return
|
|
2879
|
-
|
|
2880
|
-
}).catch((
|
|
2881
|
-
|
|
1658
|
+
const s = r ?? new URL("/assets/xr/3d-models/head-occluder-v2.glb", Ne.assetStorageEndpoint).toString(), [a, o] = tt(null);
|
|
1659
|
+
we(() => {
|
|
1660
|
+
let h = !1;
|
|
1661
|
+
return Sn(s).then((u) => {
|
|
1662
|
+
h || o(u.scene);
|
|
1663
|
+
}).catch((u) => {
|
|
1664
|
+
h || console.error(`${Ne.loggerPrefix} head occluder load failed`, u);
|
|
2882
1665
|
}), () => {
|
|
2883
|
-
|
|
1666
|
+
h = !0;
|
|
2884
1667
|
};
|
|
2885
|
-
}, [
|
|
2886
|
-
const
|
|
2887
|
-
if (!
|
|
2888
|
-
const
|
|
2889
|
-
return
|
|
2890
|
-
|
|
1668
|
+
}, [s]);
|
|
1669
|
+
const c = Ae(() => {
|
|
1670
|
+
if (!a) return null;
|
|
1671
|
+
const h = a.clone();
|
|
1672
|
+
return h.traverse((u) => {
|
|
1673
|
+
u instanceof K.Mesh && (u.material = new K.MeshStandardMaterial({
|
|
2891
1674
|
color: 15132390,
|
|
2892
1675
|
colorWrite: n,
|
|
2893
1676
|
depthWrite: !0,
|
|
2894
|
-
opacity: n ?
|
|
2895
|
-
side:
|
|
1677
|
+
opacity: n ? i : 1,
|
|
1678
|
+
side: K.DoubleSide,
|
|
2896
1679
|
transparent: n
|
|
2897
1680
|
}));
|
|
2898
|
-
}),
|
|
2899
|
-
}, [
|
|
2900
|
-
return
|
|
2901
|
-
if (
|
|
1681
|
+
}), h;
|
|
1682
|
+
}, [a, n, i]);
|
|
1683
|
+
return we(() => {
|
|
1684
|
+
if (c)
|
|
2902
1685
|
return () => {
|
|
2903
|
-
|
|
2904
|
-
|
|
1686
|
+
c.traverse((h) => {
|
|
1687
|
+
h instanceof K.Mesh && h.material.dispose();
|
|
2905
1688
|
});
|
|
2906
1689
|
};
|
|
2907
|
-
}, [
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
),
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
),
|
|
2916
|
-
},
|
|
2917
|
-
children:
|
|
2918
|
-
faceIndex:
|
|
2919
|
-
numFaces:
|
|
2920
|
-
scaleWithFace:
|
|
1690
|
+
}, [c]), c ? (l ? c.position.set(l[0], l[1], l[2]) : c.position.set(
|
|
1691
|
+
$[0],
|
|
1692
|
+
$[1],
|
|
1693
|
+
$[2]
|
|
1694
|
+
), t && c.rotation.set(t[0], t[1], t[2]), e ? c.scale.set(e[0], e[1], e[2]) : c.scale.set(
|
|
1695
|
+
U[0],
|
|
1696
|
+
U[1],
|
|
1697
|
+
U[2]
|
|
1698
|
+
), c.renderOrder = -1, /* @__PURE__ */ R("primitive", { object: c })) : null;
|
|
1699
|
+
}, yn = 4, vn = ({
|
|
1700
|
+
children: l,
|
|
1701
|
+
faceIndex: t = 0,
|
|
1702
|
+
numFaces: e = yn,
|
|
1703
|
+
scaleWithFace: r = !0,
|
|
2921
1704
|
occluder: n = !0,
|
|
2922
|
-
showFaceMesh:
|
|
2923
|
-
faceMeshMaterial:
|
|
1705
|
+
showFaceMesh: i = !1,
|
|
1706
|
+
faceMeshMaterial: s
|
|
2924
1707
|
}) => {
|
|
2925
|
-
const
|
|
2926
|
-
() => new
|
|
1708
|
+
const a = Ae(
|
|
1709
|
+
() => new K.MeshBasicMaterial({
|
|
2927
1710
|
color: "#22c55e",
|
|
2928
|
-
side:
|
|
1711
|
+
side: K.BackSide,
|
|
2929
1712
|
transparent: !0,
|
|
2930
1713
|
opacity: 0.35,
|
|
2931
1714
|
depthWrite: !1
|
|
2932
1715
|
}),
|
|
2933
1716
|
[]
|
|
2934
|
-
),
|
|
2935
|
-
return /* @__PURE__ */
|
|
2936
|
-
|
|
2937
|
-
|
|
1717
|
+
), o = n === !1 ? null : n === !0 ? {} : n;
|
|
1718
|
+
return /* @__PURE__ */ S(Ut, { faceIndex: t, numFaces: e, scaleWithFace: r, children: [
|
|
1719
|
+
o && /* @__PURE__ */ R(
|
|
1720
|
+
We,
|
|
2938
1721
|
{
|
|
2939
|
-
position:
|
|
2940
|
-
rotation:
|
|
2941
|
-
scale:
|
|
2942
|
-
url:
|
|
2943
|
-
showDebugMaterial:
|
|
2944
|
-
opacity:
|
|
1722
|
+
position: o.position ?? $,
|
|
1723
|
+
rotation: o.rotation,
|
|
1724
|
+
scale: o.scale ?? U,
|
|
1725
|
+
url: o.url,
|
|
1726
|
+
showDebugMaterial: o.showDebugMaterial,
|
|
1727
|
+
opacity: o.opacity ?? ze
|
|
2945
1728
|
}
|
|
2946
1729
|
),
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
1730
|
+
l,
|
|
1731
|
+
i && /* @__PURE__ */ R(
|
|
1732
|
+
vt,
|
|
2950
1733
|
{
|
|
2951
|
-
faceIndex:
|
|
2952
|
-
numFaces:
|
|
2953
|
-
material:
|
|
1734
|
+
faceIndex: t,
|
|
1735
|
+
numFaces: e,
|
|
1736
|
+
material: s ?? a
|
|
2954
1737
|
}
|
|
2955
1738
|
)
|
|
2956
1739
|
] });
|
|
2957
|
-
},
|
|
2958
|
-
eyeMidX:
|
|
2959
|
-
noseX:
|
|
2960
|
-
offsetX:
|
|
2961
|
-
rawYaw:
|
|
1740
|
+
}, Ln = 57, bn = 15.5, he = Ln / Math.PI / bn, In = -0.134, Nn = -0.024, O = (l, t, e) => Math.min(e, Math.max(t, l)), qe = (l, t) => l * t - t / 2, Ze = (l, t) => -(l * t - t / 2), Cn = ({
|
|
1741
|
+
eyeMidX: l,
|
|
1742
|
+
noseX: t,
|
|
1743
|
+
offsetX: e,
|
|
1744
|
+
rawYaw: r,
|
|
2962
1745
|
sideMidX: n
|
|
2963
1746
|
}) => {
|
|
2964
|
-
const
|
|
2965
|
-
return
|
|
2966
|
-
},
|
|
2967
|
-
baseScale:
|
|
2968
|
-
pitchRadians:
|
|
1747
|
+
const i = O((Math.abs(r) - 0.18) / 0.42, 0, 1), s = n * 0.75 + l * 0.25, a = l * 0.7 + t * 0.3;
|
|
1748
|
+
return s * (1 - i) + a * i + e;
|
|
1749
|
+
}, jn = ({
|
|
1750
|
+
baseScale: l,
|
|
1751
|
+
pitchRadians: t
|
|
2969
1752
|
}) => {
|
|
2970
|
-
const
|
|
2971
|
-
return [
|
|
2972
|
-
},
|
|
2973
|
-
const
|
|
2974
|
-
return Math.sign(
|
|
2975
|
-
},
|
|
2976
|
-
pitchRadians:
|
|
1753
|
+
const e = t * 180 / Math.PI, n = 1 + O((e - 6) / 22, 0, 1) * 0.22;
|
|
1754
|
+
return [l[0] * n, l[1] * n, l[2] * n];
|
|
1755
|
+
}, Kn = ({ yawRadians: l }) => {
|
|
1756
|
+
const t = Math.abs(l * 180 / Math.PI), r = 0.066 * O((t - 8) / 12, 0, 1);
|
|
1757
|
+
return Math.sign(l) * r;
|
|
1758
|
+
}, Xn = ({
|
|
1759
|
+
pitchRadians: l
|
|
2977
1760
|
}) => {
|
|
2978
|
-
const
|
|
2979
|
-
return -0.026 *
|
|
2980
|
-
},
|
|
2981
|
-
baseOffset:
|
|
2982
|
-
yawRadians:
|
|
1761
|
+
const t = l * 180 / Math.PI;
|
|
1762
|
+
return -0.026 * O((-t - 6) / 18, 0, 1);
|
|
1763
|
+
}, Yn = ({
|
|
1764
|
+
baseOffset: l,
|
|
1765
|
+
yawRadians: t
|
|
2983
1766
|
}) => {
|
|
2984
|
-
const
|
|
2985
|
-
return
|
|
2986
|
-
},
|
|
2987
|
-
baseOffsetY:
|
|
2988
|
-
baseScaleY:
|
|
2989
|
-
face:
|
|
1767
|
+
const e = Math.abs(t * 180 / Math.PI), r = O((e - 8) / 24, 0, 1);
|
|
1768
|
+
return l + r * 0.25;
|
|
1769
|
+
}, Vn = ({
|
|
1770
|
+
baseOffsetY: l,
|
|
1771
|
+
baseScaleY: t,
|
|
1772
|
+
face: e
|
|
2990
1773
|
}) => {
|
|
2991
|
-
if (!
|
|
1774
|
+
if (!e || e.bounds.width <= 0)
|
|
2992
1775
|
return {
|
|
2993
1776
|
aspectRatio: 0,
|
|
2994
1777
|
normalizedAspect: 0,
|
|
2995
|
-
scaleY:
|
|
2996
|
-
offsetY:
|
|
1778
|
+
scaleY: t,
|
|
1779
|
+
offsetY: l
|
|
2997
1780
|
};
|
|
2998
|
-
const
|
|
1781
|
+
const r = e.bounds.height / e.bounds.width, n = O((r - 1.55) / 0.35, -1, 1);
|
|
2999
1782
|
return {
|
|
3000
|
-
aspectRatio:
|
|
1783
|
+
aspectRatio: r,
|
|
3001
1784
|
normalizedAspect: n,
|
|
3002
|
-
scaleY:
|
|
3003
|
-
offsetY:
|
|
1785
|
+
scaleY: t + n * 0.06,
|
|
1786
|
+
offsetY: l + n * 5e-3
|
|
3004
1787
|
};
|
|
3005
|
-
},
|
|
3006
|
-
face:
|
|
3007
|
-
offsetX:
|
|
3008
|
-
offsetY:
|
|
3009
|
-
scaleX:
|
|
1788
|
+
}, Pn = ({
|
|
1789
|
+
face: l,
|
|
1790
|
+
offsetX: t,
|
|
1791
|
+
offsetY: e,
|
|
1792
|
+
scaleX: r,
|
|
3010
1793
|
scaleY: n
|
|
3011
1794
|
}) => {
|
|
3012
|
-
const
|
|
1795
|
+
const i = l.bounds.width * r, s = l.bounds.height * n, a = l.bounds.centerX + t, o = l.bounds.centerY + e;
|
|
3013
1796
|
return {
|
|
3014
|
-
x:
|
|
3015
|
-
y:
|
|
3016
|
-
width:
|
|
3017
|
-
height:
|
|
3018
|
-
centerX:
|
|
3019
|
-
centerY:
|
|
1797
|
+
x: a - i * 0.5,
|
|
1798
|
+
y: o - s * 0.5,
|
|
1799
|
+
width: i,
|
|
1800
|
+
height: s,
|
|
1801
|
+
centerX: a,
|
|
1802
|
+
centerY: o
|
|
3020
1803
|
};
|
|
3021
|
-
},
|
|
3022
|
-
face:
|
|
3023
|
-
height:
|
|
3024
|
-
lockDepth:
|
|
3025
|
-
lockRotation:
|
|
1804
|
+
}, Fn = ({
|
|
1805
|
+
face: l,
|
|
1806
|
+
height: t,
|
|
1807
|
+
lockDepth: e,
|
|
1808
|
+
lockRotation: r,
|
|
3026
1809
|
model: n,
|
|
3027
|
-
offsetX:
|
|
3028
|
-
offsetY:
|
|
3029
|
-
scaleX:
|
|
3030
|
-
scaleY:
|
|
3031
|
-
scaleZ:
|
|
3032
|
-
width:
|
|
1810
|
+
offsetX: i,
|
|
1811
|
+
offsetY: s,
|
|
1812
|
+
scaleX: a,
|
|
1813
|
+
scaleY: o,
|
|
1814
|
+
scaleZ: c,
|
|
1815
|
+
width: h
|
|
3033
1816
|
}) => {
|
|
3034
|
-
const
|
|
3035
|
-
face:
|
|
3036
|
-
offsetX:
|
|
3037
|
-
offsetY:
|
|
3038
|
-
scaleX:
|
|
3039
|
-
scaleY:
|
|
3040
|
-
}), d =
|
|
3041
|
-
eyeMidX:
|
|
3042
|
-
noseX: (m == null ? void 0 : m.x) ??
|
|
3043
|
-
offsetX:
|
|
3044
|
-
rawYaw:
|
|
3045
|
-
sideMidX:
|
|
3046
|
-
}),
|
|
3047
|
-
(
|
|
1817
|
+
const u = Pn({
|
|
1818
|
+
face: l,
|
|
1819
|
+
offsetX: i,
|
|
1820
|
+
offsetY: s,
|
|
1821
|
+
scaleX: a,
|
|
1822
|
+
scaleY: o
|
|
1823
|
+
}), d = l.landmarks[33], p = l.landmarks[263], g = l.landmarks[234], A = l.landmarks[454], m = l.landmarks[1], f = l.landmarks[10], E = l.landmarks[152], _ = u.width * h, x = u.height * t, w = d && p ? (d.x + p.x) * 0.5 : l.bounds.centerX, b = d && p ? (d.y + p.y) * 0.5 : l.bounds.centerY - l.bounds.height * 0.15, y = g && A ? (g.x + A.x) * 0.5 : w, C = (f == null ? void 0 : f.y) ?? l.bounds.minY, L = (E == null ? void 0 : E.y) ?? l.bounds.maxY, P = (C + L) * 0.5, Q = d && p ? Math.atan2(p.y - d.y, p.x - d.x) : 0, H = m && l.bounds.width > 0 ? O((m.x - l.bounds.centerX) / (l.bounds.width * 0.5), -1, 1) * 0.75 : 0, j = Cn({
|
|
1824
|
+
eyeMidX: w,
|
|
1825
|
+
noseX: (m == null ? void 0 : m.x) ?? w,
|
|
1826
|
+
offsetX: i,
|
|
1827
|
+
rawYaw: H,
|
|
1828
|
+
sideMidX: y
|
|
1829
|
+
}), M = P * 0.75 + b * 0.25 + s, te = n === "v2" ? qe(j, h) : u.centerX * h - h / 2, Y = n === "v2" ? Ze(l.bounds.centerY + s * 0.75, t) : -(u.centerY * t - t / 2), V = f && m ? Math.max(1e-4, m.y - f.y) : l.bounds.height * 0.42, Te = m && E ? Math.max(1e-4, E.y - m.y) : l.bounds.height * 0.58, Ee = (Te - V) / (Te + V), xe = O((Ee - In) / 0.28, -1, 1) * 0.58, Re = m && l.bounds.height > 0 ? O(
|
|
1830
|
+
(l.bounds.centerY - m.y) / (l.bounds.height * 0.5) - Nn,
|
|
3048
1831
|
-1,
|
|
3049
1832
|
1
|
|
3050
|
-
) * 0.18 : 0,
|
|
1833
|
+
) * 0.18 : 0, ne = xe * 0.82 + Re * 0.18, _e = r ? 0 : n === "v2" ? H * 0.72 : H, Je = r ? 0 : n === "v2" ? -ne * 0.78 : -ne, $e = r ? 0 : -Q, et = e ? _ * he : n === "v2" ? _ * (he + Math.abs(_e) * 0.18) : _ * he;
|
|
3051
1834
|
return {
|
|
3052
|
-
centerXPx:
|
|
3053
|
-
centerYPx:
|
|
3054
|
-
depthPx:
|
|
3055
|
-
heightPx:
|
|
3056
|
-
pitch:
|
|
3057
|
-
rawPitch:
|
|
3058
|
-
rawPitchFromBalance:
|
|
3059
|
-
rawPitchFromCenter:
|
|
3060
|
-
rawYaw:
|
|
3061
|
-
rotationZ:
|
|
3062
|
-
roll:
|
|
3063
|
-
shape:
|
|
3064
|
-
skullAnchorX:
|
|
3065
|
-
skullAnchorY:
|
|
3066
|
-
verticalBalance:
|
|
3067
|
-
widthPx:
|
|
3068
|
-
yaw:
|
|
1835
|
+
centerXPx: te,
|
|
1836
|
+
centerYPx: Y,
|
|
1837
|
+
depthPx: et * c,
|
|
1838
|
+
heightPx: x,
|
|
1839
|
+
pitch: Je,
|
|
1840
|
+
rawPitch: ne,
|
|
1841
|
+
rawPitchFromBalance: xe,
|
|
1842
|
+
rawPitchFromCenter: Re,
|
|
1843
|
+
rawYaw: H,
|
|
1844
|
+
rotationZ: $e,
|
|
1845
|
+
roll: Q,
|
|
1846
|
+
shape: u,
|
|
1847
|
+
skullAnchorX: j,
|
|
1848
|
+
skullAnchorY: M,
|
|
1849
|
+
verticalBalance: Ee,
|
|
1850
|
+
widthPx: _,
|
|
1851
|
+
yaw: _e
|
|
3069
1852
|
};
|
|
3070
|
-
},
|
|
3071
|
-
lockDepth:
|
|
3072
|
-
lockRotation:
|
|
3073
|
-
model:
|
|
3074
|
-
face:
|
|
1853
|
+
}, On = ({
|
|
1854
|
+
lockDepth: l,
|
|
1855
|
+
lockRotation: t,
|
|
1856
|
+
model: e,
|
|
1857
|
+
face: r,
|
|
3075
1858
|
height: n,
|
|
3076
|
-
headDepthOffset:
|
|
3077
|
-
offsetX:
|
|
3078
|
-
offsetY:
|
|
3079
|
-
rotationOffsetX:
|
|
3080
|
-
rotationOffsetY:
|
|
3081
|
-
rotationOffsetZ:
|
|
3082
|
-
scaleX:
|
|
1859
|
+
headDepthOffset: i,
|
|
1860
|
+
offsetX: s,
|
|
1861
|
+
offsetY: a,
|
|
1862
|
+
rotationOffsetX: o,
|
|
1863
|
+
rotationOffsetY: c,
|
|
1864
|
+
rotationOffsetZ: h,
|
|
1865
|
+
scaleX: u,
|
|
3083
1866
|
scaleY: d,
|
|
3084
1867
|
scaleZ: p,
|
|
3085
1868
|
skullCenterMode: g,
|
|
3086
1869
|
skullVerticalBias: A,
|
|
3087
1870
|
width: m
|
|
3088
|
-
}) =>
|
|
3089
|
-
lockDepth:
|
|
3090
|
-
lockRotation:
|
|
3091
|
-
model:
|
|
3092
|
-
face:
|
|
1871
|
+
}) => Qe({
|
|
1872
|
+
lockDepth: l,
|
|
1873
|
+
lockRotation: t,
|
|
1874
|
+
model: e,
|
|
1875
|
+
face: r,
|
|
3093
1876
|
height: n,
|
|
3094
|
-
headDepthOffset:
|
|
3095
|
-
offsetX:
|
|
3096
|
-
offsetY:
|
|
3097
|
-
rotationOffsetX:
|
|
3098
|
-
rotationOffsetY:
|
|
3099
|
-
rotationOffsetZ:
|
|
3100
|
-
scaleX:
|
|
1877
|
+
headDepthOffset: i,
|
|
1878
|
+
offsetX: s,
|
|
1879
|
+
offsetY: a,
|
|
1880
|
+
rotationOffsetX: o,
|
|
1881
|
+
rotationOffsetY: c,
|
|
1882
|
+
rotationOffsetZ: h,
|
|
1883
|
+
scaleX: u,
|
|
3101
1884
|
scaleY: d,
|
|
3102
1885
|
scaleZ: p,
|
|
3103
1886
|
skullCenterMode: g,
|
|
3104
1887
|
skullVerticalBias: A,
|
|
3105
1888
|
width: m
|
|
3106
|
-
}).pose,
|
|
3107
|
-
lockDepth:
|
|
3108
|
-
lockRotation:
|
|
3109
|
-
model:
|
|
3110
|
-
face:
|
|
1889
|
+
}).pose, Qe = ({
|
|
1890
|
+
lockDepth: l,
|
|
1891
|
+
lockRotation: t,
|
|
1892
|
+
model: e,
|
|
1893
|
+
face: r,
|
|
3111
1894
|
height: n,
|
|
3112
|
-
headDepthOffset:
|
|
3113
|
-
offsetX:
|
|
3114
|
-
offsetY:
|
|
3115
|
-
rotationOffsetX:
|
|
3116
|
-
rotationOffsetY:
|
|
3117
|
-
rotationOffsetZ:
|
|
3118
|
-
scaleX:
|
|
1895
|
+
headDepthOffset: i,
|
|
1896
|
+
offsetX: s,
|
|
1897
|
+
offsetY: a,
|
|
1898
|
+
rotationOffsetX: o,
|
|
1899
|
+
rotationOffsetY: c,
|
|
1900
|
+
rotationOffsetZ: h,
|
|
1901
|
+
scaleX: u,
|
|
3119
1902
|
scaleY: d,
|
|
3120
1903
|
scaleZ: p,
|
|
3121
1904
|
skullCenterMode: g,
|
|
3122
1905
|
skullVerticalBias: A,
|
|
3123
1906
|
width: m
|
|
3124
1907
|
}) => {
|
|
3125
|
-
const f =
|
|
3126
|
-
face:
|
|
1908
|
+
const f = Fn({
|
|
1909
|
+
face: r,
|
|
3127
1910
|
height: n,
|
|
3128
|
-
lockDepth:
|
|
3129
|
-
lockRotation:
|
|
3130
|
-
model:
|
|
3131
|
-
offsetX:
|
|
3132
|
-
offsetY:
|
|
3133
|
-
scaleX:
|
|
1911
|
+
lockDepth: l,
|
|
1912
|
+
lockRotation: t,
|
|
1913
|
+
model: e,
|
|
1914
|
+
offsetX: s,
|
|
1915
|
+
offsetY: a,
|
|
1916
|
+
scaleX: u,
|
|
3134
1917
|
scaleY: d,
|
|
3135
1918
|
scaleZ: p,
|
|
3136
1919
|
width: m
|
|
3137
1920
|
});
|
|
3138
1921
|
if (g) {
|
|
3139
|
-
const
|
|
1922
|
+
const _ = new G(
|
|
3140
1923
|
0,
|
|
3141
1924
|
f.heightPx * A,
|
|
3142
|
-
-f.depthPx *
|
|
1925
|
+
-f.depthPx * i
|
|
3143
1926
|
).applyEuler(
|
|
3144
|
-
new
|
|
3145
|
-
),
|
|
1927
|
+
new Gt(f.pitch, f.yaw, f.rotationZ, "XYZ")
|
|
1928
|
+
), x = qe(f.skullAnchorX, m), w = Ze(f.skullAnchorY, n);
|
|
3146
1929
|
return {
|
|
3147
1930
|
pose: {
|
|
3148
|
-
boxCenterZ:
|
|
3149
|
-
centerX:
|
|
3150
|
-
centerY:
|
|
1931
|
+
boxCenterZ: _.z,
|
|
1932
|
+
centerX: x + _.x,
|
|
1933
|
+
centerY: w + _.y,
|
|
3151
1934
|
width: f.widthPx,
|
|
3152
1935
|
height: f.heightPx,
|
|
3153
1936
|
depth: f.depthPx,
|
|
3154
|
-
rotationX: f.pitch +
|
|
3155
|
-
rotationY: f.yaw +
|
|
3156
|
-
rotationZ: f.rotationZ +
|
|
1937
|
+
rotationX: f.pitch + o,
|
|
1938
|
+
rotationY: f.yaw + c,
|
|
1939
|
+
rotationZ: f.rotationZ + h
|
|
3157
1940
|
},
|
|
3158
1941
|
debugMetrics: {
|
|
3159
1942
|
face: {
|
|
@@ -3173,18 +1956,18 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3173
1956
|
pose: {
|
|
3174
1957
|
pitch: f.pitch,
|
|
3175
1958
|
yaw: f.yaw,
|
|
3176
|
-
rotationX: f.pitch +
|
|
3177
|
-
rotationY: f.yaw +
|
|
3178
|
-
rotationZ: f.rotationZ +
|
|
1959
|
+
rotationX: f.pitch + o,
|
|
1960
|
+
rotationY: f.yaw + c,
|
|
1961
|
+
rotationZ: f.rotationZ + h
|
|
3179
1962
|
},
|
|
3180
1963
|
skullAnchor: {
|
|
3181
1964
|
x: f.skullAnchorX,
|
|
3182
1965
|
y: f.skullAnchorY
|
|
3183
1966
|
},
|
|
3184
1967
|
center: {
|
|
3185
|
-
x:
|
|
3186
|
-
y:
|
|
3187
|
-
z:
|
|
1968
|
+
x: x + _.x,
|
|
1969
|
+
y: w + _.y,
|
|
1970
|
+
z: _.z
|
|
3188
1971
|
},
|
|
3189
1972
|
depthPx: f.depthPx,
|
|
3190
1973
|
screen: {
|
|
@@ -3196,15 +1979,15 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3196
1979
|
}
|
|
3197
1980
|
return {
|
|
3198
1981
|
pose: {
|
|
3199
|
-
boxCenterZ: -f.depthPx *
|
|
1982
|
+
boxCenterZ: -f.depthPx * i,
|
|
3200
1983
|
centerX: f.centerXPx,
|
|
3201
1984
|
centerY: f.centerYPx,
|
|
3202
1985
|
width: f.widthPx,
|
|
3203
1986
|
height: f.heightPx,
|
|
3204
1987
|
depth: f.depthPx,
|
|
3205
|
-
rotationX: f.pitch +
|
|
3206
|
-
rotationY: f.yaw +
|
|
3207
|
-
rotationZ: f.rotationZ +
|
|
1988
|
+
rotationX: f.pitch + o,
|
|
1989
|
+
rotationY: f.yaw + c,
|
|
1990
|
+
rotationZ: f.rotationZ + h
|
|
3208
1991
|
},
|
|
3209
1992
|
debugMetrics: {
|
|
3210
1993
|
face: {
|
|
@@ -3224,9 +2007,9 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3224
2007
|
pose: {
|
|
3225
2008
|
pitch: f.pitch,
|
|
3226
2009
|
yaw: f.yaw,
|
|
3227
|
-
rotationX: f.pitch +
|
|
3228
|
-
rotationY: f.yaw +
|
|
3229
|
-
rotationZ: f.rotationZ +
|
|
2010
|
+
rotationX: f.pitch + o,
|
|
2011
|
+
rotationY: f.yaw + c,
|
|
2012
|
+
rotationZ: f.rotationZ + h
|
|
3230
2013
|
},
|
|
3231
2014
|
skullAnchor: {
|
|
3232
2015
|
x: f.skullAnchorX,
|
|
@@ -3235,7 +2018,7 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3235
2018
|
center: {
|
|
3236
2019
|
x: f.centerXPx,
|
|
3237
2020
|
y: f.centerYPx,
|
|
3238
|
-
z: -f.depthPx *
|
|
2021
|
+
z: -f.depthPx * i
|
|
3239
2022
|
},
|
|
3240
2023
|
depthPx: f.depthPx,
|
|
3241
2024
|
screen: {
|
|
@@ -3244,151 +2027,151 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3244
2027
|
}
|
|
3245
2028
|
}
|
|
3246
2029
|
};
|
|
3247
|
-
},
|
|
3248
|
-
lockDepth:
|
|
3249
|
-
lockRotation:
|
|
3250
|
-
model:
|
|
3251
|
-
face:
|
|
2030
|
+
}, zn = ({
|
|
2031
|
+
lockDepth: l,
|
|
2032
|
+
lockRotation: t,
|
|
2033
|
+
model: e,
|
|
2034
|
+
face: r,
|
|
3252
2035
|
height: n,
|
|
3253
|
-
headDepthOffset:
|
|
3254
|
-
offsetX:
|
|
3255
|
-
offsetY:
|
|
3256
|
-
rotationOffsetX:
|
|
3257
|
-
rotationOffsetY:
|
|
3258
|
-
rotationOffsetZ:
|
|
3259
|
-
scaleX:
|
|
2036
|
+
headDepthOffset: i,
|
|
2037
|
+
offsetX: s,
|
|
2038
|
+
offsetY: a,
|
|
2039
|
+
rotationOffsetX: o,
|
|
2040
|
+
rotationOffsetY: c,
|
|
2041
|
+
rotationOffsetZ: h,
|
|
2042
|
+
scaleX: u,
|
|
3260
2043
|
scaleY: d,
|
|
3261
2044
|
scaleZ: p,
|
|
3262
2045
|
skullCenterMode: g,
|
|
3263
2046
|
skullVerticalBias: A,
|
|
3264
2047
|
width: m
|
|
3265
|
-
}) =>
|
|
3266
|
-
lockDepth:
|
|
3267
|
-
lockRotation:
|
|
3268
|
-
model:
|
|
3269
|
-
face:
|
|
2048
|
+
}) => Qe({
|
|
2049
|
+
lockDepth: l,
|
|
2050
|
+
lockRotation: t,
|
|
2051
|
+
model: e,
|
|
2052
|
+
face: r,
|
|
3270
2053
|
height: n,
|
|
3271
|
-
headDepthOffset:
|
|
3272
|
-
offsetX:
|
|
3273
|
-
offsetY:
|
|
3274
|
-
rotationOffsetX:
|
|
3275
|
-
rotationOffsetY:
|
|
3276
|
-
rotationOffsetZ:
|
|
3277
|
-
scaleX:
|
|
2054
|
+
headDepthOffset: i,
|
|
2055
|
+
offsetX: s,
|
|
2056
|
+
offsetY: a,
|
|
2057
|
+
rotationOffsetX: o,
|
|
2058
|
+
rotationOffsetY: c,
|
|
2059
|
+
rotationOffsetZ: h,
|
|
2060
|
+
scaleX: u,
|
|
3278
2061
|
scaleY: d,
|
|
3279
2062
|
scaleZ: p,
|
|
3280
2063
|
skullCenterMode: g,
|
|
3281
2064
|
skullVerticalBias: A,
|
|
3282
2065
|
width: m
|
|
3283
|
-
}).debugMetrics,
|
|
3284
|
-
boxColor:
|
|
3285
|
-
boxOpacity:
|
|
3286
|
-
face:
|
|
3287
|
-
headDepthOffset:
|
|
2066
|
+
}).debugMetrics, Wn = ({
|
|
2067
|
+
boxColor: l,
|
|
2068
|
+
boxOpacity: t,
|
|
2069
|
+
face: e,
|
|
2070
|
+
headDepthOffset: r,
|
|
3288
2071
|
lockDepth: n,
|
|
3289
|
-
lockRotation:
|
|
3290
|
-
model:
|
|
3291
|
-
occluderOffset:
|
|
3292
|
-
occluderOpacity:
|
|
3293
|
-
occluderScale:
|
|
3294
|
-
showOccluderProxy:
|
|
3295
|
-
offsetX:
|
|
2072
|
+
lockRotation: i,
|
|
2073
|
+
model: s,
|
|
2074
|
+
occluderOffset: a,
|
|
2075
|
+
occluderOpacity: o,
|
|
2076
|
+
occluderScale: c,
|
|
2077
|
+
showOccluderProxy: h = !1,
|
|
2078
|
+
offsetX: u,
|
|
3296
2079
|
offsetY: d,
|
|
3297
2080
|
pose: p,
|
|
3298
2081
|
rotationOffsetX: g,
|
|
3299
2082
|
rotationOffsetY: A,
|
|
3300
2083
|
rotationOffsetZ: m,
|
|
3301
2084
|
scaleX: f,
|
|
3302
|
-
scaleY:
|
|
3303
|
-
scaleZ:
|
|
3304
|
-
show:
|
|
3305
|
-
showCenterDot:
|
|
3306
|
-
showFacePlaneReference:
|
|
3307
|
-
showGizmo:
|
|
3308
|
-
showHeadOccluder:
|
|
3309
|
-
skullCenterMode:
|
|
2085
|
+
scaleY: E,
|
|
2086
|
+
scaleZ: _,
|
|
2087
|
+
show: x,
|
|
2088
|
+
showCenterDot: w,
|
|
2089
|
+
showFacePlaneReference: b,
|
|
2090
|
+
showGizmo: y,
|
|
2091
|
+
showHeadOccluder: C,
|
|
2092
|
+
skullCenterMode: L,
|
|
3310
2093
|
skullVerticalBias: P,
|
|
3311
|
-
url:
|
|
3312
|
-
viewportHeight:
|
|
3313
|
-
viewportWidth:
|
|
2094
|
+
url: Q,
|
|
2095
|
+
viewportHeight: H,
|
|
2096
|
+
viewportWidth: j
|
|
3314
2097
|
}) => {
|
|
3315
|
-
const
|
|
3316
|
-
face:
|
|
3317
|
-
width:
|
|
3318
|
-
height:
|
|
3319
|
-
headDepthOffset:
|
|
2098
|
+
const M = Ae(() => p || (!e || j <= 0 || H <= 0 ? null : On({
|
|
2099
|
+
face: e,
|
|
2100
|
+
width: j,
|
|
2101
|
+
height: H,
|
|
2102
|
+
headDepthOffset: r,
|
|
3320
2103
|
lockDepth: n,
|
|
3321
|
-
lockRotation:
|
|
3322
|
-
model:
|
|
3323
|
-
offsetX:
|
|
2104
|
+
lockRotation: i,
|
|
2105
|
+
model: s,
|
|
2106
|
+
offsetX: u,
|
|
3324
2107
|
offsetY: d,
|
|
3325
2108
|
rotationOffsetX: g,
|
|
3326
2109
|
rotationOffsetY: A,
|
|
3327
2110
|
rotationOffsetZ: m,
|
|
3328
2111
|
scaleX: f,
|
|
3329
|
-
scaleY:
|
|
3330
|
-
scaleZ:
|
|
3331
|
-
skullCenterMode:
|
|
2112
|
+
scaleY: E,
|
|
2113
|
+
scaleZ: _,
|
|
2114
|
+
skullCenterMode: L,
|
|
3332
2115
|
skullVerticalBias: P
|
|
3333
2116
|
})), [
|
|
3334
|
-
|
|
3335
|
-
s,
|
|
3336
|
-
n,
|
|
2117
|
+
e,
|
|
3337
2118
|
r,
|
|
3338
|
-
|
|
3339
|
-
|
|
2119
|
+
n,
|
|
2120
|
+
i,
|
|
2121
|
+
s,
|
|
2122
|
+
u,
|
|
3340
2123
|
d,
|
|
3341
2124
|
g,
|
|
3342
2125
|
A,
|
|
3343
2126
|
m,
|
|
3344
2127
|
f,
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
2128
|
+
E,
|
|
2129
|
+
_,
|
|
2130
|
+
L,
|
|
3348
2131
|
P,
|
|
3349
2132
|
p,
|
|
3350
|
-
|
|
3351
|
-
|
|
2133
|
+
H,
|
|
2134
|
+
j
|
|
3352
2135
|
]);
|
|
3353
|
-
if (!
|
|
3354
|
-
const
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
2136
|
+
if (!x || !M) return null;
|
|
2137
|
+
const te = L ? [0, -M.height * P, M.depth * r] : [0, 0, 0], Y = M.height, V = [
|
|
2138
|
+
U[0] * c[0] * Y,
|
|
2139
|
+
U[1] * c[1] * Y,
|
|
2140
|
+
U[2] * c[2] * Y
|
|
3358
2141
|
];
|
|
3359
|
-
return /* @__PURE__ */
|
|
3360
|
-
/* @__PURE__ */
|
|
2142
|
+
return /* @__PURE__ */ S(Me, { children: [
|
|
2143
|
+
/* @__PURE__ */ S(
|
|
3361
2144
|
"group",
|
|
3362
2145
|
{
|
|
3363
|
-
position: [
|
|
3364
|
-
rotation: [
|
|
2146
|
+
position: [M.centerX, M.centerY, M.boxCenterZ],
|
|
2147
|
+
rotation: [M.rotationX, M.rotationY, M.rotationZ],
|
|
3365
2148
|
children: [
|
|
3366
|
-
/* @__PURE__ */
|
|
3367
|
-
/* @__PURE__ */
|
|
3368
|
-
/* @__PURE__ */
|
|
2149
|
+
/* @__PURE__ */ R("group", { scale: [M.width, M.height, M.depth], children: t > 0 && /* @__PURE__ */ S("mesh", { children: [
|
|
2150
|
+
/* @__PURE__ */ R("boxGeometry", { args: [1, 1, 1] }),
|
|
2151
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: l, wireframe: !0, transparent: !0, opacity: t })
|
|
3369
2152
|
] }) }),
|
|
3370
|
-
|
|
3371
|
-
/* @__PURE__ */
|
|
3372
|
-
/* @__PURE__ */
|
|
2153
|
+
w && /* @__PURE__ */ S("mesh", { children: [
|
|
2154
|
+
/* @__PURE__ */ R("sphereGeometry", { args: [6, 20, 20] }),
|
|
2155
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: l })
|
|
3373
2156
|
] }),
|
|
3374
|
-
|
|
3375
|
-
/* @__PURE__ */
|
|
3376
|
-
/* @__PURE__ */
|
|
3377
|
-
/* @__PURE__ */
|
|
2157
|
+
b && /* @__PURE__ */ S("group", { position: te, children: [
|
|
2158
|
+
/* @__PURE__ */ S("mesh", { rotation: [0, 0, Math.PI / 4], children: [
|
|
2159
|
+
/* @__PURE__ */ R("ringGeometry", { args: [6, 8, 24] }),
|
|
2160
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: "#f8fafc", side: J })
|
|
3378
2161
|
] }),
|
|
3379
|
-
/* @__PURE__ */
|
|
3380
|
-
/* @__PURE__ */
|
|
3381
|
-
/* @__PURE__ */
|
|
2162
|
+
/* @__PURE__ */ S("mesh", { rotation: [0, 0, Math.PI / 2], children: [
|
|
2163
|
+
/* @__PURE__ */ R("planeGeometry", { args: [3, 16] }),
|
|
2164
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: J })
|
|
3382
2165
|
] }),
|
|
3383
|
-
/* @__PURE__ */
|
|
3384
|
-
/* @__PURE__ */
|
|
3385
|
-
/* @__PURE__ */
|
|
2166
|
+
/* @__PURE__ */ S("mesh", { children: [
|
|
2167
|
+
/* @__PURE__ */ R("planeGeometry", { args: [16, 3] }),
|
|
2168
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: J })
|
|
3386
2169
|
] })
|
|
3387
2170
|
] }),
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
/* @__PURE__ */
|
|
3391
|
-
/* @__PURE__ */
|
|
2171
|
+
C && /* @__PURE__ */ S(Me, { children: [
|
|
2172
|
+
h && /* @__PURE__ */ S("mesh", { position: a, scale: V, renderOrder: 20, children: [
|
|
2173
|
+
/* @__PURE__ */ R("sphereGeometry", { args: [1, 24, 16] }),
|
|
2174
|
+
/* @__PURE__ */ R(
|
|
3392
2175
|
"meshBasicMaterial",
|
|
3393
2176
|
{
|
|
3394
2177
|
color: "#facc15",
|
|
@@ -3400,57 +2183,57 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3400
2183
|
}
|
|
3401
2184
|
)
|
|
3402
2185
|
] }),
|
|
3403
|
-
/* @__PURE__ */
|
|
3404
|
-
|
|
2186
|
+
/* @__PURE__ */ R(
|
|
2187
|
+
We,
|
|
3405
2188
|
{
|
|
3406
|
-
opacity:
|
|
3407
|
-
position:
|
|
3408
|
-
scale:
|
|
2189
|
+
opacity: o,
|
|
2190
|
+
position: a,
|
|
2191
|
+
scale: V,
|
|
3409
2192
|
showDebugMaterial: !0,
|
|
3410
|
-
url:
|
|
2193
|
+
url: Q
|
|
3411
2194
|
}
|
|
3412
2195
|
)
|
|
3413
2196
|
] })
|
|
3414
2197
|
]
|
|
3415
2198
|
}
|
|
3416
2199
|
),
|
|
3417
|
-
|
|
2200
|
+
y && /* @__PURE__ */ R(
|
|
3418
2201
|
"group",
|
|
3419
2202
|
{
|
|
3420
|
-
position: [
|
|
3421
|
-
rotation: [
|
|
2203
|
+
position: [M.centerX, M.centerY, M.boxCenterZ],
|
|
2204
|
+
rotation: [M.rotationX, M.rotationY, M.rotationZ],
|
|
3422
2205
|
renderOrder: 10,
|
|
3423
|
-
children: /* @__PURE__ */
|
|
3424
|
-
/* @__PURE__ */
|
|
3425
|
-
/* @__PURE__ */
|
|
3426
|
-
/* @__PURE__ */
|
|
2206
|
+
children: /* @__PURE__ */ S("group", { children: [
|
|
2207
|
+
/* @__PURE__ */ S("mesh", { children: [
|
|
2208
|
+
/* @__PURE__ */ R("sphereGeometry", { args: [6, 20, 20] }),
|
|
2209
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: "#e2e8f0", depthTest: !1, depthWrite: !1 })
|
|
3427
2210
|
] }),
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
/* @__PURE__ */
|
|
3430
|
-
/* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ S("mesh", { position: [18, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
|
|
2212
|
+
/* @__PURE__ */ R("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
|
|
2213
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
|
|
3431
2214
|
] }),
|
|
3432
|
-
/* @__PURE__ */
|
|
3433
|
-
/* @__PURE__ */
|
|
3434
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ S("mesh", { position: [34, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
|
|
2216
|
+
/* @__PURE__ */ R("coneGeometry", { args: [4.2, 12, 16] }),
|
|
2217
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
|
|
3435
2218
|
] }),
|
|
3436
|
-
/* @__PURE__ */
|
|
3437
|
-
/* @__PURE__ */
|
|
3438
|
-
/* @__PURE__ */
|
|
2219
|
+
/* @__PURE__ */ S("mesh", { position: [0, 18, 0], children: [
|
|
2220
|
+
/* @__PURE__ */ R("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
|
|
2221
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
|
|
3439
2222
|
] }),
|
|
3440
|
-
/* @__PURE__ */
|
|
3441
|
-
/* @__PURE__ */
|
|
3442
|
-
/* @__PURE__ */
|
|
2223
|
+
/* @__PURE__ */ S("mesh", { position: [0, 34, 0], children: [
|
|
2224
|
+
/* @__PURE__ */ R("coneGeometry", { args: [4.2, 12, 16] }),
|
|
2225
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
|
|
3443
2226
|
] }),
|
|
3444
|
-
/* @__PURE__ */
|
|
3445
|
-
/* @__PURE__ */
|
|
3446
|
-
/* @__PURE__ */
|
|
2227
|
+
/* @__PURE__ */ S("mesh", { position: [0, 0, 18], rotation: [Math.PI / 2, 0, 0], children: [
|
|
2228
|
+
/* @__PURE__ */ R("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
|
|
2229
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
|
|
3447
2230
|
] }),
|
|
3448
|
-
/* @__PURE__ */
|
|
3449
|
-
/* @__PURE__ */
|
|
3450
|
-
/* @__PURE__ */
|
|
2231
|
+
/* @__PURE__ */ S("mesh", { position: [0, 0, 34], rotation: [Math.PI / 2, 0, 0], children: [
|
|
2232
|
+
/* @__PURE__ */ R("coneGeometry", { args: [4.2, 12, 16] }),
|
|
2233
|
+
/* @__PURE__ */ R("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
|
|
3451
2234
|
] }),
|
|
3452
|
-
/* @__PURE__ */
|
|
3453
|
-
|
|
2235
|
+
/* @__PURE__ */ R(
|
|
2236
|
+
oe,
|
|
3454
2237
|
{
|
|
3455
2238
|
position: [42, 0, 0],
|
|
3456
2239
|
fontSize: 10,
|
|
@@ -3462,8 +2245,8 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3462
2245
|
children: "X"
|
|
3463
2246
|
}
|
|
3464
2247
|
),
|
|
3465
|
-
/* @__PURE__ */
|
|
3466
|
-
|
|
2248
|
+
/* @__PURE__ */ R(
|
|
2249
|
+
oe,
|
|
3467
2250
|
{
|
|
3468
2251
|
position: [0, 42, 0],
|
|
3469
2252
|
fontSize: 10,
|
|
@@ -3475,8 +2258,8 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3475
2258
|
children: "Y"
|
|
3476
2259
|
}
|
|
3477
2260
|
),
|
|
3478
|
-
/* @__PURE__ */
|
|
3479
|
-
|
|
2261
|
+
/* @__PURE__ */ R(
|
|
2262
|
+
oe,
|
|
3480
2263
|
{
|
|
3481
2264
|
position: [0, 0, 42],
|
|
3482
2265
|
fontSize: 10,
|
|
@@ -3494,49 +2277,57 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
|
|
|
3494
2277
|
] });
|
|
3495
2278
|
};
|
|
3496
2279
|
export {
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
2280
|
+
Qn as CANONICAL_FACE_MESH_GEOMETRY_SPECS,
|
|
2281
|
+
Jn as CanonicalFaceMeshRenderer,
|
|
2282
|
+
$n as DEFAULT_APPEARANCE,
|
|
2283
|
+
es as DEFAULT_FACE_MESH_RENDERER,
|
|
2284
|
+
ts as DEFAULT_FACE_MESH_TRANSFORM,
|
|
2285
|
+
Ms as DEFAULT_FACE_WARP_3D_SETTINGS,
|
|
2286
|
+
ns as DEFAULT_MASKING,
|
|
2287
|
+
ss as FACE_MESH_ALPHA_MAPS,
|
|
2288
|
+
rs as FACE_MESH_BLEND_MODES,
|
|
2289
|
+
is as FACE_MESH_MASK_TEXTURE_SOURCES,
|
|
2290
|
+
os as FACE_MESH_MATERIAL_TYPES,
|
|
2291
|
+
as as FACE_MESH_SHADER_PRESETS,
|
|
2292
|
+
cs as FACE_MESH_SIDES,
|
|
2293
|
+
ls as FACE_MESH_TEXTURE_MAPS,
|
|
2294
|
+
ws as FACE_RETOUCH_DEFAULT_CONTROLS,
|
|
2295
|
+
Ss as FACE_RETOUCH_SETTINGS_FIELDS,
|
|
2296
|
+
ys as FACE_WARP_3D_PRESET,
|
|
2297
|
+
us as FaceMeshMaterial,
|
|
2298
|
+
hs as FaceMeshRenderer,
|
|
2299
|
+
Ls as FaceRetouch,
|
|
2300
|
+
ze as HEAD_OCCLUDER_DEFAULT_OPACITY,
|
|
2301
|
+
$ as HEAD_OCCLUDER_DEFAULT_POSITION,
|
|
2302
|
+
U as HEAD_OCCLUDER_DEFAULT_SCALE,
|
|
2303
|
+
vn as HeadBinding,
|
|
2304
|
+
Wn as HeadBindingOccluder,
|
|
2305
|
+
We as HeadOccluder,
|
|
2306
|
+
bs as alphaMapOptions,
|
|
2307
|
+
ds as blendModeIndices,
|
|
2308
|
+
Is as blendModeOptions,
|
|
2309
|
+
fs as canonicalFaceAlphaMaskUrl,
|
|
2310
|
+
ps as canonicalFaceTextureStyle2Url,
|
|
2311
|
+
ms as canonicalFaceTextureUrl,
|
|
2312
|
+
Vn as computeAdaptiveVerticalFit,
|
|
2313
|
+
On as computeHeadBindingCubePose,
|
|
2314
|
+
zn as computeHeadBindingDebugMetrics,
|
|
2315
|
+
Pn as computeHeadBindingShape,
|
|
2316
|
+
Yn as computeUniversalHeadDepthOffset,
|
|
2317
|
+
jn as computeUniversalOccluderScale,
|
|
2318
|
+
Xn as computeUniversalPitchOffsetY,
|
|
2319
|
+
Kn as computeUniversalYawOffsetX,
|
|
2320
|
+
gs as mapFaceMeshRendererSettingsToProps,
|
|
2321
|
+
Ns as materialTypeOptions,
|
|
2322
|
+
As as parseCanonicalFaceModel,
|
|
2323
|
+
Cs as patchFaceRetouchControls,
|
|
2324
|
+
Ts as resolveFaceMeshRendererSettings,
|
|
2325
|
+
Ps as resolveFaceRetouchControls,
|
|
2326
|
+
Fs as shaderPresetOptions,
|
|
2327
|
+
Os as sideOptions,
|
|
2328
|
+
Qe as solveHeadBinding,
|
|
2329
|
+
Es as supportsBlendMode,
|
|
2330
|
+
xs as supportsTexturePanel,
|
|
2331
|
+
Ds as textureMapOptions,
|
|
2332
|
+
Rs as useCanonicalFaceMesh
|
|
3542
2333
|
};
|