Skip to content

format

typescript
Bounds.center

class: 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_nametypedescription

reture

typedescription
Vector3The 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