mirror of
https://github.com/tiennm99/godot.git
synced 2026-08-18 08:25:04 +00:00
Merge pull request #41528 from keegano/physics-fix-wrap-angle
Wrap angles to (-pi, pi) in momentum calculation.
This commit is contained in:
@@ -468,7 +468,7 @@ void Body2DSW::integrate_forces(real_t p_step) {
|
||||
linear_velocity = motion / p_step;
|
||||
|
||||
real_t rot = new_transform.get_rotation() - get_transform().get_rotation();
|
||||
angular_velocity = rot / p_step;
|
||||
angular_velocity = remainder(rot, 2.0 * Math_PI) / p_step;
|
||||
|
||||
do_motion = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user