From d1bc88d426b3751a37beb9c81513ccd16c7e2860 Mon Sep 17 00:00:00 2001 From: Morris Tabor <80684659+mortarroad@users.noreply.github.com> Date: Fri, 21 May 2021 09:58:01 +0200 Subject: 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 --- servers/physics_3d/shape_3d_sw.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'servers/physics_3d') diff --git a/servers/physics_3d/shape_3d_sw.cpp b/servers/physics_3d/shape_3d_sw.cpp index ccd37ca742..ca7248993f 100644 --- a/servers/physics_3d/shape_3d_sw.cpp +++ b/servers/physics_3d/shape_3d_sw.cpp @@ -31,8 +31,8 @@ #include "shape_3d_sw.h" #include "core/io/image.h" +#include "core/math/convex_hull.h" #include "core/math/geometry_3d.h" -#include "core/math/quick_hull.h" #include "core/templates/sort_array.h" // HeightMapShape3DSW is based on Bullet btHeightfieldTerrainShape. @@ -1089,9 +1089,9 @@ Vector3 ConvexPolygonShape3DSW::get_moment_of_inertia(real_t p_mass) const { } void ConvexPolygonShape3DSW::_setup(const Vector &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; -- cgit v1.2.3