summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-08-22 20:05:25 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-08-22 20:05:25 +0000
commiteae54a26eedbe6ed14164cb09eafafbcbbec8ee8 (patch)
treeade57822ff69838dd5bda82896585b6646c01318 /legacy
parent3627234fb835205f170196adcf56873cb58bf265 (diff)
EPhysics: improve convex shapes
Center of these shapes were wrong, now it's much better. But collision still seems a bit inaccurate. SVN revision: 75572
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ephysics/src/bin/test_shapes.c51
-rw-r--r--legacy/ephysics/src/lib/EPhysics.h17
-rw-r--r--legacy/ephysics/src/lib/ephysics_body.cpp84
-rw-r--r--legacy/ephysics/src/lib/ephysics_private.h4
-rw-r--r--legacy/ephysics/src/lib/ephysics_shape.cpp6
5 files changed, 103 insertions, 59 deletions
diff --git a/legacy/ephysics/src/bin/test_shapes.c b/legacy/ephysics/src/bin/test_shapes.c
index 4e00b5aafd..3547dbbd6b 100644
--- a/legacy/ephysics/src/bin/test_shapes.c
+++ b/legacy/ephysics/src/bin/test_shapes.c
@@ -9,68 +9,51 @@ _world_populate(Test_Data *test_data)
9{ 9{
10 EPhysics_Shape *pentagon_shape, *hexagon_shape; 10 EPhysics_Shape *pentagon_shape, *hexagon_shape;
11 EPhysics_Body *pentagon_body, *hexagon_body; 11 EPhysics_Body *pentagon_body, *hexagon_body;
12 EPhysics_Constraint *constraint;
13 Evas_Object *pentagon, *hexagon; 12 Evas_Object *pentagon, *hexagon;
14 13
15 pentagon = elm_image_add(test_data->win); 14 pentagon = elm_image_add(test_data->win);
16 elm_image_file_set( 15 elm_image_file_set(
17 pentagon, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "pentagon"); 16 pentagon, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "pentagon");
18 evas_object_move(pentagon, WIDTH / 3, HEIGHT / 2 - 30); 17 evas_object_move(pentagon, WIDTH / 3, HEIGHT / 2 - 30);
19 evas_object_resize(pentagon, 70, 66); 18 evas_object_resize(pentagon, 70, 68);
20 evas_object_show(pentagon); 19 evas_object_show(pentagon);
21 test_data->evas_objs = eina_list_append(test_data->evas_objs, pentagon); 20 test_data->evas_objs = eina_list_append(test_data->evas_objs, pentagon);
22 21
23 pentagon_shape = ephysics_shape_new(); 22 pentagon_shape = ephysics_shape_new();
24 ephysics_shape_point_add(pentagon_shape, 0/70., 24/66.); 23 ephysics_shape_point_add(pentagon_shape, -1, -9/33.);
25 ephysics_shape_point_add(pentagon_shape, 35/70., 0/66.); 24 ephysics_shape_point_add(pentagon_shape, 0, -1);
26 ephysics_shape_point_add(pentagon_shape, 70/70., 24/66.); 25 ephysics_shape_point_add(pentagon_shape, 1, -9/33.);
27 ephysics_shape_point_add(pentagon_shape, 56/70., 66/66.); 26 ephysics_shape_point_add(pentagon_shape, -21/35., 1);
28 ephysics_shape_point_add(pentagon_shape, 14/70., 66/66.); 27 ephysics_shape_point_add(pentagon_shape, 21/35., 1);
29 28
30 pentagon_body = ephysics_body_shape_add(test_data->world, pentagon_shape); 29 pentagon_body = ephysics_body_shape_add(test_data->world, pentagon_shape);
31 ephysics_body_evas_object_set(pentagon_body, pentagon, EINA_TRUE); 30 ephysics_body_evas_object_set(pentagon_body, pentagon, EINA_TRUE);
32 ephysics_body_restitution_set(pentagon_body, 1); 31 ephysics_body_restitution_set(pentagon_body, 1);
33 ephysics_body_friction_set(pentagon_body, 0);
34 test_data->bodies = eina_list_append(test_data->bodies, pentagon_body); 32 test_data->bodies = eina_list_append(test_data->bodies, pentagon_body);
35 33
36 hexagon = elm_image_add(test_data->win); 34 hexagon = elm_image_add(test_data->win);
37 elm_image_file_set( 35 elm_image_file_set(
38 hexagon, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "hexagon"); 36 hexagon, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "hexagon");
39 evas_object_move(hexagon, WIDTH / 3 + 80, HEIGHT / 2 - 30 + 35); 37 evas_object_move(hexagon, WIDTH / 3 + 80, HEIGHT / 2 - 30);
40 evas_object_resize(hexagon, 70, 60); 38 evas_object_resize(hexagon, 70, 60);
41 evas_object_show(hexagon); 39 evas_object_show(hexagon);
42 test_data->evas_objs = eina_list_append(test_data->evas_objs, hexagon); 40 test_data->evas_objs = eina_list_append(test_data->evas_objs, hexagon);
43 41
44 hexagon_shape = ephysics_shape_new(); 42 hexagon_shape = ephysics_shape_new();
45 ephysics_shape_point_add(hexagon_shape, 0, 0.5); 43 ephysics_shape_point_add(hexagon_shape, 0, 30);
46 ephysics_shape_point_add(hexagon_shape, 18/70., 0); 44 ephysics_shape_point_add(hexagon_shape, 18, 0);
47 ephysics_shape_point_add(hexagon_shape, 52/70., 0); 45 ephysics_shape_point_add(hexagon_shape, 52, 0);
48 ephysics_shape_point_add(hexagon_shape, 1, 0.5); 46 ephysics_shape_point_add(hexagon_shape, 70, 30);
49 ephysics_shape_point_add(hexagon_shape, 52/70., 1); 47 ephysics_shape_point_add(hexagon_shape, 52, 60);
50 ephysics_shape_point_add(hexagon_shape, 18/70., 1); 48 ephysics_shape_point_add(hexagon_shape, 18, 60);
51 49
52 hexagon_body = ephysics_body_shape_add(test_data->world, hexagon_shape); 50 hexagon_body = ephysics_body_shape_add(test_data->world, hexagon_shape);
53 ephysics_body_mass_set(hexagon_body, 5);
54 ephysics_body_evas_object_set(hexagon_body, hexagon, EINA_TRUE); 51 ephysics_body_evas_object_set(hexagon_body, hexagon, EINA_TRUE);
55 ephysics_body_restitution_set(hexagon_body, 1); 52 ephysics_body_restitution_set(hexagon_body, 1);
56 ephysics_body_friction_set(hexagon_body, 0);
57 test_data->bodies = eina_list_append(test_data->bodies, hexagon_body); 53 test_data->bodies = eina_list_append(test_data->bodies, hexagon_body);
58 54
59 constraint = ephysics_constraint_p2p_add(pentagon_body, NULL, 8, 0,
60 0, 0);
61 test_data->constraints = eina_list_append(test_data->constraints,
62 constraint);
63
64 constraint = ephysics_constraint_p2p_add(hexagon_body, NULL, 0, 0, 0, 0);
65 test_data->constraints = eina_list_append(test_data->constraints,
66 constraint);
67
68 ephysics_body_torque_impulse_apply(pentagon_body, 2);
69
70 ephysics_shape_del(pentagon_shape); 55 ephysics_shape_del(pentagon_shape);
71 ephysics_shape_del(hexagon_shape); 56 ephysics_shape_del(hexagon_shape);
72
73 ephysics_world_serialize(test_data->world, "/tmp/test.bullet");
74} 57}
75 58
76static void 59static void
@@ -86,6 +69,7 @@ _restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED_
86void 69void
87test_shapes(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 70test_shapes(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
88{ 71{
72 EPhysics_Body *boundary;
89 EPhysics_World *world; 73 EPhysics_World *world;
90 Test_Data *test_data; 74 Test_Data *test_data;
91 75
@@ -102,5 +86,12 @@ test_shapes(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
102 ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40); 86 ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
103 test_data->world = world; 87 test_data->world = world;
104 88
89 boundary = ephysics_body_bottom_boundary_add(test_data->world);
90 ephysics_body_restitution_set(boundary, 0.65);
91
92 ephysics_body_top_boundary_add(test_data->world);
93 ephysics_body_left_boundary_add(test_data->world);
94 ephysics_body_right_boundary_add(test_data->world);
95
105 _world_populate(test_data); 96 _world_populate(test_data);
106} 97}
diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h
index 3372c1c2e4..babe3b5ed4 100644
--- a/legacy/ephysics/src/lib/EPhysics.h
+++ b/legacy/ephysics/src/lib/EPhysics.h
@@ -205,6 +205,9 @@ EAPI void ephysics_shape_del(EPhysics_Shape *shape);
205 * geometric shapes. The final shape will be constructed in such a way 205 * geometric shapes. The final shape will be constructed in such a way
206 * it will have all the added points and will be convex. 206 * it will have all the added points and will be convex.
207 * 207 *
208 * The center of mass will be the centroid, or geometric center of the
209 * shape.
210 *
208 * The order of points doesn't matter. 211 * The order of points doesn't matter.
209 * 212 *
210 * For example, to create a pentagon: 213 * For example, to create a pentagon:
@@ -212,11 +215,11 @@ EAPI void ephysics_shape_del(EPhysics_Shape *shape);
212 * @code 215 * @code
213 * EPhysics_Shape *shape = ephysics_shape_new(); 216 * EPhysics_Shape *shape = ephysics_shape_new();
214 * 217 *
215 * ephysics_shape_point_add(shape, 0/70., 24/66.); 218 * ephysics_shape_point_add(shape, 0, 24);
216 * ephysics_shape_point_add(shape, 35/70., 0/66.); 219 * ephysics_shape_point_add(shape, 35, 0);
217 * ephysics_shape_point_add(shape, 70/70., 24/66.); 220 * ephysics_shape_point_add(shape, 70, 24);
218 * ephysics_shape_point_add(shape, 56/70., 66/66.); 221 * ephysics_shape_point_add(shape, 56, 66);
219 * ephysics_shape_point_add(shape, 14/70., 66/66.); 222 * ephysics_shape_point_add(shape, 14, 66);
220 * 223 *
221 * ephysics_body_shape_add(world, shape); 224 * ephysics_body_shape_add(world, shape);
222 * 225 *
@@ -224,8 +227,8 @@ EAPI void ephysics_shape_del(EPhysics_Shape *shape);
224 * @endcode 227 * @endcode
225 * 228 *
226 * @param shape The shape to be modified. 229 * @param shape The shape to be modified.
227 * @param x Point position at x axis. Should be a value between 0 and 1. 230 * @param x Point position at x axis.
228 * @param y Point position at y axis. Should be a value between 0 and 1. 231 * @param y Point position at y axis.
229 * @return @c EINA_TRUE on success or EINA_FALSE on error. 232 * @return @c EINA_TRUE on success or EINA_FALSE on error.
230 * 233 *
231 * @see ephysics_shape_new(). 234 * @see ephysics_shape_new().
diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp
index b390108846..123192791b 100644
--- a/legacy/ephysics/src/lib/ephysics_body.cpp
+++ b/legacy/ephysics/src/lib/ephysics_body.cpp
@@ -193,7 +193,7 @@ ephysics_body_collision_group_list_get(const EPhysics_Body *body)
193} 193}
194 194
195static EPhysics_Body * 195static EPhysics_Body *
196_ephysics_body_add(EPhysics_World *world, btCollisionShape *collision_shape, const char *type) 196_ephysics_body_add(EPhysics_World *world, btCollisionShape *collision_shape, const char *type, double cm_x, double cm_y)
197{ 197{
198 btRigidBody::btRigidBodyConstructionInfo *rigid_body_ci; 198 btRigidBody::btRigidBodyConstructionInfo *rigid_body_ci;
199 btDefaultMotionState *motion_state; 199 btDefaultMotionState *motion_state;
@@ -244,6 +244,8 @@ _ephysics_body_add(EPhysics_World *world, btCollisionShape *collision_shape, con
244 body->rigid_body = rigid_body; 244 body->rigid_body = rigid_body;
245 body->mass = mass; 245 body->mass = mass;
246 body->world = world; 246 body->world = world;
247 body->cm.x = cm_x;
248 body->cm.y = cm_y;
247 body->rigid_body->setUserPointer(body); 249 body->rigid_body->setUserPointer(body);
248 body->rigid_body->setLinearFactor(btVector3(1, 1, 0)); 250 body->rigid_body->setLinearFactor(btVector3(1, 1, 0));
249 body->rigid_body->setAngularFactor(btVector3(0, 0, 1)); 251 body->rigid_body->setAngularFactor(btVector3(0, 0, 1));
@@ -353,8 +355,8 @@ _ephysics_body_move(EPhysics_Body *body, Evas_Coord x, Evas_Coord y)
353 ephysics_world_render_geometry_get(body->world, NULL, &wy, NULL, &height); 355 ephysics_world_render_geometry_get(body->world, NULL, &wy, NULL, &height);
354 height += wy; 356 height += wy;
355 357
356 mx = (x + body->w / 2) / rate; 358 mx = (x + body->w * body->cm.x) / rate;
357 my = (height - (y + body->h / 2)) / rate; 359 my = (height - (y + body->h * body->cm.y)) / rate;
358 360
359 body->rigid_body->getMotionState()->getWorldTransform(trans); 361 body->rigid_body->getMotionState()->getWorldTransform(trans);
360 trans.setOrigin(btVector3(mx, my, 0)); 362 trans.setOrigin(btVector3(mx, my, 0));
@@ -377,8 +379,8 @@ _ephysics_body_geometry_set(EPhysics_Body *body, Evas_Coord x, Evas_Coord y, Eva
377 ephysics_world_render_geometry_get(body->world, NULL, &wy, NULL, &height); 379 ephysics_world_render_geometry_get(body->world, NULL, &wy, NULL, &height);
378 height += wy; 380 height += wy;
379 381
380 mx = (x + w / 2) / rate; 382 mx = (x + w * body->cm.x) / rate;
381 my = (height - (y + h / 2)) / rate; 383 my = (height - (y + h * body->cm.y)) / rate;
382 sx = w / rate; 384 sx = w / rate;
383 sy = h / rate; 385 sy = h / rate;
384 386
@@ -513,8 +515,8 @@ _ephysics_body_evas_object_default_update(EPhysics_Body *body)
513 515
514 evas_object_geometry_get(body->evas_obj, NULL, NULL, &w, &h); 516 evas_object_geometry_get(body->evas_obj, NULL, NULL, &w, &h);
515 rate = ephysics_world_rate_get(body->world); 517 rate = ephysics_world_rate_get(body->world);
516 x = (int) (trans.getOrigin().getX() * rate) - w / 2 - cx; 518 x = (int) (trans.getOrigin().getX() * rate) - w * body->cm.x - cx;
517 y = wh + wy - (int) (trans.getOrigin().getY() * rate) - h / 2 - cy; 519 y = wh + wy - (int) (trans.getOrigin().getY() * rate) - h * body->cm.y - cy;
518 520
519 evas_object_move(body->evas_obj, x, y); 521 evas_object_move(body->evas_obj, x, y);
520 522
@@ -534,7 +536,8 @@ _ephysics_body_evas_object_default_update(EPhysics_Body *body)
534 if (body->soft_body) 536 if (body->soft_body)
535 _ephysics_body_soft_body_deform(body, rate, map); 537 _ephysics_body_soft_body_deform(body, rate, map);
536 538
537 evas_map_util_rotate(map, rot, x + (w / 2), y + (h / 2)); 539 evas_map_util_rotate(map, rot, x + (w * body->cm.x), y +
540 (h * body->cm.y));
538 evas_object_map_set(body->evas_obj, map); 541 evas_object_map_set(body->evas_obj, map);
539 evas_object_map_enable_set(body->evas_obj, EINA_TRUE); 542 evas_object_map_enable_set(body->evas_obj, EINA_TRUE);
540 evas_map_free(map); 543 evas_map_free(map);
@@ -690,7 +693,7 @@ _ephysics_body_soft_add(EPhysics_World *world, btCollisionShape *collision_shape
690 btSoftBody::AJoint::Specs angular_joint; 693 btSoftBody::AJoint::Specs angular_joint;
691 btSoftBody::LJoint::Specs linear_joint; 694 btSoftBody::LJoint::Specs linear_joint;
692 695
693 body = _ephysics_body_add(world, collision_shape, "soft box"); 696 body = _ephysics_body_add(world, collision_shape, "soft box", 0.5, 0.5);
694 if (!body) 697 if (!body)
695 { 698 {
696 ephysics_body_del(body); 699 ephysics_body_del(body);
@@ -702,7 +705,7 @@ _ephysics_body_soft_add(EPhysics_World *world, btCollisionShape *collision_shape
702 705
703 body->soft_body->getCollisionShape()->setMargin(0.22); 706 body->soft_body->getCollisionShape()->setMargin(0.22);
704 707
705 soft_body->m_materials[0]->m_kLST = 0.35; 708 soft_body->m_materials[0]->m_kLST = 0.35;
706 soft_body->setPose(true, false); 709 soft_body->setPose(true, false);
707 710
708 body->soft_body->m_cfg.collisions += btSoftBody::fCollision::SDF_RS; 711 body->soft_body->m_cfg.collisions += btSoftBody::fCollision::SDF_RS;
@@ -806,7 +809,7 @@ ephysics_body_circle_add(EPhysics_World *world)
806 return NULL; 809 return NULL;
807 } 810 }
808 811
809 return _ephysics_body_add(world, collision_shape, "circle"); 812 return _ephysics_body_add(world, collision_shape, "circle", 0.5, 0.5);
810} 813}
811 814
812EAPI EPhysics_Body * 815EAPI EPhysics_Body *
@@ -883,13 +886,14 @@ ephysics_body_box_add(EPhysics_World *world)
883 886
884 collision_shape = new btBoxShape(btVector3(0.5, 0.5, 0.5)); 887 collision_shape = new btBoxShape(btVector3(0.5, 0.5, 0.5));
885 888
886 return _ephysics_body_add(world, collision_shape, "box"); 889 return _ephysics_body_add(world, collision_shape, "box", 0.5, 0.5);
887} 890}
888 891
889EAPI EPhysics_Body * 892EAPI EPhysics_Body *
890ephysics_body_shape_add(EPhysics_World *world, EPhysics_Shape *shape) 893ephysics_body_shape_add(EPhysics_World *world, EPhysics_Shape *shape)
891{ 894{
892 btConvexHullShape *full_shape, *simplified_shape; 895 btConvexHullShape *full_shape, *simplified_shape;
896 double max_x, max_y, min_x, min_y, cm_x, cm_y, range_x, range_y;
893 const Eina_Inlist *points; 897 const Eina_Inlist *points;
894 EPhysics_Point *point; 898 EPhysics_Point *point;
895 btShapeHull *hull; 899 btShapeHull *hull;
@@ -908,6 +912,13 @@ ephysics_body_shape_add(EPhysics_World *world, EPhysics_Shape *shape)
908 return NULL; 912 return NULL;
909 } 913 }
910 914
915 points = ephysics_shape_points_get(shape);
916 if (eina_inlist_count(points) < 3)
917 {
918 ERR("At least 3 points are required to add a shape");
919 return NULL;
920 }
921
911 full_shape = new btConvexHullShape(); 922 full_shape = new btConvexHullShape();
912 if (!full_shape) 923 if (!full_shape)
913 { 924 {
@@ -915,24 +926,65 @@ ephysics_body_shape_add(EPhysics_World *world, EPhysics_Shape *shape)
915 return NULL; 926 return NULL;
916 } 927 }
917 928
918 points = ephysics_shape_points_get(shape); 929 point = EINA_INLIST_CONTAINER_GET(points, EPhysics_Point);
930 max_x = min_x = point->x;
931 max_y = min_y = point->y;
932 cm_x = cm_y = 0;
933
934 /* FIXME : only vertices should be used to calculate the center of mass */
935 EINA_INLIST_FOREACH(points, point)
936 {
937 if (point->x > max_x) max_x = point->x;
938 if (point->x < min_x) min_x = point->x;
939 if (point->y > max_y) max_y = point->y;
940 if (point->y < min_y) min_y = point->y;
941
942 cm_x += point->x;
943 cm_y += point->y;
944 }
945
946 cm_x /= eina_inlist_count(points);
947 cm_y /= eina_inlist_count(points);
948 range_x = max_x - min_x;
949 range_y = max_y - min_y;
919 950
920 EINA_INLIST_FOREACH(points, point) 951 EINA_INLIST_FOREACH(points, point)
921 { 952 {
922 point3d = btVector3(point->x, point->y, 0); 953 double x, y;
954
955 x = (point->x - cm_x) / range_x;
956 y = - (point->y - cm_y) / range_y;
957
958 point3d = btVector3(x, y, -0.5);
923 full_shape->addPoint(point3d); 959 full_shape->addPoint(point3d);
924 point3d = btVector3(point->x, point->y, 0.5); 960
961 point3d = btVector3(x, y, 0.5);
925 full_shape->addPoint(point3d); 962 full_shape->addPoint(point3d);
926 } 963 }
927 964
928 hull = new btShapeHull(full_shape); 965 hull = new btShapeHull(full_shape);
966 if (!hull)
967 {
968 delete full_shape;
969 ERR("Couldn't create a shape hull.");
970 return NULL;
971 }
972
929 margin = full_shape->getMargin(); 973 margin = full_shape->getMargin();
930 hull->buildHull(margin); 974 hull->buildHull(margin);
931 simplified_shape = new btConvexHullShape(&(hull->getVertexPointer()->getX()), 975 simplified_shape = new btConvexHullShape(&(hull->getVertexPointer()->getX()),
932 hull->numVertices()); 976 hull->numVertices());
977 delete hull;
978 delete full_shape;
979 if (!simplified_shape)
980 {
981 ERR("Couldn't create a simplified shape.");
982 return NULL;
983 }
933 984
934 return _ephysics_body_add(world, (btCollisionShape *)simplified_shape, 985 return _ephysics_body_add(world, (btCollisionShape *)simplified_shape,
935 "generic"); 986 "generic", (cm_x - min_x) / range_x,
987 1 - (cm_y - min_y) / range_y);
936} 988}
937 989
938void 990void
diff --git a/legacy/ephysics/src/lib/ephysics_private.h b/legacy/ephysics/src/lib/ephysics_private.h
index 1cd491e125..a9d29b1fdb 100644
--- a/legacy/ephysics/src/lib/ephysics_private.h
+++ b/legacy/ephysics/src/lib/ephysics_private.h
@@ -85,6 +85,10 @@ struct _EPhysics_Body {
85 double y; 85 double y;
86 double torque; 86 double torque;
87 } force; 87 } force;
88 struct {
89 double x;
90 double y;
91 } cm;
88 Eina_Bool active:1; 92 Eina_Bool active:1;
89 Eina_Bool deleted:1; 93 Eina_Bool deleted:1;
90 double distances[4][3]; 94 double distances[4][3];
diff --git a/legacy/ephysics/src/lib/ephysics_shape.cpp b/legacy/ephysics/src/lib/ephysics_shape.cpp
index 7970b09e63..f75a4e6cf9 100644
--- a/legacy/ephysics/src/lib/ephysics_shape.cpp
+++ b/legacy/ephysics/src/lib/ephysics_shape.cpp
@@ -80,12 +80,6 @@ ephysics_shape_point_add(EPhysics_Shape *shape, double x, double y)
80 return EINA_FALSE;; 80 return EINA_FALSE;;
81 } 81 }
82 82
83 if ((x < 0) || (x > 1) || (y < 0) || (y > 1))
84 {
85 ERR("Points should be between 0 and 1.");
86 return EINA_FALSE;
87 }
88
89 point = _ephysics_shape_point_new(); 83 point = _ephysics_shape_point_new();
90 if (!point) 84 if (!point)
91 return EINA_FALSE;; 85 return EINA_FALSE;;