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

@ -30,8 +30,8 @@
#include "spatial_editor_gizmos.h"
#include "core/math/convex_hull.h"
#include "core/math/geometry.h"
#include "core/math/quick_hull.h"
#include "scene/3d/audio_stream_player_3d.h"
#include "scene/3d/baked_lightmap.h"
#include "scene/3d/collision_polygon.h"
@ -3550,7 +3550,7 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
if (points.size() > 3) {
Vector<Vector3> varr = Variant(points);
Geometry::MeshData md;
Error err = QuickHull::build(varr, md);
Error err = ConvexHullComputer::convex_hull(varr, md);
if (err == OK) {
Vector<Vector3> points2;
points2.resize(md.edges.size() * 2);