返回介绍

RaycastHit2D 2D射线投射碰撞信息

发布于 2019-12-18 15:38:23 字数 2420 浏览 979 评论 0 收藏 0

Description 描述

Information returned about an object detected by a raycast in 2D physics.

返回有关2D物理射线投射检测对象信息。

A raycast is used to detect objects that lie along the path of a ray and is conceptually like firing a laser beam into the scene and observing which objects are hit by it. The RaycastHit2D class is used by Physics2D.Raycast and other functions to return information about the objects detected by raycasts.

射线投射用于检测沿射线路径的对象,就像在场景发射的激光束,观察哪些对象被它击中。

See Also: Physics2D, Ray2D class.RaycastHit2D类用于Physics2D.Raycast并返回射线碰到对象的信息。

Variables 变量

centroidThe centroid of the primitive used to perform the cast.
原始图形的重心。
colliderThe collider hit by the ray.
射线碰到的碰撞器。
distanceThe distance from the ray origin to the impact point.
从射线原点到接触点的距离。
fractionFraction of the distance along the ray that the hit occurred.
射线发生碰撞距离的百分比。
normalThe normal vector of the surface hit by the ray.
射线碰到表面的法线向量。
pointThe point in world space where the ray hit the collider's surface.
在世界坐标空间,射线碰到碰撞器表面的点。
rigidbodyThe Rigidbody2D attached to the object that was hit.
碰到对象上的Rigidbody2D。
transformThe Transform of the object that was hit.
碰到对象的变换。

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

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

发布评论

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