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:
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user