diff --git a/docs/API/hooks.mdx b/docs/API/hooks.mdx index bb76ec4a69..4d29bf5eca 100644 --- a/docs/API/hooks.mdx +++ b/docs/API/hooks.mdx @@ -50,33 +50,34 @@ The hook is reactive, if you resize the browser for instance, you get fresh meas ### `state` properties -| Prop | Description | Type | -| ----------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `gl` | Renderer | `THREE.WebGLRenderer` | -| `scene` | Scene | `THREE.Scene` | -| `camera` | Camera | `THREE.PerspectiveCamera` | -| `raycaster` | Default raycaster | `THREE.Raycaster` | -| `pointer` | Contains updated, normalized, centric pointer coordinates | `THREE.Vector2` | -| `mouse` | Note: this is deprecated, use `pointer` instead! Normalized event coordinates | `THREE.Vector2` | -| `clock` | Running system clock | `THREE.Clock` | -| `linear` | True when the colorspace is linear | `boolean` | -| `flat` | True when no tonemapping is used | `boolean` | -| `legacy` | Disables global color management via `THREE.ColorManagement` | `boolean` | -| `frameloop` | Render mode: always, demand, never | `always`, `demand`, `never` | -| `performance` | System regression | `{ current: number, min: number, max: number, debounce: number, regress: () => void }` | -| `size` | Canvas size in pixels | `{ width: number, height: number, top: number, left: number, updateStyle?: boolean }` | -| `viewport` | Viewport size in three.js units | `{ width: number, height: number, initialDpr: number, dpr: number, factor: number, distance: number, aspect: number, getCurrentViewport: (camera?: Camera, target?: THREE.Vector3, size?: Size) => Viewport }` | -| `xr` | XR interface, manages WebXR rendering | `{ connect: () => void, disconnect: () => void }` | -| `set` | Allows you to set any state property | `(state: SetState) => void` | -| `get` | Allows you to retrieve any state property non-reactively | `() => GetState` | -| `invalidate` | Request a new render, given that `frameloop === 'demand'` | `() => void` | -| `advance` | Advance one tick, given that `frameloop === 'never'` | `(timestamp: number, runGlobalEffects?: boolean) => void` | -| `setSize` | Resize the canvas | `(width: number, height: number, updateStyle?: boolean, top?: number, left?: number) => void` | -| `setDpr` | Set the pixel-ratio | `(dpr: number) => void` | -| `setFrameloop` | Shortcut to set the current render mode | `(frameloop?: 'always', 'demand', 'never') => void` | -| `setEvents` | Shortcut to setting the event layer | `(events: Partial>) => void` | -| `onPointerMissed` | Response for pointer clicks that have missed a target | `() => void` | -| `events` | Pointer-event handling | `{ connected: TargetNode, handlers: Events, connect: (target: TargetNode) => void, disconnect: () => void }` | +| Prop | Description | Type | +| ----------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `gl` | Renderer | `THREE.WebGLRenderer` | +| `scene` | Scene | `THREE.Scene` | +| `camera` | Camera | `THREE.PerspectiveCamera` | +| `controls` | A `[makeDefault]` [`*Controls`](https://drei.docs.pmnd.rs/controls/introduction) | `THREE.EventDispatcher` or `null` | +| `raycaster` | Default raycaster | `THREE.Raycaster` | +| `pointer` | Contains updated, normalized, centric pointer coordinates | `THREE.Vector2` | +| `mouse` | Note: this is deprecated, use `pointer` instead! Normalized event coordinates | `THREE.Vector2` | +| `clock` | Running system clock | `THREE.Clock` | +| `linear` | True when the colorspace is linear | `boolean` | +| `flat` | True when no tonemapping is used | `boolean` | +| `legacy` | Disables global color management via `THREE.ColorManagement` | `boolean` | +| `frameloop` | Render mode: always, demand, never | `always`, `demand`, `never` | +| `performance` | System regression | `{ current: number, min: number, max: number, debounce: number, regress: () => void }` | +| `size` | Canvas size in pixels | `{ width: number, height: number, top: number, left: number, updateStyle?: boolean }` | +| `viewport` | Viewport size in three.js units | `{ width: number, height: number, initialDpr: number, dpr: number, factor: number, distance: number, aspect: number, getCurrentViewport: (camera?: Camera, target?: THREE.Vector3, size?: Size) => Viewport }` | +| `xr` | XR interface, manages WebXR rendering | `{ connect: () => void, disconnect: () => void }` | +| `set` | Allows you to set any state property | `(state: SetState) => void` | +| `get` | Allows you to retrieve any state property non-reactively | `() => GetState` | +| `invalidate` | Request a new render, given that `frameloop === 'demand'` | `() => void` | +| `advance` | Advance one tick, given that `frameloop === 'never'` | `(timestamp: number, runGlobalEffects?: boolean) => void` | +| `setSize` | Resize the canvas | `(width: number, height: number, updateStyle?: boolean, top?: number, left?: number) => void` | +| `setDpr` | Set the pixel-ratio | `(dpr: number) => void` | +| `setFrameloop` | Shortcut to set the current render mode | `(frameloop?: 'always', 'demand', 'never') => void` | +| `setEvents` | Shortcut to setting the event layer | `(events: Partial>) => void` | +| `onPointerMissed` | Response for pointer clicks that have missed a target | `() => void` | +| `events` | Pointer-event handling | `{ connected: TargetNode, handlers: Events, connect: (target: TargetNode) => void, disconnect: () => void }` | ### Selector