Changeset View
Changeset View
Standalone View
Standalone View
src/examples/ephysics/test_rotating_forever.c
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 38 | { | |||
---|---|---|---|---|---|
42 | ephysics_body_forces_clear(body); | 42 | ephysics_body_forces_clear(body); | ||
43 | obj = ephysics_body_evas_object_get(body); | 43 | obj = ephysics_body_evas_object_get(body); | ||
44 | evas_object_data_set(obj, "stop_timer", NULL); | 44 | evas_object_data_set(obj, "stop_timer", NULL); | ||
45 | 45 | | |||
46 | return EINA_FALSE; | 46 | return EINA_FALSE; | ||
47 | } | 47 | } | ||
48 | 48 | | |||
49 | static void | 49 | static void | ||
50 | _del_cb(void *data, EPhysics_Body *body __UNUSED__, void *event_info __UNUSED__) | 50 | _del_cb(void *data, EPhysics_Body *body EINA_UNUSED, void *event_info EINA_UNUSED) | ||
51 | { | 51 | { | ||
52 | ecore_timer_del(data); | 52 | ecore_timer_del(data); | ||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | static void | 55 | static void | ||
56 | _del_torque_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) | 56 | _del_torque_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) | ||
57 | { | 57 | { | ||
58 | Ecore_Timer *timer; | 58 | Ecore_Timer *timer; | ||
59 | 59 | | |||
60 | timer = evas_object_data_get(obj, "increase_timer"); | 60 | timer = evas_object_data_get(obj, "increase_timer"); | ||
61 | if (timer) | 61 | if (timer) | ||
62 | ecore_timer_del(timer); | 62 | ecore_timer_del(timer); | ||
63 | 63 | | |||
64 | timer = evas_object_data_get(obj, "stop_timer"); | 64 | timer = evas_object_data_get(obj, "stop_timer"); | ||
65 | if (timer) | 65 | if (timer) | ||
66 | ecore_timer_del(timer); | 66 | ecore_timer_del(timer); | ||
67 | } | 67 | } | ||
68 | 68 | | |||
69 | static void | 69 | static void | ||
70 | _update_object_cb(void *data __UNUSED__, EPhysics_Body *body, void *event_info __UNUSED__) | 70 | _update_object_cb(void *data EINA_UNUSED, EPhysics_Body *body, void *event_info EINA_UNUSED) | ||
71 | { | 71 | { | ||
72 | double rx, ry, rz, rw, vrot, torque; | 72 | double rx, ry, rz, rw, vrot, torque; | ||
73 | EPhysics_Quaternion quat; | 73 | EPhysics_Quaternion quat; | ||
74 | 74 | | |||
75 | ephysics_body_angular_velocity_get(body, NULL, NULL, &vrot); | 75 | ephysics_body_angular_velocity_get(body, NULL, NULL, &vrot); | ||
76 | ephysics_body_torques_get(body, NULL, NULL, &torque); | 76 | ephysics_body_torques_get(body, NULL, NULL, &torque); | ||
77 | 77 | | |||
78 | ephysics_body_rotation_get(body, &quat); | 78 | ephysics_body_rotation_get(body, &quat); | ||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 89 | { | |||
167 | 167 | | |||
168 | timer = ecore_timer_add(3, _increase_torque_cb, body); | 168 | timer = ecore_timer_add(3, _increase_torque_cb, body); | ||
169 | evas_object_data_set(cube, "increase_timer", timer); | 169 | evas_object_data_set(cube, "increase_timer", timer); | ||
170 | timer = ecore_timer_add(5, _stop_torque_cb, body); | 170 | timer = ecore_timer_add(5, _stop_torque_cb, body); | ||
171 | evas_object_data_set(cube, "stop_timer", timer); | 171 | evas_object_data_set(cube, "stop_timer", timer); | ||
172 | } | 172 | } | ||
173 | 173 | | |||
174 | static void | 174 | static void | ||
175 | _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) | 175 | _restart(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) | ||
176 | { | 176 | { | ||
177 | Test_Data *test_data = data; | 177 | Test_Data *test_data = data; | ||
178 | 178 | | |||
179 | DBG("Restart pressed"); | 179 | DBG("Restart pressed"); | ||
180 | test_clean(test_data); | 180 | test_clean(test_data); | ||
181 | _world_populate(test_data); | 181 | _world_populate(test_data); | ||
182 | } | 182 | } | ||
183 | 183 | | |||
184 | void | 184 | void | ||
185 | test_rotating_forever(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) | 185 | test_rotating_forever(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) | ||
186 | { | 186 | { | ||
187 | EPhysics_World *world; | 187 | EPhysics_World *world; | ||
188 | Test_Data *test_data; | 188 | Test_Data *test_data; | ||
189 | 189 | | |||
190 | if (!ephysics_init()) | 190 | if (!ephysics_init()) | ||
191 | return; | 191 | return; | ||
192 | 192 | | |||
193 | test_data = test_data_new(); | 193 | test_data = test_data_new(); | ||
Show All 13 Lines |