From: Bruno Dilly Date: Tue, 4 Sep 2012 22:42:35 +0000 (+0000) Subject: ephysics: activate all bodies when one is deleted X-Git-Tag: submit/devel/efl/20131022.203902~4394 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35780ad7cfae50a3a3d32d205138ad38bb435304;p=platform%2Fupstream%2Fefl.git ephysics: activate all bodies when one is deleted Otherwise it can lead to scenarios when a body 1, below body 2 is deleted and body 2 will stay freezed in the air. Gravity won't start to act over it until it's activated again. SVN revision: 76155 --- diff --git a/legacy/ephysics/src/lib/ephysics_world.cpp b/legacy/ephysics/src/lib/ephysics_world.cpp index 6baec1f..093c323 100644 --- a/legacy/ephysics/src/lib/ephysics_world.cpp +++ b/legacy/ephysics/src/lib/ephysics_world.cpp @@ -360,6 +360,7 @@ Eina_Bool ephysics_world_body_del(EPhysics_World *world, EPhysics_Body *body) { btSoftBody *soft_body; + EPhysics_Body *bd; if (world->walking) { @@ -379,6 +380,16 @@ ephysics_world_body_del(EPhysics_World *world, EPhysics_Body *body) world->bodies = eina_inlist_remove(world->bodies, EINA_INLIST_GET(body)); ephysics_orphan_body_del(body); + /* Activate all the bodies after a body is deleted. + Otherwise it can lead to scenarios when a body 1, below body 2 is deleted + and body 2 will stay freezed in the air. Gravity won't start to + act over it until it's activated again. */ + EINA_INLIST_FOREACH(world->bodies, bd) + { + btRigidBody *rigid_body = ephysics_body_rigid_body_get(bd); + rigid_body->activate(1); + } + return EINA_TRUE; }