summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2021-03-11 18:15:31 -0700
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-03-18 11:30:22 -0700
commit7bbd5454329e483c67f51dba960213da930bda1d (patch)
tree7a4f0c4adb1459e55d301885dbb6c0e07e801c38 /modules
parentc097ce0c1843f71271b8af9a1291602b1aab7df6 (diff)
Disable backface collision with ConcavePolygonShape by default
Helps a lot with soft bodies and generally useful to avoid shapes to go through the ground in certain cases. Added an option in ConcavePolygonShape to re-enable backface collision on specific bodies if needed.
Diffstat (limited to 'modules')
-rw-r--r--modules/bullet/shape_bullet.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp
index 82876ab77c..471b154813 100644
--- a/modules/bullet/shape_bullet.cpp
+++ b/modules/bullet/shape_bullet.cpp
@@ -375,11 +375,17 @@ ConcavePolygonShapeBullet::~ConcavePolygonShapeBullet() {
}
void ConcavePolygonShapeBullet::set_data(const Variant &p_data) {
- setup(p_data);
+ Dictionary d = p_data;
+ ERR_FAIL_COND(!d.has("faces"));
+
+ setup(d["faces"]);
}
Variant ConcavePolygonShapeBullet::get_data() const {
- return faces;
+ Dictionary d;
+ d["faces"] = faces;
+
+ return d;
}
PhysicsServer3D::ShapeType ConcavePolygonShapeBullet::get_type() const {