Replacing std::format with fmt::format

This commit is contained in:
Dynamitos
2024-01-16 19:24:49 +01:00
parent c0da7d77a1
commit 861c146b46
55 changed files with 304 additions and 186 deletions
+10 -1
View File
@@ -339,7 +339,16 @@ int32 BVH::splitNode(Array<AABBCenter> aabbs)
{
longestAxis = 2;
}
std::sort(aabbs.begin(), aabbs.end(), [longestAxis](AABBCenter lhs, AABBCenter rhs){ return lhs.center[longestAxis] < rhs.center[longestAxis];});
struct
{
bool operator()(const AABBCenter& lhs, const AABBCenter& rhs)
{
return lhs.center[longestAxis] < rhs.center[longestAxis];
}
int32 longestAxis;
} compare = {longestAxis};
std::sort(aabbs.begin(), aabbs.end(), compare);
Array<AABBCenter> left((aabbs.size()+1)/2);
Array<AABBCenter> right(aabbs.size()/2);
std::copy(aabbs.begin(), aabbs.begin()+left.size(), left.begin());