UE4 有关Break Hit Result的返回结果解释 版本4.20

最近用到射线检测,关于Hit Result的解释网上有些教程存在解释不全,不明确,错误的现象,所以自己切实研究了一下,并记录了下来,供新手作为参考。

 

True if there was a blocking hit, false otherwise.

 

Initial Overlap

Boolean

True if the hit started in an initial overlap. In this case some other values should be interpreted differently. Time will be 0, ImpactPoint will equal Location, and normals will be equal and indicate a depenetration vector.

一系列结果中的首次重叠。

Time

Float

'Time' of impact along trace direction ranging from [0.0 to 1.0) if there is a hit, indicating time between start and end. Equals 1.0 if there is no hit.

Time = Distance/(TraceEnd-TraceStart)  TraceStart:发射线的起点,TraceEnd:发射线的终点,

(TraceEnd-TraceStart):整条射线的长度,Distance:射线的起点到首次检测到物体的交点的距离

Distance

Float

The distance from the TraceStart to the Location in world space. This value is 0 if there was an initial overlap (trace started inside another colliding object).

射线的起点到首次检测到物体的交点的距离

Location

Vector

Location of the hit in world space. If this was a swept shape test, this is the location where we can place the shape in the world where it will not penetrate.

首次检测到物体的交点的坐标

Impact Point

Vector

Location of the actual contact point of the trace shape with the surface of the hit object. Equal to Location in the case of an initial overlap.

首次检测到物体的交点的坐标,等同Location,(碰撞情况会有区别,跟碰撞三角面有关)

Normal

Vector

Normal of the hit in world space, for the object that was swept (e.g. for a sphere trace this points towards the sphere's center). Equal to ImpactNormal for line tests.

切面法向量

Impact Normal

Vector

Normal of the hit in world space, for the object that was hit by the sweep.

碰撞切面法向量(射线检测时等于Normal,碰撞情况会有区别)

Phys Mat

Physical Material Object Reference

Physical material that was hit. Must set bReturnPhysicalMaterial to true in the query params for this to be returned.

被击中的物质。必须在查询参数中将bReturnPhysicalMaterial设置为true才能返回此值。

命中表面的 物理材质

Hit Actor

Actor Object Reference

Actor hit by the trace.

被击中的actor

Hit Component

Primitive Component Object Reference

PrimitiveComponent hit by the trace.

被击中的actor中的component,如果有子组件mesh可以被射线检测到的话

Hit Bone Name

Name

Name of the bone hit (valid only if we hit a skeletal mesh).

击中带骨骼的角色,返回击中骨骼的名称

Hit Item

Integer

Primitive-specific data recording which item in the primitive was hit

基元特定的数据,记录基元中命中的物体。(没搞清楚是啥,有知道的大牛请留言告诉我,谢谢)

Face Index

Integer

If colliding with trimesh or landscape, index of face that was hit.

如与三角网格图或地形发生碰撞,这便是命中面的索引。

击中mesh的三角形索引

Trace Start

Vector

发射线的起点

Trace End

Vector

发射线的终点

 

 

参考的教程:

https://zhuanlan.zhihu.com/p/33529865

https://www.52vr.com//extDoc/ue4/CHN/Engine/Physics/Tracing/Overview/index.html

  • 9
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值