format
typescript
Bounds.centerclass: Bounds
description
The center of the bounding box.
This method is used to manipulate the bounding box, such as dynamically adjusting the position of the bounding box in a game or using it for collision detection.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
Vector3 | The center of the bounding box. |
code example
typescript
let bounds = new Bounds(new Vector3(1, 1, 1), new Vector3(1, 1, 1));
let center = bounds.center;//Get the center
bounds.center = new Vector3(2, 2, 2);//Set the center