aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2012-10-25 21:53:44 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-25 21:53:44 +0000
commit906fff00116c798c4f167539becbd1a29d09f5df (patch)
treed43df9993e6f3ee72540b6657c3eaf056db7877a
parent03c52724db9438810e96363ffdc572f93a8c3fa4 (diff)
downloadefl-906fff00116c798c4f167539becbd1a29d09f5df.tar.gz
efl-906fff00116c798c4f167539becbd1a29d09f5df.tar.xz
efl-906fff00116c798c4f167539becbd1a29d09f5df.zip
EPhysics: no need to anchor props
Actually for cloth anchors its hardness must always be 0.8. Patch by: Leandro Dorileo <dorileo@profusion.mobi> SVN revision: 78479
-rw-r--r--legacy/ephysics/src/lib/ephysics_body.cpp9
-rw-r--r--legacy/ephysics/src/lib/ephysics_private.h1
2 files changed, 6 insertions, 4 deletions
diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp
index 73fa6c9a6..5fa72a5fe 100644
--- a/legacy/ephysics/src/lib/ephysics_body.cpp
+++ b/legacy/ephysics/src/lib/ephysics_body.cpp
@@ -1292,7 +1292,12 @@ _ephysics_body_soft_body_hardness_set(EPhysics_Body *body, double hardness)
{
int m = body->material_index;
btSoftBody *soft_body = body->soft_body;
- soft_body->m_cfg.kAHR = (hardness / body->anchor_prop) * 0.6;
+
+ if (body->type == EPHYSICS_BODY_TYPE_CLOTH)
+ soft_body->m_cfg.kAHR = 0.8;
+ else
+ soft_body->m_cfg.kAHR = (hardness / 1000) * 0.6;
+
soft_body->m_materials[m]->m_kVST = (hardness / 1000);
soft_body->m_materials[m]->m_kLST = (hardness / 1000);
soft_body->m_materials[m]->m_kAST = (hardness / 1000);
@@ -1440,7 +1445,6 @@ _ephysics_body_soft_body_add(EPhysics_World *world, btCollisionShape *collision_
}
body->material_index = 0;
- body->anchor_prop = 1000;
body->type = EPHYSICS_BODY_TYPE_SOFT;
_ephysics_body_soft_body_default_config(body, soft_body);
@@ -1595,7 +1599,6 @@ ephysics_body_cloth_add(EPhysics_World *world, unsigned short granularity)
body->cloth_columns = columns;
body->cloth_rows = rows;
- body->anchor_prop = 1;
body->type = EPHYSICS_BODY_TYPE_CLOTH;
ephysics_world_soft_body_add(world, body);
diff --git a/legacy/ephysics/src/lib/ephysics_private.h b/legacy/ephysics/src/lib/ephysics_private.h
index 1a0ba3e64..41c819830 100644
--- a/legacy/ephysics/src/lib/ephysics_private.h
+++ b/legacy/ephysics/src/lib/ephysics_private.h
@@ -111,7 +111,6 @@ struct _EPhysics_Body {
EPhysics_Body_Type type;
int cloth_columns;
int cloth_rows;
- int anchor_prop;
int material_index;
struct {
int triangle;