\begin{DoxyDate}{Date}
2012 (created)
\end{DoxyDate}
\hypertarget{ephysics_main_ephysics_toc}{}\doxysection{Table of Contents}\label{ephysics_main_ephysics_toc}
\begin{DoxyItemize}
\item \mbox{\hyperlink{ephysics_main_ephysics_main_intro}{Introduction}} \item \mbox{\hyperlink{ephysics_main_ephysics_main_compiling}{How to compile}} \item \mbox{\hyperlink{ephysics_main_ephysics_main_next_steps}{Next Steps}} \item \mbox{\hyperlink{ephysics_main_ephysics_main_intro_example}{Introductory Example}}\end{DoxyItemize}
\hypertarget{ephysics_main_ephysics_main_intro}{}\doxysection{Introduction}\label{ephysics_main_ephysics_main_intro}
EPhysics is a library that makes it easy to use Ecore, Evas and Bullet Physics together. It\textquotesingle{}s a kind of wrapper, a glue, between these libraries. It\textquotesingle{}s not intended to be a physics library (we already have many out there).

 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth,height=\textheight/2,keepaspectratio=true]{diagram_ephysics}}
\end{DoxyImageNoCaption}
\hypertarget{ephysics_main_ephysics_main_compiling}{}\doxysection{How to compile}\label{ephysics_main_ephysics_main_compiling}
Ephysics is a library your application links to. The procedure for this is very simple. You simply have to compile your application with the appropriate compiler flags that the {\ttfamily pkg-\/config} script outputs. For example\+:

Compiling C or C++ files into object files\+:

\begin{DoxyVerb}gcc -c -o main.o main.c `pkg-config --cflags ephysics`
\end{DoxyVerb}


Linking object files into a binary executable\+:

\begin{DoxyVerb}gcc -o my_application main.o `pkg-config --libs ephysics`
\end{DoxyVerb}


See \mbox{\hyperlink{pkgconfig}{pkgconfig}}\hypertarget{ephysics_main_ephysics_main_next_steps}{}\doxysection{Next Steps}\label{ephysics_main_ephysics_main_next_steps}
After you understood what EPhysics is and installed it in your system you should proceed understanding the programming interface.

Recommended reading\+: \begin{DoxyItemize}
\item \mbox{\hyperlink{group__EPhysics}{EPhysics}} \item \mbox{\hyperlink{group__EPhysics__World}{EPhysics World}} \item \mbox{\hyperlink{group__EPhysics__Body}{EPhysics Body}} \item \mbox{\hyperlink{group__EPhysics__Camera}{EPhysics Camera}} \item \mbox{\hyperlink{group__EPhysics__Constraint}{EPhysics Constraint}} \item \mbox{\hyperlink{group__EPhysics__Quaternion}{EPhysics Quaternion}} \item \mbox{\hyperlink{group__EPhysics__Shape}{EPhysics Shape}}\end{DoxyItemize}
\hypertarget{ephysics_main_ephysics_main_intro_example}{}\doxysection{Introductory Example}\label{ephysics_main_ephysics_main_intro_example}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#ifdef\ HAVE\_CONFIG\_H}}
\DoxyCodeLine{\textcolor{preprocessor}{\#\ include\ <config.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ "{}ephysics\_test.h"{}}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_on\_keydown(\textcolor{keywordtype}{void}\ *data,\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *obj\ \_\_UNUSED\_\_,\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *src\ \_\_UNUSED\_\_,\ \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968}{Evas\_Callback\_Type}}\ type,\ \textcolor{keywordtype}{void}\ *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}}\ *ev\ =\ event\_info;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}}\ *body\ =\ data;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (type\ !=\ \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968ac436b50ad665089f8a24b0fb827cec5f}{EVAS\_CALLBACK\_KEY\_UP}})}
\DoxyCodeLine{\ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Up"{}})\ ==\ 0)}
\DoxyCodeLine{\ \ \ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga9109b39047a724640f6a18c683c9eb07}{ephysics\_body\_central\_impulse\_apply}}(body,\ 0,\ -\/300,\ 0);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Down"{}})\ ==\ 0)}
\DoxyCodeLine{\ \ \ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga9109b39047a724640f6a18c683c9eb07}{ephysics\_body\_central\_impulse\_apply}}(body,\ 0,\ 300,\ 0);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Right"{}})\ ==\ 0)}
\DoxyCodeLine{\ \ \ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga9109b39047a724640f6a18c683c9eb07}{ephysics\_body\_central\_impulse\_apply}}(body,\ 300,\ 0,\ 0);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Left"{}})\ ==\ 0)}
\DoxyCodeLine{\ \ \ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga9109b39047a724640f6a18c683c9eb07}{ephysics\_body\_central\_impulse\_apply}}(body,\ -\/300,\ 0,\ 0);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_world\_populate(Test\_Data\ *test\_data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *sphere,\ *shadow;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}}\ *fall\_body;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ shadow\ =\ \mbox{\hyperlink{group__Elm__Layout_ga5bcf7d68b0401cc7d557ef7d297baa3e}{elm\_layout\_add}}(test\_data-\/>win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Layout_ga8d1105463d52787a7b0ca8d7402cd3ea}{elm\_layout\_file\_set}}(}
\DoxyCodeLine{\ \ \ \ \ \ shadow,\ PACKAGE\_DATA\_DIR\ \textcolor{stringliteral}{"{}/"{}}\ EPHYSICS\_TEST\_THEME\ \textcolor{stringliteral}{"{}.edj"{}},\ \textcolor{stringliteral}{"{}shadow-\/ball"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(shadow,\ WIDTH\ /\ 3,\ FLOOR\_Y);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(shadow,\ 70,\ 3);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(shadow);}
\DoxyCodeLine{\ \ \ test\_data-\/>evas\_objs\ =\ \mbox{\hyperlink{group__Eina__List__Group_ga625698a383dda8fc0db245a1c7608c49}{eina\_list\_append}}(test\_data-\/>evas\_objs,\ shadow);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ sphere\ =\ \mbox{\hyperlink{group__Elm__Image_ga1e320bab8a343c91522d0f09b938ab4f}{elm\_image\_add}}(test\_data-\/>win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Image_gad1a96ede5f513042cef3c1dac4572f73}{elm\_image\_file\_set}}(}
\DoxyCodeLine{\ \ \ \ \ \ sphere,\ PACKAGE\_DATA\_DIR\ \textcolor{stringliteral}{"{}/"{}}\ EPHYSICS\_TEST\_THEME\ \textcolor{stringliteral}{"{}.edj"{}},\ \textcolor{stringliteral}{"{}big-\/blue-\/ball"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(sphere,\ WIDTH\ /\ 3,\ HEIGHT\ /\ 8);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(sphere,\ 70,\ 70);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(sphere);}
\DoxyCodeLine{\ \ \ test\_data-\/>evas\_objs\ =\ \mbox{\hyperlink{group__Eina__List__Group_ga625698a383dda8fc0db245a1c7608c49}{eina\_list\_append}}(test\_data-\/>evas\_objs,\ sphere);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ fall\_body\ =\ \mbox{\hyperlink{group__EPhysics__Body_ga9fe94b35f5b58527b1199a23468b1f86}{ephysics\_body\_sphere\_add}}(test\_data-\/>world);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga39cb9e95bbe1d097926a09365c501db3}{ephysics\_body\_evas\_object\_set}}(fall\_body,\ sphere,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(fall\_body,\ 0.95);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga986d45060bf6ba1689a56889a2bcabce}{ephysics\_body\_friction\_set}}(fall\_body,\ 0.1);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_gada176f4748a4c2fc4ba2042021ea7067}{ephysics\_body\_event\_callback\_add}}(fall\_body,\ \mbox{\hyperlink{group__EPhysics__Body_gga904d0d1462e71c1f32cb27f540b5277cacb2363cd59bc8642e74ad916c6658e0a}{EPHYSICS\_CALLBACK\_BODY\_UPDATE}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ update\_object\_cb,\ shadow);}
\DoxyCodeLine{\ \ \ test\_data-\/>bodies\ =\ \mbox{\hyperlink{group__Eina__List__Group_ga625698a383dda8fc0db245a1c7608c49}{eina\_list\_append}}(test\_data-\/>bodies,\ fall\_body);}
\DoxyCodeLine{\ \ \ test\_data-\/>data\ =\ fall\_body;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_restart(\textcolor{keywordtype}{void}\ *data,\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *obj\ \_\_UNUSED\_\_,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *emission\ \_\_UNUSED\_\_,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *source\ \_\_UNUSED\_\_)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ Test\_Data\ *test\_data\ =\ data;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ DBG(\textcolor{stringliteral}{"{}Restart\ pressed"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga60297eacd3aa561f1a59d881daeb0586}{elm\_object\_event\_callback\_del}}(test\_data-\/>win,\ \_on\_keydown,\ test\_data-\/>data);}
\DoxyCodeLine{\ \ \ test\_clean(test\_data);}
\DoxyCodeLine{\ \ \ \_world\_populate(test\_data);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_gae2d2f3ef544f5aa59a0d89fbb67584e5}{elm\_object\_event\_callback\_add}}(test\_data-\/>win,\ \_on\_keydown,\ test\_data-\/>data);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{void}}
\DoxyCodeLine{test\_bouncing\_ball(\textcolor{keywordtype}{void}\ *data\ \_\_UNUSED\_\_,\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *obj\ \_\_UNUSED\_\_,\ \textcolor{keywordtype}{void}\ *event\_info\ \_\_UNUSED\_\_)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}}\ *boundary;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__World_ga83c0d22744748525aa2dac11726c58e6}{EPhysics\_World}}\ *world;}
\DoxyCodeLine{\ \ \ Test\_Data\ *test\_data;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{group__EPhysics_gaca8fc170d73b3f688349cc4dbaf219fd}{ephysics\_init}}())}
\DoxyCodeLine{\ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ test\_data\ =\ test\_data\_new();}
\DoxyCodeLine{\ \ \ test\_win\_add(test\_data,\ \textcolor{stringliteral}{"{}Bouncing\ Ball"{}},\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Layout_gadab42e647f164fc8ab585c0e1bd34cc0}{elm\_layout\_signal\_callback\_add}}(test\_data-\/>layout,\ \textcolor{stringliteral}{"{}restart"{}},\ \textcolor{stringliteral}{"{}test-\/theme"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_restart,\ test\_data);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga1beada7edf5d714c0dba5459bcc993fc}{elm\_object\_signal\_emit}}(test\_data-\/>layout,\ \textcolor{stringliteral}{"{}borders,show"{}},\ \textcolor{stringliteral}{"{}ephysics\_test"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga1beada7edf5d714c0dba5459bcc993fc}{elm\_object\_signal\_emit}}(test\_data-\/>layout,\ \textcolor{stringliteral}{"{}arrows,show"{}},\ \textcolor{stringliteral}{"{}ephysics\_test"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ world\ =\ \mbox{\hyperlink{group__EPhysics__World_ga7b24e5bada9bcd105bc7d1e68cf2e44e}{ephysics\_world\_new}}();}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__World_ga9ccd111c05eafbdc99dc70e7c0ca5b22}{ephysics\_world\_light\_all\_bodies\_set}}(world,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__World_gaabf8abaf9c41b0c1e5daa4acf3df0356}{ephysics\_world\_render\_geometry\_set}}(world,\ 50,\ 40,\ -\/50,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ WIDTH\ -\/\ 100,\ FLOOR\_Y\ -\/\ 40,\ DEPTH);}
\DoxyCodeLine{\ \ \ test\_data-\/>world\ =\ world;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ boundary\ =\ \mbox{\hyperlink{group__EPhysics__Body_ga41939240a53e1373d592b8a6be273978}{ephysics\_body\_bottom\_boundary\_add}}(test\_data-\/>world);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(boundary,\ 0.65);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga986d45060bf6ba1689a56889a2bcabce}{ephysics\_body\_friction\_set}}(boundary,\ 4);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ boundary\ =\ \mbox{\hyperlink{group__EPhysics__Body_gaa2db93bfa483a5a1b755801d14a343dd}{ephysics\_body\_right\_boundary\_add}}(test\_data-\/>world);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(boundary,\ 0.4);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga986d45060bf6ba1689a56889a2bcabce}{ephysics\_body\_friction\_set}}(boundary,\ 3);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ boundary\ =\ \mbox{\hyperlink{group__EPhysics__Body_ga6bad14ec64496e39d589ac25aee889f0}{ephysics\_body\_left\_boundary\_add}}(test\_data-\/>world);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(boundary,\ 0.4);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga986d45060bf6ba1689a56889a2bcabce}{ephysics\_body\_friction\_set}}(boundary,\ 3);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga58ecc44fc7febb980fe1857ef053f61f}{ephysics\_body\_top\_boundary\_add}}(test\_data-\/>world);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \_world\_populate(test\_data);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_gae2d2f3ef544f5aa59a0d89fbb67584e5}{elm\_object\_event\_callback\_add}}(test\_data-\/>win,\ \_on\_keydown,\ test\_data-\/>data);}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}


More examples can be found at \mbox{\hyperlink{ephysics_examples}{EPhysics Examples}}. 