Region3

顯示已棄用項目

The Region3 data type describes a volume in 3D space similar to an axis-aligned rectangular prism. It is commonly used with Terrain functions and functions that detect parts within a volume, such as WorldRoot:FindPartsInRegion3().

The prism's center is accessible using the Region3.CFrame property and the prism's size is accessible through the Region3.Size property. Note that the components of this property may be negative.

The Region3:ExpandToGrid() method returns a new Region3 whose bounds comply with a provided resolution value. The resulting volume may be equal to or greater than the original volume, but never smaller.

See also:

概要

建構子

屬性

方法

建構子

new

Returns a new Region3 given the Vector3 bounds of the rectangular prism volume.

Note that the order of the provided bounds matters: by switching them, the polarity of the size components will switch. It is possible to create a Region3 with a negative volume.

參數

min: Vector3
max: Vector3

屬性

CFrame

The center location and rotation of the Region3.

The 3D size of the Region3.

方法

ExpandToGrid

Expands the Region3 based on the provided resolution and returns the expanded Region3 aligned to the Terrain voxel grid.

參數

resolution: number

返回