diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2015-11-22 14:14:07 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2015-11-22 14:14:07 +0100 |
commit | f33d9dab5bf05356f9a2c882537e83390a710e0b (patch) | |
tree | 824443d9ea9d1791a2b5cd0c7adc594b581e4dce /scene/3d/physics_body.h | |
parent | bcf4aded9a2af5f9ab48f7f279ee2032d0833f16 (diff) | |
download | redot-engine-f33d9dab5bf05356f9a2c882537e83390a710e0b.tar.gz |
Fix can_move_to and rename it for more clarity
Fixes #2416.
The KinematicBody::can_move_to function was likely designed for two behaviours:
- discrete: check if the body can "teleport" to the destination
- continuous: check if the direct path to the destination is valid
The continuous behaviour was however not implemented, and the discrete behaviour was broken too due to a wrong call to intersect_shape.
The discrete behaviour has thus been fixed and the function renamed to can_teleport_to for more clarity.
Diffstat (limited to 'scene/3d/physics_body.h')
-rw-r--r-- | scene/3d/physics_body.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h index 66490ba925..0e63b77118 100644 --- a/scene/3d/physics_body.h +++ b/scene/3d/physics_body.h @@ -304,7 +304,7 @@ public: Vector3 move(const Vector3& p_motion); Vector3 move_to(const Vector3& p_position); - bool can_move_to(const Vector3& p_position,bool p_discrete=false); + bool can_teleport_to(const Vector3& p_position); bool is_colliding() const; Vector3 get_collision_pos() const; Vector3 get_collision_normal() const; |