summaryrefslogtreecommitdiff
path: root/legacy/ephysics
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2012-12-11 21:11:00 +0000
committerLeandro Dorileo <dorileo@profusion.mobi>2012-12-11 21:11:00 +0000
commit44a9b9a350589b53682381f2a5b0dfceb3acd7fc (patch)
tree62150a284f2f732fa9c9f9d5784e04225eebbae6 /legacy/ephysics
parentc90d6c58426c40ebbd15e7d409fb61c195eecb31 (diff)
EPhysics: add ephysics_body_sphere_add() API
SVN revision: 80717
Diffstat (limited to 'legacy/ephysics')
-rw-r--r--legacy/ephysics/src/bin/ephysics_sandbox.c2
-rw-r--r--legacy/ephysics/src/bin/test_bouncing_ball.c2
-rw-r--r--legacy/ephysics/src/bin/test_camera.c8
-rw-r--r--legacy/ephysics/src/bin/test_camera_track.c2
-rw-r--r--legacy/ephysics/src/bin/test_colliding_balls.c4
-rw-r--r--legacy/ephysics/src/bin/test_collision_detection.c4
-rw-r--r--legacy/ephysics/src/bin/test_collision_filter.c2
-rw-r--r--legacy/ephysics/src/bin/test_collision_speed.c2
-rw-r--r--legacy/ephysics/src/bin/test_delete.c4
-rw-r--r--legacy/ephysics/src/bin/test_growing_balls.c2
-rw-r--r--legacy/ephysics/src/bin/test_heavy.c2
-rw-r--r--legacy/ephysics/src/bin/test_jumping_balls.c6
-rw-r--r--legacy/ephysics/src/bin/test_light.c2
-rw-r--r--legacy/ephysics/src/bin/test_material.c2
-rw-r--r--legacy/ephysics/src/bin/test_sleeping_threshold.c4
-rw-r--r--legacy/ephysics/src/bin/test_soft_body.c2
-rw-r--r--legacy/ephysics/src/bin/test_velocity.c2
-rw-r--r--legacy/ephysics/src/bin/test_win_resize.c2
-rw-r--r--legacy/ephysics/src/lib/EPhysics.h24
-rw-r--r--legacy/ephysics/src/lib/ephysics_body.cpp27
-rw-r--r--legacy/ephysics/src/lib/ephysics_private.h1
21 files changed, 78 insertions, 28 deletions
diff --git a/legacy/ephysics/src/bin/ephysics_sandbox.c b/legacy/ephysics/src/bin/ephysics_sandbox.c
index 9a56094063..3d28ed9a6a 100644
--- a/legacy/ephysics/src/bin/ephysics_sandbox.c
+++ b/legacy/ephysics/src/bin/ephysics_sandbox.c
@@ -146,7 +146,7 @@ _type_set_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
146 } 146 }
147 else 147 else
148 { 148 {
149 body = ephysics_body_cylinder_add(world); 149 body = ephysics_body_sphere_add(world);
150 elm_object_disabled_set(bd->controls.hardness, EINA_TRUE); 150 elm_object_disabled_set(bd->controls.hardness, EINA_TRUE);
151 } 151 }
152 152
diff --git a/legacy/ephysics/src/bin/test_bouncing_ball.c b/legacy/ephysics/src/bin/test_bouncing_ball.c
index 74b8e6959b..00736b09c8 100644
--- a/legacy/ephysics/src/bin/test_bouncing_ball.c
+++ b/legacy/ephysics/src/bin/test_bouncing_ball.c
@@ -47,7 +47,7 @@ _world_populate(Test_Data *test_data)
47 evas_object_show(sphere); 47 evas_object_show(sphere);
48 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere); 48 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
49 49
50 fall_body = ephysics_body_cylinder_add(test_data->world); 50 fall_body = ephysics_body_sphere_add(test_data->world);
51 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE); 51 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
52 ephysics_body_restitution_set(fall_body, 0.95); 52 ephysics_body_restitution_set(fall_body, 0.95);
53 ephysics_body_friction_set(fall_body, 0.1); 53 ephysics_body_friction_set(fall_body, 0.1);
diff --git a/legacy/ephysics/src/bin/test_camera.c b/legacy/ephysics/src/bin/test_camera.c
index 88787344ab..8dc1dcc74a 100644
--- a/legacy/ephysics/src/bin/test_camera.c
+++ b/legacy/ephysics/src/bin/test_camera.c
@@ -95,10 +95,10 @@ _world_populate(Camera_Data *camera_data)
95 camera_data->base.evas_objs = eina_list_append(camera_data->base.evas_objs, 95 camera_data->base.evas_objs = eina_list_append(camera_data->base.evas_objs,
96 sphere); 96 sphere);
97 97
98 fall_body = ephysics_body_cylinder_add(camera_data->base.world); 98 fall_body = ephysics_body_sphere_add(camera_data->base.world);
99 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE); 99 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
100 ephysics_body_restitution_set(fall_body, 0.2); 100 ephysics_body_restitution_set(fall_body, 0.2);
101 ephysics_body_friction_set(fall_body, 0.5); 101 ephysics_body_friction_set(fall_body, 1);
102 ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE, 102 ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE,
103 update_object_cb, shadow); 103 update_object_cb, shadow);
104 camera_data->base.bodies = eina_list_append(camera_data->base.bodies, 104 camera_data->base.bodies = eina_list_append(camera_data->base.bodies,
@@ -123,8 +123,8 @@ _world_populate(Camera_Data *camera_data)
123 camera_data->base.evas_objs = eina_list_append(camera_data->base.evas_objs, 123 camera_data->base.evas_objs = eina_list_append(camera_data->base.evas_objs,
124 sphere); 124 sphere);
125 125
126 fall_body = ephysics_body_cylinder_add(camera_data->base.world); 126 fall_body = ephysics_body_sphere_add(camera_data->base.world);
127 ephysics_body_mass_set(fall_body, 3.7); 127 ephysics_body_mass_set(fall_body, 4.6);
128 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE); 128 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
129 ephysics_body_restitution_set(fall_body, 0.12); 129 ephysics_body_restitution_set(fall_body, 0.12);
130 ephysics_body_friction_set(fall_body, 2); 130 ephysics_body_friction_set(fall_body, 2);
diff --git a/legacy/ephysics/src/bin/test_camera_track.c b/legacy/ephysics/src/bin/test_camera_track.c
index 5d39fddcc5..443ec3f994 100644
--- a/legacy/ephysics/src/bin/test_camera_track.c
+++ b/legacy/ephysics/src/bin/test_camera_track.c
@@ -126,7 +126,7 @@ _world_populate(Track_Data *track_data)
126 track_data->base.evas_objs = eina_list_append(track_data->base.evas_objs, 126 track_data->base.evas_objs = eina_list_append(track_data->base.evas_objs,
127 sphere); 127 sphere);
128 128
129 body = ephysics_body_cylinder_add(track_data->base.world); 129 body = ephysics_body_sphere_add(track_data->base.world);
130 ephysics_body_evas_object_set(body, sphere, EINA_TRUE); 130 ephysics_body_evas_object_set(body, sphere, EINA_TRUE);
131 ephysics_body_restitution_set(body, 0.95); 131 ephysics_body_restitution_set(body, 0.95);
132 ephysics_body_friction_set(body, 1); 132 ephysics_body_friction_set(body, 1);
diff --git a/legacy/ephysics/src/bin/test_colliding_balls.c b/legacy/ephysics/src/bin/test_colliding_balls.c
index 11987d4f42..6de20f3569 100644
--- a/legacy/ephysics/src/bin/test_colliding_balls.c
+++ b/legacy/ephysics/src/bin/test_colliding_balls.c
@@ -36,13 +36,13 @@ _world_populate(Test_Data *test_data)
36 evas_object_show(sphere); 36 evas_object_show(sphere);
37 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere); 37 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
38 38
39 fall_body = ephysics_body_cylinder_add(test_data->world); 39 fall_body = ephysics_body_sphere_add(test_data->world);
40 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE); 40 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
41 ephysics_body_event_callback_add(fall_body, 41 ephysics_body_event_callback_add(fall_body,
42 EPHYSICS_CALLBACK_BODY_UPDATE, 42 EPHYSICS_CALLBACK_BODY_UPDATE,
43 update_object_cb, shadow); 43 update_object_cb, shadow);
44 ephysics_body_restitution_set(fall_body, 0.95); 44 ephysics_body_restitution_set(fall_body, 0.95);
45 ephysics_body_friction_set(fall_body, 0.1); 45 ephysics_body_friction_set(fall_body, 1);
46 test_data->bodies = eina_list_append(test_data->bodies, fall_body); 46 test_data->bodies = eina_list_append(test_data->bodies, fall_body);
47 } 47 }
48} 48}
diff --git a/legacy/ephysics/src/bin/test_collision_detection.c b/legacy/ephysics/src/bin/test_collision_detection.c
index 70d86e4a2b..5e89163de0 100644
--- a/legacy/ephysics/src/bin/test_collision_detection.c
+++ b/legacy/ephysics/src/bin/test_collision_detection.c
@@ -58,7 +58,7 @@ _world_populate(Collision_Data *collision_data)
58 collision_data->base.evas_objs = eina_list_append( 58 collision_data->base.evas_objs = eina_list_append(
59 collision_data->base.evas_objs, sphere1); 59 collision_data->base.evas_objs, sphere1);
60 60
61 sphere_body1 = ephysics_body_cylinder_add(collision_data->base.world); 61 sphere_body1 = ephysics_body_sphere_add(collision_data->base.world);
62 ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE); 62 ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE);
63 ephysics_body_event_callback_add(sphere_body1, 63 ephysics_body_event_callback_add(sphere_body1,
64 EPHYSICS_CALLBACK_BODY_UPDATE, 64 EPHYSICS_CALLBACK_BODY_UPDATE,
@@ -88,7 +88,7 @@ _world_populate(Collision_Data *collision_data)
88 collision_data->base.evas_objs = eina_list_append( 88 collision_data->base.evas_objs = eina_list_append(
89 collision_data->base.evas_objs, sphere2); 89 collision_data->base.evas_objs, sphere2);
90 90
91 sphere_body2 = ephysics_body_cylinder_add(collision_data->base.world); 91 sphere_body2 = ephysics_body_sphere_add(collision_data->base.world);
92 ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE); 92 ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE);
93 ephysics_body_event_callback_add(sphere_body2, 93 ephysics_body_event_callback_add(sphere_body2,
94 EPHYSICS_CALLBACK_BODY_UPDATE, 94 EPHYSICS_CALLBACK_BODY_UPDATE,
diff --git a/legacy/ephysics/src/bin/test_collision_filter.c b/legacy/ephysics/src/bin/test_collision_filter.c
index 3a0b5a07da..b224ff22c6 100644
--- a/legacy/ephysics/src/bin/test_collision_filter.c
+++ b/legacy/ephysics/src/bin/test_collision_filter.c
@@ -29,7 +29,7 @@ _world_populate(Test_Data *test_data)
29 evas_object_show(sphere); 29 evas_object_show(sphere);
30 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere); 30 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
31 31
32 fall_body = ephysics_body_cylinder_add(test_data->world); 32 fall_body = ephysics_body_sphere_add(test_data->world);
33 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE); 33 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
34 ephysics_body_restitution_set(fall_body, 0.95); 34 ephysics_body_restitution_set(fall_body, 0.95);
35 ephysics_body_friction_set(fall_body, 0.1); 35 ephysics_body_friction_set(fall_body, 0.1);
diff --git a/legacy/ephysics/src/bin/test_collision_speed.c b/legacy/ephysics/src/bin/test_collision_speed.c
index c95e70ab11..887110fcb8 100644
--- a/legacy/ephysics/src/bin/test_collision_speed.c
+++ b/legacy/ephysics/src/bin/test_collision_speed.c
@@ -50,7 +50,7 @@ _world_populate(Speed_Data *speed_data)
50 speed_data->base.evas_objs = eina_list_append(speed_data->base.evas_objs, 50 speed_data->base.evas_objs = eina_list_append(speed_data->base.evas_objs,
51 sphere); 51 sphere);
52 52
53 ball = ephysics_body_cylinder_add(speed_data->base.world); 53 ball = ephysics_body_sphere_add(speed_data->base.world);
54 ephysics_body_evas_object_set(ball, sphere, EINA_TRUE); 54 ephysics_body_evas_object_set(ball, sphere, EINA_TRUE);
55 ephysics_body_restitution_set(ball, 0.8); 55 ephysics_body_restitution_set(ball, 0.8);
56 ephysics_body_friction_set(ball, 0.2); 56 ephysics_body_friction_set(ball, 0.2);
diff --git a/legacy/ephysics/src/bin/test_delete.c b/legacy/ephysics/src/bin/test_delete.c
index 25deaff70f..a9d3fc4008 100644
--- a/legacy/ephysics/src/bin/test_delete.c
+++ b/legacy/ephysics/src/bin/test_delete.c
@@ -75,7 +75,7 @@ _world_populate(Collision_Data *collision_data)
75 collision_data->base.evas_objs = eina_list_append( 75 collision_data->base.evas_objs = eina_list_append(
76 collision_data->base.evas_objs, sphere1); 76 collision_data->base.evas_objs, sphere1);
77 77
78 sphere_body1 = ephysics_body_cylinder_add(collision_data->base.world); 78 sphere_body1 = ephysics_body_sphere_add(collision_data->base.world);
79 ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE); 79 ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE);
80 ephysics_body_event_callback_add(sphere_body1, 80 ephysics_body_event_callback_add(sphere_body1,
81 EPHYSICS_CALLBACK_BODY_UPDATE, 81 EPHYSICS_CALLBACK_BODY_UPDATE,
@@ -108,7 +108,7 @@ _world_populate(Collision_Data *collision_data)
108 collision_data->base.evas_objs = eina_list_append( 108 collision_data->base.evas_objs = eina_list_append(
109 collision_data->base.evas_objs, sphere2); 109 collision_data->base.evas_objs, sphere2);
110 110
111 sphere_body2 = ephysics_body_cylinder_add(collision_data->base.world); 111 sphere_body2 = ephysics_body_sphere_add(collision_data->base.world);
112 ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE); 112 ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE);
113 ephysics_body_event_callback_add(sphere_body2, 113 ephysics_body_event_callback_add(sphere_body2,
114 EPHYSICS_CALLBACK_BODY_UPDATE, 114 EPHYSICS_CALLBACK_BODY_UPDATE,
diff --git a/legacy/ephysics/src/bin/test_growing_balls.c b/legacy/ephysics/src/bin/test_growing_balls.c
index b1f9ec1bb9..f92de5f149 100644
--- a/legacy/ephysics/src/bin/test_growing_balls.c
+++ b/legacy/ephysics/src/bin/test_growing_balls.c
@@ -41,7 +41,7 @@ _add_sphere(Test_Data *test_data, const char *group, int size, int x, int y)
41 evas_object_show(sphere); 41 evas_object_show(sphere);
42 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere); 42 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
43 43
44 sphere_body = ephysics_body_cylinder_add(test_data->world); 44 sphere_body = ephysics_body_sphere_add(test_data->world);
45 ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE); 45 ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE);
46 ephysics_body_restitution_set(sphere_body, 0.5); 46 ephysics_body_restitution_set(sphere_body, 0.5);
47 ephysics_body_central_impulse_apply(sphere_body, 300, 0, 0); 47 ephysics_body_central_impulse_apply(sphere_body, 300, 0, 0);
diff --git a/legacy/ephysics/src/bin/test_heavy.c b/legacy/ephysics/src/bin/test_heavy.c
index ee4ab0f69f..d8997e403d 100644
--- a/legacy/ephysics/src/bin/test_heavy.c
+++ b/legacy/ephysics/src/bin/test_heavy.c
@@ -19,7 +19,7 @@ _add_sphere(Test_Data *test_data, int i)
19 evas_object_show(sphere); 19 evas_object_show(sphere);
20 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere); 20 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
21 21
22 body = ephysics_body_cylinder_add(test_data->world); 22 body = ephysics_body_sphere_add(test_data->world);
23 ephysics_body_restitution_set(body, 0.85); 23 ephysics_body_restitution_set(body, 0.85);
24 ephysics_body_evas_object_set(body, sphere, EINA_TRUE); 24 ephysics_body_evas_object_set(body, sphere, EINA_TRUE);
25 test_data->bodies = eina_list_append(test_data->bodies, body); 25 test_data->bodies = eina_list_append(test_data->bodies, body);
diff --git a/legacy/ephysics/src/bin/test_jumping_balls.c b/legacy/ephysics/src/bin/test_jumping_balls.c
index 47c402ed17..69bcc13b72 100644
--- a/legacy/ephysics/src/bin/test_jumping_balls.c
+++ b/legacy/ephysics/src/bin/test_jumping_balls.c
@@ -59,14 +59,12 @@ _add_sphere(Test_Data *test_data, int i)
59 evas_object_show(sphere); 59 evas_object_show(sphere);
60 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere); 60 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
61 61
62 fall_body = ephysics_body_cylinder_add(test_data->world); 62 fall_body = ephysics_body_sphere_add(test_data->world);
63 ephysics_body_linear_movement_enable_set(fall_body, EINA_TRUE, EINA_TRUE,
64 EINA_TRUE);
65 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE); 63 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
66 ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE, 64 ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE,
67 update_object_cb, shadow); 65 update_object_cb, shadow);
68 ephysics_body_restitution_set(fall_body, 0.95); 66 ephysics_body_restitution_set(fall_body, 0.95);
69 ephysics_body_friction_set(fall_body, 0.1); 67 ephysics_body_friction_set(fall_body, 1);
70 test_data->bodies = eina_list_append(test_data->bodies, fall_body); 68 test_data->bodies = eina_list_append(test_data->bodies, fall_body);
71} 69}
72 70
diff --git a/legacy/ephysics/src/bin/test_light.c b/legacy/ephysics/src/bin/test_light.c
index 81de0e803c..b3ee79a9e3 100644
--- a/legacy/ephysics/src/bin/test_light.c
+++ b/legacy/ephysics/src/bin/test_light.c
@@ -33,7 +33,7 @@ _ball_add(Test_Data *test_data, int x)
33 evas_object_show(sphere); 33 evas_object_show(sphere);
34 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere); 34 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
35 35
36 ball = ephysics_body_cylinder_add(test_data->world); 36 ball = ephysics_body_sphere_add(test_data->world);
37 ephysics_body_evas_object_set(ball, sphere, EINA_TRUE); 37 ephysics_body_evas_object_set(ball, sphere, EINA_TRUE);
38 ephysics_body_restitution_set(ball, 0.95); 38 ephysics_body_restitution_set(ball, 0.95);
39 ephysics_body_friction_set(ball, 0.1); 39 ephysics_body_friction_set(ball, 0.1);
diff --git a/legacy/ephysics/src/bin/test_material.c b/legacy/ephysics/src/bin/test_material.c
index 57c766a33e..4d94f299bc 100644
--- a/legacy/ephysics/src/bin/test_material.c
+++ b/legacy/ephysics/src/bin/test_material.c
@@ -56,7 +56,7 @@ _world_populate(Test_Data *test_data)
56 evas_object_show(sphere); 56 evas_object_show(sphere);
57 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere); 57 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
58 58
59 fall_body = ephysics_body_cylinder_add(test_data->world); 59 fall_body = ephysics_body_sphere_add(test_data->world);
60 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE); 60 ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
61 ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE, 61 ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE,
62 update_object_cb, shadow); 62 update_object_cb, shadow);
diff --git a/legacy/ephysics/src/bin/test_sleeping_threshold.c b/legacy/ephysics/src/bin/test_sleeping_threshold.c
index bf38fb2ca3..e6b2d513ed 100644
--- a/legacy/ephysics/src/bin/test_sleeping_threshold.c
+++ b/legacy/ephysics/src/bin/test_sleeping_threshold.c
@@ -27,7 +27,7 @@ _world_populate(Test_Data *test_data)
27 evas_object_show(sphere1); 27 evas_object_show(sphere1);
28 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere1); 28 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere1);
29 29
30 sphere_body1 = ephysics_body_cylinder_add(test_data->world); 30 sphere_body1 = ephysics_body_sphere_add(test_data->world);
31 ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE); 31 ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE);
32 ephysics_body_event_callback_add(sphere_body1, 32 ephysics_body_event_callback_add(sphere_body1,
33 EPHYSICS_CALLBACK_BODY_UPDATE, 33 EPHYSICS_CALLBACK_BODY_UPDATE,
@@ -55,7 +55,7 @@ _world_populate(Test_Data *test_data)
55 evas_object_show(sphere2); 55 evas_object_show(sphere2);
56 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere2); 56 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere2);
57 57
58 sphere_body2 = ephysics_body_cylinder_add(test_data->world); 58 sphere_body2 = ephysics_body_sphere_add(test_data->world);
59 ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE); 59 ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE);
60 ephysics_body_event_callback_add(sphere_body2, 60 ephysics_body_event_callback_add(sphere_body2,
61 EPHYSICS_CALLBACK_BODY_UPDATE, 61 EPHYSICS_CALLBACK_BODY_UPDATE,
diff --git a/legacy/ephysics/src/bin/test_soft_body.c b/legacy/ephysics/src/bin/test_soft_body.c
index b595a31542..d99db710dc 100644
--- a/legacy/ephysics/src/bin/test_soft_body.c
+++ b/legacy/ephysics/src/bin/test_soft_body.c
@@ -76,7 +76,7 @@ _world_populate(Test_Data *test_data)
76 evas_object_show(evas_obj); 76 evas_object_show(evas_obj);
77 test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj); 77 test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj);
78 78
79 fall_body = ephysics_body_cylinder_add(test_data->world); 79 fall_body = ephysics_body_sphere_add(test_data->world);
80 ephysics_body_mass_set(fall_body, 2); 80 ephysics_body_mass_set(fall_body, 2);
81 ephysics_body_evas_object_set(fall_body, evas_obj, EINA_TRUE); 81 ephysics_body_evas_object_set(fall_body, evas_obj, EINA_TRUE);
82 ephysics_body_restitution_set(fall_body, 0.95); 82 ephysics_body_restitution_set(fall_body, 0.95);
diff --git a/legacy/ephysics/src/bin/test_velocity.c b/legacy/ephysics/src/bin/test_velocity.c
index 9f3d4a5d67..0ae8372005 100644
--- a/legacy/ephysics/src/bin/test_velocity.c
+++ b/legacy/ephysics/src/bin/test_velocity.c
@@ -106,7 +106,7 @@ _world_populate(Velocity_Data *velocity_data)
106 velocity_data->base.evas_objs = eina_list_append( 106 velocity_data->base.evas_objs = eina_list_append(
107 velocity_data->base.evas_objs, sphere); 107 velocity_data->base.evas_objs, sphere);
108 108
109 sphere_body = ephysics_body_cylinder_add(velocity_data->base.world); 109 sphere_body = ephysics_body_sphere_add(velocity_data->base.world);
110 ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE); 110 ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE);
111 ephysics_body_restitution_set(sphere_body, 0.8); 111 ephysics_body_restitution_set(sphere_body, 0.8);
112 ephysics_body_friction_set(sphere_body, 1); 112 ephysics_body_friction_set(sphere_body, 1);
diff --git a/legacy/ephysics/src/bin/test_win_resize.c b/legacy/ephysics/src/bin/test_win_resize.c
index e790608230..8df93bfa59 100644
--- a/legacy/ephysics/src/bin/test_win_resize.c
+++ b/legacy/ephysics/src/bin/test_win_resize.c
@@ -136,7 +136,7 @@ _world_populate(Test_Data *test_data)
136 evas_object_show(sphere); 136 evas_object_show(sphere);
137 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere); 137 test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
138 138
139 sphere_body = ephysics_body_cylinder_add(test_data->world); 139 sphere_body = ephysics_body_sphere_add(test_data->world);
140 ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE); 140 ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE);
141 ephysics_body_restitution_set(sphere_body, 1.0); 141 ephysics_body_restitution_set(sphere_body, 1.0);
142 ephysics_body_event_callback_add(sphere_body, EPHYSICS_CALLBACK_BODY_UPDATE, 142 ephysics_body_event_callback_add(sphere_body, EPHYSICS_CALLBACK_BODY_UPDATE,
diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h
index ec6d79981e..888e4be004 100644
--- a/legacy/ephysics/src/lib/EPhysics.h
+++ b/legacy/ephysics/src/lib/EPhysics.h
@@ -2670,6 +2670,30 @@ EAPI void ephysics_body_soft_body_bending_constraints_add(EPhysics_Body *body, i
2670 2670
2671/** 2671/**
2672 * @brief 2672 * @brief
2673 * Create a new sphere physics body.
2674 *
2675 * Its collision shape will be a sphere of diameter 1. To change its size @ref
2676 * ephysics_body_geometry_set(), @p ephysics_body_resize() should be used.
2677 *
2678 * Any evas object can be associated to it with @p
2679 * ephysics_body_evas_object_set(), and it will collid as a sphere(even if
2680 * you`ve associated an evas rectangle).
2681 *
2682 * For deformable sphere use @p ephysics_body_soft_ellipsoid_add() instead.
2683 *
2684 * @param world The world this body will belong to.
2685 * @return a new body or @c NULL, on errors.
2686 *
2687 * @see ephysics_body_del().
2688 * @see ephysics_body_evas_object_set().
2689 * @see ephysics_body_face_evas_object_set().
2690 *
2691 * @ingroup EPhysics_Body
2692 */
2693EAPI EPhysics_Body *ephysics_body_sphere_add(EPhysics_World *world);
2694
2695/**
2696 * @brief
2673 * Create a new cylinder physics body. 2697 * Create a new cylinder physics body.
2674 * 2698 *
2675 * Its collision shape will be a cylinder of diameter 1. To change it's size 2699 * Its collision shape will be a cylinder of diameter 1. To change it's size
diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp
index 5c7a061e60..5fde811807 100644
--- a/legacy/ephysics/src/lib/ephysics_body.cpp
+++ b/legacy/ephysics/src/lib/ephysics_body.cpp
@@ -2841,6 +2841,33 @@ no_collision_shape:
2841} 2841}
2842 2842
2843EAPI EPhysics_Body * 2843EAPI EPhysics_Body *
2844ephysics_body_sphere_add(EPhysics_World *world)
2845{
2846 btCollisionShape *collision_shape;
2847 EPhysics_Body *body;
2848
2849 if (!world)
2850 {
2851 ERR("Can't add sphere, world is null.");
2852 return NULL;
2853 }
2854
2855 collision_shape = new btSphereShape(0.5);
2856 if (!collision_shape)
2857 {
2858 ERR("Couldn't create a new sphere shape.");
2859 return NULL;
2860 }
2861
2862 ephysics_world_lock_take(world);
2863 body = _ephysics_body_rigid_body_add(world, collision_shape, "sphere", 0.5,
2864 0.5, 0.5);
2865 body->shape = EPHYSICS_BODY_SHAPE_SPHERE;
2866 ephysics_world_lock_release(world);
2867 return body;
2868}
2869
2870EAPI EPhysics_Body *
2844ephysics_body_cylinder_add(EPhysics_World *world) 2871ephysics_body_cylinder_add(EPhysics_World *world)
2845{ 2872{
2846 btCollisionShape *collision_shape; 2873 btCollisionShape *collision_shape;
diff --git a/legacy/ephysics/src/lib/ephysics_private.h b/legacy/ephysics/src/lib/ephysics_private.h
index 3e7050b480..994561a4a9 100644
--- a/legacy/ephysics/src/lib/ephysics_private.h
+++ b/legacy/ephysics/src/lib/ephysics_private.h
@@ -66,6 +66,7 @@ typedef enum _EPhysics_Body_Shape
66 EPHYSICS_BODY_SHAPE_BOX, 66 EPHYSICS_BODY_SHAPE_BOX,
67 EPHYSICS_BODY_SHAPE_CUSTOM, 67 EPHYSICS_BODY_SHAPE_CUSTOM,
68 EPHYSICS_BODY_SHAPE_CYLINDER, 68 EPHYSICS_BODY_SHAPE_CYLINDER,
69 EPHYSICS_BODY_SHAPE_SPHERE,
69 EPHYSICS_BODY_SHAPE_ELLIPSOID, 70 EPHYSICS_BODY_SHAPE_ELLIPSOID,
70 EPHYSICS_BODY_SHAPE_LAST, 71 EPHYSICS_BODY_SHAPE_LAST,
71} EPhysics_Body_Shape; 72} EPhysics_Body_Shape;