summaryrefslogtreecommitdiffstats
path: root/servers/physics_2d/area_2d_sw.h
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2017-07-25 04:26:47 +0200
committerPedro J. Estébanez <pedrojrulez@gmail.com>2017-08-01 01:39:40 +0200
commit7264716e8666b3a5d80f96f645226235e55c7b6f (patch)
treefd4c2b0bb3233230ee1f4859c9c2618d15eb8dd4 /servers/physics_2d/area_2d_sw.h
parentac2c5e8dcdf4c4957fc20b124b91847c6b0145ad (diff)
downloadredot-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.h1
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; }