summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMorris Tabor <80684659+mortarroad@users.noreply.github.com>2021-05-21 09:58:01 +0200
committerMorris Tabor <80684659+mortarroad@users.noreply.github.com>2021-05-22 22:35:42 +0200
commitd1bc88d426b3751a37beb9c81513ccd16c7e2860 (patch)
tree96b3ab3d650a4910c84523ed0e7e475572ee1cca /tests
parentd5f9f58b61c2430ee5fae59a0366581482a3b636 (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/test_physics_3d.cpp4
-rw-r--r--tests/test_render.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_physics_3d.cpp b/tests/test_physics_3d.cpp
index ac8078a0a8..727c44b3ac 100644
--- a/tests/test_physics_3d.cpp
+++ b/tests/test_physics_3d.cpp
@@ -30,8 +30,8 @@
#include "test_physics_3d.h"
+#include "core/math/convex_hull.h"
#include "core/math/math_funcs.h"
-#include "core/math/quick_hull.h"
#include "core/os/main_loop.h"
#include "core/os/os.h"
#include "core/string/print_string.h"
@@ -169,7 +169,7 @@ protected:
RID convex_mesh = vs->mesh_create();
Geometry3D::MeshData convex_data = Geometry3D::build_convex_mesh(convex_planes);
- QuickHull::build(convex_data.vertices, convex_data);
+ ConvexHullComputer::convex_hull(convex_data.vertices, convex_data);
vs->mesh_add_surface_from_mesh_data(convex_mesh, convex_data);
type_mesh_map[PhysicsServer3D::SHAPE_CONVEX_POLYGON] = convex_mesh;
diff --git a/tests/test_render.cpp b/tests/test_render.cpp
index 72b2840098..9737fd03f3 100644
--- a/tests/test_render.cpp
+++ b/tests/test_render.cpp
@@ -30,8 +30,8 @@
#include "test_render.h"
+#include "core/math/convex_hull.h"
#include "core/math/math_funcs.h"
-#include "core/math/quick_hull.h"
#include "core/os/keyboard.h"
#include "core/os/main_loop.h"
#include "core/os/os.h"
@@ -118,7 +118,7 @@ public:
vts.push_back(Vector3(-1, -1, -1));
Geometry3D::MeshData md;
- Error err = QuickHull::build(vts, md);
+ Error err = ConvexHullComputer::convex_hull(vts, md);
print_line("ERR: " + itos(err));
test_cube = vs->mesh_create();
vs->mesh_add_surface_from_mesh_data(test_cube, md);