Fix physics glitch with TileMap moving platforms

Added a parameter in test_body_motion to exclude attached objects from
collision, used to avoid collision with all TileMap tiles with moving
platform motion instead of just the one tile the character touches.

Same changes made in 3D for consistency, and handling potential similar
cases.
This commit is contained in:
PouleyKetchoupp
2021-09-30 11:05:30 -07:00
parent 5b270278c8
commit 4f8d761be6
12 changed files with 99 additions and 0 deletions

View File

@ -472,6 +472,7 @@ public:
real_t margin = 0.08;
bool collide_separation_ray = false;
Set<RID> exclude_bodies;
Set<ObjectID> exclude_objects;
MotionParameters() {}
@ -609,6 +610,9 @@ public:
Vector<RID> get_exclude_bodies() const;
void set_exclude_bodies(const Vector<RID> &p_exclude);
Array get_exclude_objects() const;
void set_exclude_objects(const Array &p_exclude);
};
class PhysicsTestMotionResult2D : public RefCounted {