# OBB

class in `3d-tiles-renderer/playcanvas`

```js
import { OBB } from '3d-tiles-renderer/playcanvas';
```

An oriented bounding box: an axis-aligned box from `min` to `max` in the frame given by
`transform`.

## Methods

### .update

```js
.update(  )
```

Recomputes the inverse transform, corners and planes after `min`, `max` or `transform` change.

### .clampPoint

```js
.clampPoint( point: Vec3, target: Vec3 ): Vec3
```

Returns the point inside the box that is closest to the given point.

- `point`, `Vec3`
- `target`, `Vec3`

### .distanceToPoint

```js
.distanceToPoint( point: Vec3 ): number
```

Returns the distance from the box to the point, or 0 when the point is inside.

- `point`, `Vec3`

### .intersectsFrustum

```js
.intersectsFrustum( frustumPlanes: Array<Plane>, frustumPoints: Array<Vec3> ): boolean
```

- `frustumPlanes`, `Array<Plane>`: The six inward facing planes of the frustum.
- `frustumPoints`, `Array<Vec3>`: The eight corners of the frustum.
