summaryrefslogtreecommitdiff
path: root/servers/physics_2d
diff options
context:
space:
mode:
authorDaniel <daniel.j.tritscher@gmail.com>2021-09-23 21:30:42 +1200
committerDaniel <daniel.j.tritscher@gmail.com>2021-09-24 17:22:51 +1200
commite8efe621d594203f8b7acb2ea1c3e9a9f49ed442 (patch)
tree650a4c44ce7afb5b7111d72d799f82c18000569b /servers/physics_2d
parent2815594ba0cc86120f70ede121a0bf32ac3ee051 (diff)
Added set_active(true) to all body direct state force apply/impulses. #52915
Diffstat (limited to 'servers/physics_2d')
-rw-r--r--servers/physics_2d/body_direct_state_2d_sw.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/servers/physics_2d/body_direct_state_2d_sw.cpp b/servers/physics_2d/body_direct_state_2d_sw.cpp
index 58250c3077..1e924a831e 100644
--- a/servers/physics_2d/body_direct_state_2d_sw.cpp
+++ b/servers/physics_2d/body_direct_state_2d_sw.cpp
@@ -59,6 +59,7 @@ real_t PhysicsDirectBodyState2DSW::get_inverse_inertia() const {
}
void PhysicsDirectBodyState2DSW::set_linear_velocity(const Vector2 &p_velocity) {
+ body->set_active(true);
body->set_linear_velocity(p_velocity);
}
@@ -67,6 +68,7 @@ Vector2 PhysicsDirectBodyState2DSW::get_linear_velocity() const {
}
void PhysicsDirectBodyState2DSW::set_angular_velocity(real_t p_velocity) {
+ body->set_active(true);
body->set_angular_velocity(p_velocity);
}
@@ -87,26 +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->add_central_force(p_force);
}
void PhysicsDirectBodyState2DSW::add_force(const Vector2 &p_force, const Vector2 &p_position) {
+ body->set_active(true);
body->add_force(p_force, p_position);
}
void PhysicsDirectBodyState2DSW::add_torque(real_t p_torque) {
+ body->set_active(true);
body->add_torque(p_torque);
}
void PhysicsDirectBodyState2DSW::apply_central_impulse(const Vector2 &p_impulse) {
+ body->set_active(true);
body->apply_central_impulse(p_impulse);
}
void PhysicsDirectBodyState2DSW::apply_impulse(const Vector2 &p_impulse, const Vector2 &p_position) {
+ body->set_active(true);
body->apply_impulse(p_impulse, p_position);
}
void PhysicsDirectBodyState2DSW::apply_torque_impulse(real_t p_torque) {
+ body->set_active(true);
body->apply_torque_impulse(p_torque);
}