@react-three/drei 10.7.6 → 10.8.0-alpha.1
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/README.md +49 -758
- package/_chunks/hls.mjs +3 -0
- package/_chunks/libs/@mediapipe/tasks-vision.mjs +4781 -0
- package/_chunks/libs/@monogrid/gainmap-js.mjs +1137 -0
- package/_chunks/libs/@use-gesture/core.mjs +1650 -0
- package/_chunks/libs/@use-gesture/react.mjs +207 -0
- package/_chunks/libs/camera-controls.mjs +2207 -0
- package/_chunks/libs/detect-gpu.mjs +515 -0
- package/_chunks/libs/hls.js.mjs +21925 -0
- package/_chunks/libs/maath.mjs +5200 -0
- package/_chunks/libs/stats-gl.mjs +301 -0
- package/_chunks/libs/stats.js.mjs +90 -0
- package/_chunks/libs/suspend-react.mjs +60 -0
- package/_chunks/libs/three.mjs +23169 -0
- package/_chunks/libs/tunnel-rat.mjs +458 -0
- package/_chunks/libs/zustand.mjs +104 -0
- package/_chunks/rolldown-runtime.mjs +47 -0
- package/_chunks/vision_bundle.mjs +3 -0
- package/core/_chunks/hls.mjs +3 -0
- package/core/_chunks/libs/@monogrid/gainmap-js.mjs +1137 -0
- package/core/_chunks/libs/@use-gesture/core.mjs +1650 -0
- package/core/_chunks/libs/@use-gesture/react.mjs +207 -0
- package/core/_chunks/libs/detect-gpu.mjs +515 -0
- package/core/_chunks/libs/hls.js.mjs +21925 -0
- package/core/_chunks/libs/maath.mjs +5200 -0
- package/core/_chunks/libs/stats-gl.mjs +301 -0
- package/core/_chunks/libs/stats.js.mjs +90 -0
- package/core/_chunks/libs/suspend-react.mjs +60 -0
- package/core/_chunks/libs/three.mjs +22457 -0
- package/core/_chunks/libs/tunnel-rat.mjs +458 -0
- package/core/_chunks/libs/zustand.mjs +104 -0
- package/core/_chunks/rolldown-runtime.mjs +47 -0
- package/core/core/index.d.mts +2232 -0
- package/core/core/index.mjs +11082 -0
- package/experimental/_chunks/libs/three.mjs +15386 -0
- package/experimental/experimental/index.d.mts +253 -0
- package/experimental/experimental/index.mjs +434 -0
- package/external/_chunks/hls.mjs +3 -0
- package/external/_chunks/libs/@mediapipe/tasks-vision.mjs +4781 -0
- package/external/_chunks/libs/camera-controls.mjs +2207 -0
- package/external/_chunks/libs/hls.js.mjs +21925 -0
- package/external/_chunks/libs/maath.mjs +5200 -0
- package/external/_chunks/libs/suspend-react.mjs +58 -0
- package/external/_chunks/libs/three.mjs +15387 -0
- package/external/_chunks/rolldown-runtime.mjs +32 -0
- package/external/_chunks/vision_bundle.mjs +3 -0
- package/external/external/index.d.mts +499 -0
- package/external/external/index.mjs +9422 -0
- package/index.d.mts +2567 -0
- package/index.mjs +20571 -0
- package/legacy/_chunks/hls.mjs +3 -0
- package/legacy/_chunks/libs/@monogrid/gainmap-js.mjs +1137 -0
- package/legacy/_chunks/libs/@use-gesture/core.mjs +1650 -0
- package/legacy/_chunks/libs/@use-gesture/react.mjs +207 -0
- package/legacy/_chunks/libs/bidi-js.mjs +675 -0
- package/legacy/_chunks/libs/detect-gpu.mjs +515 -0
- package/legacy/_chunks/libs/hls.js.mjs +21925 -0
- package/legacy/_chunks/libs/maath.mjs +5200 -0
- package/legacy/_chunks/libs/stats-gl.mjs +301 -0
- package/legacy/_chunks/libs/stats.js.mjs +90 -0
- package/legacy/_chunks/libs/suspend-react.mjs +60 -0
- package/legacy/_chunks/libs/three.mjs +26062 -0
- package/legacy/_chunks/libs/troika-three-text.mjs +6494 -0
- package/legacy/_chunks/libs/tunnel-rat.mjs +458 -0
- package/legacy/_chunks/libs/zustand.mjs +104 -0
- package/legacy/_chunks/rolldown-runtime.mjs +47 -0
- package/legacy/legacy/index.d.mts +2788 -0
- package/legacy/legacy/index.mjs +14984 -0
- package/native/_chunks/hls.mjs +3 -0
- package/native/_chunks/libs/@monogrid/gainmap-js.mjs +1137 -0
- package/native/_chunks/libs/@use-gesture/core.mjs +1650 -0
- package/native/_chunks/libs/@use-gesture/react.mjs +207 -0
- package/native/_chunks/libs/detect-gpu.mjs +515 -0
- package/native/_chunks/libs/hls.js.mjs +21925 -0
- package/native/_chunks/libs/maath.mjs +5200 -0
- package/native/_chunks/libs/stats-gl.mjs +301 -0
- package/native/_chunks/libs/stats.js.mjs +90 -0
- package/native/_chunks/libs/suspend-react.mjs +60 -0
- package/native/_chunks/libs/three.mjs +22592 -0
- package/native/_chunks/libs/tunnel-rat.mjs +458 -0
- package/native/_chunks/libs/zustand.mjs +104 -0
- package/native/_chunks/rolldown-runtime.mjs +47 -0
- package/native/native/index.d.mts +3168 -0
- package/native/native/index.mjs +14863 -0
- package/package.json +41 -10
- package/webgpu/_chunks/hls.mjs +3 -0
- package/webgpu/_chunks/libs/@monogrid/gainmap-js.mjs +1137 -0
- package/webgpu/_chunks/libs/@use-gesture/core.mjs +1650 -0
- package/webgpu/_chunks/libs/@use-gesture/react.mjs +207 -0
- package/webgpu/_chunks/libs/detect-gpu.mjs +515 -0
- package/webgpu/_chunks/libs/hls.js.mjs +21925 -0
- package/webgpu/_chunks/libs/maath.mjs +5200 -0
- package/webgpu/_chunks/libs/stats-gl.mjs +301 -0
- package/webgpu/_chunks/libs/stats.js.mjs +90 -0
- package/webgpu/_chunks/libs/suspend-react.mjs +60 -0
- package/webgpu/_chunks/libs/three.mjs +22592 -0
- package/webgpu/_chunks/libs/tunnel-rat.mjs +458 -0
- package/webgpu/_chunks/libs/zustand.mjs +104 -0
- package/webgpu/_chunks/rolldown-runtime.mjs +47 -0
- package/webgpu/webgpu/index.d.mts +3166 -0
- package/webgpu/webgpu/index.mjs +15015 -0
- package/core/AccumulativeShadows.cjs.js +0 -1
- package/core/AccumulativeShadows.d.ts +0 -59
- package/core/AccumulativeShadows.js +0 -310
- package/core/AdaptiveDpr.cjs.js +0 -1
- package/core/AdaptiveDpr.d.ts +0 -3
- package/core/AdaptiveDpr.js +0 -28
- package/core/AdaptiveEvents.cjs.js +0 -1
- package/core/AdaptiveEvents.d.ts +0 -1
- package/core/AdaptiveEvents.js +0 -20
- package/core/ArcballControls.cjs.js +0 -1
- package/core/ArcballControls.d.ts +0 -15
- package/core/ArcballControls.js +0 -67
- package/core/AsciiRenderer.cjs.js +0 -1
- package/core/AsciiRenderer.d.ts +0 -11
- package/core/AsciiRenderer.js +0 -66
- package/core/BBAnchor.cjs.js +0 -1
- package/core/BBAnchor.d.ts +0 -7
- package/core/BBAnchor.js +0 -37
- package/core/Backdrop.cjs.js +0 -1
- package/core/Backdrop.d.ts +0 -15
- package/core/Backdrop.js +0 -33
- package/core/BakeShadows.cjs.js +0 -1
- package/core/BakeShadows.d.ts +0 -1
- package/core/BakeShadows.js +0 -16
- package/core/Billboard.cjs.js +0 -1
- package/core/Billboard.d.ts +0 -10
- package/core/Billboard.js +0 -53
- package/core/Bounds.cjs.js +0 -1
- package/core/Bounds.d.ts +0 -36
- package/core/Bounds.js +0 -254
- package/core/Bvh.cjs.js +0 -1
- package/core/Bvh.d.ts +0 -19
- package/core/Bvh.js +0 -92
- package/core/CameraControls.cjs.js +0 -1
- package/core/CameraControls.d.ts +0 -48
- package/core/CameraControls.js +0 -151
- package/core/CameraShake.cjs.js +0 -1
- package/core/CameraShake.d.ts +0 -17
- package/core/CameraShake.js +0 -57
- package/core/CatmullRomLine.cjs.js +0 -1
- package/core/CatmullRomLine.d.ts +0 -10
- package/core/CatmullRomLine.js +0 -42
- package/core/Caustics.cjs.js +0 -1
- package/core/Caustics.d.ts +0 -32
- package/core/Caustics.js +0 -388
- package/core/Center.cjs.js +0 -1
- package/core/Center.d.ts +0 -33
- package/core/Center.js +0 -67
- package/core/Clone.cjs.js +0 -1
- package/core/Clone.d.ts +0 -15
- package/core/Clone.js +0 -100
- package/core/Cloud.cjs.js +0 -1
- package/core/Cloud.d.ts +0 -97
- package/core/Cloud.js +0 -231
- package/core/ComputedAttribute.cjs.js +0 -1
- package/core/ComputedAttribute.d.ts +0 -8
- package/core/ComputedAttribute.js +0 -33
- package/core/ContactShadows.cjs.js +0 -1
- package/core/ContactShadows.d.ts +0 -18
- package/core/ContactShadows.js +0 -114
- package/core/CubeCamera.cjs.js +0 -1
- package/core/CubeCamera.d.ts +0 -21
- package/core/CubeCamera.js +0 -86
- package/core/CubeTexture.cjs.js +0 -1
- package/core/CubeTexture.d.ts +0 -14
- package/core/CubeTexture.js +0 -25
- package/core/CubicBezierLine.cjs.js +0 -1
- package/core/CubicBezierLine.d.ts +0 -12
- package/core/CubicBezierLine.js +0 -28
- package/core/CurveModifier.cjs.js +0 -1
- package/core/CurveModifier.d.ts +0 -11
- package/core/CurveModifier.js +0 -27
- package/core/Decal.cjs.js +0 -1
- package/core/Decal.d.ts +0 -16
- package/core/Decal.js +0 -128
- package/core/Detailed.cjs.js +0 -1
- package/core/Detailed.d.ts +0 -10
- package/core/Detailed.js +0 -33
- package/core/DetectGPU.cjs.js +0 -1
- package/core/DetectGPU.d.ts +0 -7
- package/core/DetectGPU.js +0 -14
- package/core/DeviceOrientationControls.cjs.js +0 -1
- package/core/DeviceOrientationControls.d.ts +0 -10
- package/core/DeviceOrientationControls.js +0 -51
- package/core/Edges.cjs.js +0 -1
- package/core/Edges.d.ts +0 -13
- package/core/Edges.js +0 -38
- package/core/Effects.cjs.js +0 -1
- package/core/Effects.d.ts +0 -25
- package/core/Effects.js +0 -91
- package/core/Environment.cjs.js +0 -1
- package/core/Environment.d.ts +0 -37
- package/core/Environment.js +0 -189
- package/core/Example.cjs.js +0 -1
- package/core/Example.d.ts +0 -13
- package/core/Example.js +0 -46
- package/core/Fbo.cjs.js +0 -1
- package/core/Fbo.d.ts +0 -22
- package/core/Fbo.js +0 -63
- package/core/Fbx.cjs.js +0 -1
- package/core/Fbx.d.ts +0 -11
- package/core/Fbx.js +0 -23
- package/core/FirstPersonControls.cjs.js +0 -1
- package/core/FirstPersonControls.d.ts +0 -8
- package/core/FirstPersonControls.js +0 -38
- package/core/Fisheye.cjs.js +0 -1
- package/core/Fisheye.d.ts +0 -10
- package/core/Fisheye.js +0 -95
- package/core/Float.cjs.js +0 -1
- package/core/Float.d.ts +0 -14
- package/core/Float.js +0 -37
- package/core/FlyControls.cjs.js +0 -1
- package/core/FlyControls.d.ts +0 -10
- package/core/FlyControls.js +0 -55
- package/core/GizmoHelper.cjs.js +0 -1
- package/core/GizmoHelper.d.ts +0 -16
- package/core/GizmoHelper.js +0 -116
- package/core/GizmoViewcube.cjs.js +0 -1
- package/core/GizmoViewcube.d.ts +0 -14
- package/core/GizmoViewcube.js +0 -133
- package/core/GizmoViewport.cjs.js +0 -1
- package/core/GizmoViewport.d.ts +0 -16
- package/core/GizmoViewport.js +0 -140
- package/core/Gltf.cjs.js +0 -1
- package/core/Gltf.d.ts +0 -27
- package/core/Gltf.js +0 -52
- package/core/GradientTexture.cjs.js +0 -1
- package/core/GradientTexture.d.ts +0 -18
- package/core/GradientTexture.js +0 -54
- package/core/Grid.cjs.js +0 -1
- package/core/Grid.d.ts +0 -26
- package/core/Grid.js +0 -142
- package/core/Helper.cjs.js +0 -1
- package/core/Helper.d.ts +0 -16
- package/core/Helper.js +0 -47
- package/core/Hud.cjs.js +0 -1
- package/core/Hud.d.ts +0 -6
- package/core/Hud.js +0 -55
- package/core/Image.cjs.js +0 -1
- package/core/Image.d.ts +0 -38
- package/core/Image.js +0 -160
- package/core/Instances.cjs.js +0 -1
- package/core/Instances.d.ts +0 -64
- package/core/Instances.js +0 -313
- package/core/Ktx2.cjs.js +0 -1
- package/core/Ktx2.d.ts +0 -14
- package/core/Ktx2.js +0 -48
- package/core/Lightformer.cjs.js +0 -1
- package/core/Lightformer.d.ts +0 -15
- package/core/Lightformer.js +0 -63
- package/core/Line.cjs.js +0 -1
- package/core/Line.d.ts +0 -13
- package/core/Line.js +0 -73
- package/core/MapControls.cjs.js +0 -1
- package/core/MapControls.d.ts +0 -14
- package/core/MapControls.js +0 -63
- package/core/MarchingCubes.cjs.js +0 -1
- package/core/MarchingCubes.d.ts +0 -24
- package/core/MarchingCubes.js +0 -78
- package/core/Mask.cjs.js +0 -1
- package/core/Mask.d.ts +0 -17
- package/core/Mask.js +0 -42
- package/core/MatcapTexture.cjs.js +0 -1
- package/core/MatcapTexture.d.ts +0 -9
- package/core/MatcapTexture.js +0 -51
- package/core/MeshDiscardMaterial.cjs.js +0 -1
- package/core/MeshDiscardMaterial.d.ts +0 -10
- package/core/MeshDiscardMaterial.js +0 -15
- package/core/MeshDistortMaterial.cjs.js +0 -1
- package/core/MeshDistortMaterial.d.ts +0 -39
- package/core/MeshDistortMaterial.js +0 -72
- package/core/MeshPortalMaterial.cjs.js +0 -1
- package/core/MeshPortalMaterial.d.ts +0 -25
- package/core/MeshPortalMaterial.js +0 -467
- package/core/MeshReflectorMaterial.cjs.js +0 -1
- package/core/MeshReflectorMaterial.d.ts +0 -14
- package/core/MeshReflectorMaterial.js +0 -180
- package/core/MeshRefractionMaterial.cjs.js +0 -1
- package/core/MeshRefractionMaterial.d.ts +0 -19
- package/core/MeshRefractionMaterial.js +0 -73
- package/core/MeshTransmissionMaterial.cjs.js +0 -1
- package/core/MeshTransmissionMaterial.d.ts +0 -34
- package/core/MeshTransmissionMaterial.js +0 -402
- package/core/MeshWobbleMaterial.cjs.js +0 -1
- package/core/MeshWobbleMaterial.d.ts +0 -36
- package/core/MeshWobbleMaterial.js +0 -60
- package/core/MotionPathControls.cjs.js +0 -1
- package/core/MotionPathControls.d.ts +0 -33
- package/core/MotionPathControls.js +0 -121
- package/core/MultiMaterial.cjs.js +0 -1
- package/core/MultiMaterial.d.ts +0 -4
- package/core/MultiMaterial.js +0 -29
- package/core/NormalTexture.cjs.js +0 -1
- package/core/NormalTexture.d.ts +0 -14
- package/core/NormalTexture.js +0 -42
- package/core/OrbitControls.cjs.js +0 -1
- package/core/OrbitControls.d.ts +0 -22
- package/core/OrbitControls.js +0 -79
- package/core/OrthographicCamera.cjs.js +0 -1
- package/core/OrthographicCamera.d.ts +0 -14
- package/core/OrthographicCamera.js +0 -76
- package/core/Outlines.cjs.js +0 -1
- package/core/Outlines.d.ts +0 -17
- package/core/Outlines.js +0 -166
- package/core/PerformanceMonitor.cjs.js +0 -1
- package/core/PerformanceMonitor.d.ts +0 -36
- package/core/PerformanceMonitor.js +0 -116
- package/core/PerspectiveCamera.cjs.js +0 -1
- package/core/PerspectiveCamera.d.ts +0 -14
- package/core/PerspectiveCamera.js +0 -72
- package/core/PointMaterial.cjs.js +0 -1
- package/core/PointMaterial.d.ts +0 -8
- package/core/PointMaterial.js +0 -36
- package/core/PointerLockControls.cjs.js +0 -1
- package/core/PointerLockControls.d.ts +0 -15
- package/core/PointerLockControls.js +0 -89
- package/core/Points.cjs.js +0 -1
- package/core/Points.d.ts +0 -31
- package/core/Points.js +0 -202
- package/core/PositionalAudio.cjs.js +0 -1
- package/core/PositionalAudio.d.ts +0 -9
- package/core/PositionalAudio.js +0 -46
- package/core/Preload.cjs.js +0 -1
- package/core/Preload.d.ts +0 -7
- package/core/Preload.js +0 -44
- package/core/Progress.cjs.js +0 -1
- package/core/Progress.d.ts +0 -14
- package/core/Progress.js +0 -55
- package/core/QuadraticBezierLine.cjs.js +0 -1
- package/core/QuadraticBezierLine.d.ts +0 -14
- package/core/QuadraticBezierLine.js +0 -42
- package/core/RenderCubeTexture.cjs.js +0 -1
- package/core/RenderCubeTexture.d.ts +0 -30
- package/core/RenderCubeTexture.js +0 -96
- package/core/RenderTexture.cjs.js +0 -1
- package/core/RenderTexture.d.ts +0 -18
- package/core/RenderTexture.js +0 -105
- package/core/Resize.cjs.js +0 -1
- package/core/Resize.d.ts +0 -17
- package/core/Resize.js +0 -39
- package/core/RoundedBox.cjs.js +0 -1
- package/core/RoundedBox.d.ts +0 -14
- package/core/RoundedBox.js +0 -70
- package/core/Sampler.cjs.js +0 -1
- package/core/Sampler.d.ts +0 -28
- package/core/Sampler.js +0 -75
- package/core/ScreenQuad.cjs.js +0 -1
- package/core/ScreenQuad.d.ts +0 -5
- package/core/ScreenQuad.js +0 -25
- package/core/ScreenSizer.cjs.js +0 -1
- package/core/ScreenSizer.d.ts +0 -7
- package/core/ScreenSizer.js +0 -39
- package/core/ScreenSpace.cjs.js +0 -1
- package/core/ScreenSpace.d.ts +0 -7
- package/core/ScreenSpace.js +0 -25
- package/core/Segments.cjs.js +0 -1
- package/core/Segments.d.ts +0 -29
- package/core/Segments.js +0 -96
- package/core/Shadow.cjs.js +0 -1
- package/core/Shadow.d.ts +0 -12
- package/core/Shadow.js +0 -42
- package/core/ShadowAlpha.cjs.js +0 -1
- package/core/ShadowAlpha.d.ts +0 -7
- package/core/ShadowAlpha.js +0 -108
- package/core/Sky.cjs.js +0 -1
- package/core/Sky.d.ts +0 -16
- package/core/Sky.js +0 -39
- package/core/Sparkles.cjs.js +0 -1
- package/core/Sparkles.d.ts +0 -26
- package/core/Sparkles.js +0 -161
- package/core/Splat.cjs.js +0 -1
- package/core/Splat.d.ts +0 -56
- package/core/Splat.js +0 -506
- package/core/SpotLight.cjs.js +0 -1
- package/core/SpotLight.d.ts +0 -27
- package/core/SpotLight.js +0 -223
- package/core/SpriteAnimator.cjs.js +0 -1
- package/core/SpriteAnimator.d.ts +0 -88
- package/core/SpriteAnimator.js +0 -413
- package/core/Stage.cjs.js +0 -1
- package/core/Stage.d.ts +0 -27
- package/core/Stage.js +0 -133
- package/core/Stars.cjs.js +0 -1
- package/core/Stars.d.ts +0 -22
- package/core/Stars.js +0 -100
- package/core/Stats.cjs.js +0 -1
- package/core/Stats.d.ts +0 -7
- package/core/Stats.js +0 -32
- package/core/StatsGl.cjs.js +0 -1
- package/core/StatsGl.d.ts +0 -14
- package/core/StatsGl.js +0 -44
- package/core/Svg.cjs.js +0 -1
- package/core/Svg.d.ts +0 -13
- package/core/Svg.js +0 -62
- package/core/Text.cjs.js +0 -1
- package/core/Text.d.ts +0 -38
- package/core/Text.js +0 -57
- package/core/Text3D.cjs.js +0 -1
- package/core/Text3D.d.ts +0 -20
- package/core/Text3D.js +0 -74
- package/core/Texture.cjs.js +0 -1
- package/core/Texture.d.ts +0 -20
- package/core/Texture.js +0 -60
- package/core/TrackballControls.cjs.js +0 -1
- package/core/TrackballControls.d.ts +0 -15
- package/core/TrackballControls.js +0 -72
- package/core/Trail.cjs.js +0 -1
- package/core/Trail.d.ts +0 -21
- package/core/Trail.js +0 -150
- package/core/TrailTexture.cjs.js +0 -1
- package/core/TrailTexture.d.ts +0 -19
- package/core/TrailTexture.js +0 -159
- package/core/TransformControls.cjs.js +0 -1
- package/core/TransformControls.d.ts +0 -28
- package/core/TransformControls.js +0 -114
- package/core/VideoTexture.cjs.js +0 -1
- package/core/VideoTexture.d.ts +0 -26
- package/core/VideoTexture.js +0 -111
- package/core/Wireframe.cjs.js +0 -1
- package/core/Wireframe.d.ts +0 -15
- package/core/Wireframe.js +0 -157
- package/core/calculateScaleFactor.cjs.js +0 -1
- package/core/calculateScaleFactor.d.ts +0 -3
- package/core/calculateScaleFactor.js +0 -31
- package/core/index.cjs.js +0 -1
- package/core/index.d.ts +0 -122
- package/core/index.js +0 -150
- package/core/meshBounds.cjs.js +0 -1
- package/core/meshBounds.d.ts +0 -2
- package/core/meshBounds.js +0 -28
- package/core/shaderMaterial.cjs.js +0 -1
- package/core/shaderMaterial.d.ts +0 -9
- package/core/shaderMaterial.js +0 -29
- package/core/shapes.cjs.js +0 -1
- package/core/shapes.d.ts +0 -26
- package/core/shapes.js +0 -65
- package/core/softShadows.cjs.js +0 -1
- package/core/softShadows.d.ts +0 -6
- package/core/softShadows.js +0 -158
- package/core/useAnimations.cjs.js +0 -1
- package/core/useAnimations.d.ts +0 -13
- package/core/useAnimations.js +0 -52
- package/core/useAspect.cjs.js +0 -1
- package/core/useAspect.d.ts +0 -1
- package/core/useAspect.js +0 -10
- package/core/useBoxProjectedEnv.cjs.js +0 -1
- package/core/useBoxProjectedEnv.d.ts +0 -19
- package/core/useBoxProjectedEnv.js +0 -95
- package/core/useCamera.cjs.js +0 -1
- package/core/useCamera.d.ts +0 -3
- package/core/useCamera.js +0 -19
- package/core/useContextBridge.cjs.js +0 -1
- package/core/useContextBridge.d.ts +0 -4
- package/core/useContextBridge.js +0 -20
- package/core/useDepthBuffer.cjs.js +0 -1
- package/core/useDepthBuffer.d.ts +0 -6
- package/core/useDepthBuffer.js +0 -38
- package/core/useEnvironment.cjs.js +0 -1
- package/core/useEnvironment.d.ts +0 -17
- package/core/useEnvironment.js +0 -150
- package/core/useFont.cjs.js +0 -1
- package/core/useFont.d.ts +0 -24
- package/core/useFont.js +0 -24
- package/core/useIntersect.cjs.js +0 -1
- package/core/useIntersect.d.ts +0 -3
- package/core/useIntersect.js +0 -36
- package/core/useSpriteLoader.cjs.js +0 -1
- package/core/useSpriteLoader.d.ts +0 -57
- package/core/useSpriteLoader.js +0 -402
- package/helpers/constants.cjs.js +0 -1
- package/helpers/constants.d.ts +0 -1
- package/helpers/constants.js +0 -6
- package/helpers/deprecated.cjs.js +0 -1
- package/helpers/deprecated.d.ts +0 -5
- package/helpers/deprecated.js +0 -8
- package/helpers/environment-assets.cjs.js +0 -1
- package/helpers/environment-assets.d.ts +0 -13
- package/helpers/environment-assets.js +0 -14
- package/helpers/glsl/DefaultSpotlightShadowShadows.glsl.js +0 -3
- package/helpers/glsl/distort.vert.glsl.js +0 -3
- package/helpers/ts-utils.cjs.js +0 -1
- package/helpers/ts-utils.d.ts +0 -7
- package/helpers/ts-utils.js +0 -1
- package/helpers/useEffectfulState.cjs.js +0 -1
- package/helpers/useEffectfulState.d.ts +0 -4
- package/helpers/useEffectfulState.js +0 -17
- package/index.cjs.js +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -139
- package/materials/BlurPass.cjs.js +0 -1
- package/materials/BlurPass.d.ts +0 -23
- package/materials/BlurPass.js +0 -72
- package/materials/ConvolutionMaterial.cjs.js +0 -1
- package/materials/ConvolutionMaterial.d.ts +0 -7
- package/materials/ConvolutionMaterial.js +0 -97
- package/materials/DiscardMaterial.cjs.js +0 -1
- package/materials/DiscardMaterial.d.ts +0 -3
- package/materials/DiscardMaterial.js +0 -5
- package/materials/MeshReflectorMaterial.cjs.js +0 -1
- package/materials/MeshReflectorMaterial.d.ts +0 -50
- package/materials/MeshReflectorMaterial.js +0 -256
- package/materials/MeshRefractionMaterial.cjs.js +0 -1
- package/materials/MeshRefractionMaterial.d.ts +0 -18
- package/materials/MeshRefractionMaterial.js +0 -163
- package/materials/SpotLightMaterial.cjs.js +0 -1
- package/materials/SpotLightMaterial.d.ts +0 -4
- package/materials/SpotLightMaterial.js +0 -115
- package/materials/WireframeMaterial.cjs.js +0 -1
- package/materials/WireframeMaterial.d.ts +0 -64
- package/materials/WireframeMaterial.js +0 -217
- package/native/index.cjs.js +0 -1
- package/native/index.d.ts +0 -1
- package/native/index.js +0 -150
- package/web/CycleRaycast.cjs.js +0 -1
- package/web/CycleRaycast.d.ts +0 -10
- package/web/CycleRaycast.js +0 -93
- package/web/DragControls.cjs.js +0 -1
- package/web/DragControls.d.ts +0 -17
- package/web/DragControls.js +0 -127
- package/web/FaceControls.cjs.js +0 -1
- package/web/FaceControls.d.ts +0 -29
- package/web/FaceControls.js +0 -236
- package/web/FaceLandmarker.cjs.js +0 -1
- package/web/FaceLandmarker.d.ts +0 -14
- package/web/FaceLandmarker.js +0 -49
- package/web/Facemesh.cjs.js +0 -1
- package/web/Facemesh.d.ts +0 -118
- package/web/Facemesh.js +0 -4538
- package/web/Html.cjs.js +0 -1
- package/web/Html.d.ts +0 -34
- package/web/Html.js +0 -375
- package/web/KeyboardControls.cjs.js +0 -1
- package/web/KeyboardControls.d.ts +0 -37
- package/web/KeyboardControls.js +0 -104
- package/web/Loader.cjs.js +0 -1
- package/web/Loader.d.ts +0 -12
- package/web/Loader.js +0 -101
- package/web/PresentationControls.cjs.js +0 -1
- package/web/PresentationControls.d.ts +0 -16
- package/web/PresentationControls.js +0 -79
- package/web/ScreenVideoTexture.cjs.js +0 -1
- package/web/ScreenVideoTexture.d.ts +0 -17
- package/web/ScreenVideoTexture.js +0 -30
- package/web/ScrollControls.cjs.js +0 -1
- package/web/ScrollControls.d.ts +0 -45
- package/web/ScrollControls.js +0 -237
- package/web/Select.cjs.js +0 -1
- package/web/Select.d.ts +0 -14
- package/web/Select.js +0 -171
- package/web/View.cjs.js +0 -1
- package/web/View.d.ts +0 -34
- package/web/View.js +0 -259
- package/web/WebcamVideoTexture.cjs.js +0 -1
- package/web/WebcamVideoTexture.d.ts +0 -17
- package/web/WebcamVideoTexture.js +0 -33
- package/web/index.cjs.js +0 -1
- package/web/index.d.ts +0 -17
- package/web/index.js +0 -176
- package/web/pivotControls/AxisArrow.cjs.js +0 -1
- package/web/pivotControls/AxisArrow.d.ts +0 -7
- package/web/pivotControls/AxisArrow.js +0 -193
- package/web/pivotControls/AxisRotator.cjs.js +0 -1
- package/web/pivotControls/AxisRotator.d.ts +0 -7
- package/web/pivotControls/AxisRotator.js +0 -220
- package/web/pivotControls/PlaneSlider.cjs.js +0 -1
- package/web/pivotControls/PlaneSlider.d.ts +0 -7
- package/web/pivotControls/PlaneSlider.js +0 -202
- package/web/pivotControls/ScalingSphere.cjs.js +0 -1
- package/web/pivotControls/ScalingSphere.d.ts +0 -7
- package/web/pivotControls/ScalingSphere.js +0 -192
- package/web/pivotControls/context.cjs.js +0 -1
- package/web/pivotControls/context.d.ts +0 -33
- package/web/pivotControls/context.js +0 -5
- package/web/pivotControls/index.cjs.js +0 -1
- package/web/pivotControls/index.d.ts +0 -39
- package/web/pivotControls/index.js +0 -213
- package/web/useCursor.cjs.js +0 -1
- package/web/useCursor.d.ts +0 -1
- package/web/useCursor.js +0 -12
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from "react";
|
|
3
|
+
import { MarchingCubes as MarchingCubes$1 } from "three/examples/jsm/objects/MarchingCubes";
|
|
4
|
+
import { ReactThreeFiber, ThreeElement, ThreeElements } from "@react-three/fiber";
|
|
5
|
+
import "three-mesh-bvh";
|
|
6
|
+
import { RenderPass } from "three/examples/jsm/postprocessing/RenderPass";
|
|
7
|
+
import { ShaderPass } from "three/examples/jsm/postprocessing/ShaderPass";
|
|
8
|
+
import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer";
|
|
9
|
+
import * as THREE from "three";
|
|
10
|
+
import { ColorRepresentation, Object3D } from "three";
|
|
11
|
+
import { Line2 } from "three/examples/jsm/lines/Line2.js";
|
|
12
|
+
import "three/examples/jsm/lines/LineSegments2.js";
|
|
13
|
+
import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";
|
|
14
|
+
import * as THREE$1 from "#three";
|
|
15
|
+
import { Color, Matrix4, MeshStandardMaterial, Texture } from "#three";
|
|
16
|
+
|
|
17
|
+
//#region src/utils/ts-utils.d.ts
|
|
18
|
+
type ForwardRefComponent<P, T> = ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/experimental/Geometry/MarchingCubes/MarchingCubes.d.ts
|
|
21
|
+
type MarchingCubesProps = {
|
|
22
|
+
resolution?: number;
|
|
23
|
+
maxPolyCount?: number;
|
|
24
|
+
enableUvs?: boolean;
|
|
25
|
+
enableColors?: boolean;
|
|
26
|
+
} & Omit<ThreeElements['group'], 'ref'>;
|
|
27
|
+
declare const MarchingCubes: ForwardRefComponent<MarchingCubesProps, MarchingCubes$1>;
|
|
28
|
+
type MarchingCubeProps = {
|
|
29
|
+
strength?: number;
|
|
30
|
+
subtract?: number;
|
|
31
|
+
color?: Color;
|
|
32
|
+
} & ThreeElements['group'];
|
|
33
|
+
declare const MarchingCube: ForwardRefComponent<MarchingCubeProps, THREE$1.Group>;
|
|
34
|
+
type MarchingPlaneProps = {
|
|
35
|
+
planeType?: 'x' | 'y' | 'z';
|
|
36
|
+
strength?: number;
|
|
37
|
+
subtract?: number;
|
|
38
|
+
} & ThreeElements['group'];
|
|
39
|
+
declare const MarchingPlane: ForwardRefComponent<MarchingPlaneProps, THREE$1.Group>;
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/experimental/Effects/Outlines/Outlines.d.ts
|
|
42
|
+
type OutlinesProps = Omit<ThreeElements['group'], 'ref'> & {
|
|
43
|
+
color?: ReactThreeFiber.Color;
|
|
44
|
+
screenspace?: boolean;
|
|
45
|
+
opacity?: number;
|
|
46
|
+
transparent?: boolean;
|
|
47
|
+
thickness?: number;
|
|
48
|
+
angle?: number;
|
|
49
|
+
clippingPlanes?: THREE$1.Plane[];
|
|
50
|
+
toneMapped?: boolean;
|
|
51
|
+
polygonOffset?: boolean;
|
|
52
|
+
polygonOffsetFactor?: number;
|
|
53
|
+
renderOrder?: number;
|
|
54
|
+
};
|
|
55
|
+
declare function Outlines({
|
|
56
|
+
color,
|
|
57
|
+
opacity,
|
|
58
|
+
transparent,
|
|
59
|
+
screenspace,
|
|
60
|
+
toneMapped,
|
|
61
|
+
polygonOffset,
|
|
62
|
+
polygonOffsetFactor,
|
|
63
|
+
renderOrder,
|
|
64
|
+
thickness,
|
|
65
|
+
angle,
|
|
66
|
+
clippingPlanes,
|
|
67
|
+
...props
|
|
68
|
+
}: OutlinesProps): React.JSX.Element;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/legacy/Materials/AccumulativeShadows/AccumulativeShadows.d.ts
|
|
71
|
+
type SoftShadowMaterialProps = {
|
|
72
|
+
map: THREE$1.Texture;
|
|
73
|
+
color?: ReactThreeFiber.Color;
|
|
74
|
+
alphaTest?: number;
|
|
75
|
+
blend?: number;
|
|
76
|
+
};
|
|
77
|
+
declare module '@react-three/fiber' {
|
|
78
|
+
interface ThreeElements {
|
|
79
|
+
softShadowMaterial: ThreeElements['shaderMaterial'] & SoftShadowMaterialProps;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/legacy/Materials/Caustics/Caustics.d.ts
|
|
84
|
+
declare module '@react-three/fiber' {
|
|
85
|
+
interface ThreeElements {
|
|
86
|
+
causticsProjectionMaterial: ThreeElements['meshNormalMaterial'] & {
|
|
87
|
+
viewMatrix?: {
|
|
88
|
+
value: THREE$1.Matrix4;
|
|
89
|
+
};
|
|
90
|
+
color?: ReactThreeFiber.Color;
|
|
91
|
+
causticsTexture?: THREE$1.Texture;
|
|
92
|
+
causticsTextureB?: THREE$1.Texture;
|
|
93
|
+
lightProjMatrix?: THREE$1.Matrix4;
|
|
94
|
+
lightViewMatrix?: THREE$1.Matrix4;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/legacy/Materials/MeshTransmissionMaterial/MeshTransmissionMaterial.d.ts
|
|
100
|
+
type MeshTransmissionMaterialType = Omit<ThreeElements['meshPhysicalMaterial'], 'args' | 'roughness' | 'thickness' | 'transmission'> & {
|
|
101
|
+
transmission?: number;
|
|
102
|
+
thickness?: number;
|
|
103
|
+
roughness?: number;
|
|
104
|
+
chromaticAberration?: number;
|
|
105
|
+
anisotropy?: number;
|
|
106
|
+
anisotropicBlur?: number;
|
|
107
|
+
distortion?: number;
|
|
108
|
+
distortionScale?: number;
|
|
109
|
+
temporalDistortion?: number;
|
|
110
|
+
buffer?: THREE$1.Texture;
|
|
111
|
+
time?: number;
|
|
112
|
+
args?: [samples: number, transmissionSampler: boolean];
|
|
113
|
+
};
|
|
114
|
+
declare module '@react-three/fiber' {
|
|
115
|
+
interface ThreeElements {
|
|
116
|
+
meshTransmissionMaterial: MeshTransmissionMaterialType;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/legacy/Materials/MeshReflectorMaterial/MeshReflectorMaterialClass.d.ts
|
|
121
|
+
declare class MeshReflectorMaterial extends MeshStandardMaterial {
|
|
122
|
+
private _tDepth;
|
|
123
|
+
private _distortionMap;
|
|
124
|
+
private _tDiffuse;
|
|
125
|
+
private _tDiffuseBlur;
|
|
126
|
+
private _textureMatrix;
|
|
127
|
+
private _hasBlur;
|
|
128
|
+
private _mirror;
|
|
129
|
+
private _mixBlur;
|
|
130
|
+
private _blurStrength;
|
|
131
|
+
private _minDepthThreshold;
|
|
132
|
+
private _maxDepthThreshold;
|
|
133
|
+
private _depthScale;
|
|
134
|
+
private _depthToBlurRatioBias;
|
|
135
|
+
private _distortion;
|
|
136
|
+
private _mixContrast;
|
|
137
|
+
constructor(parameters?: {});
|
|
138
|
+
onBeforeCompile(shader: any): void;
|
|
139
|
+
get tDiffuse(): Texture | null;
|
|
140
|
+
set tDiffuse(v: Texture | null);
|
|
141
|
+
get tDepth(): Texture | null;
|
|
142
|
+
set tDepth(v: Texture | null);
|
|
143
|
+
get distortionMap(): Texture | null;
|
|
144
|
+
set distortionMap(v: Texture | null);
|
|
145
|
+
get tDiffuseBlur(): Texture | null;
|
|
146
|
+
set tDiffuseBlur(v: Texture | null);
|
|
147
|
+
get textureMatrix(): Matrix4 | null;
|
|
148
|
+
set textureMatrix(v: Matrix4 | null);
|
|
149
|
+
get hasBlur(): boolean;
|
|
150
|
+
set hasBlur(v: boolean);
|
|
151
|
+
get mirror(): number;
|
|
152
|
+
set mirror(v: number);
|
|
153
|
+
get mixBlur(): number;
|
|
154
|
+
set mixBlur(v: number);
|
|
155
|
+
get mixStrength(): number;
|
|
156
|
+
set mixStrength(v: number);
|
|
157
|
+
get minDepthThreshold(): number;
|
|
158
|
+
set minDepthThreshold(v: number);
|
|
159
|
+
get maxDepthThreshold(): number;
|
|
160
|
+
set maxDepthThreshold(v: number);
|
|
161
|
+
get depthScale(): number;
|
|
162
|
+
set depthScale(v: number);
|
|
163
|
+
get depthToBlurRatioBias(): number;
|
|
164
|
+
set depthToBlurRatioBias(v: number);
|
|
165
|
+
get distortion(): number;
|
|
166
|
+
set distortion(v: number);
|
|
167
|
+
get mixContrast(): number;
|
|
168
|
+
set mixContrast(v: number);
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/legacy/Materials/MeshReflectorMaterial/MeshReflectorMaterial.d.ts
|
|
172
|
+
declare module '@react-three/fiber' {
|
|
173
|
+
interface ThreeElements {
|
|
174
|
+
meshReflectorMaterialImpl: ThreeElement<typeof MeshReflectorMaterial>;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/legacy/Materials/MeshPortalMaterial/MeshPortalMaterial.d.ts
|
|
179
|
+
declare module '@react-three/fiber' {
|
|
180
|
+
interface ThreeElements {
|
|
181
|
+
portalMaterialImpl: ThreeElements['shaderMaterial'] & {
|
|
182
|
+
resolution: ReactThreeFiber.Vector2;
|
|
183
|
+
blur: number;
|
|
184
|
+
blend: number;
|
|
185
|
+
size?: number;
|
|
186
|
+
sdf?: THREE$1.Texture;
|
|
187
|
+
map?: THREE$1.Texture;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/legacy/Materials/MeshDistortMaterial/MeshDistortMaterial.d.ts
|
|
193
|
+
declare module '@react-three/fiber' {
|
|
194
|
+
interface ThreeElements {
|
|
195
|
+
distortMaterialImpl: ThreeElements['meshPhysicalMaterial'] & {
|
|
196
|
+
time?: number;
|
|
197
|
+
distort?: number;
|
|
198
|
+
radius?: number;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region src/legacy/Materials/MeshWobbleMaterial/MeshWobbleMaterial.d.ts
|
|
204
|
+
declare module '@react-three/fiber' {
|
|
205
|
+
interface ThreeElements {
|
|
206
|
+
wobbleMaterialImpl: ThreeElements['meshStandardMaterial'] & {
|
|
207
|
+
time?: number;
|
|
208
|
+
factor?: number;
|
|
209
|
+
speed?: number;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region src/legacy/Abstractions/Effects/Effects.d.ts
|
|
215
|
+
declare module '@react-three/fiber' {
|
|
216
|
+
interface ThreeElements {
|
|
217
|
+
effectComposer: ThreeElement<typeof EffectComposer>;
|
|
218
|
+
renderPass: ThreeElement<typeof RenderPass>;
|
|
219
|
+
shaderPass: ThreeElement<typeof ShaderPass>;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/legacy/Geometry/Segments/Segments.d.ts
|
|
224
|
+
declare module '@react-three/fiber' {
|
|
225
|
+
interface ThreeElements {
|
|
226
|
+
segmentObject: ThreeElement<typeof SegmentObject>;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
declare class SegmentObject {
|
|
230
|
+
color: THREE.Color;
|
|
231
|
+
start: THREE.Vector3;
|
|
232
|
+
end: THREE.Vector3;
|
|
233
|
+
constructor();
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region src/legacy/Effects/Trail/Trail.d.ts
|
|
237
|
+
type Settings = {
|
|
238
|
+
width: number;
|
|
239
|
+
length: number;
|
|
240
|
+
decay: number;
|
|
241
|
+
local: boolean;
|
|
242
|
+
stride: number;
|
|
243
|
+
interval: number;
|
|
244
|
+
};
|
|
245
|
+
type TrailProps = {
|
|
246
|
+
color?: ColorRepresentation;
|
|
247
|
+
attenuation?: (t: number) => number;
|
|
248
|
+
target?: React.RefObject<Object3D>;
|
|
249
|
+
} & Partial<Settings>;
|
|
250
|
+
declare function useTrail(target: Object3D, settings: Partial<Settings>, pointCount: number): React.RefObject<Float32Array>;
|
|
251
|
+
declare const Trail: ForwardRefComponent<React.PropsWithChildren<TrailProps>, Line2>;
|
|
252
|
+
//#endregion
|
|
253
|
+
export { MarchingCube, MarchingCubeProps, MarchingCubes, MarchingCubesProps, MarchingPlane, MarchingPlaneProps, Outlines, OutlinesProps, Trail, type TrailProps, useTrail };
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import { a as Mesh, c as SkinnedMesh, d as Vector2$1, f as Vector3$1, i as MathUtils, l as Uniform, n as Color, o as REVISION, r as InstancedMesh, s as ShaderMaterial, t as BackSide, u as UniformsUtils } from "../_chunks/libs/three.mjs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { MarchingCubes as MarchingCubes$1 } from "three/examples/jsm/objects/MarchingCubes";
|
|
4
|
+
import { applyProps, createPortal, extend, useFrame, useThree } from "@react-three/fiber";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { toCreasedNormals } from "three/examples/jsm/utils/BufferGeometryUtils";
|
|
7
|
+
import * as THREE from "three";
|
|
8
|
+
import { Object3D, Vector2, Vector3 } from "three";
|
|
9
|
+
import { Line2 } from "three/examples/jsm/lines/Line2.js";
|
|
10
|
+
import { LineGeometry } from "three/examples/jsm/lines/LineGeometry.js";
|
|
11
|
+
import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";
|
|
12
|
+
|
|
13
|
+
//#region src/experimental/Geometry/MarchingCubes/MarchingCubes.tsx
|
|
14
|
+
const globalContext = /* @__PURE__ */ React.createContext(null);
|
|
15
|
+
/**
|
|
16
|
+
* An abstraction for three's [MarchingCubes](https://threejs.org/examples/#webgl_marchingcubes).
|
|
17
|
+
*
|
|
18
|
+
* @example Basic usage
|
|
19
|
+
* ```jsx
|
|
20
|
+
* <MarchingCubes resolution={50} maxPolyCount={20000} enableUvs={false} enableColors={true}>
|
|
21
|
+
* <MarchingCube strength={0.5} subtract={12} color={new Color('#f0f')} position={[0.5, 0.5, 0.5]} />
|
|
22
|
+
* <MarchingPlane planeType="y" strength={0.5} subtract={12} />
|
|
23
|
+
* </MarchingCubes>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
const MarchingCubes = /* @__PURE__ */ React.forwardRef(({ resolution = 28, maxPolyCount = 1e4, enableUvs = false, enableColors = false, children, ...props }, ref) => {
|
|
27
|
+
const marchingCubesRef = React.useRef(null);
|
|
28
|
+
React.useImperativeHandle(ref, () => marchingCubesRef.current, []);
|
|
29
|
+
const marchingCubes = React.useMemo(() => new MarchingCubes$1(resolution, null, enableUvs, enableColors, maxPolyCount), [
|
|
30
|
+
resolution,
|
|
31
|
+
maxPolyCount,
|
|
32
|
+
enableUvs,
|
|
33
|
+
enableColors
|
|
34
|
+
]);
|
|
35
|
+
const api = React.useMemo(() => ({ getParent: () => marchingCubesRef }), []);
|
|
36
|
+
useFrame(() => {
|
|
37
|
+
marchingCubes.update();
|
|
38
|
+
marchingCubes.reset();
|
|
39
|
+
}, -1);
|
|
40
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("primitive", {
|
|
41
|
+
object: marchingCubes,
|
|
42
|
+
ref: marchingCubesRef,
|
|
43
|
+
...props,
|
|
44
|
+
children: /* @__PURE__ */ jsx(globalContext.Provider, {
|
|
45
|
+
value: api,
|
|
46
|
+
children
|
|
47
|
+
})
|
|
48
|
+
}) });
|
|
49
|
+
});
|
|
50
|
+
const MarchingCube = /* @__PURE__ */ React.forwardRef(({ strength = .5, subtract = 12, color, ...props }, ref) => {
|
|
51
|
+
const { getParent } = React.useContext(globalContext);
|
|
52
|
+
const parentRef = React.useMemo(() => getParent(), [getParent]);
|
|
53
|
+
const cubeRef = React.useRef(null);
|
|
54
|
+
React.useImperativeHandle(ref, () => cubeRef.current, []);
|
|
55
|
+
const vec = new Vector3$1();
|
|
56
|
+
useFrame((state) => {
|
|
57
|
+
if (!parentRef.current || !cubeRef.current) return;
|
|
58
|
+
cubeRef.current.getWorldPosition(vec);
|
|
59
|
+
parentRef.current.addBall(.5 + vec.x * .5, .5 + vec.y * .5, .5 + vec.z * .5, strength, subtract, color);
|
|
60
|
+
});
|
|
61
|
+
return /* @__PURE__ */ jsx("group", {
|
|
62
|
+
ref: cubeRef,
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
const MarchingPlane = /* @__PURE__ */ React.forwardRef(({ planeType: _planeType = "x", strength = .5, subtract = 12, ...props }, ref) => {
|
|
67
|
+
const { getParent } = React.useContext(globalContext);
|
|
68
|
+
const parentRef = React.useMemo(() => getParent(), [getParent]);
|
|
69
|
+
const wallRef = React.useRef(null);
|
|
70
|
+
React.useImperativeHandle(ref, () => wallRef.current, []);
|
|
71
|
+
const planeType = React.useMemo(() => _planeType === "x" ? "addPlaneX" : _planeType === "y" ? "addPlaneY" : "addPlaneZ", [_planeType]);
|
|
72
|
+
useFrame(() => {
|
|
73
|
+
if (!parentRef.current || !wallRef.current) return;
|
|
74
|
+
parentRef.current[planeType](strength, subtract);
|
|
75
|
+
});
|
|
76
|
+
return /* @__PURE__ */ jsx("group", {
|
|
77
|
+
ref: wallRef,
|
|
78
|
+
...props
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/legacy/Materials/shaderMaterial/shaderMaterial.tsx
|
|
84
|
+
/**
|
|
85
|
+
* Creates a ShaderMaterial class with uniforms as setter/getters and constructor args.
|
|
86
|
+
* Includes a unique `key` property for hot-reload support.
|
|
87
|
+
*
|
|
88
|
+
* @param uniforms - Default uniform values
|
|
89
|
+
* @param vertexShader - GLSL vertex shader
|
|
90
|
+
* @param fragmentShader - GLSL fragment shader
|
|
91
|
+
* @param onInit - Optional callback after material creation
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```jsx
|
|
95
|
+
* const MyMaterial = shaderMaterial(
|
|
96
|
+
* { time: 0, color: new THREE.Color(0.2, 0, 0.1) },
|
|
97
|
+
* vertexShader,
|
|
98
|
+
* fragmentShader
|
|
99
|
+
* )
|
|
100
|
+
* extend({ MyMaterial })
|
|
101
|
+
* <mesh><myMaterial key={MyMaterial.key} time={1} /></mesh>
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
function shaderMaterial(uniforms, vertexShader, fragmentShader, onInit) {
|
|
105
|
+
return class extends ShaderMaterial {
|
|
106
|
+
static key = MathUtils.generateUUID();
|
|
107
|
+
constructor(parameters) {
|
|
108
|
+
super({
|
|
109
|
+
vertexShader,
|
|
110
|
+
fragmentShader,
|
|
111
|
+
...parameters
|
|
112
|
+
});
|
|
113
|
+
for (const key in uniforms) {
|
|
114
|
+
this.uniforms[key] = new Uniform(uniforms[key]);
|
|
115
|
+
Object.defineProperty(this, key, {
|
|
116
|
+
get() {
|
|
117
|
+
return this.uniforms[key].value;
|
|
118
|
+
},
|
|
119
|
+
set(value) {
|
|
120
|
+
this.uniforms[key].value = value;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
this.uniforms = UniformsUtils.clone(this.uniforms);
|
|
125
|
+
onInit?.(this);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/utils/constants.ts
|
|
132
|
+
const getVersion = () => parseInt(REVISION.replace(/\D+/g, ""));
|
|
133
|
+
const version = /* @__PURE__ */ getVersion();
|
|
134
|
+
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/experimental/Effects/Outlines/Outlines.tsx
|
|
137
|
+
const OutlinesMaterial = /* @__PURE__ */ shaderMaterial({
|
|
138
|
+
screenspace: false,
|
|
139
|
+
color: /* @__PURE__ */ new Color("black"),
|
|
140
|
+
opacity: 1,
|
|
141
|
+
thickness: .05,
|
|
142
|
+
size: /* @__PURE__ */ new Vector2$1()
|
|
143
|
+
}, `#include <common>
|
|
144
|
+
#include <morphtarget_pars_vertex>
|
|
145
|
+
#include <skinning_pars_vertex>
|
|
146
|
+
#include <clipping_planes_pars_vertex>
|
|
147
|
+
uniform float thickness;
|
|
148
|
+
uniform bool screenspace;
|
|
149
|
+
uniform vec2 size;
|
|
150
|
+
void main() {
|
|
151
|
+
#if defined (USE_SKINNING)
|
|
152
|
+
#include <beginnormal_vertex>
|
|
153
|
+
#include <morphnormal_vertex>
|
|
154
|
+
#include <skinbase_vertex>
|
|
155
|
+
#include <skinnormal_vertex>
|
|
156
|
+
#include <defaultnormal_vertex>
|
|
157
|
+
#endif
|
|
158
|
+
#include <begin_vertex>
|
|
159
|
+
#include <morphtarget_vertex>
|
|
160
|
+
#include <skinning_vertex>
|
|
161
|
+
#include <project_vertex>
|
|
162
|
+
#include <clipping_planes_vertex>
|
|
163
|
+
vec4 tNormal = vec4(normal, 0.0);
|
|
164
|
+
vec4 tPosition = vec4(transformed, 1.0);
|
|
165
|
+
#ifdef USE_INSTANCING
|
|
166
|
+
tNormal = instanceMatrix * tNormal;
|
|
167
|
+
tPosition = instanceMatrix * tPosition;
|
|
168
|
+
#endif
|
|
169
|
+
if (screenspace) {
|
|
170
|
+
vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness;
|
|
171
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);
|
|
172
|
+
} else {
|
|
173
|
+
vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition;
|
|
174
|
+
vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal;
|
|
175
|
+
vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0;
|
|
176
|
+
clipPosition.xy += offset;
|
|
177
|
+
gl_Position = clipPosition;
|
|
178
|
+
}
|
|
179
|
+
}`, `uniform vec3 color;
|
|
180
|
+
uniform float opacity;
|
|
181
|
+
#include <clipping_planes_pars_fragment>
|
|
182
|
+
void main(){
|
|
183
|
+
#include <clipping_planes_fragment>
|
|
184
|
+
gl_FragColor = vec4(color, opacity);
|
|
185
|
+
#include <tonemapping_fragment>
|
|
186
|
+
#include <${version >= 154 ? "colorspace_fragment" : "encodings_fragment"}>
|
|
187
|
+
}`);
|
|
188
|
+
/**
|
|
189
|
+
* An ornamental component that extracts the geometry from its parent and displays an
|
|
190
|
+
* [inverted-hull outline](https://bnpr.gitbook.io/bnpr/outline/inverse-hull-method).
|
|
191
|
+
* Supported parents are `<mesh>`, `<skinnedMesh>` and `<instancedMesh>`.
|
|
192
|
+
*
|
|
193
|
+
* @example Basic usage
|
|
194
|
+
* ```jsx
|
|
195
|
+
* <mesh>
|
|
196
|
+
* <boxGeometry />
|
|
197
|
+
* <meshBasicMaterial />
|
|
198
|
+
* <Outlines thickness={0.05} color="hotpink" />
|
|
199
|
+
* </mesh>
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
function Outlines({ color = "black", opacity = 1, transparent = false, screenspace = false, toneMapped = true, polygonOffset = false, polygonOffsetFactor = 0, renderOrder = 0, thickness = .05, angle = Math.PI, clippingPlanes, ...props }) {
|
|
203
|
+
const ref = React.useRef(null);
|
|
204
|
+
const [material] = React.useState(() => new OutlinesMaterial({ side: BackSide }));
|
|
205
|
+
const { gl } = useThree();
|
|
206
|
+
const contextSize = gl.getDrawingBufferSize(new Vector2$1());
|
|
207
|
+
React.useMemo(() => extend({ OutlinesMaterial }), []);
|
|
208
|
+
const oldAngle = React.useRef(0);
|
|
209
|
+
const oldGeometry = React.useRef(null);
|
|
210
|
+
React.useLayoutEffect(() => {
|
|
211
|
+
const group = ref.current;
|
|
212
|
+
if (!group) return;
|
|
213
|
+
const parent = group.parent;
|
|
214
|
+
if (parent && parent.geometry) {
|
|
215
|
+
if (oldAngle.current !== angle || oldGeometry.current !== parent.geometry) {
|
|
216
|
+
oldAngle.current = angle;
|
|
217
|
+
oldGeometry.current = parent.geometry;
|
|
218
|
+
let mesh = group.children?.[0];
|
|
219
|
+
if (mesh) {
|
|
220
|
+
if (angle) mesh.geometry.dispose();
|
|
221
|
+
group.remove(mesh);
|
|
222
|
+
}
|
|
223
|
+
if (parent.skeleton) {
|
|
224
|
+
mesh = new SkinnedMesh();
|
|
225
|
+
mesh.material = material;
|
|
226
|
+
mesh.bind(parent.skeleton, parent.bindMatrix);
|
|
227
|
+
group.add(mesh);
|
|
228
|
+
} else if (parent.isInstancedMesh) {
|
|
229
|
+
mesh = new InstancedMesh(parent.geometry, material, parent.count);
|
|
230
|
+
mesh.instanceMatrix = parent.instanceMatrix;
|
|
231
|
+
group.add(mesh);
|
|
232
|
+
} else {
|
|
233
|
+
mesh = new Mesh();
|
|
234
|
+
mesh.material = material;
|
|
235
|
+
group.add(mesh);
|
|
236
|
+
}
|
|
237
|
+
mesh.geometry = angle ? toCreasedNormals(parent.geometry, angle) : parent.geometry;
|
|
238
|
+
mesh.morphTargetInfluences = parent.morphTargetInfluences;
|
|
239
|
+
mesh.morphTargetDictionary = parent.morphTargetDictionary;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
React.useLayoutEffect(() => {
|
|
244
|
+
const group = ref.current;
|
|
245
|
+
if (!group) return;
|
|
246
|
+
const mesh = group.children[0];
|
|
247
|
+
if (mesh) {
|
|
248
|
+
mesh.renderOrder = renderOrder;
|
|
249
|
+
const parent = group.parent;
|
|
250
|
+
applyProps(mesh, {
|
|
251
|
+
morphTargetInfluences: parent.morphTargetInfluences,
|
|
252
|
+
morphTargetDictionary: parent.morphTargetDictionary
|
|
253
|
+
});
|
|
254
|
+
applyProps(mesh.material, {
|
|
255
|
+
transparent,
|
|
256
|
+
thickness,
|
|
257
|
+
color,
|
|
258
|
+
opacity,
|
|
259
|
+
size: contextSize,
|
|
260
|
+
screenspace,
|
|
261
|
+
toneMapped,
|
|
262
|
+
polygonOffset,
|
|
263
|
+
polygonOffsetFactor,
|
|
264
|
+
clippingPlanes,
|
|
265
|
+
clipping: clippingPlanes && clippingPlanes.length > 0
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
React.useEffect(() => {
|
|
270
|
+
return () => {
|
|
271
|
+
const group = ref.current;
|
|
272
|
+
if (!group) return;
|
|
273
|
+
const mesh = group.children[0];
|
|
274
|
+
if (mesh) {
|
|
275
|
+
if (angle) mesh.geometry.dispose();
|
|
276
|
+
group.remove(mesh);
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
}, []);
|
|
280
|
+
return /* @__PURE__ */ jsx("group", {
|
|
281
|
+
ref,
|
|
282
|
+
...props
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/legacy/Effects/Trail/Trail.tsx
|
|
288
|
+
const defaults = {
|
|
289
|
+
width: .2,
|
|
290
|
+
length: 1,
|
|
291
|
+
decay: 1,
|
|
292
|
+
local: false,
|
|
293
|
+
stride: 0,
|
|
294
|
+
interval: 1
|
|
295
|
+
};
|
|
296
|
+
const shiftLeft = (collection, steps = 1) => {
|
|
297
|
+
const lastX = collection[collection.length - 3];
|
|
298
|
+
const lastY = collection[collection.length - 2];
|
|
299
|
+
const lastZ = collection[collection.length - 1];
|
|
300
|
+
collection.set(collection.subarray(steps));
|
|
301
|
+
const fillStart = collection.length - steps;
|
|
302
|
+
for (let i = fillStart; i < collection.length; i += 3) {
|
|
303
|
+
collection[i] = lastX;
|
|
304
|
+
collection[i + 1] = lastY;
|
|
305
|
+
collection[i + 2] = lastZ;
|
|
306
|
+
}
|
|
307
|
+
return collection;
|
|
308
|
+
};
|
|
309
|
+
function useTrail(target, settings, pointCount) {
|
|
310
|
+
const { local, decay, interval, stride } = {
|
|
311
|
+
...defaults,
|
|
312
|
+
...settings
|
|
313
|
+
};
|
|
314
|
+
const points = React.useRef(null);
|
|
315
|
+
const [worldPosition] = React.useState(() => new Vector3());
|
|
316
|
+
React.useLayoutEffect(() => {
|
|
317
|
+
if (target) {
|
|
318
|
+
const pos = target.position;
|
|
319
|
+
points.current = Float32Array.from({ length: pointCount * 3 }, (_, i) => pos.getComponent(i % 3));
|
|
320
|
+
}
|
|
321
|
+
}, [pointCount, target]);
|
|
322
|
+
const prevPosition = React.useRef(new Vector3());
|
|
323
|
+
const frameCount = React.useRef(0);
|
|
324
|
+
useFrame(() => {
|
|
325
|
+
if (!target) return;
|
|
326
|
+
if (!points.current) return;
|
|
327
|
+
if (frameCount.current === 0) {
|
|
328
|
+
let newPosition;
|
|
329
|
+
if (local) newPosition = target.position;
|
|
330
|
+
else {
|
|
331
|
+
target.getWorldPosition(worldPosition);
|
|
332
|
+
newPosition = worldPosition;
|
|
333
|
+
}
|
|
334
|
+
const steps = 1 * decay;
|
|
335
|
+
for (let i = 0; i < steps; i++) {
|
|
336
|
+
if (newPosition.distanceTo(prevPosition.current) < stride) continue;
|
|
337
|
+
shiftLeft(points.current, 3);
|
|
338
|
+
points.current.set(newPosition.toArray(), points.current.length - 3);
|
|
339
|
+
}
|
|
340
|
+
prevPosition.current.copy(newPosition);
|
|
341
|
+
}
|
|
342
|
+
frameCount.current++;
|
|
343
|
+
frameCount.current = frameCount.current % interval;
|
|
344
|
+
});
|
|
345
|
+
return points;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* A declarative trail effect using Line2.
|
|
349
|
+
* WebGL version using LineMaterial.
|
|
350
|
+
*/
|
|
351
|
+
const Trail = /* @__PURE__ */ React.forwardRef((props, forwardRef) => {
|
|
352
|
+
const { children } = props;
|
|
353
|
+
const { width, length, decay, local, stride, interval } = {
|
|
354
|
+
...defaults,
|
|
355
|
+
...props
|
|
356
|
+
};
|
|
357
|
+
const { color = "hotpink", attenuation, target } = props;
|
|
358
|
+
const size = useThree((s) => s.size);
|
|
359
|
+
const scene = useThree((s) => s.scene);
|
|
360
|
+
const ref = React.useRef(null);
|
|
361
|
+
const [anchor, setAnchor] = React.useState(null);
|
|
362
|
+
const pointCount = length * 10;
|
|
363
|
+
const points = useTrail(anchor, {
|
|
364
|
+
decay,
|
|
365
|
+
local,
|
|
366
|
+
stride,
|
|
367
|
+
interval
|
|
368
|
+
}, pointCount);
|
|
369
|
+
React.useEffect(() => {
|
|
370
|
+
const t = target?.current || ref.current.children.find((o) => o instanceof Object3D);
|
|
371
|
+
if (t) setAnchor(t);
|
|
372
|
+
}, [points, target]);
|
|
373
|
+
const line = React.useMemo(() => new Line2(), []);
|
|
374
|
+
const geo = React.useMemo(() => {
|
|
375
|
+
const geometry = new LineGeometry();
|
|
376
|
+
const initialPositions = new Float32Array(pointCount * 3).fill(0);
|
|
377
|
+
const initialColors = new Float32Array(pointCount * 3).fill(1);
|
|
378
|
+
geometry.setPositions(initialPositions);
|
|
379
|
+
geometry.setColors(initialColors);
|
|
380
|
+
return geometry;
|
|
381
|
+
}, [pointCount]);
|
|
382
|
+
const [resolution] = React.useState(() => new Vector2(size.width, size.height));
|
|
383
|
+
const colorsRef = React.useRef(new Float32Array(pointCount * 3));
|
|
384
|
+
const baseColor = React.useMemo(() => new THREE.Color(color), [color]);
|
|
385
|
+
const mat = React.useMemo(() => new LineMaterial({
|
|
386
|
+
color: 16777215,
|
|
387
|
+
linewidth: width,
|
|
388
|
+
vertexColors: true,
|
|
389
|
+
resolution: new Vector2(size.width, size.height),
|
|
390
|
+
transparent: true,
|
|
391
|
+
alphaToCoverage: true
|
|
392
|
+
}), [width, size]);
|
|
393
|
+
React.useEffect(() => {
|
|
394
|
+
resolution.set(size.width, size.height);
|
|
395
|
+
mat.resolution.set(size.width, size.height);
|
|
396
|
+
}, [
|
|
397
|
+
size,
|
|
398
|
+
mat,
|
|
399
|
+
resolution
|
|
400
|
+
]);
|
|
401
|
+
useFrame(() => {
|
|
402
|
+
if (!points.current) return;
|
|
403
|
+
const count = points.current.length / 3;
|
|
404
|
+
const colors = colorsRef.current;
|
|
405
|
+
for (let i = 0; i < count; i++) {
|
|
406
|
+
const t = i / (count - 1);
|
|
407
|
+
const alpha = attenuation ? attenuation(t) : t;
|
|
408
|
+
colors[i * 3 + 0] = baseColor.r * alpha;
|
|
409
|
+
colors[i * 3 + 1] = baseColor.g * alpha;
|
|
410
|
+
colors[i * 3 + 2] = baseColor.b * alpha;
|
|
411
|
+
}
|
|
412
|
+
geo.setPositions(points.current);
|
|
413
|
+
geo.setColors(colors);
|
|
414
|
+
line.computeLineDistances();
|
|
415
|
+
});
|
|
416
|
+
React.useLayoutEffect(() => {
|
|
417
|
+
line.geometry = geo;
|
|
418
|
+
line.material = mat;
|
|
419
|
+
}, [
|
|
420
|
+
line,
|
|
421
|
+
geo,
|
|
422
|
+
mat
|
|
423
|
+
]);
|
|
424
|
+
return /* @__PURE__ */ jsxs("group", { children: [createPortal(/* @__PURE__ */ jsx("primitive", {
|
|
425
|
+
object: line,
|
|
426
|
+
ref: forwardRef
|
|
427
|
+
}), scene), /* @__PURE__ */ jsx("group", {
|
|
428
|
+
ref,
|
|
429
|
+
children
|
|
430
|
+
})] });
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
//#endregion
|
|
434
|
+
export { MarchingCube, MarchingCubes, MarchingPlane, Outlines, Trail, useTrail };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { A as LoadStats, B as isSupported, C as HlsSkip, D as Level, E as KeySystems, F as SubtitleStreamController, I as SubtitleTrackController, L as TimelineController, M as NetworkErrorAction, N as Part, O as LevelDetails, P as PlaylistLevelType, R as getMediaSource, S as Hls, T as KeySystemFormats, _ as ErrorDetails, a as BasePlaylistController, b as FPSController, c as BufferController, d as ChunkMetadata, f as ContentSteeringController, g as ErrorController, h as ErrorActionFlags, i as AudioTrackController, j as MetadataSchema, k as LevelKey, l as CMCDController, m as EMEController, n as AttrList, o as BaseSegment, p as DateRange, r as AudioStreamController, s as BaseStreamController, t as AbrController, u as CapLevelController, v as ErrorTypes, w as HlsUrlParameters, x as Fragment, y as Events, z as isMSESupported } from "./libs/hls.js.mjs";
|
|
2
|
+
|
|
3
|
+
export { AbrController, AttrList, AudioStreamController, AudioTrackController, BasePlaylistController, BaseSegment, BaseStreamController, BufferController, CMCDController, CapLevelController, ChunkMetadata, ContentSteeringController, DateRange, EMEController, ErrorActionFlags, ErrorController, ErrorDetails, ErrorTypes, Events, FPSController, Fragment, Hls, Hls as default, HlsSkip, HlsUrlParameters, KeySystemFormats, KeySystems, Level, LevelDetails, LevelKey, LoadStats, MetadataSchema, NetworkErrorAction, Part, PlaylistLevelType, SubtitleStreamController, SubtitleTrackController, TimelineController, getMediaSource, isMSESupported, isSupported };
|