SphereTrace中Hit Result里的Location和ImpactPoint

这篇博客探讨了在球形检测中Location和ImpactPoint的区别。Location表示球体中心位置,而ImpactPoint是实际接触点。源码显示在InitialOverlap为True时,ImpactPoint可能与Location不同,这在特定情况下如Start和End点相同时会发生。此外,当bValidPosition为false,ImpactPoint等于StartLoc。题外话提到了Normal与ImpactNormal在不同检测类型中的含义。
摘要由CSDN通过智能技术生成

球形检测中的Location和ImpactPoint

在用球形检测的时候发现Location输出的是球体的中心位置,而ImpactPoint输出是接触点的位置
在这里插入图片描述
在源码中的解释 :

/**
	 * The location in world space where the moving shape would end up against the impacted object, if there is a hit. Equal to the point of impact for line tests.
	 * Example: for a sphere trace test, this is the point where the center of the sphere would be located when it touched the other object.
	 * For swept movement (but not queries) this may not equal the final location of the shape since hits are pulled back slightly to prevent precision issues from overlapping another surface.
	 翻译内容:
     *在世界空间中,如果受到撞击,运动形状最终会靠在受影响物体上的位置。 等于在线测试的影响点。
     *示例:对于球体跟踪测试,这是球体接触另一个对象时将位于球体中心的位置。
     *对于扫掠运动(但不是查询),这可能不等于形状的最终位置,因为击点会稍微向后拉,以防止精度问题与另一个表面重叠。
    */
	UPROPERTY()
	FVector_NetQuantize Location;

	/**
	 * Location in world space of the actual contact of the trace shape (box, sphere, ray, etc) with the impacted object.
	 * Example: for a sphere trace test, this is the point where the surface of the sphere touches the other object.
	 * @note: In the case of initial overlap (bStartPenetrating=true), ImpactPoint will be the same as Location because there is no meaningfu
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值