I upgraded to UE 5.4.1 and have the following which worked in 5.3.*:
.h
// inherit from intanced static mesh scene proxy
class FInstanceSceneProxy : public FInstancedStaticMeshSceneProxy
{
public:
FInstanceSceneProxy(UInstancedStaticMeshComponent* InComponent, ERHIFeatureLevel::Type InFeatureLevel);
SIZE_T GetTypeHash() const override;
virtual bool GetInstanceDrawDistanceMinMax(FVector2f& OutDistanceMinMax) const override;
};
.cpp
FInstanceSceneProxy::FInstanceSceneProxy(UInstancedStaticMeshComponent* InComponent, ERHIFeatureLevel::Type InFeatureLevel)
: FInstancedStaticMeshSceneProxy(InComponent, InFeatureLevel)
{
}
SIZE_T FInstanceSceneProxy::GetTypeHash() const
{
static size_t UniquePointer;
return reinterpret_cast<size_t>(&UniquePointer);
}
bool FInstanceSceneProxy::GetInstanceDrawDistanceMinMax(FVector2f& OutDistanceMinMax) const
{
if (UserData_AllInstances.EndCullDistance > 0)
{
OutDistanceMinMax = FVector2f(0.0f, UserData_AllInstances.EndCullDistance);
return true;
}
else
{
OutDistanceMinMax = FVector2f(0.0f);
return false;
}
}
when I compile I get:
1>InstanceSceneProxy.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class FInstanceDataUpdateTaskInfo * __cdecl FInstancedStaticMeshSceneProxy::GetInstanceDataUpdateTaskInfo(void)const " (?GetInstanceDataUpdateTaskInfo@FInstancedStaticMeshSceneProxy@@UEBAPEAVFInstanceDataUpdateTaskInfo@@XZ)
1>InstanceSceneProxy.cpp.obj : error LNK2001: unresolved external symbol “public: virtual void __cdecl FInstancedStaticMeshSceneProxy::SetInstanceCullDistance_RenderThread(float,float)” (?SetInstanceCullDistance_RenderThread@FInstancedStaticMeshSceneProxy@@UEAAXMM@Z)
And I have the public/private dependencies in build.cs:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "RenderCore", "Renderer", "RHI" });
PrivateDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "RenderCore", "Renderer", "RHI" });
How do I solve this or submit a bug report?