1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

meshoptimizer: Sync with upstream commit f4c356d79

f4c356d79f
This commit is contained in:
Rémi Verschelde
2021-11-19 14:02:23 +01:00
parent 42f8bfaff0
commit 2410f5de03
6 changed files with 178 additions and 36 deletions

View File

@@ -368,8 +368,7 @@ static size_t kdtreeBuild(size_t offset, KDNode* nodes, size_t node_count, const
}
// split axis is one where the variance is largest
unsigned int axis = vars[0] >= vars[1] && vars[0] >= vars[2] ? 0 : vars[1] >= vars[2] ? 1
: 2;
unsigned int axis = vars[0] >= vars[1] && vars[0] >= vars[2] ? 0 : vars[1] >= vars[2] ? 1 : 2;
float split = mean[axis];
size_t middle = kdtreePartition(indices, count, points, stride, axis, split);