diff options
author | Bruno Dilly <bdilly@profusion.mobi> | 2012-11-09 18:52:42 +0000 |
---|---|---|
committer | Bruno Dilly <bdilly@profusion.mobi> | 2012-11-09 18:52:42 +0000 |
commit | 61d7e5e30ea865a699bc2cadb9487282791fd970 (patch) | |
tree | 31ca37493aec38c82fa09c81b0e900eca870423e /legacy/ephysics/src/lib/EPhysics.h | |
parent | 7af37b39809a0bc03b1c2c86c8261c91eae75916 (diff) |
ephysics: support multiple evas objects associated to
body
SVN revision: 79041
Diffstat (limited to '')
-rw-r--r-- | legacy/ephysics/src/lib/EPhysics.h | 252 |
1 files changed, 252 insertions, 0 deletions
diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h index 72a52ddba0..710df3a656 100644 --- a/legacy/ephysics/src/lib/EPhysics.h +++ b/legacy/ephysics/src/lib/EPhysics.h | |||
@@ -1842,6 +1842,66 @@ 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 | ||
1846 | * @typedef EPhysics_Body_Box_Face | ||
1847 | * | ||
1848 | * Define in wich box's face the evas object should be set. | ||
1849 | * | ||
1850 | * @see ephysics_body_box_face_evas_object_set() | ||
1851 | * | ||
1852 | * @ingroup EPhysics_Body | ||
1853 | */ | ||
1854 | typedef enum _EPhysics_Body_Box_Face | ||
1855 | { | ||
1856 | EPHYSICS_BODY_BOX_FACE_MIDDLE_FRONT, | ||
1857 | EPHYSICS_BODY_BOX_FACE_MIDDLE_BACK, | ||
1858 | EPHYSICS_BODY_BOX_FACE_FRONT, | ||
1859 | EPHYSICS_BODY_BOX_FACE_BACK, | ||
1860 | EPHYSICS_BODY_BOX_FACE_LEFT, | ||
1861 | EPHYSICS_BODY_BOX_FACE_RIGHT, | ||
1862 | EPHYSICS_BODY_BOX_FACE_TOP, | ||
1863 | EPHYSICS_BODY_BOX_FACE_BOTTOM, | ||
1864 | EPHYSICS_BODY_BOX_FACE_LAST, | ||
1865 | } EPhysics_Body_Box_Face; | ||
1866 | |||
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 | */ | ||
1877 | typedef enum _EPhysics_Body_Cylinder_Face | ||
1878 | { | ||
1879 | EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_FRONT, | ||
1880 | EPHYSICS_BODY_CYLINDER_FACE_MIDDLE_BACK, | ||
1881 | EPHYSICS_BODY_CYLINDER_FACE_FRONT, | ||
1882 | EPHYSICS_BODY_CYLINDER_FACE_BACK, | ||
1883 | EPHYSICS_BODY_CYLINDER_FACE_CURVED, | ||
1884 | EPHYSICS_BODY_CYLINDER_FACE_LAST, | ||
1885 | } EPhysics_Body_Cylinder_Face; | ||
1886 | |||
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 | */ | ||
1897 | typedef enum _EPhysics_Body_Cloth_Face | ||
1898 | { | ||
1899 | EPHYSICS_BODY_CLOTH_FACE_FRONT, | ||
1900 | EPHYSICS_BODY_CLOTH_FACE_BACK, | ||
1901 | EPHYSICS_BODY_CLOTH_FACE_LAST, | ||
1902 | } EPhysics_Body_Cloth_Face; | ||
1903 | |||
1904 | /** | ||
1845 | * @typedef EPhysics_Body_Collision | 1905 | * @typedef EPhysics_Body_Collision |
1846 | * | 1906 | * |
1847 | * Body collision wraps collision informations. | 1907 | * Body collision wraps collision informations. |
@@ -2084,6 +2144,8 @@ EAPI void ephysics_body_soft_body_triangle_move(EPhysics_Body *body, int idx, Ev | |||
2084 | * @return a new body or @c NULL, on errors. | 2144 | * @return a new body or @c NULL, on errors. |
2085 | * | 2145 | * |
2086 | * @see ephysics_body_del(). | 2146 | * @see ephysics_body_del(). |
2147 | * @see ephysics_body_evas_object_set(). | ||
2148 | * @see ephysics_body_cylinder_face_evas_object_set(). | ||
2087 | * | 2149 | * |
2088 | * @ingroup EPhysics_Body | 2150 | * @ingroup EPhysics_Body |
2089 | */ | 2151 | */ |
@@ -2113,6 +2175,8 @@ EAPI EPhysics_Body *ephysics_body_circle_add(EPhysics_World *world); | |||
2113 | * @return a new body or @c NULL, on errors. | 2175 | * @return a new body or @c NULL, on errors. |
2114 | * | 2176 | * |
2115 | * @see ephysics_body_del(). | 2177 | * @see ephysics_body_del(). |
2178 | * @see ephysics_body_evas_object_set(). | ||
2179 | * @see ephysics_body_cylinder_face_evas_object_set(). | ||
2116 | * @see ephysics_world_simulation_set(). | 2180 | * @see ephysics_world_simulation_set(). |
2117 | * | 2181 | * |
2118 | * @ingroup EPhysics_Body | 2182 | * @ingroup EPhysics_Body |
@@ -2134,6 +2198,7 @@ EAPI EPhysics_Body *ephysics_body_soft_circle_add(EPhysics_World *world); | |||
2134 | * | 2198 | * |
2135 | * @see ephysics_body_del(). | 2199 | * @see ephysics_body_del(). |
2136 | * @see ephysics_body_evas_object_set(). | 2200 | * @see ephysics_body_evas_object_set(). |
2201 | * @see ephysics_body_box_face_evas_object_set(). | ||
2137 | * | 2202 | * |
2138 | * @ingroup EPhysics_Body | 2203 | * @ingroup EPhysics_Body |
2139 | */ | 2204 | */ |
@@ -2159,6 +2224,7 @@ EAPI EPhysics_Body *ephysics_body_box_add(EPhysics_World *world); | |||
2159 | * | 2224 | * |
2160 | * @see ephysics_body_del(). | 2225 | * @see ephysics_body_del(). |
2161 | * @see ephysics_body_evas_object_set(). | 2226 | * @see ephysics_body_evas_object_set(). |
2227 | * @see ephysics_body_box_face_evas_object_set(). | ||
2162 | * @see ephysics_world_simulation_set(). | 2228 | * @see ephysics_world_simulation_set(). |
2163 | * | 2229 | * |
2164 | * @ingroup EPhysics_Body | 2230 | * @ingroup EPhysics_Body |
@@ -2188,6 +2254,7 @@ EAPI EPhysics_Body *ephysics_body_soft_box_add(EPhysics_World *world); | |||
2188 | * | 2254 | * |
2189 | * @see ephysics_body_del(). | 2255 | * @see ephysics_body_del(). |
2190 | * @see ephysics_body_evas_object_set(). | 2256 | * @see ephysics_body_evas_object_set(). |
2257 | * @see ephysics_body_cloth_face_evas_object_set(). | ||
2191 | * @see ephysics_world_simulation_set(). | 2258 | * @see ephysics_world_simulation_set(). |
2192 | * @see ephysics_body_cloth_anchor_add(). | 2259 | * @see ephysics_body_cloth_anchor_add(). |
2193 | * @see ephysics_body_cloth_anchor_full_add(). | 2260 | * @see ephysics_body_cloth_anchor_full_add(). |
@@ -2429,6 +2496,12 @@ EAPI EPhysics_World *ephysics_body_world_get(const EPhysics_Body *body); | |||
2429 | * updates of associated evas objects, or complement updates, like changing | 2496 | * updates of associated evas objects, or complement updates, like changing |
2430 | * evas objects properties under certain conditions of position or rotation. | 2497 | * evas objects properties under certain conditions of position or rotation. |
2431 | * | 2498 | * |
2499 | * 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: | ||
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 | * | ||
2432 | * @param body The body to associate to an evas object. | 2505 | * @param body The body to associate to an evas object. |
2433 | * @param evas_obj The evas object that will be associated to this @p body. | 2506 | * @param evas_obj The evas object that will be associated to this @p body. |
2434 | * @param use_obj_pos If @c EINA_TRUE it will set the physics body position | 2507 | * @param use_obj_pos If @c EINA_TRUE it will set the physics body position |
@@ -2475,6 +2548,185 @@ EAPI Evas_Object *ephysics_body_evas_object_get(const EPhysics_Body *body); | |||
2475 | 2548 | ||
2476 | /** | 2549 | /** |
2477 | * @brief | 2550 | * @brief |
2551 | * Set an evas object to a physics box 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 | */ | ||
2577 | EAPI 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 | */ | ||
2592 | EAPI 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 | */ | ||
2607 | EAPI 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 | */ | ||
2637 | EAPI 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 | */ | ||
2652 | EAPI 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 | */ | ||
2667 | EAPI 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 | * | ||
2673 | * It will create a direct association between a specific face of the physics | ||
2674 | * body and an evas object. | ||
2675 | * With that EPhysics will be able to update evas object | ||
2676 | * position and rotation automatically. | ||
2677 | * | ||
2678 | * If it's required to associate only one evas object to this body, a more | ||
2679 | * generic function @see ephysics_body_evas_object_set() can be used. | ||
2680 | * | ||
2681 | * @param body The body to associate to an evas object. | ||
2682 | * @param face The specific face of @p body where the evas object will be | ||
2683 | * placed. | ||
2684 | * @param evas_obj The evas object that will be associated to this @p body. | ||
2685 | * @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. | ||
2687 | * | ||
2688 | * @see ephysics_body_cloth_face_evas_object_unset(). | ||
2689 | * @see ephysics_body_cloth_face_evas_object_get(). | ||
2690 | * @see ephysics_body_cloth_add(). | ||
2691 | * @see ephysics_body_evas_object_set(). | ||
2692 | * @see ephysics_world_rate_set(). | ||
2693 | * | ||
2694 | * @ingroup EPhysics_Body | ||
2695 | */ | ||
2696 | EAPI 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); | ||
2697 | |||
2698 | /** | ||
2699 | * @brief | ||
2700 | * Get the evas object associated to a physics cloth body face. | ||
2701 | * | ||
2702 | * @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. | ||
2704 | * @return The associated evas object, or @c NULL if no object is associated | ||
2705 | * or on error. | ||
2706 | * | ||
2707 | * @see ephysics_body_cloth_face_evas_object_set() for more details. | ||
2708 | * | ||
2709 | * @ingroup EPhysics_Body | ||
2710 | */ | ||
2711 | EAPI Evas_Object *ephysics_body_cloth_face_evas_object_get(const EPhysics_Body *body, EPhysics_Body_Cloth_Face face); | ||
2712 | |||
2713 | /** | ||
2714 | * @brief | ||
2715 | * Unset the evas object associated to a physics cloth body face. | ||
2716 | * | ||
2717 | * @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. | ||
2719 | * @return The associated evas object, or @c NULL if no object is associated | ||
2720 | * or on error. | ||
2721 | * | ||
2722 | * @see ephysics_body_cloth_face_evas_object_set() for more details. | ||
2723 | * | ||
2724 | * @ingroup EPhysics_Body | ||
2725 | */ | ||
2726 | EAPI Evas_Object *ephysics_body_cloth_face_evas_object_unset(EPhysics_Body *body, EPhysics_Body_Cloth_Face face); | ||
2727 | |||
2728 | /** | ||
2729 | * @brief | ||
2478 | * Set physics body size. | 2730 | * Set physics body size. |
2479 | * | 2731 | * |
2480 | * By default circles have diameter equal to 1 meter * rate, boxes have | 2732 | * By default circles have diameter equal to 1 meter * rate, boxes have |