summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/lib/EPhysics.h
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-10-10 19:17:54 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-10 19:17:54 +0000
commitf75457d4b95e26fa485193535ffac43f3fb59a21 (patch)
tree5e8d0702178c08de97fdea9669596de27b22da62 /legacy/ephysics/src/lib/EPhysics.h
parent59cc6c6f2fd9f9c991a9d310c2dfc8576304d55c (diff)
ephysics: add new 3d shapes
Instead of creating it from 2d shapes. Bad news is that for some cases basically points will need to be kind of duplicated. SVN revision: 77783
Diffstat (limited to '')
-rw-r--r--legacy/ephysics/src/lib/EPhysics.h33
1 files changed, 20 insertions, 13 deletions
diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h
index d49492d61d..2d294b6850 100644
--- a/legacy/ephysics/src/lib/EPhysics.h
+++ b/legacy/ephysics/src/lib/EPhysics.h
@@ -214,11 +214,16 @@ EAPI void ephysics_shape_del(EPhysics_Shape *shape);
214 * @code 214 * @code
215 * EPhysics_Shape *shape = ephysics_shape_new(); 215 * EPhysics_Shape *shape = ephysics_shape_new();
216 * 216 *
217 * ephysics_shape_point_add(shape, 0, 24); 217 * ephysics_shape_point_add(shape, 0, 24, -10);
218 * ephysics_shape_point_add(shape, 35, 0); 218 * ephysics_shape_point_add(shape, 0, 24, 10);
219 * ephysics_shape_point_add(shape, 70, 24); 219 * ephysics_shape_point_add(shape, 35, 0, -10);
220 * ephysics_shape_point_add(shape, 56, 66); 220 * ephysics_shape_point_add(shape, 35, 0, 10);
221 * ephysics_shape_point_add(shape, 14, 66); 221 * ephysics_shape_point_add(shape, 70, 24, -10);
222 * ephysics_shape_point_add(shape, 70, 24, 10);
223 * ephysics_shape_point_add(shape, 56, 66, -10);
224 * ephysics_shape_point_add(shape, 56, 66, 10);
225 * ephysics_shape_point_add(shape, 14, 66, -10);
226 * ephysics_shape_point_add(shape, 14, 66, 10);
222 * 227 *
223 * ephysics_body_shape_add(world, shape); 228 * ephysics_body_shape_add(world, shape);
224 * 229 *
@@ -228,13 +233,14 @@ EAPI void ephysics_shape_del(EPhysics_Shape *shape);
228 * @param shape The shape to be modified. 233 * @param shape The shape to be modified.
229 * @param x Point position at x axis. 234 * @param x Point position at x axis.
230 * @param y Point position at y axis. 235 * @param y Point position at y axis.
236 * @param z Point position at z axis.
231 * @return @c EINA_TRUE on success or EINA_FALSE on error. 237 * @return @c EINA_TRUE on success or EINA_FALSE on error.
232 * 238 *
233 * @see ephysics_shape_new(). 239 * @see ephysics_shape_new().
234 * 240 *
235 * @ingroup EPhysics_Shape 241 * @ingroup EPhysics_Shape
236 */ 242 */
237EAPI Eina_Bool ephysics_shape_point_add(EPhysics_Shape *shape, double x, double y); 243EAPI Eina_Bool ephysics_shape_point_add(EPhysics_Shape *shape, double x, double y, double z);
238 244
239/** 245/**
240 * @brief 246 * @brief
@@ -1765,7 +1771,7 @@ EAPI void ephysics_body_cloth_anchor_del(EPhysics_Body *body);
1765 * @ref ephysics_shape_new(). 1771 * @ref ephysics_shape_new().
1766 * 1772 *
1767 * To change it's size @ref ephysics_body_geometry_set() should be used, 1773 * To change it's size @ref ephysics_body_geometry_set() should be used,
1768 * so it can be deformed on x and y axes. 1774 * so it can be deformed on x, y and z axes.
1769 * 1775 *
1770 * The center of mass of this body can be get with 1776 * The center of mass of this body can be get with
1771 * @ref ephysics_body_center_mass_get(). 1777 * @ref ephysics_body_center_mass_get().
@@ -3043,14 +3049,14 @@ EAPI void ephysics_body_forces_clear(EPhysics_Body *body);
3043 * Get the center of mass of physics body. 3049 * Get the center of mass of physics body.
3044 * 3050 *
3045 * It returns a value from 0 to 1 representing where is the center of the mass 3051 * It returns a value from 0 to 1 representing where is the center of the mass
3046 * considering the height and width of the body. 3052 * considering the height, width and depth of the body.
3047 * 3053 *
3048 * If a body of width = 30 and height = 20 has the center of mass at 3054 * If a body of width = 30, height = 20 and depth = 20, and has the center of
3049 * center of mass x component = 20 and y component = 10, it will return 3055 * mass at x component = 20, y component = 10 and z = 10, it will return
3050 * @p x = 0.666 and @p y = 0.5. 3056 * @p x = 0.666, @p y = 0.5 and @z = 0.5.
3051 * 3057 *
3052 * For primitive shapes, like box and circle, the center of mass 3058 * For primitive shapes, like box and circle, the center of mass
3053 * is (0.5, 0.5). 3059 * is (0.5, 0.5, 0.5).
3054 * 3060 *
3055 * This function can be useful when updating evas objects for bodies 3061 * This function can be useful when updating evas objects for bodies
3056 * with custom shapes. 3062 * with custom shapes.
@@ -3058,12 +3064,13 @@ EAPI void ephysics_body_forces_clear(EPhysics_Body *body);
3058 * @param body The physics body. 3064 * @param body The physics body.
3059 * @param x The axis x component of center of mass. 3065 * @param x The axis x component of center of mass.
3060 * @param y The axis y component of center of mass. 3066 * @param y The axis y component of center of mass.
3067 * @param z The axis z component of center of mass.
3061 * 3068 *
3062 * @see ephysics_body_shape_add(). 3069 * @see ephysics_body_shape_add().
3063 * 3070 *
3064 * @ingroup EPhysics_Body 3071 * @ingroup EPhysics_Body
3065 */ 3072 */
3066EAPI void ephysics_body_center_mass_get(const EPhysics_Body *body, double *x, double *y); 3073EAPI void ephysics_body_center_mass_get(const EPhysics_Body *body, double *x, double *y, double *z);
3067 3074
3068/** 3075/**
3069 * @brief 3076 * @brief