Version: 2017.1

Physics.OverlapCapsuleNonAlloc

切换到手册
public static int OverlapCapsuleNonAlloc (Vector3 point0, Vector3 point1, float radius, Collider[] results, int layerMask= AllLayers, QueryTriggerInteraction queryTriggerInteraction= QueryTriggerInteraction.UseGlobal);

参数

point0 胶囊体在 start 处的球体中心。
point1 胶囊体在 end 处的球体中心。
radius 胶囊体的半径。
results 用于存储结果的缓冲区。
layerMask 层遮罩,用于在投射胶囊体时有选择地忽略碰撞体。
queryTriggerInteraction 指定该查询是否应该命中触发器。

返回

int 写入缓冲区的条目的数量。

描述

在物理世界中检查给定胶囊体,并在用户提供的缓冲区中返回所有重叠的碰撞体。

Physics.OverlapCapsule 相同,但不在托管堆上进行任何分配。