How do you use FMeshBatchElement?

So I’m putting together a SceneProxy that needs to do its own construction of meshes for the FMeshElementCollector.

In looking at code that does this, I’m seeing some weird stuff. For instance, this weird piece of C++

TArray<FMeshBatchElement,TInlineAllocator<1> > Elements;
for (int32 ParticleIndex = 1; ParticleIndex < ParticleCount; ++ParticleIndex)
	FMeshBatchElement* NextElement = new(Mesh.Elements) FMeshBatchElement();
	*NextElement = Mesh.Elements[0];
	NextElement->UserIndex = ParticleIndex;

If I am understanding this code correctly, it’s creating a new FMeshBatchElement with placement new, then getting it and setting the user index. I see this pattern of only using element 0 of this array everywhere. I assume it’s something to do with the TInlineAllocator.

I don’t see how it would fill the array though, as it obviously wants to do.

Can someone explain to me what’s going on here?

Also, some other issues:

uint32 FirstIndex;
uint32 NumPrimitives;
uint32 NumInstances;
uint32 MinVertexIndex;
uint32 MaxVertexIndex;

These members are all undocumented. NumPrimitives is somewhat obvious - how many triangles this element has.

NumInstances - no idea.
FirstIndex - Index into the index buffer? Actual vert index?
MinVertexIndex - Lowest actual vert index? Something else?
MaxVertexIndex - As above.

Same here, really weird stuff all around. Check Andrew Schneidecker BrickGame, it has written a beautiful plugin that has a RenderComponent that does all of this. In his case for a lot of cubes, but it’s the same principle really. That guy has worked for Unreal for ten years, he knows his stuff.