summaryrefslogtreecommitdiff
path: root/servers/physics_3d
diff options
context:
space:
mode:
authorDaniel <daniel.j.tritscher@gmail.com>2021-10-04 07:57:26 +1300
committerDaniel <daniel.j.tritscher@gmail.com>2021-10-05 13:17:05 +1300
commit243f235300c92ff2e9166929a37627a791a02bc4 (patch)
tree9a57203f635773309e6bbf1586ad32188c51033f /servers/physics_3d
parent66ab3ce954a94fd43baed1dd74381dd32c893407 (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_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);
}