summaryrefslogtreecommitdiff
path: root/servers/physics_3d
diff options
context:
space:
mode:
authorCamille Mohr-Daurat <pouleyKetchoup@gmail.com>2021-10-04 18:03:35 -0700
committerGitHub <noreply@github.com>2021-10-04 18:03:35 -0700
commit4778770d3c46a9a2af5e1514ed631316f804620c (patch)
treed4e031d3474db7a7bfd7c0f2c420bce993fbcaff /servers/physics_3d
parent2e8cba0bd9aba40d559368c7cfd01305000a5d00 (diff)
parent243f235300c92ff2e9166929a37627a791a02bc4 (diff)
Merge pull request #53365 from danger-dan/wakeup_fix
Use wakeup() function to wake sleeping bodies on impulse, force and velocities. Fix for PR #52967
Diffstat (limited to 'servers/physics_3d')
-rw-r--r--servers/physics_3d/body_direct_state_3d_sw.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/servers/physics_3d/body_direct_state_3d_sw.cpp b/servers/physics_3d/body_direct_state_3d_sw.cpp
index e74baefc3a..d61a6ac8e4 100644
--- a/servers/physics_3d/body_direct_state_3d_sw.cpp
+++ b/servers/physics_3d/body_direct_state_3d_sw.cpp
@@ -66,7 +66,7 @@ Basis PhysicsDirectBodyState3DSW::get_inverse_inertia_tensor() const {
}
void PhysicsDirectBodyState3DSW::set_linear_velocity(const Vector3 &p_velocity) {
- body->set_active(true);
+ body->wakeup();
body->set_linear_velocity(p_velocity);
}
@@ -75,7 +75,7 @@ Vector3 PhysicsDirectBodyState3DSW::get_linear_velocity() const {
}
void PhysicsDirectBodyState3DSW::set_angular_velocity(const Vector3 &p_velocity) {
- body->set_active(true);
+ body->wakeup();
body->set_angular_velocity(p_velocity);
}
@@ -96,32 +96,32 @@ Vector3 PhysicsDirectBodyState3DSW::get_velocity_at_local_position(const Vector3
}
void PhysicsDirectBodyState3DSW::add_central_force(const Vector3 &p_force) {
- body->set_active(true);
+ body->wakeup();
body->add_central_force(p_force);
}
void PhysicsDirectBodyState3DSW::add_force(const Vector3 &p_force, const Vector3 &p_position) {
- body->set_active(true);
+ body->wakeup();
body->add_force(p_force, p_position);
}
void PhysicsDirectBodyState3DSW::add_torque(const Vector3 &p_torque) {
- body->set_active(true);
+ body->wakeup();
body->add_torque(p_torque);
}
void PhysicsDirectBodyState3DSW::apply_central_impulse(const Vector3 &p_impulse) {
- body->set_active(true);
+ body->wakeup();
body->apply_central_impulse(p_impulse);
}
void PhysicsDirectBodyState3DSW::apply_impulse(const Vector3 &p_impulse, const Vector3 &p_position) {
- body->set_active(true);
+ body->wakeup();
body->apply_impulse(p_impulse, p_position);
}
void PhysicsDirectBodyState3DSW::apply_torque_impulse(const Vector3 &p_impulse) {
- body->set_active(true);
+ body->wakeup();
body->apply_torque_impulse(p_impulse);
}