Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
drcmda committed Nov 19, 2021
1 parent 26a2d27 commit 05c95f1
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The `native` route of the library **does not** export `Html` or `Loader`. The de
</ul>
<li><a href="#controls">Controls</a></li>
<ul>
<li><a href="#controls">OrbitControls</a></li>
<li><a href="#controls">+ontrols</a></li>
<li><a href="#controls">FlyControls</a></li>
<li><a href="#controls">MapControls</a></li>
<li><a href="#controls">DeviceOrientationControls</a></li>
Expand Down Expand Up @@ -257,18 +257,7 @@ Some controls allow you to set `makeDefault`, similar to, for instance, Perspect

Drei currently exports OrbitControls [![](https://img.shields.io/badge/-storybook-%23ff69b4)](https://drei.vercel.app/?path=/story/controls-orbitcontrols--orbit-controls-story), MapControls [![](https://img.shields.io/badge/-storybook-%23ff69b4)](https://drei.vercel.app/?path=/story/controls-mapcontrols--map-controls-scene-st), TrackballControls, ArcballControls, FlyControls, DeviceOrientationControls, PointerLockControls [![](https://img.shields.io/badge/-storybook-%23ff69b4)](https://drei.vercel.app/?path=/story/controls-pointerlockcontrols--pointer-lock-controls-scene-st), FirstPersonControls [![](https://img.shields.io/badge/-storybook-%23ff69b4)](https://drei.vercel.app/?path=/story/controls-firstpersoncontrols--first-person-controls-story)

Every control component can be used with a custom camera using the `camera` prop:

```jsx
const [camera, set] = useState()

return (
<>
<PerspectiveCamera ref={set} position={[0, 5, 5]} />
<OrbitControls camera={camera} />
</>
)
```
All controls react to the default camera. If you have a `<PerspectiveCamera makeDefault />` in your scene, they will control it. If you need to inject an imperative camera or one that isn't the default, use the `camera` prop: `<OrbitControls camera={MyCamera} />`.

PointerLockControls additionally supports a `selector` prop, which enables the binding of `click` event handlers for control activation to other elements than `document` (e.g. a 'Click here to play' button). All elements matching the `selector` prop will activate the controls.

Expand Down

0 comments on commit 05c95f1

Please sign in to comment.