I’m upgrading my code to use the new TOctree2 type in UE v4.26 (TOctree is deprecated).
Previously I had the following code to iterate over elements within the specified box:
for (FCoverPointOctree::TConstElementBoxIterator<> OctreeIt(*CoverPointOctree, BoundsIn);
OctreeIt.HasPendingElements();
OctreeIt.Advance())
{
octreeElements.Add(OctreeIt.GetCurrentElement());
count++;
}
TConstElementBoxIterator has been deprecated. Instead I’m trying to achieve the same result using the new FindElementsWithBoundsTest method which has the following signature (from GenericOctree.h):
template<typename IterateBoundsFunc>
inline void FindElementsWithBoundsTest(const FBoxCenterAndExtent& BoxBounds, const IterateBoundsFunc& Func) const
I can’t figure out how to pass an “inline” function as an argument:
CoverPointOctree->FindElementsWithBoundsTest<>(BoundsIn, ***[pass function here]***);
Also, how do you decern the function’s signature from looking at the headers files? These classes are scarcely documented which makes it very hard to work with.