Download

Is there a quick method to get current viewprojection matrix?

FSceneViewFamilyContext ViewFamily(FSceneViewFamily::ConstructionValues(
m_LocalPlayer->ViewportClient->Viewport,
GetWorld()->Scene,
m_LocalPlayer->ViewportClient->EngineShowFlags)
.SetRealtimeUpdate(true));

FVector ViewLocation; FRotator ViewRotation;

FSceneView* SceneView = m_LocalPlayer->CalcSceneView(&ViewFamily,
/out/ ViewLocation,
/out/ ViewRotation,
m_LocalPlayer->ViewportClient->Viewport);
FMatrix viewPrj = SceneView->ViewMatrices.GetViewProjectionMatrix();

I use the codes above to get current ViewProjection matrix.It works well, but I think it’s too heavy. Is there a better method to get the ViewProjection matrix or a shortcut to get current sceneview?

thanks in advance…