# CameraPickOptions

> Talos 0.7 · Since 0.7

Options for `ctx.camera.pick`: the raycast options, plus the view, a range and a ground plane.

## Signature

```ts
export interface CameraPickOptions extends CastOptions {
  /** The view whose cell `x`, `y` are in, 1 to 4. Default 1. */
  view?: number
  /** Furthest hit, metres along the ray. Default unlimited. */
  max?: number
  /** Height of a plane y = `ground` that answers when no collider is hit. */
  ground?: number
}
```

Import: `import type { CameraPickOptions } from "@argus/api"`

## Members

| Member | Signature | Description |
|---|---|---|
| `view` | `view?: number` | The view whose cell `x`, `y` are in, 1 to 4. Default 1. |
| `max` | `max?: number` | Furthest hit, metres along the ray. Default unlimited. |
| `ground` | `ground?: number` | Height of a plane y = `ground` that answers when no collider is hit. |

## Example

The tested fixture `fixtures/host/door.ts`.

```ts
import type { Behavior } from "@argus/api"
// docs/API.md, "Joints": a door on a hinge that swings open while the player is near and closes
// behind them. Typechecked by packages/api's tests.
export default {
  update(ctx) {
    const player = ctx.world.find("player")
    const near = player !== null && ctx.entity.distanceTo(player) < 2
    ctx.joint?.setMotor(near ? Math.PI / 2 : 0, { mode: "position", maxForce: 200 })
  },
} satisfies Behavior
```
