forked from enlightenment/efl
ephysics: expose volume getter
useful to calculate density given a mass SVN revision: 78201
This commit is contained in:
parent
cc28164d70
commit
64bc76ba49
|
@ -3446,6 +3446,23 @@ EAPI void ephysics_body_density_set(EPhysics_Body *body, double density);
|
||||||
*/
|
*/
|
||||||
EAPI double ephysics_body_density_get(const EPhysics_Body *body);
|
EAPI double ephysics_body_density_get(const EPhysics_Body *body);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
* Get body's volume.
|
||||||
|
*
|
||||||
|
* @note The unit of the returned value is meters ^ 3. Not pixels. Useful
|
||||||
|
* for calculation with mass and density.
|
||||||
|
*
|
||||||
|
* @param body The physics body.
|
||||||
|
* @return the @p body's volume, in meters ^ 3 or -1 on error.
|
||||||
|
*
|
||||||
|
* @see ephysics_body_geometry_set().
|
||||||
|
* @see ephysics_body_geometry_get().
|
||||||
|
*
|
||||||
|
* @ingroup EPhysics_Body
|
||||||
|
*/
|
||||||
|
EAPI double ephysics_body_volume_get(const EPhysics_Body *body);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
* Set body's material.
|
* Set body's material.
|
||||||
|
|
|
@ -3142,6 +3142,16 @@ ephysics_body_light_get(const EPhysics_Body *body)
|
||||||
return body->light_apply;
|
return body->light_apply;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI double
|
||||||
|
ephysics_body_volume_get(const EPhysics_Body *body)
|
||||||
|
{
|
||||||
|
if (!body)
|
||||||
|
{
|
||||||
|
ERR("No body, no volume.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return _ephysics_body_volume_get(body);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue