返回介绍

Physics.BoxCastAll 盒投射全部

发布于 2019-12-18 15:38:15 字数 3233 浏览 1685 评论 0 收藏 0

JavaScript => public static function BoxCastAll(center: Vector3, halfExtents: Vector3, direction: Vector3, orientation: Quaternion = Quaternion.identity, maxDistance: float = Mathf.Infinity, layerMask: int = DefaultRaycastLayers, queryTriggerInteraction: QueryTriggerInteraction = QueryTriggerInteraction.UseGlobal): RaycastHit[];
C# => public static RaycastHit[] BoxCastAll(Vector3 center, Vector3 halfExtents, Vector3 direction, Quaternion orientation = Quaternion.identity, float maxDistance = Mathf.Infinity, int layerMask = DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal);

Parameters 参数

centerCenter of the box.
盒的中心
halfExtentsHalf the size of the box in each dimension.
盒的每轴的一半大小。
directionThe direction in which to cast the box.
投射盒的方向。
orientationRotation of the box.
盒的旋转。
maxDistanceThe max length of the cast.
投射的最大长度。
layerMaskA Layer mask that is used to selectively ignore colliders when casting a capsule.
选择投射的碰撞器层蒙版。
queryTriggerInteractionSpecifies whether this query should hit Triggers.
指定查询碰到触发器。

Returns 返回值

RaycastHit[] All colliders that were hit.

返回碰到的所有碰撞器的RaycastHit[]。

Description 描述

Like Physics.BoxCast, but returns all hits.

就像Physics.BoxCast,但返回的是所有碰到的对象信息。

Notes: For colliders that overlap the box at the start of the sweep, the output direction is set opposite to the direction of the sweep, distance is set to zero as well as zero vector gets returned in the position field of the RaycastHit structure. You might want to check whether this is the case in your particular query and perform additional queries to refine the result.

Physics

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文