summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/lib/EPhysics.h
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-10-18 23:55:45 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-18 23:55:45 +0000
commit211d38aac0745164814ea5db5e27e8f071d1a364 (patch)
treee68c970317b7dd9d0f236549ac8710506f34d292 /legacy/ephysics/src/lib/EPhysics.h
parent08643f3112c2b1494734aae07a34927275655fac (diff)
ephysics: move perspective stuff to camera component
Looks like it fits better the camera component than world. SVN revision: 78206
Diffstat (limited to '')
-rw-r--r--legacy/ephysics/src/lib/EPhysics.h188
1 files changed, 94 insertions, 94 deletions
diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h
index fb13874718..072c1be325 100644
--- a/legacy/ephysics/src/lib/EPhysics.h
+++ b/legacy/ephysics/src/lib/EPhysics.h
@@ -429,6 +429,100 @@ EAPI void ephysics_camera_body_track(EPhysics_Camera *camera, EPhysics_Body *bod
429EAPI void ephysics_camera_tracked_body_get(EPhysics_Camera *camera, EPhysics_Body **body, Eina_Bool *horizontal, Eina_Bool *vertical); 429EAPI void ephysics_camera_tracked_body_get(EPhysics_Camera *camera, EPhysics_Body **body, Eina_Bool *horizontal, Eina_Bool *vertical);
430 430
431/** 431/**
432 * @brief
433 * Set perspective to be applied on the scene.
434 *
435 * This applies a given perspective (3D) to the world rendering.
436 * It will be used when the scene is rendered, after each simulation step,
437 * by @ref ephysics_body_evas_object_update().
438 *
439 * The @p px and @p py points specify the "infinite distance" point in the 3D
440 * conversion (where all lines converge to like when artists draw 3D by hand).
441 * The @p z0 value specifies the z value at which there is a 1:1 mapping between
442 * spatial coordinates and screen coordinates. Any points on this z value will
443 * not have their X and Y values modified in the transform.
444 * Those further away (Z value higher) will shrink into the distance, and those
445 * less than this value will expand and become bigger. The foc value determines
446 * the "focal length" of the camera. This is in reality the distance between
447 * the camera lens plane itself (at or closer than this rendering results are
448 * undefined) and the @p z0 z value. This allows for some "depth" control and
449 * @p foc must be greater than 0.
450 *
451 * Considering the world geometry, by default, perspective is set to
452 * px = x + w / 2, py = y + h / 2, z0 = z + d / 2 and foc = 10 * (z + d).
453 * This means the conversion point is centered on render area, and @p z0
454 * is on the center of render area z axis. It is set when
455 * @ref ephysics_world_render_geometry_set() is called.
456 *
457 * @note The unit used for all parameters is Evas coordinates.
458 *
459 * @note To be used, perspective need to be enabled with
460 * @ref ephysics_camera_perspective_enabled_set().
461 *
462 * @param camera The world's camera.
463 * @param px The perspective distance X coordinate
464 * @param py The perspective distance Y coordinate
465 * @param z0 The "0" z plane value
466 * @param foc The focal distance
467 *
468 * @see ephysics_camera_perspective_get().
469 * @see ephysics_camera_perspective_enabled_set().
470 *
471 * @ingroup EPhysics_Camera
472 */
473EAPI void ephysics_camera_perspective_set(EPhysics_Camera *camera, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc);
474
475/**
476 * @brief
477 * Get perspective applied on the scene.
478 *
479 * @param camera The world's camera.
480 * @param px The perspective distance X coordinate
481 * @param py The perspective distance Y coordinate
482 * @param z0 The "0" z plane value
483 * @param foc The focal distance
484 *
485 * @see ephysics_camera_perspective_set() for more details.
486 * @see ephysics_camera_perspective_enabled_get().
487 *
488 * @ingroup EPhysics_Camera
489 */
490EAPI void ephysics_camera_perspective_get(const EPhysics_Camera *camera, Evas_Coord *px, Evas_Coord *py, Evas_Coord *z0, Evas_Coord *foc);
491
492/**
493 * @brief
494 * Set if perspective should be applied.
495 *
496 * The applied perspective can be set with
497 * @ref ephysics_camera_perspective_set().
498 *
499 * @param camera The world's camera.
500 * @param enabled @c EINA_TRUE if perspective should be used, or @c EINA_FALSE
501 * if it shouldn't.
502 *
503 * @see ephysics_camera_perspective_set() for more details.
504 * @see ephysics_camera_perspective_enabled_get().
505 *
506 * @ingroup EPhysics_Camera
507 */
508EAPI void ephysics_camera_perspective_enabled_set(EPhysics_Camera *camera, Eina_Bool enabled);
509
510/**
511 * @brief
512 * Return if perspective is enabled or not.
513 *
514 * @param camera The world's camera.
515 * @return @c EINA_TRUE if perspective is enabled, or @c EINA_FALSE if it
516 * isn't, or on error.
517 *
518 * @see ephysics_camera_perspective_set() for more details.
519 * @see ephysics_camera_perspective_enabled_set().
520 *
521 * @ingroup EPhysics_Camera
522 */
523EAPI Eina_Bool ephysics_camera_perspective_enabled_get(const EPhysics_Camera *camera);
524
525/**
432 * @} 526 * @}
433 */ 527 */
434 528
@@ -1423,100 +1517,6 @@ 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); 1517EAPI Eina_Bool ephysics_world_light_all_bodies_get(const EPhysics_World *world);
1424 1518
1425/** 1519/**
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/**
1520 * @} 1520 * @}
1521 */ 1521 */
1522 1522