summaryrefslogtreecommitdiff
path: root/servers/physics_2d/body_pair_2d_sw.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-01-01 12:11:46 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-01-01 12:13:17 -0300
commit0ed864d876347841d60797773a37c0b2f235c85c (patch)
treeabe292b66dae00d93254a73d8fc440959bdb61cc /servers/physics_2d/body_pair_2d_sw.cpp
parent199a29b353748245e9589d3ef38877613eef0ede (diff)
properly removing unprocessed objects from physics islands fixes one way platforms for rigidbodies, closes #2345
Diffstat (limited to 'servers/physics_2d/body_pair_2d_sw.cpp')
-rw-r--r--servers/physics_2d/body_pair_2d_sw.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp
index b6006de140..db7869c6a6 100644
--- a/servers/physics_2d/body_pair_2d_sw.cpp
+++ b/servers/physics_2d/body_pair_2d_sw.cpp
@@ -364,6 +364,9 @@ bool BodyPair2DSW::setup(float p_step) {
real_t inv_dt = 1.0/p_step;
+
+ bool do_process=false;
+
for (int i = 0; i < contact_count; i++) {
Contact& c = contacts[i];
@@ -459,10 +462,11 @@ bool BodyPair2DSW::setup(float p_step) {
c.bounce = c.bounce * dv.dot(c.normal);
}
+ do_process=true;
}
- return true;
+ return do_process;
}
void BodyPair2DSW::solve(float p_step) {