Hi,
I noticed that I get a ‘hit’ result from a AsyncSweep all the time. Yet all information in the FHitResult is empty.
The m_QueryParams contain the actor that calls the sweep so that it wont find itself.
However, is it possible that if there are 2 async sweep calls, in the same frame, that they intersect eachother even if they are called from the same actor and with the same IgnoreActor added?
The Check:
FTraceDatum datum;
if ( m_MoveTrace._Data.FrameNumber != -1 &&
GetWorld()->IsTraceHandleValid( m_MoveTrace, false ) &&
GetWorld()->QueryTraceData( m_MoveTrace, datum ) &&
datum.OutHits.Num() > 0 )
{
}
The Call:
FVector origin = GetActorLocation();
FVector end = origin + m_Derivatives->GetVelocity() * dt * m_MoveTraceMultiplier;
FCollisionShape shape = MakeLineOfSightCollisionShape();
m_MoveTrace = GetWorld()->AsyncSweepByObjectType( origin, end, m_ObjectQueryParams, shape, m_QueryParams );
if (m_ShowDebugInfo)
{
FCollisionShape& shape = datum.CollisionParams.CollisionShape;
FVector dir = end-origin;
//DrawDebugCapsule( GetWorld(), datum.Start + dir*.5f, dir.Size()*.5f, shape.GetSphereRadius(), dir.ToOrientationQuat(), FColor::Cyan );
float r = shape.GetSphereRadius();
DrawDebugBox( GetWorld(), datum.Start + dir*.5f, FVector(dir.Size()*.5f, r, r), dir.ToOrientationQuat(), FColor::Cyan );
}
PS: DrawDebugCapsule is incorrectly rotated (minor bug).