Skip to content

format

typescript
Bounds.extents

class: Bounds

description

The size of the bounding box (always half the size of the bounding box).

This method is commonly used to get the size of the bounding box to fit game objects or elements in the scene.

parameter

param_nametypedescription

reture

typedescription
Vector3The size of the bounding box.

code example

typescript
let bounds = new Bounds(new Vector3(1, 1, 1), new Vector3(1, 1, 1));
let extents = bounds.extents;//Get the extents
bounds.extents = new Vector3(2, 2, 2);//Set the extents