From e5e90c233d5afbc05fd4b232ebb21895eddfbe56 Mon Sep 17 00:00:00 2001 From: Bruno Dilly Date: Tue, 9 Oct 2012 20:00:36 +0000 Subject: [PATCH] ephysics: re-activate bodies when gravity is set So it can be applied on all the bodies. SVN revision: 77680 --- legacy/ephysics/src/lib/ephysics_world.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/legacy/ephysics/src/lib/ephysics_world.cpp b/legacy/ephysics/src/lib/ephysics_world.cpp index c0e1b04a94..94604f5af4 100644 --- a/legacy/ephysics/src/lib/ephysics_world.cpp +++ b/legacy/ephysics/src/lib/ephysics_world.cpp @@ -921,6 +921,8 @@ ephysics_world_max_sleeping_time_get(const EPhysics_World *world) EAPI void ephysics_world_gravity_set(EPhysics_World *world, double gx, double gy) { + EPhysics_Body *bd; + if (!world) { ERR("Can't set gravity, no world provided."); @@ -928,6 +930,8 @@ ephysics_world_gravity_set(EPhysics_World *world, double gx, double gy) } eina_lock_take(&world->mutex); + EINA_INLIST_FOREACH(world->bodies, bd) + ephysics_body_activate(bd, EINA_TRUE); _ephysics_world_gravity_set(world, gx, gy, world->rate); DBG("World %p gravity set to X:%lf, Y:%lf.", world, gx, gy); eina_lock_release(&world->mutex);