summaryrefslogtreecommitdiffstats
path: root/scene/2d/physics_body_2d.h
diff options
context:
space:
mode:
authorDavid Sichma <sichmada@gmail.com>2018-10-17 10:22:48 +0200
committerDavid Sichma <sichmada@gmail.com>2018-10-17 17:22:14 +0200
commit6ec4da2e3b6eeed5f6bc0d1a4f7e0a81147ea04e (patch)
treee9534fc366da0638e27f73fb7ecbb82617844cf9 /scene/2d/physics_body_2d.h
parentd3fde96dcf206a56c286eee85a52422c4cb158db (diff)
downloadredot-engine-6ec4da2e3b6eeed5f6bc0d1a4f7e0a81147ea04e.tar.gz
Fix inconsistency in KinematicBody
- moved new infinite_inertia argument of move_and_slide and move_and_slide_with_snap in KinematicBody and KinematicBody2D to the end if not already there. This makes the order of arguments consistent and should keep projects from 3.0 compatible as this argument did not exist in 3.0. Docs updated accordingly. - renamed max_bounces to max_slides for consistency. Docs updated accordingly. - the argument infinite_inertia in test_move is now optional, as it is in every other movement related method. This closes #22829.
Diffstat (limited to 'scene/2d/physics_body_2d.h')
-rw-r--r--scene/2d/physics_body_2d.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h
index 29befb0375..02d56d8474 100644
--- a/scene/2d/physics_body_2d.h
+++ b/scene/2d/physics_body_2d.h
@@ -331,15 +331,15 @@ protected:
public:
bool move_and_collide(const Vector2 &p_motion, bool p_infinite_inertia, Collision &r_collision, bool p_exclude_raycast_shapes = true, bool p_test_only = false);
- bool test_move(const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia);
+ bool test_move(const Transform2D &p_from, const Vector2 &p_motion, bool p_infinite_inertia = true);
bool separate_raycast_shapes(bool p_infinite_inertia, Collision &r_collision);
void set_safe_margin(float p_margin);
float get_safe_margin() const;
- Vector2 move_and_slide(const Vector2 &p_linear_velocity, const Vector2 &p_floor_direction = Vector2(0, 0), bool p_infinite_inertia = true, bool p_stop_on_slope = false, int p_max_slides = 4, float p_floor_max_angle = Math::deg2rad((float)45));
- Vector2 move_and_slide_with_snap(const Vector2 &p_linear_velocity, const Vector2 &p_snap, const Vector2 &p_floor_direction = Vector2(0, 0), bool p_infinite_inertia = true, bool p_stop_on_slope = false, int p_max_slides = 4, float p_floor_max_angle = Math::deg2rad((float)45));
+ Vector2 move_and_slide(const Vector2 &p_linear_velocity, const Vector2 &p_floor_direction = Vector2(0, 0), bool p_stop_on_slope = false, int p_max_slides = 4, float p_floor_max_angle = Math::deg2rad((float)45), bool p_infinite_inertia = true);
+ Vector2 move_and_slide_with_snap(const Vector2 &p_linear_velocity, const Vector2 &p_snap, const Vector2 &p_floor_direction = Vector2(0, 0), bool p_stop_on_slope = false, int p_max_slides = 4, float p_floor_max_angle = Math::deg2rad((float)45), bool p_infinite_inertia = true);
bool is_on_floor() const;
bool is_on_wall() const;
bool is_on_ceiling() const;