format
typescript
Bounds.EncapsulateBounds(bounds)class: Bounds
description
Expands the bounding box to include the specified bounding box.
This method expands the existing bounding box to include another bounding box, ensuring that the entire group of elements is enclosed. This is useful for continuously expanding the bounding box in a dynamic scene to accommodate new elements.
parameter
| param_name | type | description |
|---|---|---|
| bounds | Bounds | The specified bounding box. |
reture
| type | description |
|---|---|
void |
code example
typescript
let bounds = new Bounds(new Vector3(1, 1, 1), new Vector3(2, 2, 2));
let bounds2 = new Bounds(new Vector3(1, 1, 1), new Vector3(3, 3, 3));
bounds.EncapsulateBounds(bounds2);