summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/bin/test_flip_page.c
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2012-12-05 13:50:30 +0000
committerLeandro Dorileo <dorileo@profusion.mobi>2012-12-05 13:50:30 +0000
commit2975811327284574f1526f00dfdb0a28ff197d31 (patch)
treebd0ced390bdf2f813c5eea3c4d010e9bdeae164e /legacy/ephysics/src/bin/test_flip_page.c
parent4640e5cdca1987d96fa755af676a0f07b32be98e (diff)
EPhysics: flip page test improvements
--This line, and those below, will be ignored-- SVN revision: 80250
Diffstat (limited to '')
-rw-r--r--legacy/ephysics/src/bin/test_flip_page.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/legacy/ephysics/src/bin/test_flip_page.c b/legacy/ephysics/src/bin/test_flip_page.c
index 2003d41768..25519fcc58 100644
--- a/legacy/ephysics/src/bin/test_flip_page.c
+++ b/legacy/ephysics/src/bin/test_flip_page.c
@@ -138,6 +138,16 @@ _mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void
138 -nz); 138 -nz);
139} 139}
140 140
141static void
142_page_update_cb(void *data __UNUSED__, EPhysics_Body *body, void *event_info __UNUSED__)
143{
144 Evas_Coord z;
145
146 ephysics_body_geometry_get(body, NULL, NULL, &z, NULL, NULL, NULL);
147 if (z > -5 && z < 0) ephysics_body_stop(body);
148 ephysics_body_evas_object_update(body);
149}
150
141static Page_Data * 151static Page_Data *
142_page_add(Test_Data *test_data, EPhysics_Body *anchor, const char *img, Evas_Coord z) 152_page_add(Test_Data *test_data, EPhysics_Body *anchor, const char *img, Evas_Coord z)
143{ 153{
@@ -162,13 +172,17 @@ _page_add(Test_Data *test_data, EPhysics_Body *anchor, const char *img, Evas_Coo
162 172
163 evas_object_geometry_get(evas_obj, &page_data->x, NULL, NULL, NULL); 173 evas_object_geometry_get(evas_obj, &page_data->x, NULL, NULL, NULL);
164 174
165 body = ephysics_body_cloth_add(test_data->world, 10, 20); 175 body = ephysics_body_cloth_add(test_data->world, 10, 10);
176 ephysics_body_soft_body_anchor_hardness_set(body, 10);
166 ephysics_body_soft_body_drag_coefficient_set(body, 0.0008); 177 ephysics_body_soft_body_drag_coefficient_set(body, 0.0008);
167 ephysics_body_soft_body_position_iterations_set(body, 6); 178 ephysics_body_soft_body_bending_constraints_add(body, 2);
168 ephysics_body_soft_body_bending_constraints_add(body, 1);
169 ephysics_body_restitution_set(body, 0); 179 ephysics_body_restitution_set(body, 0);
180 ephysics_body_friction_set(body, 0.9);
170 ephysics_body_evas_object_set(body, evas_obj, EINA_TRUE); 181 ephysics_body_evas_object_set(body, evas_obj, EINA_TRUE);
171 182
183 ephysics_body_event_callback_add(body, EPHYSICS_CALLBACK_BODY_UPDATE,
184 _page_update_cb, NULL);
185
172 ephysics_body_move(body, x, y, -z * 3); 186 ephysics_body_move(body, x, y, -z * 3);
173 187
174 test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj); 188 test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj);
@@ -203,6 +217,7 @@ _world_populate(Test_Data *test_data)
203 217
204 anchor = ephysics_body_back_boundary_add(test_data->world); 218 anchor = ephysics_body_back_boundary_add(test_data->world);
205 ephysics_body_restitution_set(anchor, 0); 219 ephysics_body_restitution_set(anchor, 0);
220 ephysics_body_friction_set(anchor, 0.9);
206 test_data->bodies = eina_list_append(test_data->bodies, anchor); 221 test_data->bodies = eina_list_append(test_data->bodies, anchor);
207 222
208 pages = eina_hash_pointer_new(NULL); 223 pages = eina_hash_pointer_new(NULL);