summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2012-10-04 22:40:07 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-04 22:40:07 +0000
commit1cb8f6fc0ca74194d673813183b188db61685467 (patch)
tree473ab26e23a534ae788b24bad69e3bbb998f8cbf /legacy
parentda4c5234f2215c4fbdf2db3378bd05d8bccf22d5 (diff)
EPhysics: multi point deformation
This patch introduces support for multi point deformation mapping, it's wrapped with an evas smart object to handle multiple slices. Patch by: Leandro Dorileo <dorileo@profusion.mobi> SVN revision: 77466
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ephysics/src/bin/test_soft_body.c36
-rw-r--r--legacy/ephysics/src/lib/EPhysics.h18
-rw-r--r--legacy/ephysics/src/lib/ephysics_body.cpp476
-rw-r--r--legacy/ephysics/src/lib/ephysics_private.h4
-rw-r--r--legacy/ephysics/src/lib/ephysics_trimesh.h591
5 files changed, 746 insertions, 379 deletions
diff --git a/legacy/ephysics/src/bin/test_soft_body.c b/legacy/ephysics/src/bin/test_soft_body.c
index 4a73670..7c11ec1 100644
--- a/legacy/ephysics/src/bin/test_soft_body.c
+++ b/legacy/ephysics/src/bin/test_soft_body.c
@@ -26,7 +26,33 @@ _world_populate(Test_Data *test_data)
26 evas_object_show(evas_obj); 26 evas_object_show(evas_obj);
27 test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj); 27 test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj);
28 28
29 fall_body = ephysics_body_circle_add(test_data->world); 29 fall_body = ephysics_body_soft_circle_add(test_data->world);
30 ephysics_body_soft_body_hardness_set(fall_body, 10);
31 ephysics_body_evas_object_set(fall_body, evas_obj, EINA_TRUE);
32 ephysics_body_restitution_set(fall_body, 0.95);
33 ephysics_body_friction_set(fall_body, 0.1);
34 ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE,
35 update_object_cb, shadow);
36 test_data->bodies = eina_list_append(test_data->bodies, fall_body);
37
38 shadow = elm_layout_add(test_data->win);
39 elm_layout_file_set(
40 shadow, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "shadow-ball");
41 evas_object_move(shadow, 200, FLOOR_Y);
42 evas_object_resize(shadow, 70, 3);
43 evas_object_show(shadow);
44 test_data->evas_objs = eina_list_append(test_data->evas_objs, shadow);
45
46 evas_obj = elm_image_add(test_data->win);
47 elm_image_file_set(evas_obj, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj",
48 "big-blue-ball");
49 evas_object_move(evas_obj, 300, 100);
50 evas_object_resize(evas_obj, 70, 70);
51 evas_object_show(evas_obj);
52 test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj);
53
54 fall_body = ephysics_body_soft_circle_add(test_data->world);
55 ephysics_body_soft_body_hardness_set(fall_body, 30);
30 ephysics_body_evas_object_set(fall_body, evas_obj, EINA_TRUE); 56 ephysics_body_evas_object_set(fall_body, evas_obj, EINA_TRUE);
31 ephysics_body_restitution_set(fall_body, 0.95); 57 ephysics_body_restitution_set(fall_body, 0.95);
32 ephysics_body_friction_set(fall_body, 0.1); 58 ephysics_body_friction_set(fall_body, 0.1);
@@ -45,7 +71,7 @@ _world_populate(Test_Data *test_data)
45 evas_obj = elm_image_add(test_data->win); 71 evas_obj = elm_image_add(test_data->win);
46 elm_image_file_set(evas_obj, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", 72 elm_image_file_set(evas_obj, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj",
47 "big-blue-ball"); 73 "big-blue-ball");
48 evas_object_move(evas_obj, 100, 100); 74 evas_object_move(evas_obj, 200, 10);
49 evas_object_resize(evas_obj, 70, 70); 75 evas_object_resize(evas_obj, 70, 70);
50 evas_object_show(evas_obj); 76 evas_object_show(evas_obj);
51 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);
@@ -76,12 +102,13 @@ _world_populate(Test_Data *test_data)
76 test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj); 102 test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj);
77 103
78 fall_body = ephysics_body_soft_box_add(test_data->world); 104 fall_body = ephysics_body_soft_box_add(test_data->world);
79 ephysics_body_soft_body_hardness_set(fall_body, 50); 105 ephysics_body_soft_body_hardness_set(fall_body, 10);
80 ephysics_body_evas_object_set(fall_body, evas_obj, EINA_TRUE); 106 evas_obj = ephysics_body_evas_object_set(fall_body, evas_obj, EINA_TRUE);
81 ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE, 107 ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE,
82 update_object_cb, shadow); 108 update_object_cb, shadow);
83 ephysics_body_restitution_set(fall_body, 0.5); 109 ephysics_body_restitution_set(fall_body, 0.5);
84 ephysics_body_friction_set(fall_body, 0.1); 110 ephysics_body_friction_set(fall_body, 0.1);
111 test_data->evas_objs = eina_list_append(test_data->evas_objs, evas_obj);
85 test_data->bodies = eina_list_append(test_data->bodies, fall_body); 112 test_data->bodies = eina_list_append(test_data->bodies, fall_body);
86} 113}
87 114
@@ -113,6 +140,7 @@ test_soft_body(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
113 elm_object_signal_emit(test_data->layout, "borders,show", "ephysics_test"); 140 elm_object_signal_emit(test_data->layout, "borders,show", "ephysics_test");
114 141
115 world = ephysics_world_new(); 142 world = ephysics_world_new();
143 ephysics_world_simulation_set(world, 1/150.f, 5);
116 ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40); 144 ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
117 test_data->world = world; 145 test_data->world = world;
118 146
diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h
index d102e2b..5e1809b 100644
--- a/legacy/ephysics/src/lib/EPhysics.h
+++ b/legacy/ephysics/src/lib/EPhysics.h
@@ -1578,12 +1578,16 @@ EAPI EPhysics_Body *ephysics_body_circle_add(EPhysics_World *world);
1578 * Just like rotation, deformation will be applied on associated 1578 * Just like rotation, deformation will be applied on associated
1579 * evas object using evas map. 1579 * evas object using evas map.
1580 * 1580 *
1581 * @note When working with soft bodies it's importante to adjust the simulation's
1582 * fixed time step due its multi point nature.
1583 *
1581 * For a rigid circle, check @ref ephysics_body_circle_add(). 1584 * For a rigid circle, check @ref ephysics_body_circle_add().
1582 * 1585 *
1583 * @param world The world this body will belongs to. 1586 * @param world The world this body will belongs to.
1584 * @return a new body or @c NULL, on errors. 1587 * @return a new body or @c NULL, on errors.
1585 * 1588 *
1586 * @see ephysics_body_del(). 1589 * @see ephysics_body_del().
1590 * @see ephysics_world_simulation_set().
1587 * 1591 *
1588 * @ingroup EPhysics_Body 1592 * @ingroup EPhysics_Body
1589 */ 1593 */
@@ -1619,6 +1623,9 @@ EAPI EPhysics_Body *ephysics_body_box_add(EPhysics_World *world);
1619 * Just like rotation, deformation will be applied on associated 1623 * Just like rotation, deformation will be applied on associated
1620 * evas object using evas map. 1624 * evas object using evas map.
1621 * 1625 *
1626 * @note When working with soft bodies it's importante to adjust the simulation's
1627 * fixed time step due its multi point nature.
1628 *
1622 * For a rigid circle, check @ref ephysics_body_circle_add(). 1629 * For a rigid circle, check @ref ephysics_body_circle_add().
1623 * 1630 *
1624 * @param world The world this body will belongs to. 1631 * @param world The world this body will belongs to.
@@ -1626,6 +1633,7 @@ EAPI EPhysics_Body *ephysics_body_box_add(EPhysics_World *world);
1626 * 1633 *
1627 * @see ephysics_body_del(). 1634 * @see ephysics_body_del().
1628 * @see ephysics_body_evas_object_set(). 1635 * @see ephysics_body_evas_object_set().
1636 * @see ephysics_world_simulation_set().
1629 * 1637 *
1630 * @ingroup EPhysics_Body 1638 * @ingroup EPhysics_Body
1631 */ 1639 */
@@ -1768,19 +1776,27 @@ EAPI EPhysics_World *ephysics_body_world_get(const EPhysics_Body *body);
1768 * updates of associated evas objects, or complement updates, like changing 1776 * updates of associated evas objects, or complement updates, like changing
1769 * evas objects properties under certain conditions of position or rotation. 1777 * evas objects properties under certain conditions of position or rotation.
1770 * 1778 *
1779 * Case @p body is a soft one a new evas_object will be returned, actually
1780 * this is an smart object which maps many slices of @p evas_obj to reflect
1781 * the soft body deformation.
1782 *
1771 * @param body The body to associate to an evas object. 1783 * @param body The body to associate to an evas object.
1772 * @param evas_obj The evas object that will be associated to this @p body. 1784 * @param evas_obj The evas object that will be associated to this @p body.
1773 * @param use_obj_pos If @c EINA_TRUE it will set the physics body position 1785 * @param use_obj_pos If @c EINA_TRUE it will set the physics body position
1774 * to match evas object position taking world rate on consideration. 1786 * to match evas object position taking world rate on consideration.
1787 * @return NULL on failure, @p evas_obj case @p body is a rigid body or a
1788 * new Evas_Object if @p body is a soft body.
1775 * 1789 *
1776 * @see ephysics_body_box_add(). 1790 * @see ephysics_body_box_add().
1791 * @see ephysics_body_soft_box_add().
1777 * @see ephysics_body_circle_add(). 1792 * @see ephysics_body_circle_add().
1793 * @see ephysics_body_soft_circle_add().
1778 * @see ephysics_body_evas_object_unset(). 1794 * @see ephysics_body_evas_object_unset().
1779 * @see ephysics_world_rate_set(). 1795 * @see ephysics_world_rate_set().
1780 * 1796 *
1781 * @ingroup EPhysics_Body 1797 * @ingroup EPhysics_Body
1782 */ 1798 */
1783EAPI void ephysics_body_evas_object_set(EPhysics_Body *body, Evas_Object *evas_obj, Eina_Bool use_obj_pos); 1799EAPI Evas_Object *ephysics_body_evas_object_set(EPhysics_Body *body, Evas_Object *evas_obj, Eina_Bool use_obj_pos);
1784 1800
1785/** 1801/**
1786 * @brief 1802 * @brief
diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp
index 803b138..954c951 100644
--- a/legacy/ephysics/src/lib/ephysics_body.cpp
+++ b/legacy/ephysics/src/lib/ephysics_body.cpp
@@ -32,6 +32,323 @@ struct _EPhysics_Body_Collision {
32 Evas_Coord y; 32 Evas_Coord y;
33}; 33};
34 34
35typedef struct _EPhysics_Body_Soft_Body_Slice
36{
37 int index;
38 Evas_Object *evas_obj;
39} EPhysics_Body_Soft_Body_Slice;
40
41static const Evas_Smart_Cb_Description _smart_callbacks[] =
42{
43 {"children,changed", "i"},
44 {NULL, NULL}
45};
46
47typedef struct _EPhysics_Body_Soft_Body_Smart_Data
48{
49 Evas_Object_Smart_Clipped_Data base;
50 Evas_Object *base_obj;
51 EPhysics_Body *body;
52 Eina_List *slices;
53} EPhysics_Body_Soft_Body_Smart_Data;
54
55#define SMART_CLASS_NAME "EPhysics_Body_Soft_Body"
56
57#define EPHYSICS_BODY_SOFT_BODY_SMART_DATA_GET(o, ptr) \
58 ptr = (EPhysics_Body_Soft_Body_Smart_Data *) evas_object_smart_data_get(o) \
59
60EVAS_SMART_SUBCLASS_NEW(SMART_CLASS_NAME,
61 _ephysics_body_soft_body_evas, Evas_Smart_Class,
62 Evas_Smart_Class, evas_object_smart_clipped_class_get,
63 _smart_callbacks);
64
65static void
66_ephysics_body_soft_body_slices_apply(Evas_Object *obj)
67{
68 double rate;
69 void *data;
70 Eina_List *l;
71 Evas_Coord x, y, h, wy, wh, y0, y1, y2, x0, x1, x2;
72 Evas_Map *map;
73 btVector3 p0, p1, p2;
74 btSoftBody::tFaceArray faces;
75 EPhysics_Body_Soft_Body_Slice *slice;
76 EPhysics_Body_Soft_Body_Smart_Data *smart_data;
77 EPhysics_Body *body;
78
79 EPHYSICS_BODY_SOFT_BODY_SMART_DATA_GET(obj, smart_data);
80 body = smart_data->body;
81 rate = ephysics_world_rate_get(body->world);
82 ephysics_world_render_geometry_get(body->world, NULL, &wy, NULL, &wh);
83 EINA_LIST_FOREACH(smart_data->slices, l, data)
84 {
85 slice = (EPhysics_Body_Soft_Body_Slice *)data;
86 evas_object_geometry_get(slice->evas_obj, &x, &y, NULL, &h);
87
88 faces = body->soft_body->m_faces;
89 p0 = faces[slice->index].m_n[0]->m_x;
90 p1 = faces[slice->index].m_n[1]->m_x;
91 p2 = faces[slice->index].m_n[2]->m_x;
92
93 y0 = wh + wy - (p0.y() * rate);
94 y1 = wh + wy - (p1.y() * rate);
95 y2 = wh + wy - (p2.y() * rate);
96
97 x0 = p0.x() * rate;
98 x1 = p1.x() * rate;
99 x2 = p2.x() * rate;
100
101 evas_object_map_enable_set(slice->evas_obj, EINA_FALSE);
102 map = (Evas_Map *)evas_object_map_get((const Evas_Object *)
103 slice->evas_obj);
104
105 evas_object_image_smooth_scale_set(slice->evas_obj, EINA_TRUE);
106
107 evas_map_point_coord_set(map, 0, x0, y0, 0);
108 evas_map_point_coord_set(map, 1, x1, y1, 0);
109 evas_map_point_coord_set(map, 2, x2, y2, 0);
110 evas_map_point_coord_set(map, 3, x2, y2, 0);
111
112 evas_object_map_set(slice->evas_obj, map);
113 evas_object_map_enable_set(slice->evas_obj, EINA_TRUE);
114 }
115}
116
117static EPhysics_Body_Soft_Body_Slice *
118_ephysics_body_soft_body_slice_new(int index, Evas_Object *evas_obj)
119{
120 EPhysics_Body_Soft_Body_Slice *slice;
121
122 slice = (EPhysics_Body_Soft_Body_Slice *)malloc(
123 sizeof(EPhysics_Body_Soft_Body_Slice));
124 if (!slice)
125 {
126 ERR("Couldn't allocate EPhysics_Soft_Body_Slice memory.");
127 return NULL;
128 }
129
130 slice->index = index;
131 slice->evas_obj = evas_obj;
132 return slice;
133}
134
135static Eina_Bool
136_ephysics_body_soft_body_slices_init(EPhysics_Body *body, Evas_Object *obj)
137{
138 double rate;
139 Evas_Coord x, y, w, h, wy, wh, y0, y1, y2, x0, x1, x2;
140 Evas_Map *map;
141 Evas *evas;
142 EPhysics_Body_Soft_Body_Smart_Data *smart_data;
143 btSoftBody::tFaceArray faces;
144 EPhysics_Body_Soft_Body_Slice *slice;
145 btVector3 p0, p1, p2;
146
147 evas = evas_object_evas_get(body->evas_obj);
148 EPHYSICS_BODY_SOFT_BODY_SMART_DATA_GET(obj, smart_data);
149 ephysics_world_render_geometry_get(body->world, NULL, &wy, NULL, &wh);
150 rate = ephysics_world_rate_get(body->world);
151
152 for (int i = 0; i < body->slices; i++)
153 {
154 slice = _ephysics_body_soft_body_slice_new(body->points_deform[i],
155 evas_object_image_filled_add(evas));
156
157 if (!slice)
158 return EINA_FALSE;
159
160 evas_object_image_source_set(slice->evas_obj, smart_data->base_obj);
161
162 evas_object_geometry_get(smart_data->base_obj, &x, &y, &w, &h);
163 evas_object_resize(slice->evas_obj, w, h);
164 evas_object_move(slice->evas_obj, x, y);
165 evas_object_show(slice->evas_obj);
166
167 faces = body->soft_body->m_faces;
168 p0 = faces[slice->index].m_n[0]->m_x;
169 p1 = faces[slice->index].m_n[1]->m_x;
170 p2 = faces[slice->index].m_n[2]->m_x;
171
172 y0 = wh + wy - (p0.y() * rate);
173 y1 = wh + wy - (p1.y() * rate);
174 y2 = wh + wy - (p2.y() * rate);
175
176 x0 = p0.x() * rate;
177 x1 = p1.x() * rate;
178 x2 = p2.x() * rate;
179
180 map = evas_map_new(4);
181 evas_map_util_points_populate_from_object(map, slice->evas_obj);
182
183 evas_map_point_image_uv_set(map, 0, x0 - x, y0 - y);
184 evas_map_point_image_uv_set(map, 1, x1 - x, y1 - y);
185 evas_map_point_image_uv_set(map, 2, x2 - x, y2 - y);
186 evas_map_point_image_uv_set(map, 3, x2 - x, y2 - y);
187
188 evas_map_point_coord_set(map, 0, x0, y0, 0);
189 evas_map_point_coord_set(map, 1, x1, y1, 0);
190 evas_map_point_coord_set(map, 2, x2, y2, 0);
191 evas_map_point_coord_set(map, 3, x2, y2, 0);
192
193 evas_object_map_set(slice->evas_obj, map);
194 evas_object_map_enable_set(slice->evas_obj, EINA_TRUE);
195 evas_map_free(map);
196
197 smart_data->slices = eina_list_append(smart_data->slices, slice);
198 evas_object_smart_member_add(slice->evas_obj, obj);
199 }
200
201 return EINA_TRUE;
202}
203
204static void
205_ephysics_body_soft_body_evas_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
206{
207 EPhysics_Body_Soft_Body_Smart_Data *smart_data;
208 Eina_List *l;
209 void *data;
210
211 EPHYSICS_BODY_SOFT_BODY_SMART_DATA_GET(obj, smart_data);
212 EINA_LIST_FOREACH(smart_data->slices, l, data)
213 {
214 EPhysics_Body_Soft_Body_Slice *slice;
215
216 slice = (EPhysics_Body_Soft_Body_Slice *)data;
217 evas_object_move(slice->evas_obj, x, y);
218 }
219 _ephysics_body_soft_body_slices_apply(obj);
220}
221
222static void
223_ephysics_body_soft_body_evas_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
224{
225 EPhysics_Body_Soft_Body_Smart_Data *smart_data;
226 Eina_List *l;
227 void *data;
228
229 EPHYSICS_BODY_SOFT_BODY_SMART_DATA_GET(obj, smart_data);
230 EINA_LIST_FOREACH(smart_data->slices, l, data)
231 {
232 EPhysics_Body_Soft_Body_Slice *slice;
233
234 slice = (EPhysics_Body_Soft_Body_Slice *)data;
235 evas_object_resize(slice->evas_obj, w, h);
236 }
237 _ephysics_body_soft_body_slices_apply(obj);
238}
239
240static void
241_ephysics_body_soft_body_evas_smart_hide(Evas_Object *obj)
242{
243 EPhysics_Body_Soft_Body_Smart_Data *smart_data;
244
245 EPHYSICS_BODY_SOFT_BODY_SMART_DATA_GET(obj, smart_data);
246 evas_object_hide(smart_data->base_obj);
247}
248
249static void
250_ephysics_body_soft_body_evas_smart_show(Evas_Object *obj)
251{
252 EPhysics_Body_Soft_Body_Smart_Data *smart_data;
253
254 EPHYSICS_BODY_SOFT_BODY_SMART_DATA_GET(obj, smart_data);
255 evas_object_show(smart_data->base_obj);
256}
257
258static void
259_ephysics_body_soft_body_evas_smart_del(Evas_Object *obj)
260{
261 EPhysics_Body_Soft_Body_Smart_Data *smart_data;
262 void *data;
263
264 EPHYSICS_BODY_SOFT_BODY_SMART_DATA_GET(obj, smart_data);
265 EINA_LIST_FREE(smart_data->slices, data)
266 {
267 EPhysics_Body_Soft_Body_Slice *slice;
268
269 slice = (EPhysics_Body_Soft_Body_Slice *)data;
270 evas_object_del(slice->evas_obj);
271 free(slice);
272 }
273 _ephysics_body_soft_body_evas_parent_sc->del(obj);
274}
275
276static void
277_ephysics_body_soft_body_evas_smart_calculate(Evas_Object *obj)
278{
279 EPhysics_Body_Soft_Body_Smart_Data *smart_data;
280 Evas_Coord x, y, w, h;
281 Eina_List *l;
282 void *data;
283
284 evas_object_geometry_get(obj, &x, &y, &w, &h);
285 EPHYSICS_BODY_SOFT_BODY_SMART_DATA_GET(obj, smart_data);
286 EINA_LIST_FOREACH(smart_data->slices, l, data)
287 {
288 EPhysics_Body_Soft_Body_Slice *slice;
289
290 slice = (EPhysics_Body_Soft_Body_Slice *)data;
291 evas_object_move(slice->evas_obj, x, y);
292 evas_object_resize(slice->evas_obj, w, h);
293 }
294}
295
296static void
297_ephysics_body_soft_body_evas_smart_add(Evas_Object *obj)
298{
299 EPhysics_Body_Soft_Body_Smart_Data *priv;
300
301 EPHYSICS_BODY_SOFT_BODY_SMART_DATA_GET(obj, priv);
302 if (!priv) {
303 priv = (EPhysics_Body_Soft_Body_Smart_Data *)calloc(1,
304 sizeof(EPhysics_Body_Soft_Body_Smart_Data));
305 if (!priv) return;
306 evas_object_smart_data_set(obj, priv);
307 }
308
309 _ephysics_body_soft_body_evas_parent_sc->add(obj);
310}
311
312static void
313_ephysics_body_soft_body_evas_smart_set_user(Evas_Smart_Class *sc)
314{
315 sc->add = _ephysics_body_soft_body_evas_smart_add;
316 sc->move = _ephysics_body_soft_body_evas_smart_move;
317 sc->del = _ephysics_body_soft_body_evas_smart_del;
318 sc->resize = _ephysics_body_soft_body_evas_smart_resize;
319 sc->hide = _ephysics_body_soft_body_evas_smart_hide;
320 sc->show = _ephysics_body_soft_body_evas_smart_show;
321 sc->calculate = _ephysics_body_soft_body_evas_smart_calculate;
322}
323
324static Evas_Object *
325_ephysics_body_soft_body_evas_add(EPhysics_Body *body)
326{
327 EPhysics_Body_Soft_Body_Smart_Data *priv;
328 Evas *evas;
329 Evas_Object *obj;
330 Evas_Coord x, y, w, h;
331
332 evas = evas_object_evas_get(body->evas_obj);
333 obj = evas_object_smart_add(evas,
334 _ephysics_body_soft_body_evas_smart_class_new());
335
336 EPHYSICS_BODY_SOFT_BODY_SMART_DATA_GET(obj, priv);
337 priv->base_obj = body->evas_obj;
338 priv->body = body;
339
340 evas_object_geometry_get(body->evas_obj, &x, &y, &w, &h);
341 evas_object_move(obj, x, y);
342 evas_object_resize(obj, w, h);
343 evas_object_show(obj);
344
345 if(!_ephysics_body_soft_body_slices_init(body, obj))
346 return NULL;
347
348 evas_object_move(priv->base_obj, 0, -h);
349 return obj;
350}
351
35static void 352static void
36_ephysics_body_forces_update(EPhysics_Body *body) 353_ephysics_body_forces_update(EPhysics_Body *body)
37{ 354{
@@ -288,32 +605,6 @@ _ephysics_body_evas_obj_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj
288} 605}
289 606
290static void 607static void
291_ephysics_body_soft_body_points_distance_get(const EPhysics_Body *body, double distances[4][3])
292{
293 btVector3 center;
294 btScalar raius;
295
296 body->soft_body->getCollisionShape()->getBoundingSphere(center, raius);
297
298 for (int m = 0; m < 4; m++)
299 {
300 for (int n = 0; n < 3; n++)
301 {
302 btVector3 node;
303 double distance;
304
305 node = body->soft_body->
306 m_faces[body->points_deform[m][n]].m_n[1]->m_x;
307
308 distance = sqrt(pow(center.x() - node.x(), 2) +
309 pow(center.y() - node.y(), 2));
310
311 distances[m][n] = distance;
312 }
313 }
314}
315
316static void
317_ephysics_body_soft_body_anchors_rebuild(int node, btRigidBody *rigid_body, btSoftBody *soft_body) 608_ephysics_body_soft_body_anchors_rebuild(int node, btRigidBody *rigid_body, btSoftBody *soft_body)
318{ 609{
319 btTransform world_trans = rigid_body->getWorldTransform(); 610 btTransform world_trans = rigid_body->getWorldTransform();
@@ -345,7 +636,6 @@ _ephysics_body_soft_body_constraints_rebuild(EPhysics_Body *body)
345 636
346 soft_body->generateClusters(0); 637 soft_body->generateClusters(0);
347 soft_body->generateBendingConstraints(10, soft_body->m_materials[0]); 638 soft_body->generateBendingConstraints(10, soft_body->m_materials[0]);
348 _ephysics_body_soft_body_points_distance_get(body, body->distances);
349} 639}
350 640
351inline static double 641inline static double
@@ -479,32 +769,6 @@ _ephysics_body_geometry_set(EPhysics_Body *body, Evas_Coord x, Evas_Coord y, Eva
479} 769}
480 770
481static void 771static void
482_ephysics_body_soft_body_deform(EPhysics_Body *body, double rate, Evas_Map *map)
483{
484 double curr_distances[4][3];
485
486 _ephysics_body_soft_body_points_distance_get(body, curr_distances);
487
488 for (int m = 0; m < 4; m++)
489 {
490 Evas_Coord px, py, pz;
491 double dx = 0, dy = 0;
492
493 evas_map_point_coord_get(map, m, &px, &py, &pz);
494
495 for (int n = 0; n < 3; n++)
496 {
497 double diff = (curr_distances[m][n] - body->distances[m][n]);
498 dx += diff;
499 dy += diff;
500 }
501
502 evas_map_point_coord_set(map, m, px - (dx * rate), py - (dy * rate),
503 pz);
504 }
505}
506
507static void
508_ephysics_body_evas_obj_resize_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) 772_ephysics_body_evas_obj_resize_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
509{ 773{
510 EPhysics_Body *body = (EPhysics_Body *) data; 774 EPhysics_Body *body = (EPhysics_Body *) data;
@@ -545,6 +809,8 @@ _ephysics_body_del(EPhysics_Body *body)
545 EINA_LIST_FREE(body->collision_groups, group) 809 EINA_LIST_FREE(body->collision_groups, group)
546 eina_stringshare_del((Eina_Stringshare *)group); 810 eina_stringshare_del((Eina_Stringshare *)group);
547 811
812 free(body->points_deform);
813
548 delete body->rigid_body->getMotionState(); 814 delete body->rigid_body->getMotionState();
549 delete body->collision_shape; 815 delete body->collision_shape;
550 delete body->rigid_body; 816 delete body->rigid_body;
@@ -587,15 +853,15 @@ _ephysics_body_evas_object_default_update(EPhysics_Body *body)
587 return; 853 return;
588 } 854 }
589 855
856 if (body->soft_body)
857 return;
858
590 rot = - trans.getRotation().getAngle() * RAD_TO_DEG * 859 rot = - trans.getRotation().getAngle() * RAD_TO_DEG *
591 trans.getRotation().getAxis().getZ(); 860 trans.getRotation().getAxis().getZ();
592 861
593 map = evas_map_new(4); 862 map = evas_map_new(4);
594 evas_map_util_points_populate_from_object(map, body->evas_obj); 863 evas_map_util_points_populate_from_object(map, body->evas_obj);
595 864
596 if (body->soft_body)
597 _ephysics_body_soft_body_deform(body, rate, map);
598
599 evas_map_util_rotate(map, rot, x + (w * body->cm.x), y + 865 evas_map_util_rotate(map, rot, x + (w * body->cm.x), y +
600 (h * body->cm.y)); 866 (h * body->cm.y));
601 evas_object_map_set(body->evas_obj, map); 867 evas_object_map_set(body->evas_obj, map);
@@ -749,10 +1015,10 @@ static void
749_ephysics_body_soft_body_hardness_set(EPhysics_Body *body, double hardness) 1015_ephysics_body_soft_body_hardness_set(EPhysics_Body *body, double hardness)
750{ 1016{
751 btSoftBody *soft_body = body->soft_body; 1017 btSoftBody *soft_body = body->soft_body;
752 soft_body->m_cfg.kAHR = (hardness / 100) * 0.6; 1018 soft_body->m_cfg.kAHR = (hardness / 1000) * 0.6;
753 soft_body->m_materials[0]->m_kVST = (hardness / 100); 1019 soft_body->m_materials[0]->m_kVST = (hardness / 1000);
754 soft_body->m_materials[0]->m_kLST = (hardness / 100); 1020 soft_body->m_materials[0]->m_kLST = (hardness / 1000);
755 soft_body->m_materials[0]->m_kAST = (hardness / 100); 1021 soft_body->m_materials[0]->m_kAST = (hardness / 1000);
756 DBG("Soft body %p hardness set to %lf.", body, hardness); 1022 DBG("Soft body %p hardness set to %lf.", body, hardness);
757} 1023}
758 1024
@@ -801,7 +1067,7 @@ ephysics_body_soft_body_hardness_get(const EPhysics_Body *body)
801} 1067}
802 1068
803static EPhysics_Body * 1069static EPhysics_Body *
804_ephysics_body_soft_add(EPhysics_World *world, btCollisionShape *collision_shape, btSoftBody *soft_body) 1070_ephysics_body_soft_body_add(EPhysics_World *world, btCollisionShape *collision_shape, btSoftBody *soft_body)
805{ 1071{
806 EPhysics_Body *body; 1072 EPhysics_Body *body;
807 1073
@@ -814,6 +1080,8 @@ _ephysics_body_soft_add(EPhysics_World *world, btCollisionShape *collision_shape
814 return NULL; 1080 return NULL;
815 } 1081 }
816 body->soft_body = soft_body; 1082 body->soft_body = soft_body;
1083
1084 body->soft_body->getCollisionShape()->setMargin(btScalar(0.02));
817 body->soft_body->setUserPointer(body); 1085 body->soft_body->setUserPointer(body);
818 body->soft_body->setTotalMass(body->mass); 1086 body->soft_body->setTotalMass(body->mass);
819 1087
@@ -821,7 +1089,6 @@ _ephysics_body_soft_add(EPhysics_World *world, btCollisionShape *collision_shape
821 body->soft_body->m_cfg.collisions += btSoftBody::fCollision::VF_SS; 1089 body->soft_body->m_cfg.collisions += btSoftBody::fCollision::VF_SS;
822 1090
823 _ephysics_body_soft_body_hardness_set(body, 100); 1091 _ephysics_body_soft_body_hardness_set(body, 100);
824
825 body->rigid_body->setCollisionFlags( 1092 body->rigid_body->setCollisionFlags(
826 btCollisionObject::CF_NO_CONTACT_RESPONSE); 1093 btCollisionObject::CF_NO_CONTACT_RESPONSE);
827 1094
@@ -837,6 +1104,8 @@ ephysics_body_soft_circle_add(EPhysics_World *world)
837 btCollisionShape *shape; 1104 btCollisionShape *shape;
838 btSoftBodyWorldInfo *world_info; 1105 btSoftBodyWorldInfo *world_info;
839 btSoftBody *soft_body; 1106 btSoftBody *soft_body;
1107 int points[19] = {16, 58, 44, 79, 97, 35, 6, 27, 45, 1, 38, 18, 21, 10, 26,
1108 7, 86, 37, 55};
840 1109
841 if (!world) 1110 if (!world)
842 { 1111 {
@@ -845,7 +1114,8 @@ ephysics_body_soft_circle_add(EPhysics_World *world)
845 } 1114 }
846 1115
847 ephysics_world_lock_take(world); 1116 ephysics_world_lock_take(world);
848 shape = new btCylinderShapeZ(btVector3(0.25, 0.25, 0.25)); 1117 shape = new btCylinderShapeZ(btVector3(0.5, 0.5, 0.5));
1118
849 if (!shape) 1119 if (!shape)
850 { 1120 {
851 ERR("Couldn't create a new cylinder shape."); 1121 ERR("Couldn't create a new cylinder shape.");
@@ -862,25 +1132,20 @@ ephysics_body_soft_circle_add(EPhysics_World *world)
862 goto no_soft_body; 1132 goto no_soft_body;
863 } 1133 }
864 1134
865 body = _ephysics_body_soft_add(world, shape, soft_body); 1135 body = _ephysics_body_soft_body_add(world, shape, soft_body);
866 if (!body) 1136 if (!body)
867 goto no_body; 1137 goto no_body;
868 1138
869 body->points_deform[0][0] = 72; 1139 body->slices = 19;
870 body->points_deform[0][1] = 69; 1140 body->points_deform = (int *)malloc(body->slices * sizeof(int));
871 body->points_deform[0][2] = 3; 1141 if (!body->points_deform)
872 1142 {
873 body->points_deform[1][0] = 72; 1143 ERR("Couldn't create points of deformation.");
874 body->points_deform[1][1] = 6; 1144 goto no_deform;
875 body->points_deform[1][2] = 65; 1145 }
876
877 body->points_deform[2][0] = 54;
878 body->points_deform[2][1] = 47;
879 body->points_deform[2][2] = 65;
880 1146
881 body->points_deform[3][0] = 57; 1147 for (int i = 0; i < body->slices; i++)
882 body->points_deform[3][1] = 3; 1148 body->points_deform[i] = points[i];
883 body->points_deform[3][2] = 76;
884 1149
885 ephysics_world_lock_release(world); 1150 ephysics_world_lock_release(world);
886 return body; 1151 return body;
@@ -889,6 +1154,8 @@ no_body:
889 delete soft_body; 1154 delete soft_body;
890no_soft_body: 1155no_soft_body:
891 delete shape; 1156 delete shape;
1157no_deform:
1158 ephysics_world_body_del(world, body);
892no_collision_shape: 1159no_collision_shape:
893 ephysics_world_lock_release(world); 1160 ephysics_world_lock_release(world);
894 return NULL; 1161 return NULL;
@@ -926,6 +1193,9 @@ ephysics_body_soft_box_add(EPhysics_World *world)
926 btCollisionShape *shape; 1193 btCollisionShape *shape;
927 btSoftBodyWorldInfo *world_info; 1194 btSoftBodyWorldInfo *world_info;
928 btSoftBody *soft_body; 1195 btSoftBody *soft_body;
1196 int points[16] = {14, 85, 88, 28, 41, 55, 10, 24, 93, 79, 56, 86, 91, 8,
1197 27, 1};
1198
929 1199
930 if (!world) 1200 if (!world)
931 { 1201 {
@@ -951,25 +1221,20 @@ ephysics_body_soft_box_add(EPhysics_World *world)
951 goto no_soft_body; 1221 goto no_soft_body;
952 } 1222 }
953 1223
954 body = _ephysics_body_soft_add(world, shape, soft_body); 1224 body = _ephysics_body_soft_body_add(world, shape, soft_body);
955 if (!body) 1225 if (!body)
956 goto no_body; 1226 goto no_body;
957 1227
958 body->points_deform[0][0] = 85; 1228 body->slices = 16;
959 body->points_deform[0][1] = 12; 1229 body->points_deform = (int *)malloc(body->slices * sizeof(int));
960 body->points_deform[0][2] = 30; 1230 if (!body->points_deform)
961 1231 {
962 body->points_deform[1][0] = 27; 1232 ERR("Couldn't create points of deformation.");
963 body->points_deform[1][1] = 80; 1233 goto no_deform;
964 body->points_deform[1][2] = 69; 1234 }
965
966 body->points_deform[2][0] = 50;
967 body->points_deform[2][1] = 40;
968 body->points_deform[2][2] = 60;
969 1235
970 body->points_deform[3][0] = 18; 1236 for (int i = 0; i < body->slices; i++)
971 body->points_deform[3][1] = 62; 1237 body->points_deform[i] = points[i];
972 body->points_deform[3][2] = 8;
973 1238
974 ephysics_world_lock_release(world); 1239 ephysics_world_lock_release(world);
975 return body; 1240 return body;
@@ -978,6 +1243,8 @@ no_body:
978 delete soft_body; 1243 delete soft_body;
979no_soft_body: 1244no_soft_body:
980 delete shape; 1245 delete shape;
1246no_deform:
1247 ephysics_world_body_del(world, body);
981no_collision_shape: 1248no_collision_shape:
982 ephysics_world_lock_release(world); 1249 ephysics_world_lock_release(world);
983 return NULL; 1250 return NULL;
@@ -1244,7 +1511,7 @@ ephysics_body_del(EPhysics_Body *body)
1244 ephysics_world_lock_release(body->world); 1511 ephysics_world_lock_release(body->world);
1245} 1512}
1246 1513
1247EAPI void 1514EAPI Evas_Object *
1248ephysics_body_evas_object_set(EPhysics_Body *body, Evas_Object *evas_obj, Eina_Bool use_obj_pos) 1515ephysics_body_evas_object_set(EPhysics_Body *body, Evas_Object *evas_obj, Eina_Bool use_obj_pos)
1249{ 1516{
1250 int obj_x, obj_y, obj_w, obj_h; 1517 int obj_x, obj_y, obj_w, obj_h;
@@ -1252,13 +1519,13 @@ ephysics_body_evas_object_set(EPhysics_Body *body, Evas_Object *evas_obj, Eina_B
1252 if (!body) 1519 if (!body)
1253 { 1520 {
1254 ERR("Can't set evas object to body, the last wasn't provided."); 1521 ERR("Can't set evas object to body, the last wasn't provided.");
1255 return; 1522 return NULL;
1256 } 1523 }
1257 1524
1258 if (!evas_obj) 1525 if (!evas_obj)
1259 { 1526 {
1260 ERR("Can't set evas object to body, the first wasn't provided."); 1527 ERR("Can't set evas object to body, the first wasn't provided.");
1261 return; 1528 return NULL;
1262 } 1529 }
1263 1530
1264 if (body->evas_obj) 1531 if (body->evas_obj)
@@ -1271,19 +1538,32 @@ ephysics_body_evas_object_set(EPhysics_Body *body, Evas_Object *evas_obj, Eina_B
1271 1538
1272 body->evas_obj = evas_obj; 1539 body->evas_obj = evas_obj;
1273 1540
1541
1274 evas_object_event_callback_add(evas_obj, EVAS_CALLBACK_DEL, 1542 evas_object_event_callback_add(evas_obj, EVAS_CALLBACK_DEL,
1275 _ephysics_body_evas_obj_del_cb, body); 1543 _ephysics_body_evas_obj_del_cb, body);
1276 1544
1277 if (!use_obj_pos) 1545 if (!use_obj_pos)
1278 return; 1546 return evas_obj;
1279 1547
1280 evas_object_geometry_get(body->evas_obj, &obj_x, &obj_y, &obj_w, &obj_h); 1548 evas_object_geometry_get(body->evas_obj, &obj_x, &obj_y, &obj_w, &obj_h);
1281 ephysics_world_lock_take(body->world); 1549 ephysics_world_lock_take(body->world);
1282 _ephysics_body_geometry_set(body, obj_x, obj_y, obj_w, obj_h, 1550 _ephysics_body_geometry_set(body, obj_x, obj_y, obj_w, obj_h,
1283 ephysics_world_rate_get(body->world)); 1551 ephysics_world_rate_get(body->world));
1552
1553 if (body->soft_body)
1554 {
1555 body->evas_obj = _ephysics_body_soft_body_evas_add(body);
1556 evas_object_event_callback_del(evas_obj, EVAS_CALLBACK_DEL,
1557 _ephysics_body_evas_obj_del_cb);
1558 evas_object_event_callback_add(body->evas_obj, EVAS_CALLBACK_DEL,
1559 _ephysics_body_evas_obj_del_cb, body);
1560 }
1561
1284 ephysics_world_lock_release(body->world); 1562 ephysics_world_lock_release(body->world);
1285 evas_object_event_callback_add(evas_obj, EVAS_CALLBACK_RESIZE, 1563 evas_object_event_callback_add(body->evas_obj, EVAS_CALLBACK_RESIZE,
1286 _ephysics_body_evas_obj_resize_cb, body); 1564 _ephysics_body_evas_obj_resize_cb, body);
1565
1566 return evas_obj;
1287} 1567}
1288 1568
1289EAPI Evas_Object * 1569EAPI Evas_Object *
diff --git a/legacy/ephysics/src/lib/ephysics_private.h b/legacy/ephysics/src/lib/ephysics_private.h
index 358c720..91e4de8 100644
--- a/legacy/ephysics/src/lib/ephysics_private.h
+++ b/legacy/ephysics/src/lib/ephysics_private.h
@@ -93,8 +93,8 @@ struct _EPhysics_Body {
93 } cm; 93 } cm;
94 Eina_Bool active:1; 94 Eina_Bool active:1;
95 Eina_Bool deleted:1; 95 Eina_Bool deleted:1;
96 double distances[4][3]; 96 int slices;
97 int points_deform[4][3]; 97 int *points_deform;
98}; 98};
99 99
100extern int _ephysics_log_dom; 100extern int _ephysics_log_dom;
diff --git a/legacy/ephysics/src/lib/ephysics_trimesh.h b/legacy/ephysics/src/lib/ephysics_trimesh.h
index 3d17c40..975cb1c 100644
--- a/legacy/ephysics/src/lib/ephysics_trimesh.h
+++ b/legacy/ephysics/src/lib/ephysics_trimesh.h
@@ -1,292 +1,335 @@
1#ifndef EPHYSICS_TRIMESH_H 1#ifndef EPHYSICS_TRIMESH_H
2#define EPHYSICS_TRIMESH_H 2#define EPHYSICS_TRIMESH_H
3 3
4#define CYLINDER_NUM_VERTICES 46 4#define CYLINDER_NUM_VERTICES 58
5#define CYLINDER_NUM_TRIANGLES 80 5#define CYLINDER_NUM_TRIANGLES 104
6 6
7static btScalar cylinder_vertices[CYLINDER_NUM_VERTICES * 3] = { 7static btScalar cylinder_vertices[CYLINDER_NUM_VERTICES * 3] = {
8 btScalar(0.378791), btScalar(-0.156900), btScalar(0.410000), 8 btScalar(0.508134), btScalar(-0.210476), btScalar(0.550000),
9 btScalar(0.381661), btScalar(0.142468), btScalar(0.410000), 9 btScalar(0.530611), btScalar(0.097476), btScalar(0.550000),
10 btScalar(0.205276), btScalar(0.346467), btScalar(0.410000), 10 btScalar(0.406474), btScalar(0.362621), btScalar(0.550000),
11 btScalar(-0.062845), btScalar(0.397499), btScalar(0.410000), 11 btScalar(0.165687), btScalar(0.517043), btScalar(0.550000),
12 btScalar(-0.312196), btScalar(0.256566), btScalar(0.410000), 12 btScalar(-0.145614), btScalar(0.521036), btScalar(0.550000),
13 btScalar(-0.409345), btScalar(0.003295), btScalar(0.410000), 13 btScalar(-0.405485), btScalar(0.364100), btScalar(0.550000),
14 btScalar(-0.315929), btScalar(-0.250980), btScalar(0.410000), 14 btScalar(-0.536816), btScalar(0.066283), btScalar(0.550000),
15 btScalar(-0.085737), btScalar(-0.392946), btScalar(0.410000), 15 btScalar(-0.491202), btScalar(-0.235817), btScalar(0.550000),
16 btScalar(0.181088), btScalar(-0.362629), btScalar(0.410000), 16 btScalar(-0.289243), btScalar(-0.455503), btScalar(0.550000),
17 btScalar(0.378791), btScalar(-0.156900), btScalar(-0.410000), 17 btScalar(0.018444), btScalar(-0.546331), btScalar(0.550000),
18 btScalar(0.183474), btScalar(-0.361035), btScalar(-0.410000), 18 btScalar(0.321449), btScalar(-0.433984), btScalar(0.550000),
19 btScalar(-0.085737), btScalar(-0.392946), btScalar(-0.410000), 19 btScalar(0.508134), btScalar(-0.210476), btScalar(-0.550000),
20 btScalar(-0.315929), btScalar(-0.250980), btScalar(-0.410000), 20 btScalar(0.321449), btScalar(-0.433984), btScalar(-0.550000),
21 btScalar(-0.409345), btScalar(0.003295), btScalar(-0.410000), 21 btScalar(0.023871), btScalar(-0.545252), btScalar(-0.550000),
22 btScalar(-0.312196), btScalar(0.256566), btScalar(-0.410000), 22 btScalar(-0.289243), btScalar(-0.455503), btScalar(-0.550000),
23 btScalar(-0.062845), btScalar(0.397499), btScalar(-0.410000), 23 btScalar(-0.490465), btScalar(-0.236920), btScalar(-0.550000),
24 btScalar(0.204218), btScalar(0.347174), btScalar(-0.410000), 24 btScalar(-0.537432), btScalar(0.063186), btScalar(-0.550000),
25 btScalar(0.381661), btScalar(0.142468), btScalar(-0.410000), 25 btScalar(-0.407240), btScalar(0.361475), btScalar(-0.550000),
26 btScalar(0.197462), btScalar(0.068348), btScalar(0.410000), 26 btScalar(-0.145614), btScalar(0.521036), btScalar(-0.550000),
27 btScalar(-0.036961), btScalar(0.150675), btScalar(0.410000), 27 btScalar(0.162590), btScalar(0.517659), btScalar(-0.550000),
28 btScalar(0.067713), btScalar(-0.147128), btScalar(0.410000), 28 btScalar(0.405750), btScalar(0.363704), btScalar(-0.550000),
29 btScalar(-0.178972), btScalar(-0.060078), btScalar(0.410000), 29 btScalar(0.529995), btScalar(0.100572), btScalar(-0.550000),
30 btScalar(0.120907), btScalar(-0.105917), btScalar(-0.410000), 30 btScalar(0.225162), btScalar(-0.126432), btScalar(0.550000),
31 btScalar(-0.151098), btScalar(-0.043779), btScalar(-0.410000), 31 btScalar(0.182505), btScalar(0.180319), btScalar(0.550000),
32 btScalar(0.039171), btScalar(0.161620), btScalar(-0.410000), 32 btScalar(-0.135548), btScalar(0.257663), btScalar(0.550000),
33 btScalar(0.311630), btScalar(-0.257414), btScalar(0.203297), 33 btScalar(-0.128146), btScalar(-0.029182), btScalar(0.550000),
34 btScalar(-0.392051), btScalar(0.090235), btScalar(0.134737), 34 btScalar(-0.047689), btScalar(-0.299859), btScalar(0.550000),
35 btScalar(-0.360756), btScalar(-0.183891), btScalar(0.144512), 35 btScalar(0.192370), btScalar(-0.050817), btScalar(-0.550000),
36 btScalar(-0.141439), btScalar(-0.381866), btScalar(0.155320), 36 btScalar(-0.080199), btScalar(-0.257948), btScalar(-0.550000),
37 btScalar(0.110283), btScalar(-0.388063), btScalar(0.161516), 37 btScalar(-0.229392), btScalar(0.019540), btScalar(-0.550000),
38 btScalar(0.320615), btScalar(-0.243966), btScalar(-0.082931), 38 btScalar(-0.034804), btScalar(0.258372), btScalar(-0.550000),
39 btScalar(0.043971), btScalar(-0.401254), btScalar(-0.106715), 39 btScalar(0.241500), btScalar(0.226175), btScalar(-0.550000),
40 btScalar(-0.237476), btScalar(-0.324952), btScalar(-0.131440), 40 btScalar(0.532902), btScalar(-0.085955), btScalar(0.216643),
41 btScalar(-0.392954), btScalar(-0.085698), btScalar(-0.130760), 41 btScalar(0.483467), btScalar(0.247392), btScalar(0.234226),
42 btScalar(-0.355705), btScalar(0.191451), btScalar(-0.132884), 42 btScalar(0.278528), btScalar(0.462663), btScalar(0.218255),
43 btScalar(-0.115651), btScalar(0.386996), btScalar(-0.130213), 43 btScalar(-0.041739), btScalar(0.541698), btScalar(0.182347),
44 btScalar(0.169937), btScalar(0.370080), btScalar(-0.151207), 44 btScalar(-0.330369), btScalar(0.428024), btScalar(0.180626),
45 btScalar(0.388128), btScalar(0.109959), btScalar(-0.173023), 45 btScalar(-0.518580), btScalar(0.157959), btScalar(0.172947),
46 btScalar(0.401935), btScalar(-0.040547), btScalar(0.142301), 46 btScalar(-0.521671), btScalar(-0.142420), btScalar(0.183206),
47 btScalar(0.319544), btScalar(0.245570), btScalar(0.129082), 47 btScalar(-0.340102), btScalar(-0.421520), btScalar(0.186658),
48 btScalar(0.058047), btScalar(0.398454), btScalar(0.125903), 48 btScalar(-0.046556), btScalar(-0.540740), btScalar(0.196846),
49 btScalar(-0.223604), btScalar(0.334221), btScalar(0.131019), 49 btScalar(0.325206), btScalar(-0.431473), btScalar(0.238916),
50 btScalar(-0.118588), btScalar(-0.126284), btScalar(-0.116393), 50 btScalar(0.479824), btScalar(-0.252844), btScalar(-0.162453),
51 btScalar(0.107303), btScalar(0.062176), btScalar(0.066999), 51 btScalar(0.184507), btScalar(-0.513299), btScalar(-0.136220),
52 btScalar(-0.052534), btScalar(0.162121), btScalar(-0.154024), 52 btScalar(-0.159624), btScalar(-0.518249), btScalar(-0.150107),
53 btScalar(-0.027084), btScalar(-0.147475), btScalar(0.173698), 53 btScalar(-0.426985), btScalar(-0.331923), btScalar(-0.168222),
54 btScalar(-0.541617), btScalar(-0.042144), btScalar(-0.168426),
55 btScalar(-0.470990), btScalar(0.266065), btScalar(-0.185909),
56 btScalar(-0.239361), btScalar(0.488834), btScalar(-0.187932),
57 btScalar(0.134846), btScalar(0.523178), btScalar(-0.152636),
58 btScalar(0.397364), btScalar(0.376254), btScalar(-0.269892),
59 btScalar(0.531212), btScalar(0.094456), btScalar(-0.324493),
60 btScalar(0.382010), btScalar(0.393518), btScalar(-0.011940),
61 btScalar(0.523986), btScalar(0.130780), btScalar(-0.048009),
62 btScalar(0.041379), btScalar(-0.196807), btScalar(0.054210),
63 btScalar(0.013146), btScalar(0.357496), btScalar(0.024686),
64 btScalar(-0.047077), btScalar(0.119424), btScalar(-0.167934),
65 btScalar(0.055271), btScalar(0.158920), btScalar(0.227414),
54}; 66};
55 67
56static int cylinder_indices[CYLINDER_NUM_TRIANGLES][3] = { 68static int cylinder_indices[CYLINDER_NUM_TRIANGLES][3] = {
57 {0, 1, 18}, 69 {0, 1, 22},
58 {1, 2, 18}, 70 {1, 2, 23},
59 {2, 3, 19}, 71 {22, 1, 23},
60 {18, 2, 19}, 72 {2, 3, 23},
61 {3, 4, 19}, 73 {3, 4, 24},
62 {8, 0, 20}, 74 {23, 3, 24},
63 {7, 8, 20}, 75 {4, 5, 24},
64 {0, 18, 20}, 76 {10, 0, 22},
65 {4, 5, 21}, 77 {25, 24, 6},
66 {19, 4, 21}, 78 {5, 6, 24},
67 {5, 6, 21}, 79 {6, 7, 25},
68 {6, 7, 21}, 80 {7, 8, 26},
69 {7, 20, 21}, 81 {25, 7, 26},
70 {18, 19, 20}, 82 {8, 9, 26},
71 {20, 19, 21}, 83 {22, 26, 10},
72 {9, 10, 22}, 84 {9, 10, 26},
73 {10, 11, 22}, 85 {26, 22, 25},
74 {11, 12, 23}, 86 {22, 23, 25},
75 {22, 11, 23}, 87 {23, 24, 25},
76 {12, 13, 23}, 88 {11, 12, 27},
77 {17, 9, 22}, 89 {13, 28, 12},
78 {13, 14, 23}, 90 {13, 14, 28},
79 {14, 15, 24}, 91 {27, 12, 28},
80 {23, 14, 24}, 92 {14, 15, 28},
81 {15, 16, 24}, 93 {15, 16, 29},
82 {16, 17, 24}, 94 {28, 15, 29},
83 {17, 22, 24}, 95 {16, 17, 29},
84 {23, 24, 22}, 96 {21, 11, 27},
85 {0, 8, 25}, 97 {17, 18, 30},
86 {5, 4, 26}, 98 {29, 17, 30},
87 {6, 5, 27}, 99 {18, 19, 30},
88 {5, 26, 27}, 100 {19, 20, 31},
89 {7, 6, 28}, 101 {30, 19, 31},
90 {6, 27, 28}, 102 {20, 21, 31},
91 {8, 7, 29}, 103 {31, 21, 27},
92 {25, 8, 29}, 104 {30, 31, 27},
93 {7, 28, 29}, 105 {28, 29, 27},
94 {10, 9, 30}, 106 {30, 27, 29},
95 {11, 10, 31}, 107 {1, 0, 32},
96 {10, 30, 31}, 108 {2, 1, 33},
97 {12, 11, 32}, 109 {1, 32, 33},
98 {11, 31, 32}, 110 {3, 2, 34},
99 {13, 12, 33}, 111 {2, 33, 34},
100 {12, 32, 33}, 112 {4, 3, 35},
101 {14, 13, 34}, 113 {3, 34, 35},
102 {13, 33, 34}, 114 {5, 4, 36},
103 {15, 14, 35}, 115 {4, 35, 36},
104 {14, 34, 35}, 116 {6, 5, 37},
105 {16, 15, 36}, 117 {5, 36, 37},
106 {15, 35, 36}, 118 {7, 6, 38},
107 {17, 16, 37}, 119 {6, 37, 38},
108 {16, 36, 37}, 120 {8, 7, 39},
109 {1, 0, 38}, 121 {7, 38, 39},
110 {2, 1, 39}, 122 {9, 8, 40},
111 {3, 2, 40}, 123 {8, 39, 40},
112 {4, 3, 41}, 124 {10, 9, 41},
113 {26, 4, 41}, 125 {9, 40, 41},
114 {3, 40, 41}, 126 {12, 11, 42},
115 {1, 38, 39}, 127 {13, 12, 43},
116 {17, 37, 9}, 128 {12, 42, 43},
117 {38, 0, 25}, 129 {14, 13, 44},
118 {30, 9, 37}, 130 {13, 43, 44},
119 {40, 2, 39}, 131 {15, 14, 45},
120 {39, 38, 37}, 132 {14, 44, 45},
121 {28, 27, 32}, 133 {16, 15, 46},
122 {31, 30, 29}, 134 {15, 45, 46},
123 {32, 31, 28}, 135 {17, 16, 47},
124 {33, 32, 27}, 136 {16, 46, 47},
125 {34, 33, 26}, 137 {18, 17, 48},
126 {36, 35, 40}, 138 {17, 47, 48},
127 {37, 36, 39}, 139 {19, 18, 49},
128 {30, 37, 38}, 140 {18, 48, 49},
129 {34, 26, 41}, 141 {20, 19, 50},
130 {27, 26, 33}, 142 {19, 49, 50},
131 {40, 39, 36}, 143 {21, 20, 51},
132 {28, 31, 29}, 144 {20, 50, 51},
133 {40, 35, 41}, 145 {10, 41, 0},
134 {30, 38, 25}, 146 {21, 51, 11},
135 {25, 29, 30}, 147 {0, 41, 32},
136 {41, 35, 34}, 148 {11, 51, 42},
149 {34, 33, 52},
150 {35, 34, 49},
151 {36, 35, 48},
152 {37, 36, 47},
153 {38, 37, 46},
154 {39, 38, 45},
155 {40, 39, 44},
156 {41, 40, 43},
157 {48, 35, 49},
158 {44, 43, 40},
159 {45, 44, 39},
160 {46, 45, 38},
161 {47, 46, 37},
162 {48, 47, 36},
163 {50, 49, 52},
164 {51, 50, 53},
165 {50, 52, 53},
166 {33, 32, 53},
167 {43, 42, 41},
168 {41, 42, 32},
169 {52, 49, 34},
170 {33, 53, 52},
171 {32, 42, 53},
172 {42, 51, 53},
137}; 173};
138 174
139#define CUBE_NUM_VERTICES 54 175#define CUBE_NUM_VERTICES 61
140#define CUBE_NUM_TRIANGLES 90 176#define CUBE_NUM_TRIANGLES 96
141 177
142static btScalar cube_vertices[CUBE_NUM_VERTICES * 3] = { 178static btScalar cube_vertices[CUBE_NUM_VERTICES * 3] = {
143 btScalar(0.400000), btScalar(-0.400000), btScalar(-0.400000), 179 btScalar(0.550000), btScalar(-0.550000), btScalar(-0.550000),
144 btScalar(0.400000), btScalar(-0.400000), btScalar(-0.129695), 180 btScalar(0.550000), btScalar(-0.550000), btScalar(-0.215571),
145 btScalar(0.400000), btScalar(-0.400000), btScalar(0.157468), 181 btScalar(0.550000), btScalar(-0.550000), btScalar(0.149207),
146 btScalar(0.400000), btScalar(-0.400000), btScalar(0.400000), 182 btScalar(0.550000), btScalar(-0.550000), btScalar(0.550000),
147 btScalar(-0.400000), btScalar(-0.400000), btScalar(-0.400000), 183 btScalar(-0.550000), btScalar(-0.550000), btScalar(-0.550000),
148 btScalar(-0.137266), btScalar(-0.400000), btScalar(-0.400000), 184 btScalar(-0.215767), btScalar(-0.550000), btScalar(-0.550000),
149 btScalar(0.142832), btScalar(-0.400000), btScalar(-0.400000), 185 btScalar(0.178583), btScalar(-0.550000), btScalar(-0.550000),
150 btScalar(-0.400000), btScalar(-0.400000), btScalar(0.400000), 186 btScalar(-0.550000), btScalar(-0.550000), btScalar(0.550000),
151 btScalar(-0.400000), btScalar(-0.400000), btScalar(0.144537), 187 btScalar(-0.550000), btScalar(-0.550000), btScalar(0.205306),
152 btScalar(-0.400000), btScalar(-0.400000), btScalar(-0.132810), 188 btScalar(-0.550000), btScalar(-0.550000), btScalar(-0.180403),
153 btScalar(0.147946), btScalar(-0.400000), btScalar(0.400000), 189 btScalar(0.213790), btScalar(-0.550000), btScalar(0.550000),
154 btScalar(-0.127038), btScalar(-0.400000), btScalar(0.400000), 190 btScalar(-0.152594), btScalar(-0.550000), btScalar(0.550000),
155 btScalar(0.400000), btScalar(-0.156914), btScalar(-0.400000), 191 btScalar(0.550000), btScalar(-0.171346), btScalar(-0.550000),
156 btScalar(0.400000), btScalar(0.110878), btScalar(-0.400000), 192 btScalar(0.550000), btScalar(0.218404), btScalar(-0.550000),
157 btScalar(0.400000), btScalar(0.400000), btScalar(-0.400000), 193 btScalar(0.550000), btScalar(0.550000), btScalar(-0.550000),
158 btScalar(0.400000), btScalar(0.400000), btScalar(0.400000), 194 btScalar(0.550000), btScalar(0.550000), btScalar(0.550000),
159 btScalar(0.400000), btScalar(0.143565), btScalar(0.400000), 195 btScalar(0.550000), btScalar(0.216178), btScalar(0.550000),
160 btScalar(0.400000), btScalar(-0.142881), btScalar(0.400000), 196 btScalar(0.550000), btScalar(-0.168604), btScalar(0.550000),
161 btScalar(0.400000), btScalar(0.400000), btScalar(-0.142285), 197 btScalar(0.550000), btScalar(0.550000), btScalar(-0.230974),
162 btScalar(0.400000), btScalar(0.400000), btScalar(0.142285), 198 btScalar(0.550000), btScalar(0.550000), btScalar(0.154825),
163 btScalar(-0.400000), btScalar(-0.155504), btScalar(-0.400000), 199 btScalar(-0.550000), btScalar(-0.201191), btScalar(-0.550000),
164 btScalar(-0.400000), btScalar(0.143304), btScalar(-0.400000), 200 btScalar(-0.550000), btScalar(0.180873), btScalar(-0.550000),
165 btScalar(-0.400000), btScalar(0.400000), btScalar(-0.400000), 201 btScalar(-0.550000), btScalar(0.550000), btScalar(-0.550000),
166 btScalar(-0.137266), btScalar(0.400000), btScalar(-0.400000), 202 btScalar(-0.167045), btScalar(0.550000), btScalar(-0.550000),
167 btScalar(0.142832), btScalar(0.400000), btScalar(-0.400000), 203 btScalar(0.207428), btScalar(0.550000), btScalar(-0.550000),
168 btScalar(-0.400000), btScalar(0.400000), btScalar(0.400000), 204 btScalar(-0.550000), btScalar(0.550000), btScalar(0.550000),
169 btScalar(-0.400000), btScalar(0.123157), btScalar(0.400000), 205 btScalar(-0.550000), btScalar(0.235945), btScalar(0.550000),
170 btScalar(-0.400000), btScalar(-0.151643), btScalar(0.400000), 206 btScalar(-0.550000), btScalar(-0.152540), btScalar(0.550000),
171 btScalar(0.147946), btScalar(0.400000), btScalar(0.400000), 207 btScalar(0.202185), btScalar(0.550000), btScalar(0.550000),
172 btScalar(-0.127038), btScalar(0.400000), btScalar(0.400000), 208 btScalar(-0.178486), btScalar(0.550000), btScalar(0.550000),
173 btScalar(-0.400000), btScalar(0.400000), btScalar(-0.145673), 209 btScalar(-0.550000), btScalar(0.550000), btScalar(-0.200119),
174 btScalar(-0.400000), btScalar(0.400000), btScalar(0.145673), 210 btScalar(-0.550000), btScalar(0.550000), btScalar(0.178238),
175 btScalar(0.149457), btScalar(-0.400000), btScalar(0.029476), 211 btScalar(0.183518), btScalar(-0.550000), btScalar(-0.048608),
176 btScalar(-0.118651), btScalar(-0.400000), btScalar(-0.091520), 212 btScalar(-0.193942), btScalar(-0.550000), btScalar(-0.265714),
177 btScalar(-0.116729), btScalar(-0.400000), btScalar(0.185444), 213 btScalar(-0.176127), btScalar(-0.550000), btScalar(0.121548),
178 btScalar(0.400000), btScalar(-0.030750), btScalar(0.108353), 214 btScalar(0.550000), btScalar(-0.228480), btScalar(-0.211018),
179 btScalar(0.400000), btScalar(-0.017128), btScalar(-0.173998), 215 btScalar(0.550000), btScalar(0.115197), btScalar(-0.269727),
180 btScalar(-0.098445), btScalar(-0.123516), btScalar(-0.400000), 216 btScalar(0.550000), btScalar(0.087351), btScalar(0.133224),
181 btScalar(0.189421), btScalar(-0.129196), btScalar(-0.400000), 217 btScalar(0.019637), btScalar(-0.192951), btScalar(-0.550000),
182 btScalar(0.028300), btScalar(0.131810), btScalar(-0.400000), 218 btScalar(0.260210), btScalar(0.183806), btScalar(-0.550000),
183 btScalar(-0.121334), btScalar(-0.101441), btScalar(0.400000), 219 btScalar(-0.127158), btScalar(0.171482), btScalar(-0.550000),
184 btScalar(0.149876), btScalar(0.018849), btScalar(0.400000), 220 btScalar(-0.144513), btScalar(-0.112619), btScalar(0.550000),
185 btScalar(-0.114236), btScalar(0.180350), btScalar(0.400000), 221 btScalar(0.201326), btScalar(0.040933), btScalar(0.550000),
186 btScalar(0.140128), btScalar(0.400000), btScalar(0.051515), 222 btScalar(-0.167096), btScalar(0.273800), btScalar(0.550000),
187 btScalar(-0.119461), btScalar(0.400000), btScalar(-0.055704), 223 btScalar(0.207212), btScalar(0.550000), btScalar(-0.049764),
188 btScalar(-0.400000), btScalar(-0.140426), btScalar(-0.044838), 224 btScalar(-0.148416), btScalar(0.550000), btScalar(-0.261736),
189 btScalar(-0.400000), btScalar(0.123997), btScalar(0.045044), 225 btScalar(-0.150781), btScalar(0.550000), btScalar(0.120466),
190 btScalar(-0.157858), btScalar(-0.190293), btScalar(0.146609), 226 btScalar(-0.550000), btScalar(-0.243131), btScalar(0.177642),
191 btScalar(0.104141), btScalar(-0.199541), btScalar(0.222140), 227 btScalar(-0.550000), btScalar(-0.017683), btScalar(-0.199324),
192 btScalar(-0.207788), btScalar(0.065226), btScalar(0.172945), 228 btScalar(-0.550000), btScalar(0.150767), btScalar(0.162842),
193 btScalar(0.103299), btScalar(-0.168979), btScalar(-0.094225), 229 btScalar(-0.138413), btScalar(-0.072881), btScalar(-0.103734),
194 btScalar(0.130475), btScalar(0.068676), btScalar(-0.129420), 230 btScalar(0.139934), btScalar(0.152037), btScalar(-0.158703),
195 btScalar(0.065630), btScalar(0.075409), btScalar(0.150963), 231 btScalar(0.254965), btScalar(-0.254145), btScalar(-0.307055),
196 btScalar(-0.172328), btScalar(0.041173), btScalar(-0.142551), 232 btScalar(0.228935), btScalar(-0.176885), btScalar(0.123000),
233 btScalar(0.115739), btScalar(0.220857), btScalar(0.251735),
197}; 234};
198 235
199static int cube_indices[CUBE_NUM_TRIANGLES][3] = { 236static int cube_indices[CUBE_NUM_TRIANGLES][3] = {
200 {0, 1, 6}, 237 {0, 1, 6},
201 {1, 2, 32}, 238 {1, 2, 32},
202 {2, 3, 10}, 239 {2, 3, 10},
203 {4, 5, 9}, 240 {5, 33, 4},
204 {5, 6, 33}, 241 {5, 6, 33},
205 {9, 5, 33}, 242 {9, 4, 33},
206 {8, 34, 7}, 243 {7, 8, 11},
207 {8, 9, 33}, 244 {8, 9, 34},
208 {10, 11, 34}, 245 {11, 8, 34},
209 {11, 7, 34}, 246 {9, 33, 34},
210 {2, 10, 32}, 247 {10, 11, 34},
211 {6, 1, 32}, 248 {2, 10, 32},
212 {34, 8, 33}, 249 {6, 1, 32},
213 {6, 32, 33}, 250 {6, 32, 33},
214 {10, 34, 32}, 251 {33, 32, 34},
215 {32, 34, 33}, 252 {34, 32, 10},
216 {36, 1, 12}, 253 {12, 35, 0},
217 {2, 1, 35}, 254 {2, 1, 35},
218 {3, 2, 17}, 255 {3, 2, 17},
219 {12, 13, 36}, 256 {12, 13, 36},
220 {13, 14, 18}, 257 {36, 13, 18},
221 {15, 16, 19}, 258 {15, 16, 19},
222 {19, 16, 35}, 259 {19, 16, 37},
223 {16, 17, 35}, 260 {16, 17, 37},
224 {18, 19, 35}, 261 {18, 19, 37},
225 {17, 2, 35}, 262 {17, 2, 37},
226 {0, 12, 1}, 263 {14, 18, 13},
227 {13, 18, 36}, 264 {1, 0, 35},
228 {35, 1, 36}, 265 {35, 12, 36},
229 {36, 18, 35}, 266 {18, 37, 36},
230 {6, 38, 0}, 267 {35, 36, 37},
231 {5, 4, 20}, 268 {2, 35, 37},
232 {6, 5, 37}, 269 {0, 6, 12},
233 {5, 20, 37}, 270 {5, 4, 20},
234 {13, 12, 38}, 271 {6, 5, 38},
235 {14, 13, 24}, 272 {5, 20, 38},
236 {20, 21, 37}, 273 {13, 12, 39},
237 {21, 22, 23}, 274 {13, 39, 14},
238 {23, 24, 39}, 275 {21, 40, 20},
239 {21, 23, 39}, 276 {21, 22, 23},
240 {24, 13, 39}, 277 {23, 24, 40},
241 {12, 0, 38}, 278 {21, 23, 40},
242 {13, 38, 39}, 279 {24, 14, 39},
243 {37, 21, 39}, 280 {12, 6, 38},
244 {39, 38, 37}, 281 {38, 20, 40},
245 {6, 37, 38}, 282 {38, 40, 39},
246 {10, 3, 17}, 283 {40, 24, 39},
247 {7, 11, 27}, 284 {12, 38, 39},
248 {27, 11, 40}, 285 {10, 3, 17},
249 {11, 10, 40}, 286 {7, 11, 27},
250 {16, 15, 28}, 287 {27, 11, 41},
251 {17, 16, 41}, 288 {11, 10, 41},
252 {26, 42, 25}, 289 {16, 15, 28},
253 {26, 27, 40}, 290 {17, 16, 42},
254 {28, 29, 42}, 291 {26, 43, 25},
255 {29, 25, 42}, 292 {26, 27, 41},
256 {16, 28, 41}, 293 {28, 29, 43},
257 {10, 17, 41}, 294 {16, 28, 42},
258 {10, 41, 40}, 295 {41, 43, 26},
259 {26, 40, 42}, 296 {10, 17, 42},
260 {42, 40, 41}, 297 {41, 10, 42},
261 {28, 42, 41}, 298 {28, 43, 42},
262 {18, 14, 24}, 299 {41, 42, 43},
263 {15, 19, 28}, 300 {29, 25, 43},
264 {19, 18, 43}, 301 {18, 14, 24},
265 {28, 19, 43}, 302 {15, 19, 28},
266 {23, 22, 30}, 303 {19, 18, 44},
267 {24, 23, 44}, 304 {28, 19, 44},
268 {25, 29, 31}, 305 {30, 45, 22},
269 {29, 28, 43}, 306 {24, 23, 45},
270 {23, 30, 44}, 307 {25, 29, 31},
271 {44, 30, 31}, 308 {29, 28, 46},
272 {43, 44, 29}, 309 {31, 29, 46},
273 {18, 24, 43}, 310 {28, 44, 46},
274 {31, 29, 44}, 311 {30, 31, 46},
275 {24, 44, 43}, 312 {23, 22, 45},
276 {4, 9, 20}, 313 {18, 24, 44},
277 {8, 7, 27}, 314 {30, 46, 45},
278 {9, 8, 45}, 315 {45, 46, 44},
279 {8, 27, 45}, 316 {44, 24, 45},
280 {22, 21, 30}, 317 {4, 9, 20},
281 {26, 25, 31}, 318 {27, 47, 7},
282 {26, 31, 46}, 319 {9, 8, 47},
283 {27, 26, 46}, 320 {8, 7, 47},
284 {31, 30, 46}, 321 {21, 20, 48},
285 {20, 9, 45}, 322 {22, 21, 30},
286 {30, 21, 46}, 323 {26, 25, 31},
287 {45, 27, 46}, 324 {26, 31, 49},
288 {46, 21, 45}, 325 {27, 26, 49},
289 {21, 20, 45}, 326 {31, 30, 49},
327 {30, 21, 48},
328 {47, 27, 49},
329 {20, 9, 48},
330 {30, 48, 49},
331 {47, 49, 48},
332 {9, 47, 48},
290}; 333};
291 334
292#endif 335#endif