diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-08 22:40:06 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-08 22:40:06 +0100 |
commit | 1e32a286f3a912a6bd78625c77aa7b0d1a935d2f (patch) | |
tree | 914c23c577810404e0f1d9b50292fef79b43ec3f /servers/physics_3d/godot_body_direct_state_3d.cpp | |
parent | 30b3434daacc708276d13fbc0ff04f32e19a1d24 (diff) | |
parent | 8ee6264cc914fe1d007faf440fe4fda28b567cc6 (diff) |
Merge pull request #70281 from CherrySodaPop/get-impulse-3d
Implement collision impulse in Godot Physics 3D
Diffstat (limited to 'servers/physics_3d/godot_body_direct_state_3d.cpp')
-rw-r--r-- | servers/physics_3d/godot_body_direct_state_3d.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/servers/physics_3d/godot_body_direct_state_3d.cpp b/servers/physics_3d/godot_body_direct_state_3d.cpp index 7d13fb0615..9f28f3809a 100644 --- a/servers/physics_3d/godot_body_direct_state_3d.cpp +++ b/servers/physics_3d/godot_body_direct_state_3d.cpp @@ -188,8 +188,9 @@ Vector3 GodotPhysicsDirectBodyState3D::get_contact_local_normal(int p_contact_id return body->contacts[p_contact_idx].local_normal; } -real_t GodotPhysicsDirectBodyState3D::get_contact_impulse(int p_contact_idx) const { - return 0.0f; // Only implemented for bullet +Vector3 GodotPhysicsDirectBodyState3D::get_contact_impulse(int p_contact_idx) const { + ERR_FAIL_INDEX_V(p_contact_idx, body->contact_count, Vector3()); + return body->contacts[p_contact_idx].impulse; } int GodotPhysicsDirectBodyState3D::get_contact_local_shape(int p_contact_idx) const { |