Version: 2022.3

Physics.BoxCastNonAlloc

切换到手册
public static int BoxCastNonAlloc (Vector3 center, Vector3 halfExtents, Vector3 direction, RaycastHit[] results, Quaternion orientation= Quaternion.identity, float maxDistance= Mathf.Infinity, int layerMask= DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction= QueryTriggerInteraction.UseGlobal);

参数

center 盒体的中心。
halfExtents 盒体各个维度大小的一半。
direction 投射盒体的方向。
results 用于存储结果的缓冲区。
orientation 盒体的旋转。
maxDistance 投射的最大长度。
layermask 层遮罩,用于在投射胶囊体时有选择地忽略碰撞体。
queryTriggerInteraction 指定该查询是否应该命中触发器。

返回

int 存储到 results 缓冲区的命中对象数量。

描述

沿该方向投射盒体,并将命中对象存储在提供的缓冲区中。


Did you find this page useful? Please give it a rating: