Unable to get Value of FPrimitiveSceneInfo

Hi Devs,


FPrimitiveSceneInfo* sceneInfo = EarthRef->plane11->SceneProxy->GetPrimitiveSceneInfo();
    float* floatpointer = sceneInfo->ComponentLastRenderTime;

I’m not able to get the Information from FPrimitiveSceneInfo. I need the Component Last Render Time Value. This is the error I’m getting :


E:\UEProjects\SmartWorldPro\Source\SmartWorldPro\Private\SWP_WorldPlayerPawn.cpp(323): error C2027: use of undefined type 'FPrimitiveSceneInfo'
1> c:\ue4sourcecode\engine\source\runtime\engine\public\SceneManagement.h(33): note: see declaration of 'FPrimitiveSceneInfo'

To fixing those error, I’m not sure if Renderer module has been enabled in your project.

Probably what you need is the Actor’s LastRenderTime. There is no point to using ComponentLastRenderTime out of renderer, since ComponentLastRenderTime is the Ptr of Actor’s LastRenderTime.

Hi HenryLiu,
This error got resolved when I used


#include "Runtime/Renderer/Public/PrimitiveSceneInfo.h"

However can you share me knowledge about what SceneProxy() does ?

In my mind, PrimitiveSceneProxy is a mirrored data set of how to render a single primitivecomponent. It is used to support different primitive type, and comes with one to one mapping to PrimitiveSceneInfo, which is in Renderer module. Normally I would like to using those proxy to deal with some of needs of rendering. Just like, to check if its visible or can be visible based on certain view.

Unreal has 2 main Threads, the GameThread and the RenderThread. GameThread is for all the logic stuff like Game-Loop, Tick, Replication (Multiplayer), Timers, …
The RenderThread does all the rendering. To not get into any thread problems cause of raceconditions and for performance reasons (time of access to the data), each object that is to be rendered (mainly UPrimitiveComponent) provides a proxy object (SceneProxy) that the RenderThread can safely access. Any object state that influences rendering - like transform changes - need to get updated to the proxy object (This is called MarkDirty most of the time, see UInstancedStaticMeshComponent::UpdateInstanceTransform for example).

Thanks for the responses.