Version: 2019.3

Bounds

struct in UnityEngine

マニュアルに切り替える

説明

3 次元空間の範囲を表します。

An axis-aligned bounding box, or AABB for short, is a box aligned with coordinate axes and fully enclosing some object. Because the box is never rotated with respect to the axes, it can be defined by just its center and extents, or alternatively by min and max points.

BoundsCollider.boundsMesh.boundsRenderer.bounds で使用します。

変数

centerバウンディングボックスの中心座標
extentsThe extents of the Bounding Box. This is always half of the size of the Bounds.
maxボックスの最大値。常に center 変数と extents 変数を足した値となります
minボックスの最小値。常に center 変数から extents 変数を引いた値となります。
sizeボックスのサイズ。常に extents の 2 倍です。

コンストラクタ

Bounds新しい Bounds を作成します。

Public 関数

ClosestPointバウンディングボックスにもっとも近い点
Contains設定した point が、バウンディングボックスに含まれているか確認します
Encapsulate設定した point を含むように拡大します
Expand設定した amount によって size を大きくします
IntersectRay ray が交差しているか確認します
Intersects他のバウンズが設定したバウンズと交差しているか確認します。
SetMinMaxボックスの最小値 min と最大値 max を設定します。
SqrDistance設定したポイントとの最小距離の 2 乗されたものを返します
ToStringバウンズのために綺麗にフォーマットされた文字列を返します。