@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.
- package/README.md +3 -56
- package/assets/cloud.base64.cjs.js +1 -1
- package/assets/cloud.base64.d.ts +1 -2
- package/assets/cloud.base64.js +2 -3
- package/core/AdaptiveDpr.js +2 -2
- package/core/AdaptiveEvents.js +2 -3
- package/core/ArcballControls.js +2 -3
- package/core/Billboard.d.ts +1 -1
- package/core/Bounds.cjs.js +1 -1
- package/core/Bounds.js +11 -2
- package/core/CameraShake.js +1 -1
- package/core/Center.d.ts +1 -1
- package/core/Center.js +1 -1
- package/core/Cloud.cjs.js +1 -1
- package/core/Cloud.js +1 -1
- package/core/ContactShadows.d.ts +1 -1
- package/core/CubeCamera.js +1 -2
- package/core/Detailed.d.ts +1 -1
- package/core/Environment.js +1 -1
- package/core/GizmoHelper.js +1 -1
- package/core/Image.d.ts +1 -1
- package/core/Instances.d.ts +2 -2
- package/core/Line.d.ts +1 -1
- package/core/MeshDistortMaterial.d.ts +1 -1
- package/core/MeshReflectorMaterial.d.ts +1 -1
- package/core/MeshReflectorMaterial.js +1 -1
- package/core/MeshWobbleMaterial.d.ts +1 -1
- package/core/OrbitControls.js +2 -3
- package/core/OrthographicCamera.d.ts +1 -1
- package/core/PerspectiveCamera.d.ts +1 -1
- package/core/Points.d.ts +2 -2
- package/core/PositionalAudio.d.ts +1 -1
- package/core/Preload.js +1 -1
- package/core/Reflector.d.ts +1 -1
- package/core/Reflector.js +1 -1
- package/core/RoundedBox.d.ts +1 -1
- package/core/ScreenQuad.d.ts +1 -1
- package/core/Shadow.d.ts +1 -1
- package/core/SpotLight.d.ts +1 -1
- package/core/Stage.js +1 -2
- package/core/Stats.cjs.js +1 -1
- package/core/Stats.js +1 -1
- package/core/Text.d.ts +1 -1
- package/core/TrackballControls.js +2 -3
- package/core/TransformControls.d.ts +1 -1
- package/core/index.cjs.js +1 -1
- package/core/index.d.ts +0 -4
- package/core/index.js +1 -5
- package/core/shaderMaterial.d.ts +6 -11
- package/core/shapes.cjs.js +1 -1
- package/core/shapes.d.ts +21 -25
- package/core/shapes.js +1 -2
- package/core/useAnimations.js +1 -1
- package/core/useFBO.js +2 -2
- package/helpers/useEffectfulState.cjs.js +1 -1
- package/helpers/useEffectfulState.d.ts +1 -1
- package/helpers/useEffectfulState.js +2 -2
- package/index.cjs.js +1 -1
- package/index.js +1 -5
- package/native/index.cjs.js +1 -1
- package/native/index.js +1 -5
- package/package.json +2 -2
- package/web/Html.cjs.js +1 -1
- package/web/Html.d.ts +1 -0
- package/web/Html.js +5 -2
- package/web/index.cjs.js +1 -1
- package/web/index.js +1 -5
- package/core/DepthBuffer.cjs.js +0 -1
- package/core/DepthBuffer.d.ts +0 -5
- package/core/DepthBuffer.js +0 -36
- package/core/useEdgeSplit.cjs.js +0 -1
- package/core/useEdgeSplit.d.ts +0 -3
- package/core/useEdgeSplit.js +0 -24
- package/core/useSimplification.cjs.js +0 -1
- package/core/useSimplification.d.ts +0 -3
- package/core/useSimplification.js +0 -25
- package/core/useTessellation.cjs.js +0 -1
- package/core/useTessellation.d.ts +0 -3
- 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
|

|
|
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="
|
|
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
|
|
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://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://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://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]
|