forked from enlightenment/efl
ephysics: revert add depth parameter to boundary api
reverts r77785, since it will be properly handled before adding front and back boundaries SVN revision: 78013
This commit is contained in:
parent
25e3dd2a44
commit
f6e0e9a3f5
|
@ -846,12 +846,11 @@ _sandie_world_add(Evas_Object *win)
|
|||
world = ephysics_world_new();
|
||||
ephysics_world_render_geometry_set(world, 80, 80, (int) WIDTH * 0.7 - 160,
|
||||
HEIGHT - 160);
|
||||
evas_object_data_set(win, "top", ephysics_body_top_boundary_add(world, 10));
|
||||
evas_object_data_set(win, "top", ephysics_body_top_boundary_add(world));
|
||||
evas_object_data_set(win, "bottom",
|
||||
ephysics_body_bottom_boundary_add(world, 10));
|
||||
evas_object_data_set(win, "left", ephysics_body_left_boundary_add(world, 10));
|
||||
evas_object_data_set(win, "right", ephysics_body_right_boundary_add(world,
|
||||
10));
|
||||
ephysics_body_bottom_boundary_add(world));
|
||||
evas_object_data_set(win, "left", ephysics_body_left_boundary_add(world));
|
||||
evas_object_data_set(win, "right", ephysics_body_right_boundary_add(world));
|
||||
|
||||
return world;
|
||||
}
|
||||
|
|
|
@ -125,19 +125,19 @@ test_bouncing_3d(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 4);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
elm_object_event_callback_add(test_data->win, _on_keydown, test_data->data);
|
||||
|
|
|
@ -91,19 +91,19 @@ test_bouncing_ball(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 4);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
elm_object_event_callback_add(test_data->win, _on_keydown, test_data->data);
|
||||
|
|
|
@ -58,7 +58,7 @@ test_bouncing_text(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 2);
|
||||
|
||||
|
|
|
@ -77,13 +77,13 @@ test_colliding_balls(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *e
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 2);
|
||||
|
||||
ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_right_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
}
|
||||
|
|
|
@ -168,15 +168,15 @@ test_collision(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
collision_data->base.world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(collision_data->base.world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(collision_data->base.world);
|
||||
ephysics_body_restitution_set(boundary, 0);
|
||||
ephysics_body_friction_set(boundary, 20);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(collision_data->base.world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(collision_data->base.world);
|
||||
ephysics_body_restitution_set(boundary, 0.8);
|
||||
|
||||
ephysics_body_left_boundary_add(collision_data->base.world, 10);
|
||||
ephysics_body_top_boundary_add(collision_data->base.world, 10);
|
||||
ephysics_body_left_boundary_add(collision_data->base.world);
|
||||
ephysics_body_top_boundary_add(collision_data->base.world);
|
||||
|
||||
_world_populate(collision_data);
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ test_collision_filter(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *
|
|||
ephysics_world_render_geometry_set(world, 60, 40, WIDTH - 120, FLOOR_Y - 32);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 30);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 2);
|
||||
|
||||
|
@ -82,9 +82,9 @@ test_collision_filter(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *
|
|||
ephysics_body_mass_set(boundary, 0);
|
||||
ephysics_body_collision_group_add(boundary, "blue-ball");
|
||||
|
||||
ephysics_body_top_boundary_add(test_data->world, 30);
|
||||
ephysics_body_left_boundary_add(test_data->world, 30);
|
||||
ephysics_body_right_boundary_add(test_data->world, 30);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_right_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
}
|
||||
|
|
|
@ -130,19 +130,19 @@ test_collision_speed(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *e
|
|||
ephysics_world_simulation_set(world, 1/260.f, 5);
|
||||
speed_data->base.world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 4);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
boundary = ephysics_body_left_boundary_add(world, 10);
|
||||
boundary = ephysics_body_left_boundary_add(world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
ephysics_body_top_boundary_add(world, 10);
|
||||
ephysics_body_top_boundary_add(world);
|
||||
|
||||
_world_populate(speed_data);
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ test_constraint(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
|
|
|
@ -176,12 +176,12 @@ test_delete(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
collision_data->base.world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(collision_data->base.world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(collision_data->base.world);
|
||||
ephysics_body_restitution_set(boundary, 0);
|
||||
ephysics_body_friction_set(boundary, 20);
|
||||
|
||||
ephysics_body_left_boundary_add(collision_data->base.world, 10);
|
||||
ephysics_body_right_boundary_add(collision_data->base.world, 10);
|
||||
ephysics_body_left_boundary_add(collision_data->base.world);
|
||||
ephysics_body_right_boundary_add(collision_data->base.world);
|
||||
|
||||
_world_populate(collision_data);
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ test_falling_letters(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *e
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.3);
|
||||
|
||||
_world_populate(test_data);
|
||||
|
|
|
@ -77,18 +77,18 @@ test_flag(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info _
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 4);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
_world_populate(test_data);
|
||||
}
|
||||
|
|
|
@ -91,19 +91,19 @@ test_forces(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1);
|
||||
ephysics_body_friction_set(boundary, 0);
|
||||
|
||||
boundary = ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_top_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1);
|
||||
ephysics_body_friction_set(boundary, 0);
|
||||
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1);
|
||||
ephysics_body_friction_set(boundary, 0);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1);
|
||||
ephysics_body_friction_set(boundary, 0);
|
||||
|
||||
|
|
|
@ -156,19 +156,19 @@ test_grab(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info _
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 4);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
}
|
||||
|
|
|
@ -107,14 +107,14 @@ test_growing_balls(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.8);
|
||||
|
||||
boundary = ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_top_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.8);
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.8);
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.8);
|
||||
|
||||
_world_populate(test_data);
|
||||
|
|
|
@ -62,12 +62,12 @@ test_heavy(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1);
|
||||
|
||||
ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_right_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
}
|
||||
|
|
|
@ -130,13 +130,13 @@ test_jumping_balls(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve
|
|||
ephysics_world_event_callback_add(world, EPHYSICS_CALLBACK_WORLD_STOPPED,
|
||||
_world_stopped_cb, bt);
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 2);
|
||||
|
||||
ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_right_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ test_light(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 4);
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ test_material(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1);
|
||||
|
||||
_world_populate(test_data);
|
||||
|
|
|
@ -111,19 +111,19 @@ test_no_gravity(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1);
|
||||
ephysics_body_friction_set(boundary, 0);
|
||||
|
||||
boundary = ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_top_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1);
|
||||
ephysics_body_friction_set(boundary, 0);
|
||||
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1);
|
||||
ephysics_body_friction_set(boundary, 0);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1);
|
||||
ephysics_body_friction_set(boundary, 0);
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ test_rotate(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
|
|
|
@ -98,12 +98,12 @@ test_shapes(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
|
||||
ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_right_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
}
|
||||
|
|
|
@ -104,15 +104,15 @@ test_sleeping(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
|
|||
test_data->world = world;
|
||||
ephysics_world_max_sleeping_time_set(world, 0.3);
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0);
|
||||
ephysics_body_friction_set(boundary, 20);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.8);
|
||||
|
||||
ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
}
|
||||
|
|
|
@ -160,11 +160,11 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
ephysics_body_left_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
}
|
||||
|
|
|
@ -146,19 +146,19 @@ test_soft_body(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 4);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
}
|
||||
|
|
|
@ -184,19 +184,19 @@ test_velocity(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
velocity_data->base.world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(velocity_data->base.world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(velocity_data->base.world);
|
||||
ephysics_body_restitution_set(boundary, 0.65);
|
||||
ephysics_body_friction_set(boundary, 4);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(velocity_data->base.world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(velocity_data->base.world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
boundary = ephysics_body_left_boundary_add(velocity_data->base.world, 10);
|
||||
boundary = ephysics_body_left_boundary_add(velocity_data->base.world);
|
||||
ephysics_body_restitution_set(boundary, 0.4);
|
||||
ephysics_body_friction_set(boundary, 3);
|
||||
|
||||
ephysics_body_top_boundary_add(velocity_data->base.world, 10);
|
||||
ephysics_body_top_boundary_add(velocity_data->base.world);
|
||||
|
||||
_world_populate(velocity_data);
|
||||
elm_object_event_callback_add(velocity_data->base.win, _on_keydown,
|
||||
|
|
|
@ -182,16 +182,16 @@ test_win_resize(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_
|
|||
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
|
||||
test_data->world = world;
|
||||
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_bottom_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1.0);
|
||||
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_right_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1.0);
|
||||
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world, 10);
|
||||
boundary = ephysics_body_left_boundary_add(test_data->world);
|
||||
ephysics_body_restitution_set(boundary, 1.0);
|
||||
|
||||
ephysics_body_top_boundary_add(test_data->world, 10);
|
||||
ephysics_body_top_boundary_add(test_data->world);
|
||||
|
||||
_world_populate(test_data);
|
||||
}
|
||||
|
|
|
@ -1908,13 +1908,12 @@ EAPI EPhysics_Body *ephysics_body_shape_add(EPhysics_World *world, EPhysics_Shap
|
|||
* @ref ephysics_world_render_geometry_set().
|
||||
*
|
||||
* @param world The world this body will belong to.
|
||||
* @param d The boundary depth, in pixels.
|
||||
* @return a new body or @c NULL, on erros.
|
||||
* @see ephysics_world_render_geometry_set()
|
||||
*
|
||||
* @ingroup EPhysics_Body
|
||||
*/
|
||||
EAPI EPhysics_Body *ephysics_body_top_boundary_add(EPhysics_World *world, Evas_Coord d);
|
||||
EAPI EPhysics_Body *ephysics_body_top_boundary_add(EPhysics_World *world);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
|
@ -1925,13 +1924,12 @@ EAPI EPhysics_Body *ephysics_body_top_boundary_add(EPhysics_World *world, Evas_C
|
|||
* @ref ephysics_world_render_geometry_set().
|
||||
*
|
||||
* @param world The world this body will belong to.
|
||||
* @param d The boundary depth, in pixels.
|
||||
* @return a new body or @c NULL, on erros.
|
||||
* @see ephysics_world_render_geometry_set()
|
||||
*
|
||||
* @ingroup EPhysics_Body
|
||||
*/
|
||||
EAPI EPhysics_Body *ephysics_body_bottom_boundary_add(EPhysics_World *world, Evas_Coord d);
|
||||
EAPI EPhysics_Body *ephysics_body_bottom_boundary_add(EPhysics_World *world);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
|
@ -1942,13 +1940,12 @@ EAPI EPhysics_Body *ephysics_body_bottom_boundary_add(EPhysics_World *world, Eva
|
|||
* @ref ephysics_world_render_geometry_set().
|
||||
*
|
||||
* @param world The world this body will belong to.
|
||||
* @param d The boundary depth, in pixels.
|
||||
* @return a new body or @c NULL, on erros.
|
||||
* @see ephysics_world_render_geometry_set()
|
||||
*
|
||||
* @ingroup EPhysics_Body
|
||||
*/
|
||||
EAPI EPhysics_Body *ephysics_body_left_boundary_add(EPhysics_World *world, Evas_Coord d);
|
||||
EAPI EPhysics_Body *ephysics_body_left_boundary_add(EPhysics_World *world);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
|
@ -1959,13 +1956,12 @@ EAPI EPhysics_Body *ephysics_body_left_boundary_add(EPhysics_World *world, Evas_
|
|||
* @ref ephysics_world_render_geometry_set().
|
||||
*
|
||||
* @param world The world this body will belong to.
|
||||
* @param d The boundary depth, in pixels.
|
||||
* @return a new body or @c NULL, on erros.
|
||||
* @see ephysics_world_render_geometry_set()
|
||||
*
|
||||
* @ingroup EPhysics_Body
|
||||
*/
|
||||
EAPI EPhysics_Body *ephysics_body_right_boundary_add(EPhysics_World *world, Evas_Coord d);
|
||||
EAPI EPhysics_Body *ephysics_body_right_boundary_add(EPhysics_World *world);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
|
|
|
@ -1784,7 +1784,7 @@ ephysics_body_world_boundaries_resize(EPhysics_World *world)
|
|||
}
|
||||
|
||||
static EPhysics_Body *
|
||||
_ephysics_body_boundary_add(EPhysics_World *world, EPhysics_World_Boundary boundary, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Coord d)
|
||||
_ephysics_body_boundary_add(EPhysics_World *world, EPhysics_World_Boundary boundary, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
|
||||
{
|
||||
EPhysics_Body *body;
|
||||
|
||||
|
@ -1804,56 +1804,56 @@ _ephysics_body_boundary_add(EPhysics_World *world, EPhysics_World_Boundary bound
|
|||
|
||||
ephysics_body_mass_set(body, 0);
|
||||
ephysics_world_boundary_set(world, boundary, body);
|
||||
ephysics_body_geometry_set(body, x, y, -20, w, h,
|
||||
d * ephysics_world_rate_get(body->world));
|
||||
ephysics_body_geometry_set(body, x, y, -5, w, h, 10);
|
||||
|
||||
return body;
|
||||
}
|
||||
|
||||
EAPI EPhysics_Body *
|
||||
ephysics_body_top_boundary_add(EPhysics_World *world, Evas_Coord d)
|
||||
ephysics_body_top_boundary_add(EPhysics_World *world)
|
||||
{
|
||||
EPhysics_Body *body;
|
||||
Evas_Coord x, y, w;
|
||||
|
||||
ephysics_world_render_geometry_get(world, &x, &y, &w, NULL);
|
||||
body = _ephysics_body_boundary_add(world, EPHYSICS_WORLD_BOUNDARY_TOP,
|
||||
0, y - 10, x + w, 10, d);
|
||||
0, y - 10, x + w, 10);
|
||||
return body;
|
||||
}
|
||||
|
||||
EAPI EPhysics_Body *
|
||||
ephysics_body_bottom_boundary_add(EPhysics_World *world, Evas_Coord d)
|
||||
ephysics_body_bottom_boundary_add(EPhysics_World *world)
|
||||
{
|
||||
Evas_Coord x, y, w, h;
|
||||
EPhysics_Body *body;
|
||||
|
||||
ephysics_world_render_geometry_get(world, &x, &y, &w, &h);
|
||||
body = _ephysics_body_boundary_add(world, EPHYSICS_WORLD_BOUNDARY_BOTTOM,
|
||||
x, y + h, w, 10, d);
|
||||
x, y + h, w, 10);
|
||||
return body;
|
||||
}
|
||||
|
||||
EAPI EPhysics_Body *
|
||||
ephysics_body_left_boundary_add(EPhysics_World *world, Evas_Coord d)
|
||||
ephysics_body_left_boundary_add(EPhysics_World *world)
|
||||
{
|
||||
EPhysics_Body *body;
|
||||
Evas_Coord x, y, h;
|
||||
|
||||
ephysics_world_render_geometry_get(world, &x, &y, NULL, &h);
|
||||
body = _ephysics_body_boundary_add(world, EPHYSICS_WORLD_BOUNDARY_LEFT,
|
||||
x - 10, 0, 10, y + h, d);
|
||||
x - 10, 0, 10, y + h);
|
||||
return body;
|
||||
}
|
||||
|
||||
EAPI EPhysics_Body *
|
||||
ephysics_body_right_boundary_add(EPhysics_World *world, Evas_Coord d)
|
||||
ephysics_body_right_boundary_add(EPhysics_World *world)
|
||||
{
|
||||
Evas_Coord x, y, w, h;
|
||||
EPhysics_Body *body;
|
||||
|
||||
ephysics_world_render_geometry_get(world, &x, &y, &w, &h);
|
||||
body = _ephysics_body_boundary_add(world, EPHYSICS_WORLD_BOUNDARY_RIGHT,
|
||||
x + w, 0, 10, y + h, d);
|
||||
x + w, 0, 10, y + h);
|
||||
return body;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue