void URuntimeMeshLibrary::GetStaticMeshSection(UStaticMesh* InMesh, int32 LODIndex, int32 SectionIndex, const TSharedPtr<FRuntimeMeshAccessor>& MeshAccessor, const TSharedPtr<FRuntimeMeshIndicesAccessor>& TessellationIndicesAccessor)
{
	MeshAccessor->EmptyVertices();
	MeshAccessor->EmptyIndices();
	TessellationIndicesAccessor->EmptyIndices();

	GetStaticMeshSection(InMesh, LODIndex, SectionIndex, MeshAccessor->NumUVChannels(),
		[&MeshAccessor](FVector Position, FVector TangentX, FVector TangentY, FVector TangentZ) -> int32
		{
			int32 NewIndex = MeshAccessor->AddVertex(Position);
			MeshAccessor->SetTangents(NewIndex, TangentX, TangentY, TangentZ);
			return NewIndex;
		},
		[&MeshAccessor](int32 Index, int32 UVIndex, FVector2D UV)
		{
			MeshAccessor->SetUV(Index, UVIndex, UV);
		},
		[&MeshAccessor](int32 Index, FColor Color)
		{
			MeshAccessor->SetColor(Index, Color);
		},
		[&MeshAccessor](int32 Index)
		{
			MeshAccessor->AddIndex(Index);
		},
		[&TessellationIndicesAccessor](int32 Index)
		{
			TessellationIndicesAccessor->AddIndex(Index);
		});
}