summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/lib/EPhysics.h
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2012-10-16 23:12:47 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-16 23:12:47 +0000
commit4f73c6d46ef44a5afa382cf3a923975c3aaa171d (patch)
tree1c32581bc638a011bf5b4414185e815e3f412adc /legacy/ephysics/src/lib/EPhysics.h
parentd06196ca8d1a0cc84d6bd104ff72847a22d3c8dd (diff)
EPhysics: triangle API
This patch introduces soft body's mesh triangle manipulation, for picking the triangle of a body in X and Y and moving it as well. Patch by: Leandro Dorileo <dorileo@profusion.mobi> SVN revision: 78088
Diffstat (limited to '')
-rw-r--r--legacy/ephysics/src/lib/EPhysics.h42
1 files changed, 39 insertions, 3 deletions
diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h
index e2c34943a8..63164f6205 100644
--- a/legacy/ephysics/src/lib/EPhysics.h
+++ b/legacy/ephysics/src/lib/EPhysics.h
@@ -1764,6 +1764,42 @@ EAPI double ephysics_body_soft_body_hardness_get(const EPhysics_Body *body);
1764 1764
1765/** 1765/**
1766 * @brief 1766 * @brief
1767 * Get the triangle index of a soft body in @p x and @p y.
1768 *
1769 * Given a point in @p x and @p y a ray cast is performed and if a triangle is
1770 * found its index is returned.
1771 *
1772 * @param body The body to get the triangle index from.
1773 * @param x The x coord.
1774 * @param y The y coord.
1775 * @return -1 If no triangle is found, a triangle index otherwise.
1776 *
1777 * @see ephysics_body_soft_body_triangle_move().
1778 *
1779 * @ingroup EPhysics_Body
1780 */
1781EAPI int ephysics_body_soft_body_triangle_index_get(EPhysics_Body *body, Evas_Coord x, Evas_Coord y);
1782
1783/**
1784 * @brief
1785 * Move a body's triangle.
1786 *
1787 * Move the triangle of @p idx of @p body to @p x, @p y and @p z.
1788 *
1789 * @param body The body of interest.
1790 * @param idx The triangle index.
1791 * @param x The x coordinate.
1792 * @param y The y coordinate.
1793 * @param z The z coordinate.
1794 *
1795 * @see ephysics_body_soft_body_triangle_index_get().
1796 *
1797 * @ingroup EPhysics_Body
1798 */
1799EAPI void ephysics_body_soft_body_triangle_move(EPhysics_Body *body, int idx, Evas_Coord x, Evas_Coord y, Evas_Coord z);
1800
1801/**
1802 * @brief
1767 * Create a new circle physics body. 1803 * Create a new circle physics body.
1768 * 1804 *
1769 * Its collision shape will be a circle of diameter 1. To change it's size 1805 * Its collision shape will be a circle of diameter 1. To change it's size
@@ -1875,15 +1911,15 @@ EAPI EPhysics_Body *ephysics_body_soft_box_add(EPhysics_World *world);
1875 * example passing @p granularity of 20 will create a cloth with 20 rows and 20 1911 * example passing @p granularity of 20 will create a cloth with 20 rows and 20
1876 * columns. 1912 * columns.
1877 * 1913 *
1878 * By default EPhysics creates a cloth with 10 rows and 10 columns, these 1914 * By default EPhysics creates a cloth with 15 rows and 15 columns, these
1879 * default values will generally fit the most common scenarios. 1915 * default values will generally fit the most common scenarios.
1880 * 1916 *
1881 * If the informed @p granularity is of 0 then the default value - of 10 - is 1917 * If the informed @p granularity is of 0 then the default value - of 15 - is
1882 * assumed. 1918 * assumed.
1883 * 1919 *
1884 * @param world The world this body will belong to. 1920 * @param world The world this body will belong to.
1885 * @param granularity Define - proportionally - the number of rows and columns, 1921 * @param granularity Define - proportionally - the number of rows and columns,
1886 * if 0 the default value - of 10 - is assumed. 1922 * if 0 the default value - of 15 - is assumed.
1887 * @return a bew body or @c NULL on erros. 1923 * @return a bew body or @c NULL on erros.
1888 * 1924 *
1889 * @see ephysics_body_del(). 1925 * @see ephysics_body_del().