@react-three/drei 10.7.7 → 11.0.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,301 @@
|
|
|
1
|
+
//#region node_modules/stats-gl/dist/panel.js
|
|
2
|
+
var Panel = class {
|
|
3
|
+
constructor(name, fg, bg) {
|
|
4
|
+
this.name = name;
|
|
5
|
+
this.fg = fg;
|
|
6
|
+
this.bg = bg;
|
|
7
|
+
this.PR = Math.round(window.devicePixelRatio || 1);
|
|
8
|
+
this.WIDTH = 90 * this.PR;
|
|
9
|
+
this.HEIGHT = 48 * this.PR;
|
|
10
|
+
this.TEXT_X = 3 * this.PR;
|
|
11
|
+
this.TEXT_Y = 2 * this.PR;
|
|
12
|
+
this.GRAPH_X = 3 * this.PR;
|
|
13
|
+
this.GRAPH_Y = 15 * this.PR;
|
|
14
|
+
this.GRAPH_WIDTH = 84 * this.PR;
|
|
15
|
+
this.GRAPH_HEIGHT = 30 * this.PR;
|
|
16
|
+
this.canvas = document.createElement("canvas");
|
|
17
|
+
this.canvas.width = 90 * this.PR;
|
|
18
|
+
this.canvas.height = 48 * this.PR;
|
|
19
|
+
this.canvas.style.width = "90px";
|
|
20
|
+
this.canvas.style.position = "absolute";
|
|
21
|
+
this.canvas.style.height = "48px";
|
|
22
|
+
this.canvas.style.cssText = "width:90px;height:48px";
|
|
23
|
+
this.context = this.canvas.getContext("2d");
|
|
24
|
+
if (this.context) {
|
|
25
|
+
this.context.font = "bold " + 9 * this.PR + "px Helvetica,Arial,sans-serif";
|
|
26
|
+
this.context.textBaseline = "top";
|
|
27
|
+
this.context.fillStyle = this.bg;
|
|
28
|
+
this.context.fillRect(0, 0, this.WIDTH, this.HEIGHT);
|
|
29
|
+
this.context.fillStyle = this.fg;
|
|
30
|
+
this.context.fillText(this.name, this.TEXT_X, this.TEXT_Y);
|
|
31
|
+
this.context.fillRect(this.GRAPH_X, this.GRAPH_Y, this.GRAPH_WIDTH, this.GRAPH_HEIGHT);
|
|
32
|
+
this.context.fillStyle = this.bg;
|
|
33
|
+
this.context.globalAlpha = .9;
|
|
34
|
+
this.context.fillRect(this.GRAPH_X, this.GRAPH_Y, this.GRAPH_WIDTH, this.GRAPH_HEIGHT);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
update(value, valueGraph, maxValue, maxGraph, decimals = 0) {
|
|
38
|
+
let min = Infinity, max = 0;
|
|
39
|
+
if (!this.context) return;
|
|
40
|
+
min = Math.min(min, value);
|
|
41
|
+
max = Math.max(maxValue, value);
|
|
42
|
+
maxGraph = Math.max(maxGraph, valueGraph);
|
|
43
|
+
this.context.fillStyle = this.bg;
|
|
44
|
+
this.context.globalAlpha = 1;
|
|
45
|
+
this.context.fillRect(0, 0, this.WIDTH, this.GRAPH_Y);
|
|
46
|
+
this.context.fillStyle = this.fg;
|
|
47
|
+
this.context.fillText(value.toFixed(decimals) + " " + this.name + " (" + min.toFixed(decimals) + "-" + parseFloat(max.toFixed(decimals)) + ")", this.TEXT_X, this.TEXT_Y);
|
|
48
|
+
this.context.drawImage(this.canvas, this.GRAPH_X + this.PR, this.GRAPH_Y, this.GRAPH_WIDTH - this.PR, this.GRAPH_HEIGHT, this.GRAPH_X, this.GRAPH_Y, this.GRAPH_WIDTH - this.PR, this.GRAPH_HEIGHT);
|
|
49
|
+
this.context.fillRect(this.GRAPH_X + this.GRAPH_WIDTH - this.PR, this.GRAPH_Y, this.PR, this.GRAPH_HEIGHT);
|
|
50
|
+
this.context.fillStyle = this.bg;
|
|
51
|
+
this.context.globalAlpha = .9;
|
|
52
|
+
this.context.fillRect(this.GRAPH_X + this.GRAPH_WIDTH - this.PR, this.GRAPH_Y, this.PR, (1 - valueGraph / maxGraph) * this.GRAPH_HEIGHT);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region node_modules/stats-gl/dist/main.js
|
|
58
|
+
const _Stats = class _Stats2 {
|
|
59
|
+
constructor({ logsPerSecond = 20, samplesLog = 100, samplesGraph = 10, precision = 2, minimal = false, horizontal = true, mode = 0 } = {}) {
|
|
60
|
+
this.totalCpuDuration = 0;
|
|
61
|
+
this.totalGpuDuration = 0;
|
|
62
|
+
this.totalGpuDurationCompute = 0;
|
|
63
|
+
this.totalFps = 0;
|
|
64
|
+
this.activeQuery = null;
|
|
65
|
+
this.gpuQueries = [];
|
|
66
|
+
this.renderCount = 0;
|
|
67
|
+
this.mode = mode;
|
|
68
|
+
this.horizontal = horizontal;
|
|
69
|
+
this.dom = document.createElement("div");
|
|
70
|
+
this.dom.style.cssText = "position:fixed;top:0;left:0;opacity:0.9;z-index:10000;";
|
|
71
|
+
if (minimal) this.dom.style.cssText += "cursor:pointer";
|
|
72
|
+
this.gl = null;
|
|
73
|
+
this.query = null;
|
|
74
|
+
this.isRunningCPUProfiling = false;
|
|
75
|
+
this.minimal = minimal;
|
|
76
|
+
this.beginTime = (performance || Date).now();
|
|
77
|
+
this.prevTime = this.beginTime;
|
|
78
|
+
this.prevCpuTime = this.beginTime;
|
|
79
|
+
this.frames = 0;
|
|
80
|
+
this.renderCount = 0;
|
|
81
|
+
this.threeRendererPatched = false;
|
|
82
|
+
this.averageCpu = {
|
|
83
|
+
logs: [],
|
|
84
|
+
graph: []
|
|
85
|
+
};
|
|
86
|
+
this.averageGpu = {
|
|
87
|
+
logs: [],
|
|
88
|
+
graph: []
|
|
89
|
+
};
|
|
90
|
+
this.averageGpuCompute = {
|
|
91
|
+
logs: [],
|
|
92
|
+
graph: []
|
|
93
|
+
};
|
|
94
|
+
this.queryCreated = false;
|
|
95
|
+
this.fpsPanel = this.addPanel(new _Stats2.Panel("FPS", "#0ff", "#002"), 0);
|
|
96
|
+
this.msPanel = this.addPanel(new _Stats2.Panel("CPU", "#0f0", "#020"), 1);
|
|
97
|
+
this.gpuPanel = null;
|
|
98
|
+
this.gpuPanelCompute = null;
|
|
99
|
+
this.samplesLog = samplesLog;
|
|
100
|
+
this.samplesGraph = samplesGraph;
|
|
101
|
+
this.precision = precision;
|
|
102
|
+
this.logsPerSecond = logsPerSecond;
|
|
103
|
+
if (this.minimal) {
|
|
104
|
+
this.dom.addEventListener("click", (event) => {
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
this.showPanel(++this.mode % this.dom.children.length);
|
|
107
|
+
}, false);
|
|
108
|
+
this.mode = mode;
|
|
109
|
+
this.showPanel(this.mode);
|
|
110
|
+
} else window.addEventListener("resize", () => {
|
|
111
|
+
this.resizePanel(this.fpsPanel, 0);
|
|
112
|
+
this.resizePanel(this.msPanel, 1);
|
|
113
|
+
if (this.gpuPanel) this.resizePanel(this.gpuPanel, 2);
|
|
114
|
+
if (this.gpuPanelCompute) this.resizePanel(this.gpuPanelCompute, 3);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
patchThreeRenderer(renderer) {
|
|
118
|
+
const originalRenderMethod = renderer.render;
|
|
119
|
+
const statsInstance = this;
|
|
120
|
+
renderer.render = function(scene, camera) {
|
|
121
|
+
statsInstance.begin();
|
|
122
|
+
originalRenderMethod.call(this, scene, camera);
|
|
123
|
+
statsInstance.end();
|
|
124
|
+
};
|
|
125
|
+
this.threeRendererPatched = true;
|
|
126
|
+
}
|
|
127
|
+
resizePanel(panel, offset) {
|
|
128
|
+
panel.canvas.style.position = "absolute";
|
|
129
|
+
if (this.minimal) panel.canvas.style.display = "none";
|
|
130
|
+
else {
|
|
131
|
+
panel.canvas.style.display = "block";
|
|
132
|
+
if (this.horizontal) {
|
|
133
|
+
panel.canvas.style.top = "0px";
|
|
134
|
+
panel.canvas.style.left = offset * panel.WIDTH / panel.PR + "px";
|
|
135
|
+
} else {
|
|
136
|
+
panel.canvas.style.left = "0px";
|
|
137
|
+
panel.canvas.style.top = offset * panel.HEIGHT / panel.PR + "px";
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
addPanel(panel, offset) {
|
|
142
|
+
if (panel.canvas) {
|
|
143
|
+
this.dom.appendChild(panel.canvas);
|
|
144
|
+
this.resizePanel(panel, offset);
|
|
145
|
+
}
|
|
146
|
+
return panel;
|
|
147
|
+
}
|
|
148
|
+
showPanel(id) {
|
|
149
|
+
for (let i = 0; i < this.dom.children.length; i++) {
|
|
150
|
+
const child = this.dom.children[i];
|
|
151
|
+
child.style.display = i === id ? "block" : "none";
|
|
152
|
+
}
|
|
153
|
+
this.mode = id;
|
|
154
|
+
}
|
|
155
|
+
async init(canvasOrGL) {
|
|
156
|
+
if (!canvasOrGL) {
|
|
157
|
+
console.error("Stats: The \"canvas\" parameter is undefined.");
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (canvasOrGL.isWebGLRenderer && !this.threeRendererPatched) {
|
|
161
|
+
const canvas = canvasOrGL;
|
|
162
|
+
this.patchThreeRenderer(canvas);
|
|
163
|
+
this.gl = canvas.getContext();
|
|
164
|
+
} else if (!this.gl && canvasOrGL instanceof WebGL2RenderingContext) this.gl = canvasOrGL;
|
|
165
|
+
if (canvasOrGL.isWebGPURenderer) {
|
|
166
|
+
canvasOrGL.backend.trackTimestamp = true;
|
|
167
|
+
if (await canvasOrGL.hasFeatureAsync("timestamp-query")) {
|
|
168
|
+
this.gpuPanel = this.addPanel(new _Stats2.Panel("GPU", "#ff0", "#220"), 2);
|
|
169
|
+
this.gpuPanelCompute = this.addPanel(new _Stats2.Panel("CPT", "#e1e1e1", "#212121"), 3);
|
|
170
|
+
this.info = canvasOrGL.info;
|
|
171
|
+
}
|
|
172
|
+
return;
|
|
173
|
+
} else if (!this.gl && canvasOrGL instanceof HTMLCanvasElement || canvasOrGL instanceof OffscreenCanvas) {
|
|
174
|
+
this.gl = canvasOrGL.getContext("webgl2");
|
|
175
|
+
if (!this.gl) {
|
|
176
|
+
console.error("Stats: Unable to obtain WebGL2 context.");
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
} else if (!this.gl) {
|
|
180
|
+
console.error("Stats: Invalid input type. Expected WebGL2RenderingContext, HTMLCanvasElement, or OffscreenCanvas.");
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
this.ext = this.gl.getExtension("EXT_disjoint_timer_query_webgl2");
|
|
184
|
+
if (this.ext) this.gpuPanel = this.addPanel(new _Stats2.Panel("GPU", "#ff0", "#220"), 2);
|
|
185
|
+
}
|
|
186
|
+
begin() {
|
|
187
|
+
if (!this.isRunningCPUProfiling) this.beginProfiling("cpu-started");
|
|
188
|
+
if (!this.gl || !this.ext) return;
|
|
189
|
+
if (this.gl && this.ext) {
|
|
190
|
+
if (this.activeQuery) this.gl.endQuery(this.ext.TIME_ELAPSED_EXT);
|
|
191
|
+
this.activeQuery = this.gl.createQuery();
|
|
192
|
+
if (this.activeQuery !== null) this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT, this.activeQuery);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
end() {
|
|
196
|
+
this.renderCount++;
|
|
197
|
+
if (this.gl && this.ext && this.activeQuery) {
|
|
198
|
+
this.gl.endQuery(this.ext.TIME_ELAPSED_EXT);
|
|
199
|
+
this.gpuQueries.push({ query: this.activeQuery });
|
|
200
|
+
this.activeQuery = null;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
processGpuQueries() {
|
|
204
|
+
if (!this.gl || !this.ext) return;
|
|
205
|
+
this.totalGpuDuration = 0;
|
|
206
|
+
this.gpuQueries.forEach((queryInfo, index) => {
|
|
207
|
+
if (this.gl) {
|
|
208
|
+
const available = this.gl.getQueryParameter(queryInfo.query, this.gl.QUERY_RESULT_AVAILABLE);
|
|
209
|
+
const disjoint = this.gl.getParameter(this.ext.GPU_DISJOINT_EXT);
|
|
210
|
+
if (available && !disjoint) {
|
|
211
|
+
const duration = this.gl.getQueryParameter(queryInfo.query, this.gl.QUERY_RESULT) * 1e-6;
|
|
212
|
+
this.totalGpuDuration += duration;
|
|
213
|
+
this.gl.deleteQuery(queryInfo.query);
|
|
214
|
+
this.gpuQueries.splice(index, 1);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
update() {
|
|
220
|
+
if (this.info === void 0) this.processGpuQueries();
|
|
221
|
+
else {
|
|
222
|
+
this.totalGpuDuration = this.info.render.timestamp;
|
|
223
|
+
this.totalGpuDurationCompute = this.info.compute.timestamp;
|
|
224
|
+
this.addToAverage(this.totalGpuDurationCompute, this.averageGpuCompute);
|
|
225
|
+
}
|
|
226
|
+
this.endProfiling("cpu-started", "cpu-finished", "cpu-duration");
|
|
227
|
+
this.addToAverage(this.totalCpuDuration, this.averageCpu);
|
|
228
|
+
this.addToAverage(this.totalGpuDuration, this.averageGpu);
|
|
229
|
+
this.renderCount = 0;
|
|
230
|
+
if (this.totalCpuDuration === 0) this.beginProfiling("cpu-started");
|
|
231
|
+
this.totalCpuDuration = 0;
|
|
232
|
+
this.totalFps = 0;
|
|
233
|
+
this.beginTime = this.endInternal();
|
|
234
|
+
}
|
|
235
|
+
endInternal() {
|
|
236
|
+
this.frames++;
|
|
237
|
+
const time = (performance || Date).now();
|
|
238
|
+
if (time >= this.prevCpuTime + 1e3 / this.logsPerSecond) {
|
|
239
|
+
this.updatePanel(this.msPanel, this.averageCpu);
|
|
240
|
+
this.updatePanel(this.gpuPanel, this.averageGpu);
|
|
241
|
+
if (this.gpuPanelCompute) this.updatePanel(this.gpuPanelCompute, this.averageGpuCompute);
|
|
242
|
+
this.prevCpuTime = time;
|
|
243
|
+
}
|
|
244
|
+
if (time >= this.prevTime + 1e3) {
|
|
245
|
+
const fps = this.frames * 1e3 / (time - this.prevTime);
|
|
246
|
+
this.fpsPanel.update(fps, fps, 100, 100, 0);
|
|
247
|
+
this.prevTime = time;
|
|
248
|
+
this.frames = 0;
|
|
249
|
+
}
|
|
250
|
+
return time;
|
|
251
|
+
}
|
|
252
|
+
addToAverage(value, averageArray) {
|
|
253
|
+
averageArray.logs.push(value);
|
|
254
|
+
if (averageArray.logs.length > this.samplesLog) averageArray.logs.shift();
|
|
255
|
+
averageArray.graph.push(value);
|
|
256
|
+
if (averageArray.graph.length > this.samplesGraph) averageArray.graph.shift();
|
|
257
|
+
}
|
|
258
|
+
beginProfiling(marker) {
|
|
259
|
+
if (window.performance) {
|
|
260
|
+
window.performance.mark(marker);
|
|
261
|
+
this.isRunningCPUProfiling = true;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
endProfiling(startMarker, endMarker, measureName) {
|
|
265
|
+
if (window.performance && endMarker && this.isRunningCPUProfiling) {
|
|
266
|
+
window.performance.mark(endMarker);
|
|
267
|
+
const cpuMeasure = performance.measure(measureName, startMarker, endMarker);
|
|
268
|
+
this.totalCpuDuration += cpuMeasure.duration;
|
|
269
|
+
this.isRunningCPUProfiling = false;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
updatePanel(panel, averageArray) {
|
|
273
|
+
if (averageArray.logs.length > 0) {
|
|
274
|
+
let sumLog = 0;
|
|
275
|
+
let max = .01;
|
|
276
|
+
for (let i = 0; i < averageArray.logs.length; i++) {
|
|
277
|
+
sumLog += averageArray.logs[i];
|
|
278
|
+
if (averageArray.logs[i] > max) max = averageArray.logs[i];
|
|
279
|
+
}
|
|
280
|
+
let sumGraph = 0;
|
|
281
|
+
let maxGraph = .01;
|
|
282
|
+
for (let i = 0; i < averageArray.graph.length; i++) {
|
|
283
|
+
sumGraph += averageArray.graph[i];
|
|
284
|
+
if (averageArray.graph[i] > maxGraph) maxGraph = averageArray.graph[i];
|
|
285
|
+
}
|
|
286
|
+
if (panel) panel.update(sumLog / Math.min(averageArray.logs.length, this.samplesLog), sumGraph / Math.min(averageArray.graph.length, this.samplesGraph), max, maxGraph, this.precision);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
get domElement() {
|
|
290
|
+
return this.dom;
|
|
291
|
+
}
|
|
292
|
+
get container() {
|
|
293
|
+
console.warn("Stats: Deprecated! this.container as been replaced to this.dom ");
|
|
294
|
+
return this.dom;
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
_Stats.Panel = Panel;
|
|
298
|
+
let Stats = _Stats;
|
|
299
|
+
|
|
300
|
+
//#endregion
|
|
301
|
+
export { Stats as t };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { t as __commonJSMin } from "../rolldown-runtime.mjs";
|
|
2
|
+
|
|
3
|
+
//#region node_modules/stats.js/build/stats.min.js
|
|
4
|
+
var require_stats_min = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
+
(function(f, e) {
|
|
6
|
+
"object" === typeof exports && "undefined" !== typeof module ? module.exports = e() : "function" === typeof define && define.amd ? define(e) : f.Stats = e();
|
|
7
|
+
})(exports, function() {
|
|
8
|
+
var f = function() {
|
|
9
|
+
function e(a$1) {
|
|
10
|
+
c.appendChild(a$1.dom);
|
|
11
|
+
return a$1;
|
|
12
|
+
}
|
|
13
|
+
function u(a$1) {
|
|
14
|
+
for (var d = 0; d < c.children.length; d++) c.children[d].style.display = d === a$1 ? "block" : "none";
|
|
15
|
+
l = a$1;
|
|
16
|
+
}
|
|
17
|
+
var l = 0, c = document.createElement("div");
|
|
18
|
+
c.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000";
|
|
19
|
+
c.addEventListener("click", function(a$1) {
|
|
20
|
+
a$1.preventDefault();
|
|
21
|
+
u(++l % c.children.length);
|
|
22
|
+
}, !1);
|
|
23
|
+
var k = (performance || Date).now(), g = k, a = 0, r = e(new f.Panel("FPS", "#0ff", "#002")), h = e(new f.Panel("MS", "#0f0", "#020"));
|
|
24
|
+
if (self.performance && self.performance.memory) var t = e(new f.Panel("MB", "#f08", "#201"));
|
|
25
|
+
u(0);
|
|
26
|
+
return {
|
|
27
|
+
REVISION: 16,
|
|
28
|
+
dom: c,
|
|
29
|
+
addPanel: e,
|
|
30
|
+
showPanel: u,
|
|
31
|
+
begin: function() {
|
|
32
|
+
k = (performance || Date).now();
|
|
33
|
+
},
|
|
34
|
+
end: function() {
|
|
35
|
+
a++;
|
|
36
|
+
var c$1 = (performance || Date).now();
|
|
37
|
+
h.update(c$1 - k, 200);
|
|
38
|
+
if (c$1 > g + 1e3 && (r.update(1e3 * a / (c$1 - g), 100), g = c$1, a = 0, t)) {
|
|
39
|
+
var d = performance.memory;
|
|
40
|
+
t.update(d.usedJSHeapSize / 1048576, d.jsHeapSizeLimit / 1048576);
|
|
41
|
+
}
|
|
42
|
+
return c$1;
|
|
43
|
+
},
|
|
44
|
+
update: function() {
|
|
45
|
+
k = this.end();
|
|
46
|
+
},
|
|
47
|
+
domElement: c,
|
|
48
|
+
setMode: u
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
f.Panel = function(e, f$1, l) {
|
|
52
|
+
var c = Infinity, k = 0, g = Math.round, a = g(window.devicePixelRatio || 1), r = 80 * a, h = 48 * a, t = 3 * a, v = 2 * a, d = 3 * a, m = 15 * a, n = 74 * a, p = 30 * a, q = document.createElement("canvas");
|
|
53
|
+
q.width = r;
|
|
54
|
+
q.height = h;
|
|
55
|
+
q.style.cssText = "width:80px;height:48px";
|
|
56
|
+
var b = q.getContext("2d");
|
|
57
|
+
b.font = "bold " + 9 * a + "px Helvetica,Arial,sans-serif";
|
|
58
|
+
b.textBaseline = "top";
|
|
59
|
+
b.fillStyle = l;
|
|
60
|
+
b.fillRect(0, 0, r, h);
|
|
61
|
+
b.fillStyle = f$1;
|
|
62
|
+
b.fillText(e, t, v);
|
|
63
|
+
b.fillRect(d, m, n, p);
|
|
64
|
+
b.fillStyle = l;
|
|
65
|
+
b.globalAlpha = .9;
|
|
66
|
+
b.fillRect(d, m, n, p);
|
|
67
|
+
return {
|
|
68
|
+
dom: q,
|
|
69
|
+
update: function(h$1, w) {
|
|
70
|
+
c = Math.min(c, h$1);
|
|
71
|
+
k = Math.max(k, h$1);
|
|
72
|
+
b.fillStyle = l;
|
|
73
|
+
b.globalAlpha = 1;
|
|
74
|
+
b.fillRect(0, 0, r, m);
|
|
75
|
+
b.fillStyle = f$1;
|
|
76
|
+
b.fillText(g(h$1) + " " + e + " (" + g(c) + "-" + g(k) + ")", t, v);
|
|
77
|
+
b.drawImage(q, d + a, m, n - a, p, d, m, n - a, p);
|
|
78
|
+
b.fillRect(d + n - a, m, a, p);
|
|
79
|
+
b.fillStyle = l;
|
|
80
|
+
b.globalAlpha = .9;
|
|
81
|
+
b.fillRect(d + n - a, m, a, g((1 - h$1 / w) * p));
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
return f;
|
|
86
|
+
});
|
|
87
|
+
}));
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
export { require_stats_min as t };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { t as __commonJSMin } from "../rolldown-runtime.mjs";
|
|
2
|
+
|
|
3
|
+
//#region node_modules/suspend-react/index.cjs.js
|
|
4
|
+
var require_index_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const isPromise = (promise) => typeof promise === "object" && typeof promise.then === "function";
|
|
7
|
+
const globalCache = [];
|
|
8
|
+
function shallowEqualArrays(arrA, arrB, equal = (a, b) => a === b) {
|
|
9
|
+
if (arrA === arrB) return true;
|
|
10
|
+
if (!arrA || !arrB) return false;
|
|
11
|
+
const len = arrA.length;
|
|
12
|
+
if (arrB.length !== len) return false;
|
|
13
|
+
for (let i = 0; i < len; i++) if (!equal(arrA[i], arrB[i])) return false;
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
function query(fn, keys = null, preload = false, config = {}) {
|
|
17
|
+
if (keys === null) keys = [fn];
|
|
18
|
+
for (const entry$1 of globalCache) if (shallowEqualArrays(keys, entry$1.keys, entry$1.equal)) {
|
|
19
|
+
if (preload) return void 0;
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(entry$1, "error")) throw entry$1.error;
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(entry$1, "response")) {
|
|
22
|
+
if (config.lifespan && config.lifespan > 0) {
|
|
23
|
+
if (entry$1.timeout) clearTimeout(entry$1.timeout);
|
|
24
|
+
entry$1.timeout = setTimeout(entry$1.remove, config.lifespan);
|
|
25
|
+
}
|
|
26
|
+
return entry$1.response;
|
|
27
|
+
}
|
|
28
|
+
if (!preload) throw entry$1.promise;
|
|
29
|
+
}
|
|
30
|
+
const entry = {
|
|
31
|
+
keys,
|
|
32
|
+
equal: config.equal,
|
|
33
|
+
remove: () => {
|
|
34
|
+
const index = globalCache.indexOf(entry);
|
|
35
|
+
if (index !== -1) globalCache.splice(index, 1);
|
|
36
|
+
},
|
|
37
|
+
promise: (isPromise(fn) ? fn : fn(...keys)).then((response) => {
|
|
38
|
+
entry.response = response;
|
|
39
|
+
if (config.lifespan && config.lifespan > 0) entry.timeout = setTimeout(entry.remove, config.lifespan);
|
|
40
|
+
}).catch((error) => entry.error = error)
|
|
41
|
+
};
|
|
42
|
+
globalCache.push(entry);
|
|
43
|
+
if (!preload) throw entry.promise;
|
|
44
|
+
}
|
|
45
|
+
const suspend = (fn, keys, config) => query(fn, keys, false, config);
|
|
46
|
+
const preload = (fn, keys, config) => void query(fn, keys, true, config);
|
|
47
|
+
const clear = (keys) => {
|
|
48
|
+
if (keys === void 0 || keys.length === 0) globalCache.splice(0, globalCache.length);
|
|
49
|
+
else {
|
|
50
|
+
const entry = globalCache.find((entry$1) => shallowEqualArrays(keys, entry$1.keys, entry$1.equal));
|
|
51
|
+
if (entry) entry.remove();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.clear = clear;
|
|
55
|
+
exports.preload = preload;
|
|
56
|
+
exports.suspend = suspend;
|
|
57
|
+
}));
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
export { require_index_cjs as t };
|