# Class: BoundBox

## Table of contents

### Constructors

- constructor

### Properties

- OFFSETS

### Accessors

- center
- size

### Methods

- addPoint
- endInitByPoints
- initByPoints
- setValue
- startInitByPoints
- createFromCenterAndSize

## Constructors

### constructor

• **new BoundBox**(`raw?`, `offset?`)

#### Parameters

| Name | Type |
| :------ | :------ |
| `raw?` | `Float32Array` |
| `offset?` | `number` |

## Properties

### OFFSETS

▪ `Static` `Readonly` **OFFSETS**: `Readonly`

## Accessors

### center

• `get` **center**(): [`Vector3`](Vector3)

包围盒中心

**`memberof`** BoundBox

#### Returns

[`Vector3`](Vector3)

• `set` **center**(`val`): `void`

包围盒中心

#### Parameters

| Name | Type |
| :------ | :------ |
| `val` | [`Vector3`](Vector3) |

#### Returns

`void`

___

### size

• `get` **size**(): [`Vector3`](Vector3)

包围盒尺寸

**`memberof`** BoundBox

#### Returns

[`Vector3`](Vector3)

• `set` **size**(`val`): `void`

包围盒尺寸

#### Parameters

| Name | Type |
| :------ | :------ |
| `val` | [`Vector3`](Vector3) |

#### Returns

`void`

## Methods

### addPoint

▸ **addPoint**(`corner`): `void`

#### Parameters

| Name | Type |
| :------ | :------ |
| `corner` | [`Vector3`](Vector3) |

#### Returns

`void`

___

### endInitByPoints

▸ **endInitByPoints**(): `void`

#### Returns

`void`

___

### initByPoints

▸ **initByPoints**(`points`, `length?`): `void`

#### Parameters

| Name | Type |
| :------ | :------ |
| `points` | [`Vector3`](Vector3)[] |
| `length?` | `number` |

#### Returns

`void`

___

### setValue

▸ **setValue**(`center`, `size`): [`BoundBox`](BoundBox)

设置值

**`memberof`** BoundBox

#### Parameters

| Name | Type |
| :------ | :------ |
| `center` | [`Vector3`](Vector3) |
| `size` | [`Vector3`](Vector3) |

#### Returns

[`BoundBox`](BoundBox)

___

### startInitByPoints

▸ **startInitByPoints**(): `void`

#### Returns

`void`

___

### createFromCenterAndSize

▸ `Static` **createFromCenterAndSize**(`center`, `size`): [`BoundBox`](BoundBox)

使用中心和尺寸创建包围球

**`static`**

**`memberof`** BoundBall

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `center` | [`Vector3`](Vector3) | 中心 |
| `size` | [`Vector3`](Vector3) | 尺寸 |

#### Returns

[`BoundBox`](BoundBox)
