summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/lib/ephysics_body.cpp
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2012-12-05 13:50:20 +0000
committerLeandro Dorileo <dorileo@profusion.mobi>2012-12-05 13:50:20 +0000
commit4640e5cdca1987d96fa755af676a0f07b32be98e (patch)
treed1fc4a7a19617d5c9a7822f461ea0fe93b297955 /legacy/ephysics/src/lib/ephysics_body.cpp
parentd435db293105f9319fc8865558bd0edac104d318 (diff)
EPhysics: soft body drag coefficient
Add API for handling with soft body drag coefficient. --This line, and those below, will be ignored-- SVN revision: 80249
Diffstat (limited to '')
-rw-r--r--legacy/ephysics/src/lib/ephysics_body.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp
index f6b63e8ecf..ed35f83b98 100644
--- a/legacy/ephysics/src/lib/ephysics_body.cpp
+++ b/legacy/ephysics/src/lib/ephysics_body.cpp
@@ -1806,6 +1806,45 @@ ephysics_body_soft_body_anchor_hardness_get(EPhysics_Body *body)
1806 return body->soft_body->m_cfg.kAHR * 100; 1806 return body->soft_body->m_cfg.kAHR * 100;
1807} 1807}
1808 1808
1809EAPI void
1810ephysics_body_soft_body_drag_coefficient_set(EPhysics_Body *body, double coefficient)
1811{
1812 if (!body)
1813 {
1814 ERR("Can't set soft body's drag coefficient, body is null.");
1815 return;
1816 }
1817
1818 if (!body->soft_body)
1819 {
1820 ERR("Can't set soft body's drag coefficient, body seems not to be a soft"
1821 " body.");
1822 return;
1823 }
1824
1825 body->soft_body->m_cfg.kDG = coefficient;
1826 DBG("Soft body drag coefficient set to: %lf", coefficient);
1827}
1828
1829EAPI double
1830ephysics_body_soft_body_drag_coefficient_get(const EPhysics_Body *body)
1831{
1832 if (!body)
1833 {
1834 ERR("Can't get soft body's drag coefficient, body is null.");
1835 return -1;
1836 }
1837
1838 if (!body->soft_body)
1839 {
1840 ERR("Can't get soft body's drag coefficient, body seems not to be a soft"
1841 " body.");
1842 return -1;
1843 }
1844
1845 return body->soft_body->m_cfg.kDG;
1846}
1847
1809static void 1848static void
1810_ephysics_body_soft_body_hardness_set(EPhysics_Body *body, double hardness) 1849_ephysics_body_soft_body_hardness_set(EPhysics_Body *body, double hardness)
1811{ 1850{