summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/lib/EPhysics.h
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-10-30 18:31:32 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-10-30 18:31:32 +0000
commit54a8f1678d83a528f6fc686f89288cd91855eb46 (patch)
tree422c58334ea193322f9a54b3d0c073f0c1e61dfa /legacy/ephysics/src/lib/EPhysics.h
parentf9b904ae03b2d424fc7df9ea26666578249941bb (diff)
ephysics: break up light functions
Long list of same typed parameters is very error prone. Not the scene will have a initial light configuration, that can be enabled and modified. SVN revision: 78678
Diffstat (limited to '')
-rw-r--r--legacy/ephysics/src/lib/EPhysics.h83
1 files changed, 65 insertions, 18 deletions
diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h
index b6d739bdd2..2d869783af 100644
--- a/legacy/ephysics/src/lib/EPhysics.h
+++ b/legacy/ephysics/src/lib/EPhysics.h
@@ -1413,7 +1413,7 @@ EAPI void ephysics_world_simulation_get(const EPhysics_World *world, double *fix
1413 1413
1414/** 1414/**
1415 * @brief 1415 * @brief
1416 * Set light properties to be applied on the scene. 1416 * Set position of point light to be applied on the scene.
1417 * 1417 *
1418 * It will perform lighting calculations on the evas map applied on evas 1418 * It will perform lighting calculations on the evas map applied on evas
1419 * objects associated with all the bodies to have light applied over. 1419 * objects associated with all the bodies to have light applied over.
@@ -1434,63 +1434,110 @@ EAPI void ephysics_world_simulation_get(const EPhysics_World *world, double *fix
1434 * @ref ephysics_world_light_all_bodies_set(). The other, is to set each body 1434 * @ref ephysics_world_light_all_bodies_set(). The other, is to set each body
1435 * individually, with @ref ephysics_body_light_set(). 1435 * individually, with @ref ephysics_body_light_set().
1436 * 1436 *
1437 * By default, no light is set. And after a light is set, by default, 1437 * By default, point light is set to position (0, 0, -200) and has white color
1438 * no body will be affected. No change will be visible until 1438 * (r=255, g=255, b=255). The ambient color is black (r=0, g=0, b=0).
1439 * But no body will be affected. No change will be visible until
1439 * some bodies are set to be enlightened. 1440 * some bodies are set to be enlightened.
1440 * 1441 *
1441 * @param world The physics world. 1442 * @param world The physics world.
1442 * @param lx X coordinate in space of light point 1443 * @param lx X coordinate in space of light point
1443 * @param ly Y coordinate in space of light point 1444 * @param ly Y coordinate in space of light point
1444 * @param lz Z coordinate in space of light point 1445 * @param lz Z coordinate in space of light point
1446 *
1447 * @see ephysics_world_point_light_position_get().
1448 * @see ephysics_world_point_light_color_set().
1449 * @see ephysics_world_ambient_light_color_set().
1450 *
1451 * @ingroup EPhysics_World
1452 */
1453EAPI void ephysics_world_point_light_position_set(EPhysics_World *world, Evas_Coord lx, Evas_Coord ly, Evas_Coord lz);
1454
1455/**
1456 * @brief
1457 * Set color of point light to be applied on the scene.
1458 *
1459 * By default color of point light is r=255, g=255, b=255.
1460 *
1461 * @param world The physics world.
1445 * @param lr light red value (0 - 255) 1462 * @param lr light red value (0 - 255)
1446 * @param lg light green value (0 - 255) 1463 * @param lg light green value (0 - 255)
1447 * @param lb light blue value (0 - 255) 1464 * @param lb light blue value (0 - 255)
1465 *
1466 * @see ephysics_world_point_light_position_set() for more details.
1467 * @see ephysics_world_point_light_color_get().
1468 *
1469 * @ingroup EPhysics_World
1470 */
1471EAPI void ephysics_world_point_light_color_set(EPhysics_World *world, int lr, int lg, int lb);
1472
1473/**
1474 * @brief
1475 * Set color of the ambient light to be applied on the scene.
1476 *
1477 * By default, ambient color is set to r=0, g=0, b=0.
1478 *
1479 * @param world The physics world.
1448 * @param ar ambient color red value (0 - 255) 1480 * @param ar ambient color red value (0 - 255)
1449 * @param ag ambient color green value (0 - 255) 1481 * @param ag ambient color green value (0 - 255)
1450 * @param ab ambient color blue value (0 - 255) 1482 * @param ab ambient color blue value (0 - 255)
1451 * 1483 *
1452 * @see ephysics_world_light_get(). 1484 * @see ephysics_world_point_light_position_set() for more details.
1485 * @see ephysics_world_ambient_light_color_get().
1453 * 1486 *
1454 * @ingroup EPhysics_World 1487 * @ingroup EPhysics_World
1455 */ 1488 */
1456EAPI void ephysics_world_light_set(EPhysics_World *world, Evas_Coord lx, Evas_Coord ly, Evas_Coord lz, int lr, int lg, int lb, int ar, int ag, int ab); 1489EAPI void ephysics_world_ambient_light_color_set(EPhysics_World *world, int ar, int ag, int ab);
1457 1490
1458/** 1491/**
1459 * @brief 1492 * @brief
1460 * Get light properties. 1493 * Get position of point light applied on the scene.
1461 * 1494 *
1462 * @param world The physics world. 1495 * @param world The physics world.
1463 * @param lx X coordinate in space of light point 1496 * @param lx X coordinate in space of light point
1464 * @param ly Y coordinate in space of light point 1497 * @param ly Y coordinate in space of light point
1465 * @param lz Z coordinate in space of light point 1498 * @param lz Z coordinate in space of light point
1499 *
1500 * @see ephysics_world_point_light_position_set() for details.
1501 *
1502 * @ingroup EPhysics_World
1503 */
1504EAPI void ephysics_world_point_light_position_get(const EPhysics_World *world, Evas_Coord *lx, Evas_Coord *ly, Evas_Coord *lz);
1505
1506/**
1507 * @brief
1508 * Get color of point light applied on the scene.
1509 *
1510 * By default color of point light is r=255, g=255, b=255.
1511 *
1512 * @param world The physics world.
1466 * @param lr light red value (0 - 255) 1513 * @param lr light red value (0 - 255)
1467 * @param lg light green value (0 - 255) 1514 * @param lg light green value (0 - 255)
1468 * @param lb light blue value (0 - 255) 1515 * @param lb light blue value (0 - 255)
1469 * @param ar ambient color red value (0 - 255)
1470 * @param ag ambient color green value (0 - 255)
1471 * @param ab ambient color blue value (0 - 255)
1472 * @return @c EINA_TRUE if light is set, or @c EINA_FALSE if it isn't set,
1473 * or on error. On this case the other parameters won't be set.
1474 * 1516 *
1475 * @see ephysics_world_light_set() for more details. 1517 * @see ephysics_world_point_light_position_set() for more details.
1518 * @see ephysics_world_point_light_color_set().
1476 * 1519 *
1477 * @ingroup EPhysics_World 1520 * @ingroup EPhysics_World
1478 */ 1521 */
1479EAPI Eina_Bool ephysics_world_light_get(const EPhysics_World *world, Evas_Coord *lx, Evas_Coord *ly, Evas_Coord *lz, int *lr, int *lg, int *lb, int *ar, int *ag, int *ab); 1522EAPI void ephysics_world_point_light_color_get(const EPhysics_World *world, int *lr, int *lg, int *lb);
1480 1523
1481/** 1524/**
1482 * @brief 1525 * @brief
1483 * Unset light on the scene. 1526 * Set color of the ambient light to be applied on the scene.
1484 * 1527 *
1485 * It will unset light, so no body will be enlightened anymore. 1528 * By default, ambient color is set to r=0, g=0, b=0.
1486 * 1529 *
1487 * @param world The physics world. 1530 * @param world The physics world.
1531 * @param ar ambient color red value (0 - 255)
1532 * @param ag ambient color green value (0 - 255)
1533 * @param ab ambient color blue value (0 - 255)
1488 * 1534 *
1489 * @see ephysics_world_light_set() for more details. 1535 * @see ephysics_world_point_light_position_set() for more details.
1536 * @see ephysics_world_ambient_light_color_set().
1490 * 1537 *
1491 * @ingroup EPhysics_World 1538 * @ingroup EPhysics_World
1492 */ 1539 */
1493EAPI void ephysics_world_light_unset(EPhysics_World *world); 1540EAPI void ephysics_world_ambient_light_color_get(const EPhysics_World *world, int *ar, int *ag, int *ab);
1494 1541
1495/** 1542/**
1496 * @brief 1543 * @brief
@@ -1501,7 +1548,7 @@ EAPI void ephysics_world_light_unset(EPhysics_World *world);
1501 * all the bodies, or @c EINA_FALSE if it only should be applied on bodies with 1548 * all the bodies, or @c EINA_FALSE if it only should be applied on bodies with
1502 * light property set. 1549 * light property set.
1503 * 1550 *
1504 * @see ephysics_world_light_set() for more details. 1551 * @see ephysics_world_point_light_position_set() for more details.
1505 * @see ephysics_world_light_all_bodies_get(). 1552 * @see ephysics_world_light_all_bodies_get().
1506 * 1553 *
1507 * @ingroup EPhysics_World 1554 * @ingroup EPhysics_World