edje: add headers explaining all the physics examples.
authorBruno Dilly <bdilly@profusion.mobi>
Tue, 11 Dec 2012 18:52:46 +0000 (18:52 +0000)
committerBruno Dilly <bdilly@profusion.mobi>
Tue, 11 Dec 2012 18:52:46 +0000 (18:52 +0000)
SVN revision: 80679

legacy/edje/src/examples/physics_3d.edc
legacy/edje/src/examples/physics_actions.edc
legacy/edje/src/examples/physics_backcull.edc
legacy/edje/src/examples/physics_basic.edc
legacy/edje/src/examples/physics_soft_bodies.edc

index 7e58dcb..846f057 100644 (file)
@@ -1,4 +1,12 @@
-/* It can be tested with edje_player slave mode
+/* This example demonstrates the usage of physics faces.
+ *
+ * Faces references other groups of the collection. The same group
+ * can be used for many faces, but to illustrate it we are adding
+ * a rectangle of different color for each face of a cube.
+ * It will apply impulses on the cube when receiving messages, so
+ * it's possible to see the cube rotating and moving.
+ *
+ * It can be tested with edje_player slave mode
  * $ edje_player -S -p -g example_group physics_3d.edj
  *
  * message 1 FLOAT_SET 3 80 -100 0 -> apply an impulse on red box with
index 945e808..5863478 100644 (file)
@@ -1,4 +1,19 @@
-/* It can be tested with edje_player slave mode
+/* This example demostrates physics actions, like applying impulses and forces
+ * to a body.
+ *
+ * There are two ways of interacting with bodies. One is using the wanted
+ * action in a program. E.g.:
+ *
+ * action: PHYSICS_VEL_SET 0 -200 0;
+ * target: "part_name";
+ *
+ * The other way is via script. The same action described above would be
+ * physics_set_velocity(PART:"part_name", 0, -200, 0);
+ *
+ * This a very extensive example, because it illustrate the usage of all
+ * the possible actions in the both ways.
+ *
+ * It can be tested with edje_player slave mode
  * $ edje_player -S -p physics_actions.edj
  *
  * signal up impulse   -> will throw both balls up
index 412d22e..3628e65 100644 (file)
@@ -1,4 +1,15 @@
-/* It can be tested with edje_player slave mode
+/* This example demonstrates how to customize movement freedom and backface
+ * culling.
+ *
+ * By default, bodies only will move on x and y axis, and rotate only
+ * aroud the z axis. To modify it, the block "movement freedom" should be used.
+ * This block consists of the "linear" and "angular" attributes, each one
+ * receiving 3 booleans, to set if movement in each axis is allowed or not.
+ *
+ * When a body has backface culling activated, it will be hidden when
+ * it's not facing the camera. It's deactivated by default.
+ *
+ * It can be tested with edje_player slave mode
  * $ edje_player -S -p physics_backcull.edj
  *
  * signal on backcull -> allow movement in all axes, enable backface cull
index cdbd11f..86b065e 100644 (file)
@@ -1,3 +1,19 @@
+/* This example demonstrates the most basic usage of physics.
+ *
+ * To make a part behaves like a body in a physics simulation,
+ * all that is needed is to set its attribute part.physics_body
+ * to something different from NONE. For example, RIGID_BOX,
+ * or CLOTH. It will define the shape of the part, and how it
+ * will interact with the environment.
+ *
+ * The remaining body attributes should be set inside the physics
+ * block of description. In this example we are customizing
+ * the restitution, that is how much the body bounces, and friction.
+ *
+ * It can be tested with edje_player
+ * $ edje_player physics_basic.edj
+ */
+
 collections {
 
    images {
index 34946bc..41819e3 100644 (file)
@@ -1,3 +1,20 @@
+/* This example shows how to use soft bodies.
+ *
+ * Soft bodies have an attribute to change how much it will
+ * deforms when colliding. It's called "hardness", and can
+ * be set to any value between 0.0 (soft) and 1.0 (hard).
+ * By default, all the soft bodies are hard (1.0).
+ *
+ * This example will make a box and a sphere collide
+ * many times against the floor and will be placed at
+ * top of the screen again. They will have their hardness
+ * modified each time, going from the default to a very
+ * soft state.
+ *
+ * It can be tested with edje_player
+ * $ edje_player physics_soft_bodies.edj
+ */
+
 collections {
 
    images {