Version: 2021.1

RaycastHit

struct in UnityEngine

切换到手册

描述

用于从射线投射获取信息的结构。

变量

articulationBodyThe ArticulationBody of the collider that was hit. If the collider is not attached to an articulation body then it is null.
barycentricCoordinate命中的三角形的重心坐标。
collider命中的 Collider。
distance从射线原点到撞击点的距离。
lightmapCoord撞击点处的 UV 光照贴图坐标。
normal射线命中的表面的法线。
point世界空间中射线命中碰撞体的撞击点。
rigidbody命中的碰撞体的 Rigidbody。如果该碰撞体未附加到刚体,则值为 /null/。
textureCoord碰撞位置处的 UV 纹理坐标。
textureCoord2撞击点处的辅助 UV 纹理坐标。
transform命中的刚体或碰撞体的 Transform。
triangleIndex命中的三角形的索引。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961