diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-03-11 18:15:31 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-03-18 11:30:22 -0700 |
commit | 7bbd5454329e483c67f51dba960213da930bda1d (patch) | |
tree | 7a4f0c4adb1459e55d301885dbb6c0e07e801c38 /tests | |
parent | c097ce0c1843f71271b8af9a1291602b1aab7df6 (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 'tests')
-rw-r--r-- | tests/test_physics_3d.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_physics_3d.cpp b/tests/test_physics_3d.cpp index 74afbad9d1..bb324d8ffe 100644 --- a/tests/test_physics_3d.cpp +++ b/tests/test_physics_3d.cpp @@ -187,8 +187,10 @@ protected: RenderingServer *vs = RenderingServer::get_singleton(); PhysicsServer3D *ps = PhysicsServer3D::get_singleton(); RID trimesh_shape = ps->shape_create(PhysicsServer3D::SHAPE_CONCAVE_POLYGON); - ps->shape_set_data(trimesh_shape, p_faces); - p_faces = ps->shape_get_data(trimesh_shape); // optimized one + Dictionary trimesh_params; + trimesh_params["faces"] = p_faces; + trimesh_params["backface_collision"] = false; + ps->shape_set_data(trimesh_shape, trimesh_params); Vector<Vector3> normals; // for drawing for (int i = 0; i < p_faces.size() / 3; i++) { Plane p(p_faces[i * 3 + 0], p_faces[i * 3 + 1], p_faces[i * 3 + 2]); |