I tried to create a simple Octree (I looked at the FMeshTriOctree source code since no question here helped me) like this:
// My FVertex class is slightly more complexe, but let's say it's something like this:
class FVertex : public FVector
{
int32 ID;
}
struct FVertexOctreeSemantics
{
enum { MaxElementsPerLeaf = 16 };
enum { MinInclusiveElementsPerNode = 7 };
enum { MaxNodeDepth = 12 };
typedef TInlineAllocator<MaxElementsPerLeaf> ElementAllocator;
FORCEINLINE static FBoxCenterAndExtent GetBoundingBox(const PBS::FVertex* Vertex)
{
return FBoxCenterAndExtent(Vertex->GetBoundingBox());
}
FORCEINLINE static bool AreElementsEqual(const PBS::FVertex* A, const PBS::FVertex* B)
{
return A==B;
}
/** Ignored for this implementation */
FORCEINLINE static void SetElementId(const PBS::FVertex* Element, FOctreeElementId Id){}
};
typedef TOctree<PBS::FVertex*, FVertexOctreeSemantics> FVOctree;
But when I instanciate my octree it returns:
Fatal error: [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.9\Engine\Source\Runtime\Core\Private\Misc\CoreMisc.cpp] [Line: 975]
The TOctree() constructor is for internal usage only for hot-reload purposes. Please do NOT use it.
What can I do?