aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ephysics/src/lib/ephysics_constraints.cpp
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2012-10-04 22:40:16 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-04 22:40:16 +0000
commit252643a33b65af308f3084ddc407459221e96677 (patch)
tree279e243b0dd91f133c020878033791f3053c74a6 /legacy/ephysics/src/lib/ephysics_constraints.cpp
parentEPhysics: multi point deformation (diff)
downloadefl-252643a33b65af308f3084ddc407459221e96677.tar.gz
EPhysics: add cloth support
This patch introduces the cloth support. Auxiliary API's for setting full anchors, cloth nodes anchors and so on is also introduced. Few other issues concerning soft body and cloth transform, has been worked to fit the cloth support needs. Patch by: Leandro Dorileo <dorileo@profusion.mobi> SVN revision: 77467
Diffstat (limited to 'legacy/ephysics/src/lib/ephysics_constraints.cpp')
-rw-r--r--legacy/ephysics/src/lib/ephysics_constraints.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/legacy/ephysics/src/lib/ephysics_constraints.cpp b/legacy/ephysics/src/lib/ephysics_constraints.cpp
index 834d923a2b..ed5c5c8411 100644
--- a/legacy/ephysics/src/lib/ephysics_constraints.cpp
+++ b/legacy/ephysics/src/lib/ephysics_constraints.cpp
@@ -119,6 +119,13 @@ ephysics_constraint_slider_add(EPhysics_Body *body)
return NULL;
}
+ if (body->type == EPHYSICS_BODY_TYPE_CLOTH)
+ {
+ ERR("Constraints are allowed only between rigid -> rigid bodies or "
+ "rigid -> soft bodies");
+ return NULL;
+ }
+
constraint = (EPhysics_Constraint *) calloc(1, sizeof(EPhysics_Constraint));
if (!constraint)
{
@@ -277,11 +284,19 @@ ephysics_constraint_p2p_add(EPhysics_Body *body1, EPhysics_Body *body2, Evas_Coo
if ((body2) &&
(ephysics_body_world_get(body1) != ephysics_body_world_get(body2)))
{
- ERR("To create a constraint both bodies must to belong to the same"
+ ERR("To create a constraint both bodies must belong to the same"
"world.");
return NULL;
}
+ if (body1->type == EPHYSICS_BODY_TYPE_CLOTH ||
+ body2->type == EPHYSICS_BODY_TYPE_CLOTH)
+ {
+ ERR("Constraints are allowed only between rigid -> rigid bodies or"
+ "rigid -> soft bodies");
+ return NULL;
+ }
+
constraint = (EPhysics_Constraint *) calloc(1, sizeof(EPhysics_Constraint));
if (!constraint)
{