bool ALookAtTrigger::IsActorVisible(AActor* Actor, UWorld* World) { if (!Actor !World)…
- User
bool ALookAtTrigger::IsActorVisible(AActor* Actor, UWorld* World) { if (!Actor || !World) return false;
codeULocalPlayer* LocalPlayer = GetWorld()->GetFirstLocalPlayerFromController(); if (LocalPlayer != nullptr && LocalPlayer->ViewportClient != nullptr && LocalPlayer->ViewportClient->Viewport) { FSceneViewFamilyContext ViewFamily(FSceneViewFamily::ConstructionValues( LocalPlayer->ViewportClient->Viewport, GetWorld()->Scene, LocalPlayer->ViewportClient->EngineShowFlags) .SetRealtimeUpdate(true)); FVector ViewLocation; FRotator ViewRotation; FSceneView* SceneView = LocalPlayer->CalcSceneView(&ViewFamily, ViewLocation, ViewRotation, LocalPlayer->ViewportClient->Viewport); FPrimitiveComponentId ComponentId = Actor->GetRootComponent()->ComponentId; FPrimitiveSceneProxy* Proxy = Actor->GetRootComponent()->SceneProxy; if (Proxy && View) { // Ensure the component index is within the bounds of the visibility map if (View->PrimitiveVisibilityMap.IsValidIndex(ComponentIndex)) { // Checking the occlusion status const FPrimitiveOcclusionHistory* OcclusionHistory = View->PrimitiveOcclusionHistory.Find(ComponentIndex); return View->PrimitiveVisibilityMap[ComponentIndex] && !(OcclusionHistory && OcclusionHistory->IsOccluded); } } } if (Proxy && View) { return View->PrimitiveVisibilityMap[ComponentId] && !View->PrimitiveOcclusionHistory.Find(ComponentId)->IsOccluded; } return false;}
심볼 'ComponentId'을(를) 해결할 수 없습니다
Assistant
The error "Symbol 'ComponentId' could not be resolved" occurs because the variable
ComponentIdis not defined or is out of scope in the code you provided.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.