I want to create a Menger sponge fractal mesh in C++ by deriving from UStaticMesh.
I used the wizard in UE4 editor to create a class that derives from UStaticMesh but I receive the following compile error without modifying anything after the automatic class generation:
1>E:\UE4\Unreal Engine\4.4\Engine\Source\Runtime\Core\Public\Templates\ScopedPointer.h(36): error C2514: 'FStaticMeshRenderData' : class has no constructors
1> E:\UE4\Unreal Engine\4.4\Engine\Source\Runtime\Engine\Classes\Engine/StaticMesh.h(320) : see declaration of 'FStaticMeshRenderData'
1> E:\UE4\Unreal Engine\4.4\Engine\Source\Runtime\Core\Public\Templates\ScopedPointer.h(33) : while compiling class template member function 'TScopedPointer<FStaticMeshRenderData>::TScopedPointer(const TScopedPointer<FStaticMeshRenderData> &)'
1> c:\users\l\documents\unreal projects\mengersponge\source\mengersponge\MengerSpongeStaticMesh.h(19) : see reference to function template instantiation 'TScopedPointer<FStaticMeshRenderData>::TScopedPointer(const TScopedPointer<FStaticMeshRenderData> &)' being compiled
1> E:\UE4\Unreal Engine\4.4\Engine\Source\Runtime\Engine\Classes\Engine/StaticMesh.h(320) : see reference to class template instantiation 'TScopedPointer<FStaticMeshRenderData>' being compiled
I have then searched and found the relevant include to be “StaticMeshResources.h” that is obviously missing, but this causes another compiler error to be generated:
1>E:\UE4\Unreal Engine\4.4\Engine\Source\Runtime\Engine\Public\StaticMeshResources.h(711): error C2248: 'FColorVertexBuffer::FColorVertexBuffer' : cannot access private member declared in class 'FColorVertexBuffer'
1> e:\ue4\unreal engine\4.4\engine\source\runtime\engine\public\Components.h(164) : see declaration of 'FColorVertexBuffer::FColorVertexBuffer'
1> e:\ue4\unreal engine\4.4\engine\source\runtime\engine\public\Components.h(29) : see declaration of 'FColorVertexBuffer'
1> This diagnostic occurred in the compiler generated function 'FStaticMeshLODResources::FStaticMeshLODResources(const FStaticMeshLODResources &)'
Any tips are welcome.
I still use UE 4.4.3 though.