Replace QuickHull with Bullet's convex hull computer.

The code is based on the current version of thirdparty/vhacd and modified to use Godot's types and code style.

Additional changes:
- backported and extended PagedAllocator to allow leaked objects
- applied patch from https://github.com/bulletphysics/bullet3/pull/3037
This commit is contained in:
Morris Tabor
2021-05-07 12:48:56 +02:00
parent c311b4c039
commit ba396caefc
11 changed files with 2611 additions and 13 deletions

View File

@ -31,8 +31,8 @@
#include "shape_sw.h"
#include "core/image.h"
#include "core/math/convex_hull.h"
#include "core/math/geometry.h"
#include "core/math/quick_hull.h"
#include "core/sort_array.h"
// HeightMapShapeSW is based on Bullet btHeightfieldTerrainShape.
@ -1090,9 +1090,9 @@ Vector3 ConvexPolygonShapeSW::get_moment_of_inertia(real_t p_mass) const {
}
void ConvexPolygonShapeSW::_setup(const Vector<Vector3> &p_vertices) {
Error err = QuickHull::build(p_vertices, mesh);
Error err = ConvexHullComputer::convex_hull(p_vertices, mesh);
if (err != OK)
ERR_PRINT("Failed to build QuickHull");
ERR_PRINT("Failed to build convex hull");
AABB _aabb;