diff options
author | Daniel <daniel.j.tritscher@gmail.com> | 2021-10-04 07:57:26 +1300 |
---|---|---|
committer | Daniel <daniel.j.tritscher@gmail.com> | 2021-10-05 13:17:05 +1300 |
commit | 243f235300c92ff2e9166929a37627a791a02bc4 (patch) | |
tree | 9a57203f635773309e6bbf1586ad32188c51033f /servers/physics_2d | |
parent | 66ab3ce954a94fd43baed1dd74381dd32c893407 (diff) |
Changed from directly waking bodies to using the wakeup() functions in direct body state changes (forces, impulses and veloicities). this 'bug' was introduced in PR #52967
added wakeup to 2d direct body
Diffstat (limited to 'servers/physics_2d')
-rw-r--r-- | servers/physics_2d/body_direct_state_2d_sw.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/servers/physics_2d/body_direct_state_2d_sw.cpp b/servers/physics_2d/body_direct_state_2d_sw.cpp index 1c6adfe27c..b0673b9006 100644 --- a/servers/physics_2d/body_direct_state_2d_sw.cpp +++ b/servers/physics_2d/body_direct_state_2d_sw.cpp @@ -59,7 +59,7 @@ real_t PhysicsDirectBodyState2DSW::get_inverse_inertia() const { } void PhysicsDirectBodyState2DSW::set_linear_velocity(const Vector2 &p_velocity) { - body->set_active(true); + body->wakeup(); body->set_linear_velocity(p_velocity); } @@ -68,7 +68,7 @@ Vector2 PhysicsDirectBodyState2DSW::get_linear_velocity() const { } void PhysicsDirectBodyState2DSW::set_angular_velocity(real_t p_velocity) { - body->set_active(true); + body->wakeup(); body->set_angular_velocity(p_velocity); } @@ -89,32 +89,32 @@ Vector2 PhysicsDirectBodyState2DSW::get_velocity_at_local_position(const Vector2 } void PhysicsDirectBodyState2DSW::add_central_force(const Vector2 &p_force) { - body->set_active(true); + body->wakeup(); body->add_central_force(p_force); } void PhysicsDirectBodyState2DSW::add_force(const Vector2 &p_force, const Vector2 &p_position) { - body->set_active(true); + body->wakeup(); body->add_force(p_force, p_position); } void PhysicsDirectBodyState2DSW::add_torque(real_t p_torque) { - body->set_active(true); + body->wakeup(); body->add_torque(p_torque); } void PhysicsDirectBodyState2DSW::apply_central_impulse(const Vector2 &p_impulse) { - body->set_active(true); + body->wakeup(); body->apply_central_impulse(p_impulse); } void PhysicsDirectBodyState2DSW::apply_impulse(const Vector2 &p_impulse, const Vector2 &p_position) { - body->set_active(true); + body->wakeup(); body->apply_impulse(p_impulse, p_position); } void PhysicsDirectBodyState2DSW::apply_torque_impulse(real_t p_torque) { - body->set_active(true); + body->wakeup(); body->apply_torque_impulse(p_torque); } |