summaryrefslogtreecommitdiff
path: root/legacy/ephysics/doc
diff options
context:
space:
mode:
authorRicardo de Almeida Gonzaga <ricardo@profusion.mobi>2012-09-21 17:01:17 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-09-21 17:01:17 +0000
commit0055318b514cb240d0d1974ea28f5a0469c543db (patch)
tree2c0e2e33024ad56fbedfb048562449bd90e686b9 /legacy/ephysics/doc
parentcdb1dec5b6ebdfe8ed8e8811fdc160ae44805ee4 (diff)
ephysics: add a new example doc: Shapes -
test_shapes.c Patch by: Ricardo de Almeida Gonzaga <ricardo@profusion.mobi> SVN revision: 76972
Diffstat (limited to 'legacy/ephysics/doc')
-rw-r--r--legacy/ephysics/doc/examples.dox98
1 files changed, 98 insertions, 0 deletions
diff --git a/legacy/ephysics/doc/examples.dox b/legacy/ephysics/doc/examples.dox
index 8161fa9e2b..3c726f8fd3 100644
--- a/legacy/ephysics/doc/examples.dox
+++ b/legacy/ephysics/doc/examples.dox
@@ -11,6 +11,7 @@
11 * @li @ref tutorial_ephysics_constraint 11 * @li @ref tutorial_ephysics_constraint
12 * @li @ref tutorial_ephysics_gravity 12 * @li @ref tutorial_ephysics_gravity
13 * @li @ref tutorial_ephysics_velocity 13 * @li @ref tutorial_ephysics_velocity
14 * @li @ref tutorial_ephysics_shapes
14 * @li @ref tutorial_ephysics_sleeping_threshold 15 * @li @ref tutorial_ephysics_sleeping_threshold
15 */ 16 */
16 17
@@ -801,6 +802,103 @@
801 */ 802 */
802 803
803 /** 804 /**
805 * @page tutorial_ephysics_shapes EPhysics - Shapes
806 *
807 * The purpose of this example is to demonstrate the EPhysics Shapes
808 * usage - The code creates two EPhysics_Bodys using a custom shape.
809 *
810 * For this example we'll have an EPhysics_World, and two basic EPhysics_Bodys.
811 *
812 * The basic concepts like - defining an EPhysics_World, render geometry,
813 * physics limiting boundaries, add an EPhysics_Body, associate it to evas
814 * objects, change restitution, friction and impulse properties, were
815 * already covered in
816 * @ref tutorial_ephysics_bouncing_ball
817 *
818 * @section add-shape Adding a Shape
819 * @dontinclude test_shapes.c
820 *
821 * Shapes are used to create bodies with shapes that differ from primitive
822 * ones, like box and circle.
823 *
824 * A shape consists in a group of points, the vertices of the body to be
825 * created later with ephysics_body_shape_add(). You can also save and load
826 * it from a file.
827 *
828 * We'll have to create a specific type of variable:
829 * @ref EPhysics_Shape
830 *
831 * @skip _world_populate(Test_Data
832 * @until Evas_Object *pentagon,
833 *
834 * First we add an image we want to add an EPhysics_Body to have a reference
835 * to after set the points (vertices).
836 *
837 * @skip pentagon = elm_image_add
838 * @until evas_object_show(pentagon);
839 *
840 * Here we create a new shape, note that the returned shape initially
841 * doesn't has points set, so its requiered to set vertices.
842 *
843 * @skipline pentagon_shape =
844 *
845 * Now we're setting the shape points (vertices) basing on the image that
846 * we added, two vertices form a link between them, an edge, so with some
847 * vertices is possible to create polygons, in this case a pentagon.
848 *
849 * @skip ephysics_shape_point_add(pentagon_shape
850 * @until , 1);
851 *
852 * Here we create a new physics body using a custom shape. The center of mass
853 * will be the center of the shape. Its collision shape will be the convex
854 * shape that has all the points (and edges) we added to this shape before.
855 *
856 * @skip pentagon_body = ephysics_body_shape_add
857 * @until ephysics_body_restitution_set(pentagon_body, 1);
858 *
859 * Here we just delete the custom shape (not the body) after used to create
860 * the wanted bodies, it's required to delete it. It won't be deleted
861 * automatically by ephysics at any point, even on shutdown.
862 *
863 * @skipline ephysics_shape_del(pentagon_shape
864 *
865 * In the example we add another shape with the same process we just used,
866 * but with different image and points.
867 *
868 * @dontinclude test_shapes.c
869 *
870 * @skip ephysics_shape_point_add(hexagon_shape
871 * @until 18, 60);
872 *
873 * Here we finish the example. The full source code can be found at
874 * @ref test_shapes_c.
875 *
876 */
877
878 /**
879 * @page test_shapes_c test_shapes.c
880 *
881 * @section ephysics-test-h ephysics_test.h
882 * @include ephysics_test.h
883 *
884 * @section test-shapes-c test_shapes.c
885 * @dontinclude test.c
886 *
887 * @skip test_clean
888 * @until }
889 *
890 * @skip test_data_new
891 * @until }
892 *
893 * @skip test_win_add
894 * @until }
895 *
896 * @include test_shapes.c
897 *
898 * @example test_shapes.c
899 */
900
901 /**
804 * @page tutorial_ephysics_sleeping_threshold EPhysics - Sleeping Threshold 902 * @page tutorial_ephysics_sleeping_threshold EPhysics - Sleeping Threshold
805 * 903 *
806 * The purpose of this example is to demonstrate the EPhysics Sleeping 904 * The purpose of this example is to demonstrate the EPhysics Sleeping