summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/lib/EPhysics.h
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-11-09 18:52:49 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-11-09 18:52:49 +0000
commit530c8b4310119e691139a09bda106e9ed276697b (patch)
treebdbbe72ece1f67c664159d65e1889ca3c9784fa2 /legacy/ephysics/src/lib/EPhysics.h
parent61d7e5e30ea865a699bc2cadb9487282791fd970 (diff)
ephysics: use a common API to add faces for all types
of body SVN revision: 79042
Diffstat (limited to '')
-rw-r--r--legacy/ephysics/src/lib/EPhysics.h199
1 files changed, 24 insertions, 175 deletions
diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h
index 710df3a656..7611e0bd44 100644
--- a/legacy/ephysics/src/lib/EPhysics.h
+++ b/legacy/ephysics/src/lib/EPhysics.h
@@ -1842,16 +1842,16 @@ typedef enum _EPhysics_Body_Cloth_Anchor_Side
1842} EPhysics_Body_Cloth_Anchor_Side; 1842} EPhysics_Body_Cloth_Anchor_Side;
1843 1843
1844/** 1844/**
1845 * @enum _EPhysics_Body_Box_Face 1845 * @enum _EPhysics_Body_Face
1846 * @typedef EPhysics_Body_Box_Face 1846 * @typedef EPhysics_Body_Face
1847 * 1847 *
1848 * Define in wich box's face the evas object should be set. 1848 * Define in wich body's face the evas object should be set.
1849 * 1849 *
1850 * @see ephysics_body_box_face_evas_object_set() 1850 * @see ephysics_body_face_evas_object_set()
1851 * 1851 *
1852 * @ingroup EPhysics_Body 1852 * @ingroup EPhysics_Body
1853 */ 1853 */
1854typedef enum _EPhysics_Body_Box_Face 1854typedef enum _EPhysics_Body_Face
1855{ 1855{
1856 EPHYSICS_BODY_BOX_FACE_MIDDLE_FRONT, 1856 EPHYSICS_BODY_BOX_FACE_MIDDLE_FRONT,
1857 EPHYSICS_BODY_BOX_FACE_MIDDLE_BACK, 1857 EPHYSICS_BODY_BOX_FACE_MIDDLE_BACK,
@@ -1861,45 +1861,18 @@ typedef enum _EPhysics_Body_Box_Face
1861 EPHYSICS_BODY_BOX_FACE_RIGHT, 1861 EPHYSICS_BODY_BOX_FACE_RIGHT,
1862 EPHYSICS_BODY_BOX_FACE_TOP, 1862 EPHYSICS_BODY_BOX_FACE_TOP,
1863 EPHYSICS_BODY_BOX_FACE_BOTTOM, 1863 EPHYSICS_BODY_BOX_FACE_BOTTOM,
1864 EPHYSICS_BODY_BOX_FACE_LAST,
1865} EPhysics_Body_Box_Face;
1866 1864
1867/**
1868 * @enum _EPhysics_Body_Cylinder_Face
1869 * @typedef EPhysics_Body_Cylinder_Face
1870 *
1871 * Define in wich cylinder's face the evas object should be set.
1872 *
1873 * @see ephysics_body_cylinder_face_evas_object_set()
1874 *
1875 * @ingroup EPhysics_Body
1876 */
1877typedef enum _EPhysics_Body_Cylinder_Face
1878{
1879 EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_FRONT, 1865 EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_FRONT,
1880 EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_BACK, 1866 EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_BACK,
1881 EPHYSICS_BODY_CYLINDER_FACE_FRONT, 1867 EPHYSICS_BODY_CYLINDER_FACE_FRONT,
1882 EPHYSICS_BODY_CYLINDER_FACE_BACK, 1868 EPHYSICS_BODY_CYLINDER_FACE_BACK,
1883 EPHYSICS_BODY_CYLINDER_FACE_CURVED, 1869 EPHYSICS_BODY_CYLINDER_FACE_CURVED,
1884 EPHYSICS_BODY_CYLINDER_FACE_LAST,
1885} EPhysics_Body_Cylinder_Face;
1886 1870
1887/**
1888 * @enum _EPhysics_Body_Cloth_Face
1889 * @typedef EPhysics_Body_Cloth_Face
1890 *
1891 * Define in wich cloth's face the evas object should be set.
1892 *
1893 * @see ephysics_body_cloth_face_evas_object_set()
1894 *
1895 * @ingroup EPhysics_Body
1896 */
1897typedef enum _EPhysics_Body_Cloth_Face
1898{
1899 EPHYSICS_BODY_CLOTH_FACE_FRONT, 1871 EPHYSICS_BODY_CLOTH_FACE_FRONT,
1900 EPHYSICS_BODY_CLOTH_FACE_BACK, 1872 EPHYSICS_BODY_CLOTH_FACE_BACK,
1901 EPHYSICS_BODY_CLOTH_FACE_LAST, 1873
1902} EPhysics_Body_Cloth_Face; 1874 EPHYSICS_BODY_FACE_LAST,
1875} EPhysics_Body_Face;
1903 1876
1904/** 1877/**
1905 * @typedef EPhysics_Body_Collision 1878 * @typedef EPhysics_Body_Collision
@@ -2145,7 +2118,7 @@ EAPI void ephysics_body_soft_body_triangle_move(EPhysics_Body *body, int idx, Ev
2145 * 2118 *
2146 * @see ephysics_body_del(). 2119 * @see ephysics_body_del().
2147 * @see ephysics_body_evas_object_set(). 2120 * @see ephysics_body_evas_object_set().
2148 * @see ephysics_body_cylinder_face_evas_object_set(). 2121 * @see ephysics_body_face_evas_object_set().
2149 * 2122 *
2150 * @ingroup EPhysics_Body 2123 * @ingroup EPhysics_Body
2151 */ 2124 */
@@ -2176,7 +2149,7 @@ EAPI EPhysics_Body *ephysics_body_circle_add(EPhysics_World *world);
2176 * 2149 *
2177 * @see ephysics_body_del(). 2150 * @see ephysics_body_del().
2178 * @see ephysics_body_evas_object_set(). 2151 * @see ephysics_body_evas_object_set().
2179 * @see ephysics_body_cylinder_face_evas_object_set(). 2152 * @see ephysics_body_face_evas_object_set().
2180 * @see ephysics_world_simulation_set(). 2153 * @see ephysics_world_simulation_set().
2181 * 2154 *
2182 * @ingroup EPhysics_Body 2155 * @ingroup EPhysics_Body
@@ -2198,7 +2171,7 @@ EAPI EPhysics_Body *ephysics_body_soft_circle_add(EPhysics_World *world);
2198 * 2171 *
2199 * @see ephysics_body_del(). 2172 * @see ephysics_body_del().
2200 * @see ephysics_body_evas_object_set(). 2173 * @see ephysics_body_evas_object_set().
2201 * @see ephysics_body_box_face_evas_object_set(). 2174 * @see ephysics_body_face_evas_object_set().
2202 * 2175 *
2203 * @ingroup EPhysics_Body 2176 * @ingroup EPhysics_Body
2204 */ 2177 */
@@ -2224,7 +2197,7 @@ EAPI EPhysics_Body *ephysics_body_box_add(EPhysics_World *world);
2224 * 2197 *
2225 * @see ephysics_body_del(). 2198 * @see ephysics_body_del().
2226 * @see ephysics_body_evas_object_set(). 2199 * @see ephysics_body_evas_object_set().
2227 * @see ephysics_body_box_face_evas_object_set(). 2200 * @see ephysics_body_face_evas_object_set().
2228 * @see ephysics_world_simulation_set(). 2201 * @see ephysics_world_simulation_set().
2229 * 2202 *
2230 * @ingroup EPhysics_Body 2203 * @ingroup EPhysics_Body
@@ -2254,7 +2227,7 @@ EAPI EPhysics_Body *ephysics_body_soft_box_add(EPhysics_World *world);
2254 * 2227 *
2255 * @see ephysics_body_del(). 2228 * @see ephysics_body_del().
2256 * @see ephysics_body_evas_object_set(). 2229 * @see ephysics_body_evas_object_set().
2257 * @see ephysics_body_cloth_face_evas_object_set(). 2230 * @see ephysics_body_face_evas_object_set().
2258 * @see ephysics_world_simulation_set(). 2231 * @see ephysics_world_simulation_set().
2259 * @see ephysics_body_cloth_anchor_add(). 2232 * @see ephysics_body_cloth_anchor_add().
2260 * @see ephysics_body_cloth_anchor_full_add(). 2233 * @see ephysics_body_cloth_anchor_full_add().
@@ -2497,10 +2470,7 @@ EAPI EPhysics_World *ephysics_body_world_get(const EPhysics_Body *body);
2497 * evas objects properties under certain conditions of position or rotation. 2470 * evas objects properties under certain conditions of position or rotation.
2498 * 2471 *
2499 * If it's required to associate evas object to specific faces of the body, 2472 * If it's required to associate evas object to specific faces of the body,
2500 * the following functions could be used, depending on the body's shape: 2473 * function @ref ephysics_body_face_evas_object_set() could be used.
2501 * @li @ref ephysics_body_box_face_evas_object_set();
2502 * @li @ref ephysics_body_cylinder_face_evas_object_set();
2503 * @li @ref ephysics_body_cloth_face_evas_object_set().
2504 * 2474 *
2505 * @param body The body to associate to an evas object. 2475 * @param body The body to associate to an evas object.
2506 * @param evas_obj The evas object that will be associated to this @p body. 2476 * @param evas_obj The evas object that will be associated to this @p body.
@@ -2548,127 +2518,7 @@ EAPI Evas_Object *ephysics_body_evas_object_get(const EPhysics_Body *body);
2548 2518
2549/** 2519/**
2550 * @brief 2520 * @brief
2551 * Set an evas object to a physics box body face. 2521 * Set an evas object to a physics body face.
2552 *
2553 * It will create a direct association between a specific face of the physics
2554 * body and an evas object.
2555 * With that EPhysics will be able to update evas object
2556 * position and rotation automatically.
2557 *
2558 * If it's required to associate only one evas object to this body, a more
2559 * generic function @see ephysics_body_evas_object_set() can be used.
2560 *
2561 * @param body The body to associate to an evas object.
2562 * @param face The specific face of @p body where the evas object will be
2563 * placed.
2564 * @param evas_obj The evas object that will be associated to this @p body.
2565 * @param use_obj_pos If @c EINA_TRUE it will set the physics body position
2566 * to match evas object position taking world rate on consideration.
2567 *
2568 * @see ephysics_body_box_face_evas_object_unset().
2569 * @see ephysics_body_box_face_evas_object_get().
2570 * @see ephysics_body_box_add().
2571 * @see ephysics_body_soft_box_add().
2572 * @see ephysics_body_evas_object_set().
2573 * @see ephysics_world_rate_set().
2574 *
2575 * @ingroup EPhysics_Body
2576 */
2577EAPI void ephysics_body_box_face_evas_object_set(EPhysics_Body *body, EPhysics_Body_Box_Face face, Evas_Object *evas_obj, Eina_Bool use_obj_pos);
2578
2579/**
2580 * @brief
2581 * Get the evas object associated to a physics box body face.
2582 *
2583 * @param body The body to get an evas object from.
2584 * @param face The specific face of @p body where the evas object was placed.
2585 * @return The associated evas object, or @c NULL if no object is associated
2586 * or on error.
2587 *
2588 * @see ephysics_body_box_face_evas_object_set() for more details.
2589 *
2590 * @ingroup EPhysics_Body
2591 */
2592EAPI Evas_Object *ephysics_body_box_face_evas_object_get(const EPhysics_Body *body, EPhysics_Body_Box_Face face);
2593
2594/**
2595 * @brief
2596 * Unset the evas object associated to a physics box body face.
2597 *
2598 * @param body The body to unset an evas object from.
2599 * @param face The specific face of @p body where the evas object was placed.
2600 * @return The associated evas object, or @c NULL if no object is associated
2601 * or on error.
2602 *
2603 * @see ephysics_body_box_face_evas_object_set() for more details.
2604 *
2605 * @ingroup EPhysics_Body
2606 */
2607EAPI Evas_Object *ephysics_body_box_face_evas_object_unset(EPhysics_Body *body, EPhysics_Body_Box_Face face);
2608
2609/**
2610 * @brief
2611 * Set an evas object to a physics cylinder body face.
2612 *
2613 * It will create a direct association between a specific face of the physics
2614 * body and an evas object.
2615 * With that EPhysics will be able to update evas object
2616 * position and rotation automatically.
2617 *
2618 * If it's required to associate only one evas object to this body, a more
2619 * generic function @see ephysics_body_evas_object_set() can be used.
2620 *
2621 * @param body The body to associate to an evas object.
2622 * @param face The specific face of @p body where the evas object will be
2623 * placed.
2624 * @param evas_obj The evas object that will be associated to this @p body.
2625 * @param use_obj_pos If @c EINA_TRUE it will set the physics body position
2626 * to match evas object position taking world rate on consideration.
2627 *
2628 * @see ephysics_body_cylinder_face_evas_object_unset().
2629 * @see ephysics_body_cylinder_face_evas_object_get().
2630 * @see ephysics_body_circle_add().
2631 * @see ephysics_body_soft_circle_add().
2632 * @see ephysics_body_evas_object_set().
2633 * @see ephysics_world_rate_set().
2634 *
2635 * @ingroup EPhysics_Body
2636 */
2637EAPI void ephysics_body_cylinder_face_evas_object_set(EPhysics_Body *body, EPhysics_Body_Cylinder_Face face, Evas_Object *evas_obj, Eina_Bool use_obj_pos);
2638
2639/**
2640 * @brief
2641 * Get the evas object associated to a physics cylinder body face.
2642 *
2643 * @param body The body to get an evas object from.
2644 * @param face The specific face of @p body where the evas object was placed.
2645 * @return The associated evas object, or @c NULL if no object is associated
2646 * or on error.
2647 *
2648 * @see ephysics_body_cylinder_face_evas_object_set() for more details.
2649 *
2650 * @ingroup EPhysics_Body
2651 */
2652EAPI Evas_Object *ephysics_body_cylinder_face_evas_object_get(const EPhysics_Body *body, EPhysics_Body_Cylinder_Face face);
2653
2654/**
2655 * @brief
2656 * Unset the evas object associated to a physics cylinder body face.
2657 *
2658 * @param body The body to unset an evas object from.
2659 * @param face The specific face of @p body where the evas object was placed.
2660 * @return The associated evas object, or @c NULL if no object is associated
2661 * or on error.
2662 *
2663 * @see ephysics_body_cylinder_face_evas_object_set() for more details.
2664 *
2665 * @ingroup EPhysics_Body
2666 */
2667EAPI Evas_Object *ephysics_body_cylinder_face_evas_object_unset(EPhysics_Body *body, EPhysics_Body_Cylinder_Face face);
2668
2669/**
2670 * @brief
2671 * Set an evas object to a physics cloth body face.
2672 * 2522 *
2673 * It will create a direct association between a specific face of the physics 2523 * It will create a direct association between a specific face of the physics
2674 * body and an evas object. 2524 * body and an evas object.
@@ -2685,45 +2535,44 @@ EAPI Evas_Object *ephysics_body_cylinder_face_evas_object_unset(EPhysics_Body *b
2685 * @param use_obj_pos If @c EINA_TRUE it will set the physics body position 2535 * @param use_obj_pos If @c EINA_TRUE it will set the physics body position
2686 * to match evas object position taking world rate on consideration. 2536 * to match evas object position taking world rate on consideration.
2687 * 2537 *
2688 * @see ephysics_body_cloth_face_evas_object_unset(). 2538 * @see ephysics_body_face_evas_object_unset().
2689 * @see ephysics_body_cloth_face_evas_object_get(). 2539 * @see ephysics_body_face_evas_object_get().
2690 * @see ephysics_body_cloth_add().
2691 * @see ephysics_body_evas_object_set(). 2540 * @see ephysics_body_evas_object_set().
2692 * @see ephysics_world_rate_set(). 2541 * @see ephysics_world_rate_set().
2693 * 2542 *
2694 * @ingroup EPhysics_Body 2543 * @ingroup EPhysics_Body
2695 */ 2544 */
2696EAPI void ephysics_body_cloth_face_evas_object_set(EPhysics_Body *body, EPhysics_Body_Cloth_Face face, Evas_Object *evas_obj, Eina_Bool use_obj_pos); 2545EAPI void ephysics_body_face_evas_object_set(EPhysics_Body *body, EPhysics_Body_Face face, Evas_Object *evas_obj, Eina_Bool use_obj_pos);
2697 2546
2698/** 2547/**
2699 * @brief 2548 * @brief
2700 * Get the evas object associated to a physics cloth body face. 2549 * Get the evas object associated to a physics body face.
2701 * 2550 *
2702 * @param body The body to get an evas object from. 2551 * @param body The body to get an evas object from.
2703 * @param face The specific face of @p body where the evas object was placed. 2552 * @param face The specific face of @p body where the evas object was placed.
2704 * @return The associated evas object, or @c NULL if no object is associated 2553 * @return The associated evas object, or @c NULL if no object is associated
2705 * or on error. 2554 * or on error.
2706 * 2555 *
2707 * @see ephysics_body_cloth_face_evas_object_set() for more details. 2556 * @see ephysics_body_face_evas_object_set() for more details.
2708 * 2557 *
2709 * @ingroup EPhysics_Body 2558 * @ingroup EPhysics_Body
2710 */ 2559 */
2711EAPI Evas_Object *ephysics_body_cloth_face_evas_object_get(const EPhysics_Body *body, EPhysics_Body_Cloth_Face face); 2560EAPI Evas_Object *ephysics_body_face_evas_object_get(const EPhysics_Body *body, EPhysics_Body_Face face);
2712 2561
2713/** 2562/**
2714 * @brief 2563 * @brief
2715 * Unset the evas object associated to a physics cloth body face. 2564 * Unset the evas object associated to a physics body face.
2716 * 2565 *
2717 * @param body The body to unset an evas object from. 2566 * @param body The body to unset an evas object from.
2718 * @param face The specific face of @p body where the evas object was placed. 2567 * @param face The specific face of @p body where the evas object was placed.
2719 * @return The associated evas object, or @c NULL if no object is associated 2568 * @return The associated evas object, or @c NULL if no object is associated
2720 * or on error. 2569 * or on error.
2721 * 2570 *
2722 * @see ephysics_body_cloth_face_evas_object_set() for more details. 2571 * @see ephysics_body_face_evas_object_set() for more details.
2723 * 2572 *
2724 * @ingroup EPhysics_Body 2573 * @ingroup EPhysics_Body
2725 */ 2574 */
2726EAPI Evas_Object *ephysics_body_cloth_face_evas_object_unset(EPhysics_Body *body, EPhysics_Body_Cloth_Face face); 2575EAPI Evas_Object *ephysics_body_face_evas_object_unset(EPhysics_Body *body, EPhysics_Body_Face face);
2727 2576
2728/** 2577/**
2729 * @brief 2578 * @brief