diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-03 12:39:35 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-03 12:39:35 +0100 |
commit | 151e1355e80f0044042992bb8a4a4f33ccc1e41b (patch) | |
tree | 8b46014c83436dcd9ab91d6493a921ea2a125e02 /servers | |
parent | 7e2209308977372ce9ab649367b007de863b0f44 (diff) | |
parent | 3f9db7b398bd18248c486297ad8bdc7b38eed3ed (diff) |
Merge pull request #63650 from fabriceci/apply-moving-platform-angular-velocity
Allow to apply the angular velocity of a moving platform
Diffstat (limited to 'servers')
-rw-r--r-- | servers/physics_3d/godot_space_3d.cpp | 1 | ||||
-rw-r--r-- | servers/physics_server_3d.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/servers/physics_3d/godot_space_3d.cpp b/servers/physics_3d/godot_space_3d.cpp index c98409e2c4..813970848a 100644 --- a/servers/physics_3d/godot_space_3d.cpp +++ b/servers/physics_3d/godot_space_3d.cpp @@ -992,6 +992,7 @@ bool GodotSpace3D::test_body_motion(GodotBody3D *p_body, const PhysicsServer3D:: Vector3 rel_vec = result.contact - (body->get_transform().origin + body->get_center_of_mass()); collision.collider_velocity = body->get_linear_velocity() + (body->get_angular_velocity()).cross(rel_vec); + collision.collider_angular_velocity = body->get_angular_velocity(); } r_result->travel = safe * p_parameters.motion; diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h index ca1ff57c99..922baad663 100644 --- a/servers/physics_server_3d.h +++ b/servers/physics_server_3d.h @@ -541,6 +541,7 @@ public: Vector3 position; Vector3 normal; Vector3 collider_velocity; + Vector3 collider_angular_velocity; real_t depth = 0.0; int local_shape = 0; ObjectID collider_id; |