diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-02-09 18:36:38 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-02-09 18:36:38 -0700 |
commit | e5e9be8355e9dacdfcd167cc867054acc27903c7 (patch) | |
tree | c9a3393e67426d53d114bd9c9b7e63dcaf7eb11b /scene/main | |
parent | df9c98e107b19fc50bc5ae9f7ed624d693c0fb32 (diff) |
Fix contact points debug for 3D Physics
Setting each point's position was missing for 3D. Now enabling collision
render debug will display contact points for 3D physics, the same way it
does for 2D physics.
Note: Multimesh rendering seems not to work in this scenario on master,
but it's working fine on 3.2.
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/viewport.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 0ba8264f2a..6204794288 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -567,6 +567,12 @@ void Viewport::_notification(int p_what) { int point_count = PhysicsServer3D::get_singleton()->space_get_contact_count(find_world_3d()->get_space()); RS::get_singleton()->multimesh_set_visible_instances(contact_3d_debug_multimesh, point_count); + + for (int i = 0; i < point_count; i++) { + Transform point_transform; + point_transform.origin = points[i]; + RS::get_singleton()->multimesh_instance_set_transform(contact_3d_debug_multimesh, i, point_transform); + } } } break; case NOTIFICATION_WM_MOUSE_EXIT: { |