diff options
author | Camille Mohr-Daurat <pouleyKetchoup@gmail.com> | 2021-12-10 17:16:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 17:16:28 -0700 |
commit | f1ca14cc8daf7529569a11c9209c18f8f73e837a (patch) | |
tree | 937b7a7c559d6c2394cceb1874131df7b80bde0e /scene/2d/physics_body_2d.h | |
parent | c6fe431a02a490aa42d8cbf5d573feb6edc7f0a8 (diff) | |
parent | 940f3fde5c5f902b6efd0f35fb6c7d23edd1da14 (diff) |
Merge pull request #55736 from nekomatata/physics-apply-forces
Improve RigidDynamicBody force and torque API
Diffstat (limited to 'scene/2d/physics_body_2d.h')
-rw-r--r-- | scene/2d/physics_body_2d.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index 2abce4b0a5..71a7908bd7 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -292,15 +292,19 @@ public: void apply_impulse(const Vector2 &p_impulse, const Vector2 &p_position = Vector2()); void apply_torque_impulse(real_t p_torque); - void set_applied_force(const Vector2 &p_force); - Vector2 get_applied_force() const; + void apply_central_force(const Vector2 &p_force); + void apply_force(const Vector2 &p_force, const Vector2 &p_position = Vector2()); + void apply_torque(real_t p_torque); - void set_applied_torque(const real_t p_torque); - real_t get_applied_torque() const; + void add_constant_central_force(const Vector2 &p_force); + void add_constant_force(const Vector2 &p_force, const Vector2 &p_position = Vector2()); + void add_constant_torque(real_t p_torque); - void add_central_force(const Vector2 &p_force); - void add_force(const Vector2 &p_force, const Vector2 &p_position = Vector2()); - void add_torque(real_t p_torque); + void set_constant_force(const Vector2 &p_force); + Vector2 get_constant_force() const; + + void set_constant_torque(real_t p_torque); + real_t get_constant_torque() const; TypedArray<Node2D> get_colliding_bodies() const; //function for script |