summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/lib/EPhysics.h
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-10-18 23:27:26 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-18 23:27:26 +0000
commit08643f3112c2b1494734aae07a34927275655fac (patch)
treed95c3d627561de8c2c2184b788345a6b84e5aa3c /legacy/ephysics/src/lib/EPhysics.h
parent30a0f7c6593e435ac94fe7675ce3ea6ed69bcbae (diff)
ephysics: add perspective support
SVN revision: 78205
Diffstat (limited to '')
-rw-r--r--legacy/ephysics/src/lib/EPhysics.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h
index f81c3d76e2..fb13874718 100644
--- a/legacy/ephysics/src/lib/EPhysics.h
+++ b/legacy/ephysics/src/lib/EPhysics.h
@@ -1423,6 +1423,100 @@ EAPI void ephysics_world_light_all_bodies_set(EPhysics_World *world, Eina_Bool e
1423EAPI Eina_Bool ephysics_world_light_all_bodies_get(const EPhysics_World *world); 1423EAPI Eina_Bool ephysics_world_light_all_bodies_get(const EPhysics_World *world);
1424 1424
1425/** 1425/**
1426 * @brief
1427 * Set perspective to be applied on the scene.
1428 *
1429 * This applies a given perspective (3D) to the world rendering.
1430 * It will be used when the scene is rendered, after each simulation step,
1431 * by @ref ephysics_body_evas_object_update().
1432 *
1433 * The @p px and @p py points specify the "infinite distance" point in the 3D
1434 * conversion (where all lines converge to like when artists draw 3D by hand).
1435 * The @p z0 value specifies the z value at which there is a 1:1 mapping between
1436 * spatial coordinates and screen coordinates. Any points on this z value will
1437 * not have their X and Y values modified in the transform.
1438 * Those further away (Z value higher) will shrink into the distance, and those
1439 * less than this value will expand and become bigger. The foc value determines
1440 * the "focal length" of the camera. This is in reality the distance between
1441 * the camera lens plane itself (at or closer than this rendering results are
1442 * undefined) and the @p z0 z value. This allows for some "depth" control and
1443 * @p foc must be greater than 0.
1444 *
1445 * Considering the world geometry, by default, perspective is set to
1446 * px = x + w / 2, py = y + h / 2, z0 = z + d / 2 and foc = 10 * (z + d).
1447 * This means the conversion point is centered on render area, and @p z0
1448 * is on the center of render area z axis. It is set when
1449 * @ref ephysics_world_render_geometry_set() is called.
1450 *
1451 * @note The unit used for all parameters is Evas coordinates.
1452 *
1453 * @note To be used, perspective need to be enabled with
1454 * @ref ephysics_world_perspective_enabled_set().
1455 *
1456 * @param world The physics world
1457 * @param px The perspective distance X coordinate
1458 * @param py The perspective distance Y coordinate
1459 * @param z0 The "0" z plane value
1460 * @param foc The focal distance
1461 *
1462 * @see ephysics_world_perspective_get().
1463 * @see ephysics_world_perspective_enabled_set().
1464 *
1465 * @ingroup EPhysics_World
1466 */
1467EAPI void ephysics_world_perspective_set(EPhysics_World *world, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
1468
1469/**
1470 * @brief
1471 * Get perspective applied on the scene.
1472 *
1473 * @param world The physics world
1474 * @param px The perspective distance X coordinate
1475 * @param py The perspective distance Y coordinate
1476 * @param z0 The "0" z plane value
1477 * @param foc The focal distance
1478 *
1479 * @see ephysics_world_perspective_set() for more details.
1480 * @see ephysics_world_perspective_enabled_get().
1481 *
1482 * @ingroup EPhysics_World
1483 */
1484EAPI void ephysics_world_perspective_get(const EPhysics_World *world, Evas_Coord *px, Evas_Coord *py, Evas_Coord *z0, Evas_Coord *foc);
1485
1486/**
1487 * @brief
1488 * Set if perspective should be applied.
1489 *
1490 * The applied perspective can be set with
1491 * @ref ephysics_world_perspective_set().
1492 *
1493 * @param world The physics world.
1494 * @param enabled @c EINA_TRUE if perspective should be used, or @c EINA_FALSE
1495 * if it shouldn't.
1496 *
1497 * @see ephysics_world_perspective_set() for more details.
1498 * @see ephysics_world_perspective_enabled_get().
1499 *
1500 * @ingroup EPhysics_World
1501 */
1502EAPI void ephysics_world_perspective_enabled_set(EPhysics_World *world, Eina_Bool enabled);
1503
1504/**
1505 * @brief
1506 * Return if perspective is enabled or not.
1507 *
1508 * @param world The physics world.
1509 * @return @c EINA_TRUE if perspective is enabled, or @c EINA_FALSE if it
1510 * isn't, or on error.
1511 *
1512 * @see ephysics_world_perspective_set() for more details.
1513 * @see ephysics_world_perspective_enabled_set().
1514 *
1515 * @ingroup EPhysics_World
1516 */
1517EAPI Eina_Bool ephysics_world_perspective_enabled_get(const EPhysics_World *world);
1518
1519/**
1426 * @} 1520 * @}
1427 */ 1521 */
1428 1522