GetWorld()->LineTraceSingleByChannel(Hit, LineStart, LineEnd, ECC_Visibility, QueryParams); //线段的Debug显示,DrawDebugLine(GetWorld(), 起点, 终点, 线条颜色, 是否一直存在, 持续时间, 优先级, 粗细); DrawDebugLine(GetWorld(), LineStart, LineEnd, FColor::Blue, false, 1, 0, 1); 对象检...
Tick(float DeltaTime):在游戏中每帧执行,其中,DeltaTime是每帧间隔时间 (DrawDebugHelper.h) DrawDebugLine():绘制编辑下能够看到的线 FVector Start = GetComponentLocation(); FVector End = Start + GetForwardVector() * MaxGrabDistance; DrawDebugLine(GetWorld(), Start, End, FColor::Red); DrawDebug...
//画debg用的球 DrawDebugSphere(GetWorld(), HitResult.ImpactPoint, Radius, 32, LineColor, false, 10.0f); } //画视线线条 DrawDebugLine(GetWorld(), StartLocation, EndLocation, LineColor , false, 10.0f, 0U, 1.0f); } // Sets default values for this component's properties USInteractionC...
最后在事件图表(Event Graph)中控制切换Debug的模式。 绘图函数 接着实现三个基础的绘图函数。 DrawCross:画一个十字。注意要将函数设为常量(Const)函数。 输入十字中心的位置(CenterPos)和十字的半长(CrossSize),最后使用绘制线条(Draw Line)来进行绘制。 DrawFourCornersBorder:画一个四角框。注意要将函数设为常...
调试信息:在开发过程中,可以利用Line Trace By Channel节点的调试信息类型(Draw Debug Type)来可视化射线的轨迹和碰撞结果,帮助调试和优化线追踪逻辑。 如果遇到线追踪不准确或未命中的问题,可以检查以下几点: 确保起点和终点的设置正确无误。 检查碰撞通道是否设置正确,以及被检测物体是否使用了相应的碰撞通道。 考虑物...
DrawDebugLine(GetWorld(), LineStart, LineEnd, FColor::Red, false, 2.0f, 0.0f, 2.0f); //这个函数当遇到第一个碰撞的物体的时候就会停下,然后收集所有的重叠部分 //第四个参数是球体的旋转,但是查询中的旋转没有意义所以设置为空旋转 if (GetWorld()->SweepMultiByObjectType(HitResults, LineStart,...
DrawDebugLine(GetWorld(), StartLocation, EndLocation, FColor::Blue, false, 5.f); DrawDebugPoint(GetWorld(), HitResult.ImpactPoint, 10.f, FColor::Red, false, 5.f); } } ``` 以上是LineTraceMultiByProfile的基本用法,具体可以根据实际需求进行调整。你可以根据自己的需要,指定不同的追踪参数和...
多线追踪:MultiLineTraceByChannel,LineTraceForObjects,返回OutHits数组 这里我们使用第一人称角色来做测试,创建一个第一人称角色工程,打开第一人称角色蓝图,按如下操作: 将DrawDebugType选ForOneFrame,这样我们就能查看线踪迹。从OutHit拖出BrekeHitResult节点,这个就是碰撞信息,常见的有Distance(碰撞距离)、Location(碰...
Fixed collision issues when debug.draw_line() is called Fixed gyroscope sensor to properly give angular velocity readings in the local frame Fixed minor typo in the introduction section of the documentation Fixed a bug at the local planner when changing the route, causing it to maintain the firs...