diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2017-07-25 04:26:47 +0200 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2017-08-01 01:39:40 +0200 |
commit | 7264716e8666b3a5d80f96f645226235e55c7b6f (patch) | |
tree | fd4c2b0bb3233230ee1f4859c9c2618d15eb8dd4 /servers/physics_2d/area_2d_sw.h | |
parent | ac2c5e8dcdf4c4957fc20b124b91847c6b0145ad (diff) | |
download | redot-engine-7264716e8666b3a5d80f96f645226235e55c7b6f.tar.gz |
Improve cleanup of physics constraints
Don't abort the loop when one is already released
Remove warning on already-released constraint
Clean up area's contraints as well
Clear the constraint data as well
Do the cleanup as soon as the space changes
Diffstat (limited to 'servers/physics_2d/area_2d_sw.h')
-rw-r--r-- | servers/physics_2d/area_2d_sw.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/servers/physics_2d/area_2d_sw.h b/servers/physics_2d/area_2d_sw.h index 68b3c61e44..6d74a4b0f6 100644 --- a/servers/physics_2d/area_2d_sw.h +++ b/servers/physics_2d/area_2d_sw.h @@ -153,6 +153,7 @@ public: _FORCE_INLINE_ void add_constraint(Constraint2DSW *p_constraint) { constraints.insert(p_constraint); } _FORCE_INLINE_ void remove_constraint(Constraint2DSW *p_constraint) { constraints.erase(p_constraint); } _FORCE_INLINE_ const Set<Constraint2DSW *> &get_constraints() const { return constraints; } + _FORCE_INLINE_ void clear_constraints() { constraints.clear(); } void set_monitorable(bool p_monitorable); _FORCE_INLINE_ bool is_monitorable() const { return monitorable; } |