forked from enlightenment/efl
EPhysics: ephysics_body_circle_add() becomes ephysics_body_cylinder_add()
SVN revision: 80716
This commit is contained in:
parent
2903b1f122
commit
c90d6c5842
|
@ -164,7 +164,7 @@ _letter_body_box_add(EPhysics_World *world, Evas_Object *image)
|
||||||
static EPhysics_Body *
|
static EPhysics_Body *
|
||||||
_letter_body_circle_add(EPhysics_World *world, Evas_Object *image)
|
_letter_body_circle_add(EPhysics_World *world, Evas_Object *image)
|
||||||
{
|
{
|
||||||
EPhysics_Body *body = ephysics_body_circle_add(world);
|
EPhysics_Body *body = ephysics_body_cylinder_add(world);
|
||||||
|
|
||||||
_letter_body_setup_common(body, image);
|
_letter_body_setup_common(body, image);
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ _type_set_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
body = ephysics_body_circle_add(world);
|
body = ephysics_body_cylinder_add(world);
|
||||||
elm_object_disabled_set(bd->controls.hardness, EINA_TRUE);
|
elm_object_disabled_set(bd->controls.hardness, EINA_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -937,7 +937,7 @@ _body_add(Evas_Object *win, EPhysics_World *world, int x, int y)
|
||||||
evas_object_move(body_image, x, y);
|
evas_object_move(body_image, x, y);
|
||||||
evas_object_show(body_image);
|
evas_object_show(body_image);
|
||||||
|
|
||||||
body = ephysics_body_circle_add(world);
|
body = ephysics_body_cylinder_add(world);
|
||||||
ephysics_body_evas_object_set(body, body_image, EINA_TRUE);
|
ephysics_body_evas_object_set(body, body_image, EINA_TRUE);
|
||||||
ephysics_body_mass_set(body, INITIAL_MASS);
|
ephysics_body_mass_set(body, INITIAL_MASS);
|
||||||
ephysics_body_event_callback_add(body, EPHYSICS_CALLBACK_BODY_DEL,
|
ephysics_body_event_callback_add(body, EPHYSICS_CALLBACK_BODY_DEL,
|
||||||
|
|
|
@ -47,7 +47,7 @@ _world_populate(Test_Data *test_data)
|
||||||
evas_object_show(sphere);
|
evas_object_show(sphere);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
||||||
|
|
||||||
fall_body = ephysics_body_circle_add(test_data->world);
|
fall_body = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
||||||
ephysics_body_restitution_set(fall_body, 0.95);
|
ephysics_body_restitution_set(fall_body, 0.95);
|
||||||
ephysics_body_friction_set(fall_body, 0.1);
|
ephysics_body_friction_set(fall_body, 0.1);
|
||||||
|
|
|
@ -95,7 +95,7 @@ _world_populate(Camera_Data *camera_data)
|
||||||
camera_data->base.evas_objs = eina_list_append(camera_data->base.evas_objs,
|
camera_data->base.evas_objs = eina_list_append(camera_data->base.evas_objs,
|
||||||
sphere);
|
sphere);
|
||||||
|
|
||||||
fall_body = ephysics_body_circle_add(camera_data->base.world);
|
fall_body = ephysics_body_cylinder_add(camera_data->base.world);
|
||||||
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
||||||
ephysics_body_restitution_set(fall_body, 0.2);
|
ephysics_body_restitution_set(fall_body, 0.2);
|
||||||
ephysics_body_friction_set(fall_body, 0.5);
|
ephysics_body_friction_set(fall_body, 0.5);
|
||||||
|
@ -123,7 +123,7 @@ _world_populate(Camera_Data *camera_data)
|
||||||
camera_data->base.evas_objs = eina_list_append(camera_data->base.evas_objs,
|
camera_data->base.evas_objs = eina_list_append(camera_data->base.evas_objs,
|
||||||
sphere);
|
sphere);
|
||||||
|
|
||||||
fall_body = ephysics_body_circle_add(camera_data->base.world);
|
fall_body = ephysics_body_cylinder_add(camera_data->base.world);
|
||||||
ephysics_body_mass_set(fall_body, 3.7);
|
ephysics_body_mass_set(fall_body, 3.7);
|
||||||
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
||||||
ephysics_body_restitution_set(fall_body, 0.12);
|
ephysics_body_restitution_set(fall_body, 0.12);
|
||||||
|
|
|
@ -126,7 +126,7 @@ _world_populate(Track_Data *track_data)
|
||||||
track_data->base.evas_objs = eina_list_append(track_data->base.evas_objs,
|
track_data->base.evas_objs = eina_list_append(track_data->base.evas_objs,
|
||||||
sphere);
|
sphere);
|
||||||
|
|
||||||
body = ephysics_body_circle_add(track_data->base.world);
|
body = ephysics_body_cylinder_add(track_data->base.world);
|
||||||
ephysics_body_evas_object_set(body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(body, sphere, EINA_TRUE);
|
||||||
ephysics_body_restitution_set(body, 0.95);
|
ephysics_body_restitution_set(body, 0.95);
|
||||||
ephysics_body_friction_set(body, 1);
|
ephysics_body_friction_set(body, 1);
|
||||||
|
|
|
@ -37,7 +37,7 @@ _coin_add(Test_Data *test_data, Evas_Coord x, Evas_Coord y)
|
||||||
front = _obj_face_add(test_data, "coin0", x, y);
|
front = _obj_face_add(test_data, "coin0", x, y);
|
||||||
back = _obj_face_add(test_data, "coin1", x, y);
|
back = _obj_face_add(test_data, "coin1", x, y);
|
||||||
|
|
||||||
coin = ephysics_body_circle_add(test_data->world);
|
coin = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_resize(coin, 1, 1, 1);
|
ephysics_body_resize(coin, 1, 1, 1);
|
||||||
ephysics_body_face_evas_object_set(coin,
|
ephysics_body_face_evas_object_set(coin,
|
||||||
EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_FRONT,
|
EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_FRONT,
|
||||||
|
|
|
@ -36,7 +36,7 @@ _world_populate(Test_Data *test_data)
|
||||||
evas_object_show(sphere);
|
evas_object_show(sphere);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
||||||
|
|
||||||
fall_body = ephysics_body_circle_add(test_data->world);
|
fall_body = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
||||||
ephysics_body_event_callback_add(fall_body,
|
ephysics_body_event_callback_add(fall_body,
|
||||||
EPHYSICS_CALLBACK_BODY_UPDATE,
|
EPHYSICS_CALLBACK_BODY_UPDATE,
|
||||||
|
|
|
@ -58,7 +58,7 @@ _world_populate(Collision_Data *collision_data)
|
||||||
collision_data->base.evas_objs = eina_list_append(
|
collision_data->base.evas_objs = eina_list_append(
|
||||||
collision_data->base.evas_objs, sphere1);
|
collision_data->base.evas_objs, sphere1);
|
||||||
|
|
||||||
sphere_body1 = ephysics_body_circle_add(collision_data->base.world);
|
sphere_body1 = ephysics_body_cylinder_add(collision_data->base.world);
|
||||||
ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE);
|
ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE);
|
||||||
ephysics_body_event_callback_add(sphere_body1,
|
ephysics_body_event_callback_add(sphere_body1,
|
||||||
EPHYSICS_CALLBACK_BODY_UPDATE,
|
EPHYSICS_CALLBACK_BODY_UPDATE,
|
||||||
|
@ -88,7 +88,7 @@ _world_populate(Collision_Data *collision_data)
|
||||||
collision_data->base.evas_objs = eina_list_append(
|
collision_data->base.evas_objs = eina_list_append(
|
||||||
collision_data->base.evas_objs, sphere2);
|
collision_data->base.evas_objs, sphere2);
|
||||||
|
|
||||||
sphere_body2 = ephysics_body_circle_add(collision_data->base.world);
|
sphere_body2 = ephysics_body_cylinder_add(collision_data->base.world);
|
||||||
ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE);
|
ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE);
|
||||||
ephysics_body_event_callback_add(sphere_body2,
|
ephysics_body_event_callback_add(sphere_body2,
|
||||||
EPHYSICS_CALLBACK_BODY_UPDATE,
|
EPHYSICS_CALLBACK_BODY_UPDATE,
|
||||||
|
|
|
@ -29,7 +29,7 @@ _world_populate(Test_Data *test_data)
|
||||||
evas_object_show(sphere);
|
evas_object_show(sphere);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
||||||
|
|
||||||
fall_body = ephysics_body_circle_add(test_data->world);
|
fall_body = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
||||||
ephysics_body_restitution_set(fall_body, 0.95);
|
ephysics_body_restitution_set(fall_body, 0.95);
|
||||||
ephysics_body_friction_set(fall_body, 0.1);
|
ephysics_body_friction_set(fall_body, 0.1);
|
||||||
|
|
|
@ -50,7 +50,7 @@ _world_populate(Speed_Data *speed_data)
|
||||||
speed_data->base.evas_objs = eina_list_append(speed_data->base.evas_objs,
|
speed_data->base.evas_objs = eina_list_append(speed_data->base.evas_objs,
|
||||||
sphere);
|
sphere);
|
||||||
|
|
||||||
ball = ephysics_body_circle_add(speed_data->base.world);
|
ball = ephysics_body_cylinder_add(speed_data->base.world);
|
||||||
ephysics_body_evas_object_set(ball, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(ball, sphere, EINA_TRUE);
|
||||||
ephysics_body_restitution_set(ball, 0.8);
|
ephysics_body_restitution_set(ball, 0.8);
|
||||||
ephysics_body_friction_set(ball, 0.2);
|
ephysics_body_friction_set(ball, 0.2);
|
||||||
|
|
|
@ -75,7 +75,7 @@ _world_populate(Collision_Data *collision_data)
|
||||||
collision_data->base.evas_objs = eina_list_append(
|
collision_data->base.evas_objs = eina_list_append(
|
||||||
collision_data->base.evas_objs, sphere1);
|
collision_data->base.evas_objs, sphere1);
|
||||||
|
|
||||||
sphere_body1 = ephysics_body_circle_add(collision_data->base.world);
|
sphere_body1 = ephysics_body_cylinder_add(collision_data->base.world);
|
||||||
ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE);
|
ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE);
|
||||||
ephysics_body_event_callback_add(sphere_body1,
|
ephysics_body_event_callback_add(sphere_body1,
|
||||||
EPHYSICS_CALLBACK_BODY_UPDATE,
|
EPHYSICS_CALLBACK_BODY_UPDATE,
|
||||||
|
@ -108,7 +108,7 @@ _world_populate(Collision_Data *collision_data)
|
||||||
collision_data->base.evas_objs = eina_list_append(
|
collision_data->base.evas_objs = eina_list_append(
|
||||||
collision_data->base.evas_objs, sphere2);
|
collision_data->base.evas_objs, sphere2);
|
||||||
|
|
||||||
sphere_body2 = ephysics_body_circle_add(collision_data->base.world);
|
sphere_body2 = ephysics_body_cylinder_add(collision_data->base.world);
|
||||||
ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE);
|
ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE);
|
||||||
ephysics_body_event_callback_add(sphere_body2,
|
ephysics_body_event_callback_add(sphere_body2,
|
||||||
EPHYSICS_CALLBACK_BODY_UPDATE,
|
EPHYSICS_CALLBACK_BODY_UPDATE,
|
||||||
|
|
|
@ -41,7 +41,7 @@ _add_sphere(Test_Data *test_data, const char *group, int size, int x, int y)
|
||||||
evas_object_show(sphere);
|
evas_object_show(sphere);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
||||||
|
|
||||||
sphere_body = ephysics_body_circle_add(test_data->world);
|
sphere_body = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE);
|
||||||
ephysics_body_restitution_set(sphere_body, 0.5);
|
ephysics_body_restitution_set(sphere_body, 0.5);
|
||||||
ephysics_body_central_impulse_apply(sphere_body, 300, 0, 0);
|
ephysics_body_central_impulse_apply(sphere_body, 300, 0, 0);
|
||||||
|
|
|
@ -19,7 +19,7 @@ _add_sphere(Test_Data *test_data, int i)
|
||||||
evas_object_show(sphere);
|
evas_object_show(sphere);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
||||||
|
|
||||||
body = ephysics_body_circle_add(test_data->world);
|
body = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_restitution_set(body, 0.85);
|
ephysics_body_restitution_set(body, 0.85);
|
||||||
ephysics_body_evas_object_set(body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(body, sphere, EINA_TRUE);
|
||||||
test_data->bodies = eina_list_append(test_data->bodies, body);
|
test_data->bodies = eina_list_append(test_data->bodies, body);
|
||||||
|
|
|
@ -59,8 +59,9 @@ _add_sphere(Test_Data *test_data, int i)
|
||||||
evas_object_show(sphere);
|
evas_object_show(sphere);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
||||||
|
|
||||||
fall_body = ephysics_body_circle_add(test_data->world);
|
fall_body = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_linear_movement_enable_set(fall_body, EINA_TRUE, EINA_TRUE, EINA_TRUE);
|
ephysics_body_linear_movement_enable_set(fall_body, EINA_TRUE, EINA_TRUE,
|
||||||
|
EINA_TRUE);
|
||||||
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
||||||
ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE,
|
ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE,
|
||||||
update_object_cb, shadow);
|
update_object_cb, shadow);
|
||||||
|
|
|
@ -33,7 +33,7 @@ _ball_add(Test_Data *test_data, int x)
|
||||||
evas_object_show(sphere);
|
evas_object_show(sphere);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
||||||
|
|
||||||
ball = ephysics_body_circle_add(test_data->world);
|
ball = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_evas_object_set(ball, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(ball, sphere, EINA_TRUE);
|
||||||
ephysics_body_restitution_set(ball, 0.95);
|
ephysics_body_restitution_set(ball, 0.95);
|
||||||
ephysics_body_friction_set(ball, 0.1);
|
ephysics_body_friction_set(ball, 0.1);
|
||||||
|
|
|
@ -56,7 +56,7 @@ _world_populate(Test_Data *test_data)
|
||||||
evas_object_show(sphere);
|
evas_object_show(sphere);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
||||||
|
|
||||||
fall_body = ephysics_body_circle_add(test_data->world);
|
fall_body = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
|
||||||
ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE,
|
ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE,
|
||||||
update_object_cb, shadow);
|
update_object_cb, shadow);
|
||||||
|
|
|
@ -27,7 +27,7 @@ _world_populate(Test_Data *test_data)
|
||||||
evas_object_show(sphere1);
|
evas_object_show(sphere1);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere1);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere1);
|
||||||
|
|
||||||
sphere_body1 = ephysics_body_circle_add(test_data->world);
|
sphere_body1 = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE);
|
ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE);
|
||||||
ephysics_body_event_callback_add(sphere_body1,
|
ephysics_body_event_callback_add(sphere_body1,
|
||||||
EPHYSICS_CALLBACK_BODY_UPDATE,
|
EPHYSICS_CALLBACK_BODY_UPDATE,
|
||||||
|
@ -55,7 +55,7 @@ _world_populate(Test_Data *test_data)
|
||||||
evas_object_show(sphere2);
|
evas_object_show(sphere2);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere2);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere2);
|
||||||
|
|
||||||
sphere_body2 = ephysics_body_circle_add(test_data->world);
|
sphere_body2 = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE);
|
ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE);
|
||||||
ephysics_body_event_callback_add(sphere_body2,
|
ephysics_body_event_callback_add(sphere_body2,
|
||||||
EPHYSICS_CALLBACK_BODY_UPDATE,
|
EPHYSICS_CALLBACK_BODY_UPDATE,
|
||||||
|
|
|
@ -76,7 +76,7 @@ _world_populate(Test_Data *test_data)
|
||||||
evas_object_show(evas_obj);
|
evas_object_show(evas_obj);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj);
|
||||||
|
|
||||||
fall_body = ephysics_body_circle_add(test_data->world);
|
fall_body = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_mass_set(fall_body, 2);
|
ephysics_body_mass_set(fall_body, 2);
|
||||||
ephysics_body_evas_object_set(fall_body, evas_obj, EINA_TRUE);
|
ephysics_body_evas_object_set(fall_body, evas_obj, EINA_TRUE);
|
||||||
ephysics_body_restitution_set(fall_body, 0.95);
|
ephysics_body_restitution_set(fall_body, 0.95);
|
||||||
|
|
|
@ -106,7 +106,7 @@ _world_populate(Velocity_Data *velocity_data)
|
||||||
velocity_data->base.evas_objs = eina_list_append(
|
velocity_data->base.evas_objs = eina_list_append(
|
||||||
velocity_data->base.evas_objs, sphere);
|
velocity_data->base.evas_objs, sphere);
|
||||||
|
|
||||||
sphere_body = ephysics_body_circle_add(velocity_data->base.world);
|
sphere_body = ephysics_body_cylinder_add(velocity_data->base.world);
|
||||||
ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE);
|
||||||
ephysics_body_restitution_set(sphere_body, 0.8);
|
ephysics_body_restitution_set(sphere_body, 0.8);
|
||||||
ephysics_body_friction_set(sphere_body, 1);
|
ephysics_body_friction_set(sphere_body, 1);
|
||||||
|
|
|
@ -136,7 +136,7 @@ _world_populate(Test_Data *test_data)
|
||||||
evas_object_show(sphere);
|
evas_object_show(sphere);
|
||||||
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
|
||||||
|
|
||||||
sphere_body = ephysics_body_circle_add(test_data->world);
|
sphere_body = ephysics_body_cylinder_add(test_data->world);
|
||||||
ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE);
|
ephysics_body_evas_object_set(sphere_body, sphere, EINA_TRUE);
|
||||||
ephysics_body_restitution_set(sphere_body, 1.0);
|
ephysics_body_restitution_set(sphere_body, 1.0);
|
||||||
ephysics_body_event_callback_add(sphere_body, EPHYSICS_CALLBACK_BODY_UPDATE,
|
ephysics_body_event_callback_add(sphere_body, EPHYSICS_CALLBACK_BODY_UPDATE,
|
||||||
|
|
|
@ -450,7 +450,7 @@ EAPI double ephysics_quaternion_length2_get(const EPhysics_Quaternion *quat);
|
||||||
* @{
|
* @{
|
||||||
*
|
*
|
||||||
* Shapes are used to create bodies with shapes that differ from primitive
|
* Shapes are used to create bodies with shapes that differ from primitive
|
||||||
* ones, like box and circle.
|
* ones, like box and cylinder.
|
||||||
*
|
*
|
||||||
* A shape consists in a group of points, the vertices of the body to be
|
* A shape consists in a group of points, the vertices of the body to be
|
||||||
* created later with @ref ephysics_body_shape_add().
|
* created later with @ref ephysics_body_shape_add().
|
||||||
|
@ -618,7 +618,7 @@ EAPI Eina_Bool ephysics_shape_save(const EPhysics_Shape *shape, const char *file
|
||||||
* Body handle, represents an object on EPhysics world.
|
* Body handle, represents an object on EPhysics world.
|
||||||
*
|
*
|
||||||
* Many types of bodies can be created:
|
* Many types of bodies can be created:
|
||||||
* @li @ref ephysics_body_circle_add()
|
* @li @ref ephysics_body_cylinder_add()
|
||||||
* @li @ref ephysics_body_box_add()
|
* @li @ref ephysics_body_box_add()
|
||||||
* @li @ref ephysics_body_shape_add()
|
* @li @ref ephysics_body_shape_add()
|
||||||
* @li @ref ephysics_body_soft_circle_add()
|
* @li @ref ephysics_body_soft_circle_add()
|
||||||
|
@ -1291,7 +1291,7 @@ EAPI double ephysics_world_rate_get(const EPhysics_World *world);
|
||||||
*
|
*
|
||||||
* @note The list should be freed after usage.
|
* @note The list should be freed after usage.
|
||||||
*
|
*
|
||||||
* @see ephysics_body_circle_add().
|
* @see ephysics_body_cylinder_add().
|
||||||
* @see ephysics_body_box_add().
|
* @see ephysics_body_box_add().
|
||||||
* @see ephysics_body_del().
|
* @see ephysics_body_del().
|
||||||
*
|
*
|
||||||
|
@ -1952,7 +1952,7 @@ EAPI Eina_Bool ephysics_world_stack_enable_get(const EPhysics_World *world);
|
||||||
* A body is a representation of an object inside a physics world.
|
* A body is a representation of an object inside a physics world.
|
||||||
*
|
*
|
||||||
* Bodies can have different shapes that can be created with:
|
* Bodies can have different shapes that can be created with:
|
||||||
* @li @ref ephysics_body_circle_add();
|
* @li @ref ephysics_body_cylinder_add();
|
||||||
* @li @ref ephysics_body_box_add();
|
* @li @ref ephysics_body_box_add();
|
||||||
* @li or @ref ephysics_body_shape_add().
|
* @li or @ref ephysics_body_shape_add().
|
||||||
*
|
*
|
||||||
|
@ -2670,17 +2670,17 @@ EAPI void ephysics_body_soft_body_bending_constraints_add(EPhysics_Body *body, i
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
* Create a new circle physics body.
|
* Create a new cylinder physics body.
|
||||||
*
|
*
|
||||||
* Its collision shape will be a circle of diameter 1. To change it's size
|
* Its collision shape will be a cylinder of diameter 1. To change it's size
|
||||||
* @ref ephysics_body_geometry_set() should be used.
|
* @ref ephysics_body_geometry_set() should be used.
|
||||||
*
|
*
|
||||||
* Any evas object can be associated to it with
|
* Any evas object can be associated to it with
|
||||||
* @ref ephysics_body_evas_object_set(),
|
* @ref ephysics_body_evas_object_set(),
|
||||||
* and it will collide as a circle (even if you have an evas rectangle).
|
* and it will collide as a cylinder (even if you have an evas rectangle).
|
||||||
*
|
*
|
||||||
* If a circle that could have its shape deformed is required, use
|
* If a cylinder that could have its shape deformed is required, use
|
||||||
* @ref ephysics_body_soft_box_add().
|
* @ref ephysics_body_soft_circle_add().
|
||||||
*
|
*
|
||||||
* @param world The world this body will belongs to.
|
* @param world The world this body will belongs to.
|
||||||
* @return a new body or @c NULL, on errors.
|
* @return a new body or @c NULL, on errors.
|
||||||
|
@ -2691,7 +2691,7 @@ EAPI void ephysics_body_soft_body_bending_constraints_add(EPhysics_Body *body, i
|
||||||
*
|
*
|
||||||
* @ingroup EPhysics_Body
|
* @ingroup EPhysics_Body
|
||||||
*/
|
*/
|
||||||
EAPI EPhysics_Body *ephysics_body_circle_add(EPhysics_World *world);
|
EAPI EPhysics_Body *ephysics_body_cylinder_add(EPhysics_World *world);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
|
@ -2711,7 +2711,7 @@ EAPI EPhysics_Body *ephysics_body_circle_add(EPhysics_World *world);
|
||||||
* @note When working with soft bodies it's importante to adjust the
|
* @note When working with soft bodies it's importante to adjust the
|
||||||
* simulation's fixed time step due its multi point nature.
|
* simulation's fixed time step due its multi point nature.
|
||||||
*
|
*
|
||||||
* For a rigid circle, check @ref ephysics_body_circle_add().
|
* For a rigid cylinder, check @ref ephysics_body_cylinder_add().
|
||||||
*
|
*
|
||||||
* @param world The world this body will belongs to.
|
* @param world The world this body will belongs to.
|
||||||
* @return a new body or @c NULL, on errors.
|
* @return a new body or @c NULL, on errors.
|
||||||
|
@ -2759,7 +2759,7 @@ EAPI EPhysics_Body *ephysics_body_box_add(EPhysics_World *world);
|
||||||
* @note When working with soft bodies it's importante to adjust the
|
* @note When working with soft bodies it's importante to adjust the
|
||||||
* simulation's fixed time step due its multi point nature.
|
* simulation's fixed time step due its multi point nature.
|
||||||
*
|
*
|
||||||
* For a rigid circle, check @ref ephysics_body_circle_add().
|
* For a rigid cylinder, check @ref ephysics_body_cylinder_add().
|
||||||
*
|
*
|
||||||
* @param world The world this body will belong to.
|
* @param world The world this body will belong to.
|
||||||
* @return a new body or @c NULL on errors.
|
* @return a new body or @c NULL on errors.
|
||||||
|
@ -3003,7 +3003,7 @@ EAPI EPhysics_Body *ephysics_body_back_boundary_add(EPhysics_World *world);
|
||||||
* @param body The body to be deleted.
|
* @param body The body to be deleted.
|
||||||
*
|
*
|
||||||
* @see ephysics_body_box_add().
|
* @see ephysics_body_box_add().
|
||||||
* @see ephysics_body_circle_add().
|
* @see ephysics_body_cylinder_add().
|
||||||
*
|
*
|
||||||
* @ingroup EPhysics_Body
|
* @ingroup EPhysics_Body
|
||||||
*/
|
*/
|
||||||
|
@ -3048,7 +3048,7 @@ EAPI EPhysics_World *ephysics_body_world_get(const EPhysics_Body *body);
|
||||||
*
|
*
|
||||||
* @see ephysics_body_box_add().
|
* @see ephysics_body_box_add().
|
||||||
* @see ephysics_body_soft_box_add().
|
* @see ephysics_body_soft_box_add().
|
||||||
* @see ephysics_body_circle_add().
|
* @see ephysics_body_cylinder_add().
|
||||||
* @see ephysics_body_soft_circle_add().
|
* @see ephysics_body_soft_circle_add().
|
||||||
* @see ephysics_body_evas_object_unset().
|
* @see ephysics_body_evas_object_unset().
|
||||||
* @see ephysics_world_rate_set().
|
* @see ephysics_world_rate_set().
|
||||||
|
@ -3147,7 +3147,7 @@ EAPI Evas_Object *ephysics_body_face_evas_object_unset(EPhysics_Body *body, EPhy
|
||||||
* @brief
|
* @brief
|
||||||
* Set physics body size.
|
* Set physics body size.
|
||||||
*
|
*
|
||||||
* By default circles have diameter equal to 1 meter * rate, boxes have
|
* By default cylinders have diameter equal to 1 meter * rate, boxes have
|
||||||
* dimensions 1 meter * rate on all the axes.
|
* dimensions 1 meter * rate on all the axes.
|
||||||
*
|
*
|
||||||
* There are three direct ways of modifying it's size:
|
* There are three direct ways of modifying it's size:
|
||||||
|
@ -3206,7 +3206,7 @@ EAPI void ephysics_body_move(EPhysics_Body *body, Evas_Coord x, Evas_Coord y, Ev
|
||||||
* Set physics body geometry.
|
* Set physics body geometry.
|
||||||
*
|
*
|
||||||
* All the physics bodies are created centered on origin (0, 0) and with
|
* All the physics bodies are created centered on origin (0, 0) and with
|
||||||
* canonical dimensions. Circles have diameter 1, boxes have dimensions 1
|
* canonical dimensions. Cylinder have diameter 1, boxes have dimensions 1
|
||||||
* on all the axes.
|
* on all the axes.
|
||||||
*
|
*
|
||||||
* There are four direct ways of modifying this geometry:
|
* There are four direct ways of modifying this geometry:
|
||||||
|
@ -4246,7 +4246,7 @@ EAPI void ephysics_body_forces_clear(EPhysics_Body *body);
|
||||||
* mass at x component = 20, y component = 10 and z = 10, it will return
|
* mass at x component = 20, y component = 10 and z = 10, it will return
|
||||||
* @p x = 0.666, @p y = 0.5 and @p z = 0.5.
|
* @p x = 0.666, @p y = 0.5 and @p z = 0.5.
|
||||||
*
|
*
|
||||||
* For primitive shapes, like box and circle, the center of mass
|
* For primitive shapes, like box and cylinder, the center of mass
|
||||||
* is (0.5, 0.5, 0.5).
|
* is (0.5, 0.5, 0.5).
|
||||||
*
|
*
|
||||||
* This function can be useful when updating evas objects for bodies
|
* This function can be useful when updating evas objects for bodies
|
||||||
|
|
|
@ -2841,14 +2841,14 @@ no_collision_shape:
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI EPhysics_Body *
|
EAPI EPhysics_Body *
|
||||||
ephysics_body_circle_add(EPhysics_World *world)
|
ephysics_body_cylinder_add(EPhysics_World *world)
|
||||||
{
|
{
|
||||||
btCollisionShape *collision_shape;
|
btCollisionShape *collision_shape;
|
||||||
EPhysics_Body *body;
|
EPhysics_Body *body;
|
||||||
|
|
||||||
if (!world)
|
if (!world)
|
||||||
{
|
{
|
||||||
ERR("Can't add circle, world is null.");
|
ERR("Can't add cylinder, world is null.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2860,7 +2860,7 @@ ephysics_body_circle_add(EPhysics_World *world)
|
||||||
}
|
}
|
||||||
|
|
||||||
ephysics_world_lock_take(world);
|
ephysics_world_lock_take(world);
|
||||||
body = _ephysics_body_rigid_body_add(world, collision_shape, "circle", 0.5,
|
body = _ephysics_body_rigid_body_add(world, collision_shape, "cylinder", 0.5,
|
||||||
0.5, 0.5);
|
0.5, 0.5);
|
||||||
body->shape = EPHYSICS_BODY_SHAPE_CYLINDER;
|
body->shape = EPHYSICS_BODY_SHAPE_CYLINDER;
|
||||||
ephysics_world_lock_release(world);
|
ephysics_world_lock_release(world);
|
||||||
|
|
Loading…
Reference in New Issue