| start | カプセルの start にある球形の中心 |
| end | カプセルの end にある球形の中心 |
| radius | カプセルの半径 |
| layermask | レイヤーマスク はレイキャストするときに選択的に衝突を無視するために使用します。 |
| queryTriggerInteraction | トリガーに設定されているものも検索対象にするか |
ワールド空間内のコライダーのいずれかがカプセル型と重なっているか。
カプセルは2つの終点である point1 と point2 、それらの radius からなる2つの球形で定義されます。
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { bool CorridorIsWideEnough(Vector3 startPt, Vector3 endPt, float width) { return Physics.CheckCapsule(startPt, endPt, width); } }