Changeset View
Changeset View
Standalone View
Standalone View
src/examples/ephysics/test_forces.c
1 | #ifdef HAVE_CONFIG_H | 1 | #ifdef HAVE_CONFIG_H | ||
---|---|---|---|---|---|
2 | # include <config.h> | 2 | # include <config.h> | ||
3 | #endif | 3 | #endif | ||
4 | 4 | | |||
5 | #include "ephysics_test.h" | 5 | #include "ephysics_test.h" | ||
6 | 6 | | |||
7 | static void | 7 | static void | ||
8 | _update_object_cb(void *data __UNUSED__, EPhysics_Body *body, void *event_info __UNUSED__) | 8 | _update_object_cb(void *data EINA_UNUSED, EPhysics_Body *body, void *event_info EINA_UNUSED) | ||
9 | { | 9 | { | ||
10 | double x, y, z, torque, vx, vy, vz, va; | 10 | double x, y, z, torque, vx, vy, vz, va; | ||
11 | 11 | | |||
12 | ephysics_body_evas_object_update(body); | 12 | ephysics_body_evas_object_update(body); | ||
13 | ephysics_body_forces_get(body, &x, &y, &z); | 13 | ephysics_body_forces_get(body, &x, &y, &z); | ||
14 | ephysics_body_torques_get(body, NULL, NULL, &torque); | 14 | ephysics_body_torques_get(body, NULL, NULL, &torque); | ||
15 | DBG("Body %p, fx: %lf, fy: %lf, fz: %lf, torque: %lf", body, x, y, z, | 15 | DBG("Body %p, fx: %lf, fy: %lf, fz: %lf, torque: %lf", body, x, y, z, | ||
16 | torque); | 16 | torque); | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 25 | { | |||
58 | ephysics_body_restitution_set(box_body2, 0.7); | 58 | ephysics_body_restitution_set(box_body2, 0.7); | ||
59 | ephysics_body_friction_set(box_body2, 0); | 59 | ephysics_body_friction_set(box_body2, 0); | ||
60 | ephysics_body_central_force_apply(box_body2, 60, 0, 0); | 60 | ephysics_body_central_force_apply(box_body2, 60, 0, 0); | ||
61 | test_data->bodies = eina_list_append(test_data->bodies, box_body2); | 61 | test_data->bodies = eina_list_append(test_data->bodies, box_body2); | ||
62 | test_data->data = box_body2; | 62 | test_data->data = box_body2; | ||
63 | } | 63 | } | ||
64 | 64 | | |||
65 | static void | 65 | static void | ||
66 | _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) | 66 | _restart(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) | ||
67 | { | 67 | { | ||
68 | Test_Data *test_data = data; | 68 | Test_Data *test_data = data; | ||
69 | 69 | | |||
70 | DBG("Restart pressed"); | 70 | DBG("Restart pressed"); | ||
71 | test_clean(test_data); | 71 | test_clean(test_data); | ||
72 | _world_populate(test_data); | 72 | _world_populate(test_data); | ||
73 | } | 73 | } | ||
74 | 74 | | |||
75 | void | 75 | void | ||
76 | test_forces(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) | 76 | test_forces(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) | ||
77 | { | 77 | { | ||
78 | EPhysics_Body *boundary; | 78 | EPhysics_Body *boundary; | ||
79 | EPhysics_World *world; | 79 | EPhysics_World *world; | ||
80 | Test_Data *test_data; | 80 | Test_Data *test_data; | ||
81 | 81 | | |||
82 | if (!ephysics_init()) | 82 | if (!ephysics_init()) | ||
83 | return; | 83 | return; | ||
84 | 84 | | |||
Show All 30 Lines |