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.

(cherry picked from commit e5e9be8355)
This commit is contained in:
PouleyKetchoupp 2021-02-09 18:36:38 -07:00 committed by Rémi Verschelde
parent e6b3579e56
commit 5e978d1df5
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -416,6 +416,12 @@ void Viewport::_notification(int p_what) {
int point_count = PhysicsServer::get_singleton()->space_get_contact_count(find_world()->get_space());
VS::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];
VS::get_singleton()->multimesh_instance_set_transform(contact_3d_debug_multimesh, i, point_transform);
}
}
if (!GLOBAL_GET("physics/common/enable_pause_aware_picking")) {