forked from enlightenment/efl
ephysics: support enabling moves on z axis
SVN revision: 77774
This commit is contained in:
parent
f8136287ad
commit
4ef1a74d4c
|
@ -2723,39 +2723,43 @@ EAPI Eina_Bool ephysics_body_rotation_on_z_axis_enable_get(const EPhysics_Body *
|
|||
|
||||
/**
|
||||
* @brief
|
||||
* Enable or disable body's movement on x and y axes.
|
||||
* Enable or disable body's movement on x, y and z axes.
|
||||
*
|
||||
* Enabled by default on both axes.
|
||||
* Enabled by default on x and y axes, disabled on z axis.
|
||||
*
|
||||
* @param body The physics body.
|
||||
* @param enable_x If @c EINA_TRUE allow movement on x axis, if @c EINA_FALSE
|
||||
* disallow it.
|
||||
* @param enable_y If @c EINA_TRUE allow movement on y axis, if @c EINA_FALSE
|
||||
* disallow it.
|
||||
* @param enable_z If @c EINA_TRUE allow movement on z axis, if @c EINA_FALSE
|
||||
* disallow it.
|
||||
*
|
||||
* @see ephysics_body_linear_movement_enable_get().
|
||||
* @see ephysics_body_rotation_on_z_axis_enable_set().
|
||||
*
|
||||
* @ingroup EPhysics_Body
|
||||
*/
|
||||
EAPI void ephysics_body_linear_movement_enable_set(EPhysics_Body *body, Eina_Bool enable_x, Eina_Bool enable_y);
|
||||
EAPI void ephysics_body_linear_movement_enable_set(EPhysics_Body *body, Eina_Bool enable_x, Eina_Bool enable_y, Eina_Bool enable_z);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Get body's movement on x and y axes behavior.
|
||||
* Get body's movement on x, y and z axes behavior.
|
||||
*
|
||||
* @param body The physics body.
|
||||
* @param enable_x @c EINA_TRUE if movement on x axis is allowed, or
|
||||
* @c EINA_FALSE if it's not.
|
||||
* @param enable_y @c EINA_TRUE if movement on y axis is allowed, or
|
||||
* @c EINA_FALSE if it's not.
|
||||
* @param enable_z @c EINA_TRUE if movement on z axis is allowed, or
|
||||
* @c EINA_FALSE if it's not.
|
||||
*
|
||||
* @see ephysics_body_linear_movement_enable_set().
|
||||
* @see ephysics_body_rotation_on_z_axis_enable_get().
|
||||
*
|
||||
* @ingroup EPhysics_Body
|
||||
*/
|
||||
EAPI void ephysics_body_linear_movement_enable_get(const EPhysics_Body *body, Eina_Bool *enable_x, Eina_Bool *enable_y);
|
||||
EAPI void ephysics_body_linear_movement_enable_get(const EPhysics_Body *body, Eina_Bool *enable_x, Eina_Bool *enable_y, Eina_Bool *enable_z);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
|
|
|
@ -2439,7 +2439,7 @@ ephysics_body_impulse_apply(EPhysics_Body *body, double x, double y, Evas_Coord
|
|||
}
|
||||
|
||||
EAPI void
|
||||
ephysics_body_linear_movement_enable_set(EPhysics_Body *body, Eina_Bool enable_x, Eina_Bool enable_y)
|
||||
ephysics_body_linear_movement_enable_set(EPhysics_Body *body, Eina_Bool enable_x, Eina_Bool enable_y, Eina_Bool enable_z)
|
||||
{
|
||||
if (!body)
|
||||
{
|
||||
|
@ -2448,12 +2448,13 @@ ephysics_body_linear_movement_enable_set(EPhysics_Body *body, Eina_Bool enable_x
|
|||
}
|
||||
|
||||
ephysics_world_lock_take(body->world);
|
||||
body->rigid_body->setLinearFactor(btVector3(!!enable_x, !!enable_y, 0));
|
||||
body->rigid_body->setLinearFactor(btVector3(!!enable_x, !!enable_y,
|
||||
!!enable_z));
|
||||
ephysics_world_lock_release(body->world);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ephysics_body_linear_movement_enable_get(const EPhysics_Body *body, Eina_Bool *enable_x, Eina_Bool *enable_y)
|
||||
ephysics_body_linear_movement_enable_get(const EPhysics_Body *body, Eina_Bool *enable_x, Eina_Bool *enable_y, Eina_Bool *enable_z)
|
||||
{
|
||||
if (!body)
|
||||
{
|
||||
|
@ -2463,6 +2464,7 @@ ephysics_body_linear_movement_enable_get(const EPhysics_Body *body, Eina_Bool *e
|
|||
|
||||
if (enable_x) *enable_x = !!body->rigid_body->getLinearFactor().x();
|
||||
if (enable_y) *enable_y = !!body->rigid_body->getLinearFactor().y();
|
||||
if (enable_z) *enable_z = !!body->rigid_body->getLinearFactor().z();
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
Loading…
Reference in New Issue