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:
- 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-21 09:58:01 +02:00
parent d5f9f58b61
commit d1bc88d426
10 changed files with 2429 additions and 15 deletions

View file

@ -29,7 +29,7 @@
/*************************************************************************/
#include "convex_polygon_shape_3d.h"
#include "core/math/quick_hull.h"
#include "core/math/convex_hull.h"
#include "servers/physics_server_3d.h"
Vector<Vector3> ConvexPolygonShape3D::get_debug_mesh_lines() const {
@ -38,7 +38,7 @@ Vector<Vector3> ConvexPolygonShape3D::get_debug_mesh_lines() const {
if (points.size() > 3) {
Vector<Vector3> varr = Variant(points);
Geometry3D::MeshData md;
Error err = QuickHull::build(varr, md);
Error err = ConvexHullComputer::convex_hull(varr, md);
if (err == OK) {
Vector<Vector3> lines;
lines.resize(md.edges.size() * 2);