1. Détection de collision UKismetSystemLibrary ::LineTraceSingle
Ray-Trace agit sur le ray picking.
La sélection de rayons est principalement liée à
1. Les fonctions de sélection sont plusieurs méthodes de UWorld. Par exemple, LineTraceSingle est un pick-up unique, et il ne continuera pas à pénétrer après en avoir ramassé un, tandis que LineTraceMulti ramassera plusieurs cibles.
bool UKismetSystemLibrary::LineTraceSingle(UObject* WorldContextObject, const FVector Start, const FVector End, ETraceTypeQuery TraceChannel, bool bTraceComplex, const TArray<AActor*>& ActorsToIgnore, EDrawDebugTrace::Type DrawDebugType, FHitResult& OutHit, bool bIgnoreSelf, FLinearColor TraceColor, FLinearColor TraceHitColor, float DrawTime)
{
ECollisionChannel CollisionChannel = UEngineTypes::ConvertToCollisionChannel(TraceChannel);
static const FName LineTraceSingleName(TEXT("LineTraceSingle"));
FCollisionQueryParams Params = ConfigureCollisionParams(LineTraceSingleName, bTraceComplex, ActorsToIgnore, bIgnoreSelf, WorldContextObject);
UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject);
bool const bHit = World->LineTraceSingleByChannel(OutHit, Start, End, CollisionChannel, Params);
#if ENABLE_DRAW_DEBUG
DrawDebugLineTraceSingle(World, Start, End, DrawDebugType, bHit, OutHit, TraceColor, TraceHitColor, DrawTime);
#endif
return bHit;
}
bool UKismetSystemLibrary::LineTraceMulti(UObject* WorldContextObject, const FVector Start, const FVector End, ETraceTypeQuery TraceChannel, bool bTraceComplex, const TArray<AActor*>& ActorsToIgnore, EDrawDebugTrace::Type DrawDebugType, TArray<FHitResult>& OutHits, bool bIgnoreSelf, FLinearColor TraceColor, FLinearColor TraceHitColor, float DrawTime)
{
ECollisionChannel CollisionChannel = UEngineTypes::ConvertToCollisionChannel(TraceChannel);
static const FName LineTraceMultiName(TEXT("LineTraceMulti"));
FCollisionQueryParams Params = ConfigureCollisionParams(LineTraceMultiName, bTraceComplex, ActorsToIgnore, bIgnoreSelf, WorldContextObject);
UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject);
bool const bHit = World->LineTraceMultiByChannel(OutHits, Start, End, CollisionChannel, Params);
#if ENABLE_DRAW_DEBUG
DrawDebugLineTraceMulti(World, Start, End, DrawDebugType, bHit, OutHits, TraceColor, TraceHitColor, DrawTime);
#endif
return bHit;
}
2. Traitement des entrées du joueur
void APlayerController::PostProcessInput(const float DeltaTime, const bool bGamePaused)
{
if( IsLookInputIgnored() )
{
// zero look inputs
RotationInput = FRotator::ZeroRotator;
}
}
匹配字符串:40 53 48 83 EC 20 48 8B 01 48 8B D9 FF 90 00 07 00 00 84 C0 74 1C F2 0F
.text:00007FF6F7D7A4F0 sub_7FF6F7D7A4F0 proc near ; DATA XREF: .rdata:00007FF6F9856A78↓o
.text:00007FF6F7D7A4F0 ; .rdata:00007FF6F9C67D40↓o
.text:00007FF6F7D7A4F0 ; .pdata:00007FF6FA4A2460↓o
.text:00007FF6F7D7A4F0 40 53 push rbx
.text:00007FF6F7D7A4F2 48 83 EC 20 sub rsp, 20h
.text:00007FF6F7D7A4F6 48 8B 01 mov rax, [rcx]
.text:00007FF6F7D7A4F9 48 8B D9 mov rbx, rcx
.text:00007FF6F7D7A4FC FF 90 00 07 00 00 call qword ptr [rax+700h]
.text:00007FF6F7D7A502 84 C0 test al, al
.text:00007FF6F7D7A504 74 1C jz short loc_7FF6F7D7A522
.text:00007FF6F7D7A506 F2 0F 10 05 9A E0 3F 02 movsd xmm0, cs:qword_7FF6FA1785A8
.text:00007FF6F7D7A50E F2 0F 11 83 88 05 00 00 movsd qword ptr [rbx+588h], xmm0
.text:00007FF6F7D7A516 8B 05 94 E0 3F 02 mov eax, cs:dword_7FF6FA1785B0
.text:00007FF6F7D7A51C 89 83 90 05 00 00 mov [rbx+590h], eax
.text:00007FF6F7D7A522
.text:00007FF6F7D7A522 loc_7FF6F7D7A522: ; CODE XREF: sub_7FF6F7D7A4F0+14↑j
.text:00007FF6F7D7A522 48 83 C4 20 add rsp, 20h
.text:00007FF6F7D7A526 5B pop rbx
.text:00007FF6F7D7A527 C3 retn
.text:00007FF6F7D7A527 sub_7FF6F7D7A4F0 endp
__int64 __fastcall sub_7FF6F7D7A4F0(__int64 a1)
{
__int64 result; // rax
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 1792i64))(a1);
if ( (_BYTE)result )
{
*(_QWORD *)(a1 + 1416) = qword_7FF6FA1785A8;
result = (unsigned int)dword_7FF6FA1785B0;
*(_DWORD *)(a1 + 1424) = dword_7FF6FA1785B0;
}
return result;
}