summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-10-09 20:00:36 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-09 20:00:36 +0000
commite5e90c233d5afbc05fd4b232ebb21895eddfbe56 (patch)
tree96061c24e2aae4a60297542986198d78c888fd05
parent26262cb7198bc86299aeae9c258229333d066095 (diff)
ephysics: re-activate bodies when gravity is set
So it can be applied on all the bodies. SVN revision: 77680
-rw-r--r--legacy/ephysics/src/lib/ephysics_world.cpp4
1 files changed, 4 insertions, 0 deletions
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)
921EAPI void 921EAPI void
922ephysics_world_gravity_set(EPhysics_World *world, double gx, double gy) 922ephysics_world_gravity_set(EPhysics_World *world, double gx, double gy)
923{ 923{
924 EPhysics_Body *bd;
925
924 if (!world) 926 if (!world)
925 { 927 {
926 ERR("Can't set gravity, no world provided."); 928 ERR("Can't set gravity, no world provided.");
@@ -928,6 +930,8 @@ ephysics_world_gravity_set(EPhysics_World *world, double gx, double gy)
928 } 930 }
929 931
930 eina_lock_take(&world->mutex); 932 eina_lock_take(&world->mutex);
933 EINA_INLIST_FOREACH(world->bodies, bd)
934 ephysics_body_activate(bd, EINA_TRUE);
931 _ephysics_world_gravity_set(world, gx, gy, world->rate); 935 _ephysics_world_gravity_set(world, gx, gy, world->rate);
932 DBG("World %p gravity set to X:%lf, Y:%lf.", world, gx, gy); 936 DBG("World %p gravity set to X:%lf, Y:%lf.", world, gx, gy);
933 eina_lock_release(&world->mutex); 937 eina_lock_release(&world->mutex);