The purpose of this example is to demonstrate the E\+Physics Gravity usage -\/ The code apply gravity in an E\+Physics\+\_\+\+World with two cubes in movement.

 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics{no_gravity}}
\end{DoxyImageNoCaption}


For this example we'll have an E\+Physics\+\_\+\+World, and two basic E\+Physics\+\_\+\+Bodys.

The basic concepts like -\/ defining an E\+Physics\+\_\+\+World, render geometry, physics limiting boundaries, add an E\+Physics\+\_\+\+Body, associate it to evas objects, change restitution, friction and impulse properties, were already covered in \hyperlink{tutorial_ephysics_bouncing_ball}{E\+Physics -\/ Bouncing Ball}

Concepts like velocity and sleeping threshold were already covered in\+: \begin{DoxyItemize}
\item \hyperlink{tutorial_ephysics_velocity}{E\+Physics -\/ Velocity} \item \hyperlink{tutorial_ephysics_sleeping_threshold}{E\+Physics -\/ Sleeping Threshold}\end{DoxyItemize}
\hypertarget{tutorial_ephysics_gravity_add-gravity}{}\section{Setting Gravity}\label{tutorial_ephysics_gravity_add-gravity}


Here we set gravity on 3 axes (x, y, z) to (0, 0, 0). Gravity will act over bodies with mass over all the time.


\begin{DoxyCodeInclude}
   \hyperlink{group__EPhysics__World_ga849f9d794ce5da7bf07f0bfc71aa5b6c}{ephysics\_world\_gravity\_set}(world, 0, 0, 0);

\end{DoxyCodeInclude}
\hypertarget{tutorial_ephysics_gravity_add-stopbody}{}\section{Stopping a Body}\label{tutorial_ephysics_gravity_add-stopbody}


We're using a button to call this function that receives test\+\_\+data to stop the chosen body.

Stop angular and linear body movement, its equivalent to set linear velocity to 0 on both axis and angular velocity to 0 as well.


\begin{DoxyCodeInclude}
\_stop(\textcolor{keywordtype}{void} *data, \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *obj \_\_UNUSED\_\_, \textcolor{keywordtype}{void} *event\_info \_\_UNUSED\_\_)
\{
   Test\_Data *test\_data = data;
   \hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body} *body = test\_data->data;

   \hyperlink{group__EPhysics__Body_gabf7fbfc0052b28ed1d5fcade8eeaa5e6}{ephysics\_body\_stop}(body);
\}

\end{DoxyCodeInclude}


Here we finish the example. The full source code can be found at \hyperlink{test_no_gravity_c}{test\+\_\+no\+\_\+gravity.\+c}. 