@react-three/drei 7.27.4 → 8.2.0

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.
Files changed (79) hide show
  1. package/README.md +3 -56
  2. package/assets/cloud.base64.cjs.js +1 -1
  3. package/assets/cloud.base64.d.ts +1 -2
  4. package/assets/cloud.base64.js +2 -3
  5. package/core/AdaptiveDpr.js +2 -2
  6. package/core/AdaptiveEvents.js +2 -3
  7. package/core/ArcballControls.js +2 -3
  8. package/core/Billboard.d.ts +1 -1
  9. package/core/Bounds.cjs.js +1 -1
  10. package/core/Bounds.js +11 -2
  11. package/core/CameraShake.js +1 -1
  12. package/core/Center.d.ts +1 -1
  13. package/core/Center.js +1 -1
  14. package/core/Cloud.cjs.js +1 -1
  15. package/core/Cloud.js +1 -1
  16. package/core/ContactShadows.d.ts +1 -1
  17. package/core/CubeCamera.js +1 -2
  18. package/core/Detailed.d.ts +1 -1
  19. package/core/Environment.js +1 -1
  20. package/core/GizmoHelper.js +1 -1
  21. package/core/Image.d.ts +1 -1
  22. package/core/Instances.d.ts +2 -2
  23. package/core/Line.d.ts +1 -1
  24. package/core/MeshDistortMaterial.d.ts +1 -1
  25. package/core/MeshReflectorMaterial.d.ts +1 -1
  26. package/core/MeshReflectorMaterial.js +1 -1
  27. package/core/MeshWobbleMaterial.d.ts +1 -1
  28. package/core/OrbitControls.js +2 -3
  29. package/core/OrthographicCamera.d.ts +1 -1
  30. package/core/PerspectiveCamera.d.ts +1 -1
  31. package/core/Points.d.ts +2 -2
  32. package/core/PositionalAudio.d.ts +1 -1
  33. package/core/Preload.js +1 -1
  34. package/core/Reflector.d.ts +1 -1
  35. package/core/Reflector.js +1 -1
  36. package/core/RoundedBox.d.ts +1 -1
  37. package/core/ScreenQuad.d.ts +1 -1
  38. package/core/Shadow.d.ts +1 -1
  39. package/core/SpotLight.d.ts +1 -1
  40. package/core/Stage.js +1 -2
  41. package/core/Stats.cjs.js +1 -1
  42. package/core/Stats.js +1 -1
  43. package/core/Text.d.ts +1 -1
  44. package/core/TrackballControls.js +2 -3
  45. package/core/TransformControls.d.ts +1 -1
  46. package/core/index.cjs.js +1 -1
  47. package/core/index.d.ts +0 -4
  48. package/core/index.js +1 -5
  49. package/core/shaderMaterial.d.ts +6 -11
  50. package/core/shapes.cjs.js +1 -1
  51. package/core/shapes.d.ts +21 -25
  52. package/core/shapes.js +1 -2
  53. package/core/useAnimations.js +1 -1
  54. package/core/useFBO.js +2 -2
  55. package/helpers/useEffectfulState.cjs.js +1 -1
  56. package/helpers/useEffectfulState.d.ts +1 -1
  57. package/helpers/useEffectfulState.js +2 -2
  58. package/index.cjs.js +1 -1
  59. package/index.js +1 -5
  60. package/native/index.cjs.js +1 -1
  61. package/native/index.js +1 -5
  62. package/package.json +2 -2
  63. package/web/Html.cjs.js +1 -1
  64. package/web/Html.d.ts +1 -0
  65. package/web/Html.js +5 -2
  66. package/web/index.cjs.js +1 -1
  67. package/web/index.js +1 -5
  68. package/core/DepthBuffer.cjs.js +0 -1
  69. package/core/DepthBuffer.d.ts +0 -5
  70. package/core/DepthBuffer.js +0 -36
  71. package/core/useEdgeSplit.cjs.js +0 -1
  72. package/core/useEdgeSplit.d.ts +0 -3
  73. package/core/useEdgeSplit.js +0 -24
  74. package/core/useSimplification.cjs.js +0 -1
  75. package/core/useSimplification.d.ts +0 -3
  76. package/core/useSimplification.js +0 -25
  77. package/core/useTessellation.cjs.js +0 -1
  78. package/core/useTessellation.d.ts +0 -3
  79. package/core/useTessellation.js +0 -26
package/README.md CHANGED
@@ -78,9 +78,6 @@ The `native` route of the library **does not** export `Html` or `Loader`. The de
78
78
  <li><a href="#modifiers">Modifiers</a></li>
79
79
  <ul>
80
80
  <li><a href="#curvemodifier">CurveModifier</a></li>
81
- <li><a href="#useedgesplit">useEdgeSplit</a></li>
82
- <li><a href="#usetessellation">useTessellation</a></li>
83
- <li><a href="#usesimplification">useSimplification</a></li>
84
81
  </ul>
85
82
  </ul>
86
83
  </td>
@@ -147,7 +144,6 @@ The `native` route of the library **does not** export `Html` or `Loader`. The de
147
144
  <li><a href="#shapes">Dodecahedron</a></li>
148
145
  <li><a href="#shapes">Extrude</a></li>
149
146
  <li><a href="#shapes">Lathe</a></li>
150
- <li><a href="#shapes">Parametric</a></li>
151
147
  <li><a href="#roundedbox">RoundedBox</a></li>
152
148
  <li><a href="#screenquad">Screenquad</a></li>
153
149
  </ul>
@@ -279,7 +275,7 @@ If you are using other controls (Orbit, Trackball, etc), you will notice how the
279
275
  ![](https://img.shields.io/badge/-Dom only-red)
280
276
 
281
277
  <p align="center">
282
- <a href="https://codesandbox.io/s/l4klb"><img width="16%" src="https://codesandbox.io/api/v1/sandboxes/l4klb/screenshot.png" alt="Horizintal tiles"/></a>
278
+ <a href="https://codesandbox.io/s/l4klb"><img width="16%" src="https://codesandbox.io/api/v1/sandboxes/l4klb/screenshot.png" alt="Horizontal tiles"/></a>
283
279
  <a href="https://codesandbox.io/s/4m0d0"><img width="16%" src="https://codesandbox.io/api/v1/sandboxes/4m0d0/screenshot.png" alt="M1 scroll"/></a>
284
280
  <a href="https://codesandbox.io/s/gsm1y"><img width="16%" src="https://codesandbox.io/api/v1/sandboxes/gsm1y/screenshot.png" alt="useIntersect"/></a>
285
281
  <a href="https://codesandbox.io/s/x8gvs"><img width="16%" src="https://codesandbox.io/api/v1/sandboxes/x8gvs/screenshot.png" alt="Infinite scroll"/></a>
@@ -363,7 +359,7 @@ Semi-OrbitControls with spring-physics, polar zoom and snap-back, for presentati
363
359
 
364
360
  # Shapes
365
361
 
366
- [Buffer-geometry](https://threejs.org/docs/index.html#api/en/core/BufferGeometry) short-cuts for Plane, Box, Sphere, Circle, Cone, Cylinder, Tube, Torus, TorusKnot, Ring, Tetrahedron, Polyhedron, Icosahedron, Octahedron, Dodecahedron, Extrude, Lathe, Parametric.
362
+ [Buffer-geometry](https://threejs.org/docs/index.html#api/en/core/BufferGeometry) short-cuts for Plane, Box, Sphere, Circle, Cone, Cylinder, Tube, Torus, TorusKnot, Ring, Tetrahedron, Polyhedron, Icosahedron, Octahedron, Dodecahedron, Extrude, Lathe.
367
363
 
368
364
  ```jsx
369
365
  <Plane args={[2, 2]} />
@@ -751,56 +747,6 @@ return (
751
747
  )
752
748
  ```
753
749
 
754
- #### useEdgeSplit
755
-
756
- [![](https://img.shields.io/badge/-storybook-%23ff69b4)](https://drei.pmnd.rs/?path=/story/modifiers-useedgesplit)
757
-
758
- This hook mutates a mesh geometry using [three's Edge Split modifier](https://threejs.org/examples/?q=modifier#webgl_modifier_edgesplit). The first parameter is the cut-off angle, and the second parameter is a `tryKeepNormals` flag (default `true`).
759
-
760
- ```jsx
761
- const meshRef = useEdgeSplit(Math.PI / 2)
762
-
763
- return (
764
- <mesh ref={meshRef}>
765
- <boxBufferGeometry args={[10, 10]} />
766
- </mesh>
767
- )
768
- ```
769
-
770
- #### useSimplification
771
-
772
- [![](https://img.shields.io/badge/-storybook-%23ff69b4)](https://drei.pmnd.rs/?path=/story/modifiers-usesimplification)
773
-
774
- This hook mutates a mesh geometry using [three's Simplification modifier](https://threejs.org/examples/webgl_modifier_simplifier.html).
775
-
776
- 👉 The simplification code is based on [this algorithm](http://www.melax.com/polychop/).
777
-
778
- ```jsx
779
- const meshRef = useSimplification(0.5)
780
-
781
- return (
782
- <mesh ref={meshRef}>
783
- <octahedronBufferGeometry args={[2, 5]} />
784
- </mesh>
785
- )
786
- ```
787
-
788
- #### useTessellation
789
-
790
- [![](https://img.shields.io/badge/-storybook-%23ff69b4)](https://drei.pmnd.rs/?path=/story/modifiers-usetessellation)
791
-
792
- This hook mutates a mesh geometry using [three's Tessellation modifier](https://threejs.org/examples/?q=tess#webgl_modifier_tessellation). It will break-up faces withe edge longer than the maxEdgeLength parameter.
793
-
794
- ```jsx
795
- const meshRef = useTessellation(2, 8)
796
-
797
- return (
798
- <mesh ref={meshRef}>
799
- <octahedronBufferGeometry args={[2, 2]} />
800
- </mesh>
801
- )
802
- ```
803
-
804
750
  # Misc
805
751
 
806
752
  #### useContextBridge
@@ -843,6 +789,7 @@ Allows you to tie HTML content to any object of your scene. It will be projected
843
789
  ```jsx
844
790
  <Html
845
791
  as='div' // Wrapping element (default: 'div')
792
+ wrapperClass // The className of the wrapping element (default: undefined)
846
793
  prepend // Project content behind the canvas (default: false)
847
794
  center // Adds a -50%/-50% css transform (default: false) [ignored in transform mode]
848
795
  fullscreen // Aligns to the upper-left corner, fills the screen (default:false) [ignored in transform mode]