\hypertarget{group__EPhysics__Camera}{}\doxysection{EPhysics Camera}
\label{group__EPhysics__Camera}\index{EPhysics Camera@{EPhysics Camera}}


A camera defines the region of the physics world that will be rendered on the canvas.  


\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \+\_\+\+EPhysics\+\_\+\+Camera \mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}}
\begin{DoxyCompactList}\small\item\em Camera handle, used to change the position of the frame to be rendered. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
EAPI void \mbox{\hyperlink{group__EPhysics__Camera_gaed0ba3e4daecc66fca5dc399031da530}{ephysics\+\_\+camera\+\_\+position\+\_\+set}} (\mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$camera, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} x, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} y)
\begin{DoxyCompactList}\small\item\em Set camera\textquotesingle{}s position. \end{DoxyCompactList}\item 
EAPI void \mbox{\hyperlink{group__EPhysics__Camera_ga5e549e85d0d98a878dc636b6463645d6}{ephysics\+\_\+camera\+\_\+position\+\_\+get}} (const \mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$camera, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$x, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$y)
\begin{DoxyCompactList}\small\item\em Get camera\textquotesingle{}s position. \end{DoxyCompactList}\item 
EAPI void \mbox{\hyperlink{group__EPhysics__Camera_gabb7602830e3a9daa67d7bbe1a71a776e}{ephysics\+\_\+camera\+\_\+body\+\_\+track}} (\mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$camera, \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\+\_\+\+Body}} $\ast$body, \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} horizontal, \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} vertical)
\begin{DoxyCompactList}\small\item\em Set camera to track a body. \end{DoxyCompactList}\item 
EAPI void \mbox{\hyperlink{group__EPhysics__Camera_ga3f8d5e51ae54ac3c2a5bdc0a6fb162c6}{ephysics\+\_\+camera\+\_\+tracked\+\_\+body\+\_\+get}} (\mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$camera, \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\+\_\+\+Body}} $\ast$$\ast$body, \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} $\ast$horizontal, \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} $\ast$vertical)
\begin{DoxyCompactList}\small\item\em Get body tracked by camera. \end{DoxyCompactList}\item 
EAPI void \mbox{\hyperlink{group__EPhysics__Camera_gabe63cac3d18202ddb8596f50adbc3206}{ephysics\+\_\+camera\+\_\+perspective\+\_\+set}} (\mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$camera, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} px, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} py, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} z0, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} foc)
\begin{DoxyCompactList}\small\item\em Set perspective to be applied on the scene. \end{DoxyCompactList}\item 
EAPI void \mbox{\hyperlink{group__EPhysics__Camera_ga971b0520cc7ee43fdbd5b1b074c4025e}{ephysics\+\_\+camera\+\_\+perspective\+\_\+get}} (const \mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$camera, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$px, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$py, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$z0, \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$foc)
\begin{DoxyCompactList}\small\item\em Get perspective applied on the scene. \end{DoxyCompactList}\item 
EAPI void \mbox{\hyperlink{group__EPhysics__Camera_ga3dce6e71508cba24250679f67bbb8e11}{ephysics\+\_\+camera\+\_\+perspective\+\_\+enabled\+\_\+set}} (\mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$camera, \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} enabled)
\begin{DoxyCompactList}\small\item\em Set if perspective should be applied. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__EPhysics__Camera_gabe75c8755354b2d4e20ff1bcdb66302b}{ephysics\+\_\+camera\+\_\+perspective\+\_\+enabled\+\_\+get}} (const \mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$camera)
\begin{DoxyCompactList}\small\item\em Return if perspective is enabled or not. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
A camera defines the region of the physics world that will be rendered on the canvas. 

It sets the point of view.

Every world has a camera, that can be gotten with \mbox{\hyperlink{group__EPhysics__World_gac676a37c869af5ec41fab3268e53ed21}{ephysics\+\_\+world\+\_\+camera\+\_\+get()}}. Its position can be set with \mbox{\hyperlink{group__EPhysics__Camera_gaed0ba3e4daecc66fca5dc399031da530}{ephysics\+\_\+camera\+\_\+position\+\_\+set()}} or can be set to track a body, with \mbox{\hyperlink{group__EPhysics__Camera_gabb7602830e3a9daa67d7bbe1a71a776e}{ephysics\+\_\+camera\+\_\+body\+\_\+track()}}; 

\doxysubsection{Typedef Documentation}
\mbox{\Hypertarget{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}\label{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}} 
\index{EPhysics Camera@{EPhysics Camera}!EPhysics\_Camera@{EPhysics\_Camera}}
\index{EPhysics\_Camera@{EPhysics\_Camera}!EPhysics Camera@{EPhysics Camera}}
\doxysubsubsection{\texorpdfstring{EPhysics\_Camera}{EPhysics\_Camera}}
{\footnotesize\ttfamily typedef struct \+\_\+\+EPhysics\+\_\+\+Camera \mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}}}



Camera handle, used to change the position of the frame to be rendered. 

Every world have a camera that can be gotten with \mbox{\hyperlink{group__EPhysics__World_gac676a37c869af5ec41fab3268e53ed21}{ephysics\+\_\+world\+\_\+camera\+\_\+get()}}. 

\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__EPhysics__Camera_gaed0ba3e4daecc66fca5dc399031da530}\label{group__EPhysics__Camera_gaed0ba3e4daecc66fca5dc399031da530}} 
\index{EPhysics Camera@{EPhysics Camera}!ephysics\_camera\_position\_set@{ephysics\_camera\_position\_set}}
\index{ephysics\_camera\_position\_set@{ephysics\_camera\_position\_set}!EPhysics Camera@{EPhysics Camera}}
\doxysubsubsection{\texorpdfstring{ephysics\_camera\_position\_set()}{ephysics\_camera\_position\_set()}}
{\footnotesize\ttfamily EAPI void ephysics\+\_\+camera\+\_\+position\+\_\+set (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$}]{camera,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}}}]{x,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}}}]{y }\end{DoxyParamCaption})}



Set camera\textquotesingle{}s position. 

Camera\textquotesingle{}s position referes to the position of the top-\/left point of the camera.

By default a camera is created to map the first quadrant of physics world from the point (0, 0) to (render area width / world rate, render area height / world rate).

When render area is set with \mbox{\hyperlink{group__EPhysics__World_gaabf8abaf9c41b0c1e5daa4acf3df0356}{ephysics\+\_\+world\+\_\+render\+\_\+geometry\+\_\+set()}}, the camera geometry is updated to match it. So, for most cases, camera won\textquotesingle{}t need to be handled by the user.

But it can be modified passing another top-\/left point position, so another region of the physics world will be rendered on the render area. So if you have a scene larger than the render area, camera handling can be very useful.

This function will make camera stop tracking a body set with \mbox{\hyperlink{group__EPhysics__Camera_gabb7602830e3a9daa67d7bbe1a71a776e}{ephysics\+\_\+camera\+\_\+body\+\_\+track()}}.

\begin{DoxyNote}{Note}
This change will be noticed on the next physics tick, so evas objects will be updated taking the camera\textquotesingle{}s new position in account.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em camera} & The camera to be positioned. \\
\hline
{\em x} & The new position on x axis, in pixels. \\
\hline
{\em y} & The new position on y axis, in pixels.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__EPhysics__Camera_ga5e549e85d0d98a878dc636b6463645d6}{ephysics\+\_\+camera\+\_\+position\+\_\+get()}}. 

\mbox{\hyperlink{group__EPhysics__World_gac676a37c869af5ec41fab3268e53ed21}{ephysics\+\_\+world\+\_\+camera\+\_\+get()}}. 

\mbox{\hyperlink{group__EPhysics__World_ga4191077d4da05cfe550e9690fc311213}{ephysics\+\_\+world\+\_\+rate\+\_\+get()}}. 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{test_camera_8c-example}{test\+\_\+camera.\+c}}, and \mbox{\hyperlink{test_camera_track_8c-example}{test\+\_\+camera\+\_\+track.\+c}}.\end{Desc}
\mbox{\Hypertarget{group__EPhysics__Camera_ga5e549e85d0d98a878dc636b6463645d6}\label{group__EPhysics__Camera_ga5e549e85d0d98a878dc636b6463645d6}} 
\index{EPhysics Camera@{EPhysics Camera}!ephysics\_camera\_position\_get@{ephysics\_camera\_position\_get}}
\index{ephysics\_camera\_position\_get@{ephysics\_camera\_position\_get}!EPhysics Camera@{EPhysics Camera}}
\doxysubsubsection{\texorpdfstring{ephysics\_camera\_position\_get()}{ephysics\_camera\_position\_get()}}
{\footnotesize\ttfamily EAPI void ephysics\+\_\+camera\+\_\+position\+\_\+get (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$}]{camera,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$}]{x,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$}]{y }\end{DoxyParamCaption})}



Get camera\textquotesingle{}s position. 


\begin{DoxyParams}{Parameters}
{\em camera} & The world\textquotesingle{}s camera. \\
\hline
{\em x} & Position on x axis, in pixels. \\
\hline
{\em y} & Position on y axis, in pixels.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__EPhysics__Camera_gaed0ba3e4daecc66fca5dc399031da530}{ephysics\+\_\+camera\+\_\+position\+\_\+set()}} for more details. 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{test_camera_8c-example}{test\+\_\+camera.\+c}}, and \mbox{\hyperlink{test_camera_track_8c-example}{test\+\_\+camera\+\_\+track.\+c}}.\end{Desc}
\mbox{\Hypertarget{group__EPhysics__Camera_gabb7602830e3a9daa67d7bbe1a71a776e}\label{group__EPhysics__Camera_gabb7602830e3a9daa67d7bbe1a71a776e}} 
\index{EPhysics Camera@{EPhysics Camera}!ephysics\_camera\_body\_track@{ephysics\_camera\_body\_track}}
\index{ephysics\_camera\_body\_track@{ephysics\_camera\_body\_track}!EPhysics Camera@{EPhysics Camera}}
\doxysubsubsection{\texorpdfstring{ephysics\_camera\_body\_track()}{ephysics\_camera\_body\_track()}}
{\footnotesize\ttfamily EAPI void ephysics\+\_\+camera\+\_\+body\+\_\+track (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$}]{camera,  }\item[{\mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\+\_\+\+Body}} $\ast$}]{body,  }\item[{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}}}]{horizontal,  }\item[{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}}}]{vertical }\end{DoxyParamCaption})}



Set camera to track a body. 

When a body is tracked, the camera will move automatically, following this body. It will keeps the body centralized on rendered area. If it will be centralized horizontally and / or vertically depends if parameters {\ttfamily horizontal} and {\ttfamily vertical} are set to {\ttfamily EINA\+\_\+\+TRUE}.

Default updates (\mbox{\hyperlink{group__EPhysics__Body_ga7209e650176e0612efb2a2cc2af0ec27}{ephysics\+\_\+body\+\_\+evas\+\_\+object\+\_\+update()}}) will take care of updating evas objects associated to the bodies correctly. But if you need to do it yourself, you\textquotesingle{}ll need to take camera\textquotesingle{}s position in consideration, using \mbox{\hyperlink{group__EPhysics__Camera_ga5e549e85d0d98a878dc636b6463645d6}{ephysics\+\_\+camera\+\_\+position\+\_\+get()}}.

\begin{DoxyNote}{Note}
This change will be noticed on the next physics tick, so evas objects will be updated taking the camera\textquotesingle{}s new position in account.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em camera} & The world\textquotesingle{}s camera. \\
\hline
{\em body} & The body tracked by the {\ttfamily camera}, or {\ttfamily NULL} if camera isn\textquotesingle{}t tracking any body. \\
\hline
{\em horizontal} & {\ttfamily EINA\+\_\+\+TRUE} if {\ttfamily body} is tracked on x axis, {\ttfamily EINA\+\_\+\+FALSE} otherwise; \\
\hline
{\em vertical} & {\ttfamily EINA\+\_\+\+TRUE} if {\ttfamily body} is tracked on y axis, {\ttfamily EINA\+\_\+\+FALSE} otherwise;\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__EPhysics__Camera_ga3f8d5e51ae54ac3c2a5bdc0a6fb162c6}{ephysics\+\_\+camera\+\_\+tracked\+\_\+body\+\_\+get()}}. 

\mbox{\hyperlink{group__EPhysics__Camera_gaed0ba3e4daecc66fca5dc399031da530}{ephysics\+\_\+camera\+\_\+position\+\_\+set()}}. 

\mbox{\hyperlink{group__EPhysics__World_gac676a37c869af5ec41fab3268e53ed21}{ephysics\+\_\+world\+\_\+camera\+\_\+get()}}. 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{test_camera_track_8c-example}{test\+\_\+camera\+\_\+track.\+c}}.\end{Desc}
\mbox{\Hypertarget{group__EPhysics__Camera_ga3f8d5e51ae54ac3c2a5bdc0a6fb162c6}\label{group__EPhysics__Camera_ga3f8d5e51ae54ac3c2a5bdc0a6fb162c6}} 
\index{EPhysics Camera@{EPhysics Camera}!ephysics\_camera\_tracked\_body\_get@{ephysics\_camera\_tracked\_body\_get}}
\index{ephysics\_camera\_tracked\_body\_get@{ephysics\_camera\_tracked\_body\_get}!EPhysics Camera@{EPhysics Camera}}
\doxysubsubsection{\texorpdfstring{ephysics\_camera\_tracked\_body\_get()}{ephysics\_camera\_tracked\_body\_get()}}
{\footnotesize\ttfamily EAPI void ephysics\+\_\+camera\+\_\+tracked\+\_\+body\+\_\+get (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$}]{camera,  }\item[{\mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\+\_\+\+Body}} $\ast$$\ast$}]{body,  }\item[{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} $\ast$}]{horizontal,  }\item[{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} $\ast$}]{vertical }\end{DoxyParamCaption})}



Get body tracked by camera. 


\begin{DoxyParams}{Parameters}
{\em camera} & The world\textquotesingle{}s camera. \\
\hline
{\em body} & The body tracked by the {\ttfamily camera}, or {\ttfamily NULL} if camera isn\textquotesingle{}t tracking any body. \\
\hline
{\em horizontal} & {\ttfamily EINA\+\_\+\+TRUE} if {\ttfamily body} is tracked on x axis, {\ttfamily EINA\+\_\+\+FALSE} otherwise; \\
\hline
{\em vertical} & {\ttfamily EINA\+\_\+\+TRUE} if {\ttfamily body} is tracked on y axis, {\ttfamily EINA\+\_\+\+FALSE} otherwise;\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__EPhysics__Camera_gabb7602830e3a9daa67d7bbe1a71a776e}{ephysics\+\_\+camera\+\_\+body\+\_\+track()}} for more details. 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{test_camera_track_8c-example}{test\+\_\+camera\+\_\+track.\+c}}.\end{Desc}
\mbox{\Hypertarget{group__EPhysics__Camera_gabe63cac3d18202ddb8596f50adbc3206}\label{group__EPhysics__Camera_gabe63cac3d18202ddb8596f50adbc3206}} 
\index{EPhysics Camera@{EPhysics Camera}!ephysics\_camera\_perspective\_set@{ephysics\_camera\_perspective\_set}}
\index{ephysics\_camera\_perspective\_set@{ephysics\_camera\_perspective\_set}!EPhysics Camera@{EPhysics Camera}}
\doxysubsubsection{\texorpdfstring{ephysics\_camera\_perspective\_set()}{ephysics\_camera\_perspective\_set()}}
{\footnotesize\ttfamily EAPI void ephysics\+\_\+camera\+\_\+perspective\+\_\+set (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$}]{camera,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}}}]{px,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}}}]{py,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}}}]{z0,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}}}]{foc }\end{DoxyParamCaption})}



Set perspective to be applied on the scene. 

This applies a given perspective (3D) to the world rendering. It will be used when the scene is rendered, after each simulation step, by \mbox{\hyperlink{group__EPhysics__Body_ga7209e650176e0612efb2a2cc2af0ec27}{ephysics\+\_\+body\+\_\+evas\+\_\+object\+\_\+update()}}.

The {\ttfamily px} and {\ttfamily py} points specify the \char`\"{}infinite distance\char`\"{} point in the 3D conversion (where all lines converge to like when artists draw 3D by hand). The {\ttfamily z0} value specifies the z value at which there is a 1\+:1 mapping between spatial coordinates and screen coordinates. Any points on this z value will not have their X and Y values modified in the transform. Those further away (Z value higher) will shrink into the distance, and those less than this value will expand and become bigger. The foc value determines the \char`\"{}focal length\char`\"{} of the camera. This is in reality the distance between the camera lens plane itself (at or closer than this rendering results are undefined) and the {\ttfamily z0} z value. This allows for some \char`\"{}depth\char`\"{} control and {\ttfamily foc} must be greater than 0.

Considering the world geometry, by default, perspective is set to px = x + w / 2, py = y + h / 2, z0 = z + d / 2 and foc = 10 $\ast$ (z + d). This means the conversion point is centered on render area, and {\ttfamily z0} is on the center of render area z axis. It is set when \mbox{\hyperlink{group__EPhysics__World_gaabf8abaf9c41b0c1e5daa4acf3df0356}{ephysics\+\_\+world\+\_\+render\+\_\+geometry\+\_\+set()}} is called.

\begin{DoxyNote}{Note}
The unit used for all parameters is Evas coordinates.

To be used, perspective need to be enabled with \mbox{\hyperlink{group__EPhysics__Camera_ga3dce6e71508cba24250679f67bbb8e11}{ephysics\+\_\+camera\+\_\+perspective\+\_\+enabled\+\_\+set()}}.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em camera} & The world\textquotesingle{}s camera. \\
\hline
{\em px} & The perspective distance X coordinate \\
\hline
{\em py} & The perspective distance Y coordinate \\
\hline
{\em z0} & The \char`\"{}0\char`\"{} z plane value \\
\hline
{\em foc} & The focal distance\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__EPhysics__Camera_ga971b0520cc7ee43fdbd5b1b074c4025e}{ephysics\+\_\+camera\+\_\+perspective\+\_\+get()}}. 

\mbox{\hyperlink{group__EPhysics__Camera_ga3dce6e71508cba24250679f67bbb8e11}{ephysics\+\_\+camera\+\_\+perspective\+\_\+enabled\+\_\+set()}}. 
\end{DoxySeeAlso}
\mbox{\Hypertarget{group__EPhysics__Camera_ga971b0520cc7ee43fdbd5b1b074c4025e}\label{group__EPhysics__Camera_ga971b0520cc7ee43fdbd5b1b074c4025e}} 
\index{EPhysics Camera@{EPhysics Camera}!ephysics\_camera\_perspective\_get@{ephysics\_camera\_perspective\_get}}
\index{ephysics\_camera\_perspective\_get@{ephysics\_camera\_perspective\_get}!EPhysics Camera@{EPhysics Camera}}
\doxysubsubsection{\texorpdfstring{ephysics\_camera\_perspective\_get()}{ephysics\_camera\_perspective\_get()}}
{\footnotesize\ttfamily EAPI void ephysics\+\_\+camera\+\_\+perspective\+\_\+get (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$}]{camera,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$}]{px,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$}]{py,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$}]{z0,  }\item[{\mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\+\_\+\+Coord}} $\ast$}]{foc }\end{DoxyParamCaption})}



Get perspective applied on the scene. 


\begin{DoxyParams}{Parameters}
{\em camera} & The world\textquotesingle{}s camera. \\
\hline
{\em px} & The perspective distance X coordinate \\
\hline
{\em py} & The perspective distance Y coordinate \\
\hline
{\em z0} & The \char`\"{}0\char`\"{} z plane value \\
\hline
{\em foc} & The focal distance\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__EPhysics__Camera_gabe63cac3d18202ddb8596f50adbc3206}{ephysics\+\_\+camera\+\_\+perspective\+\_\+set()}} for more details. 

\mbox{\hyperlink{group__EPhysics__Camera_gabe75c8755354b2d4e20ff1bcdb66302b}{ephysics\+\_\+camera\+\_\+perspective\+\_\+enabled\+\_\+get()}}. 
\end{DoxySeeAlso}
\mbox{\Hypertarget{group__EPhysics__Camera_ga3dce6e71508cba24250679f67bbb8e11}\label{group__EPhysics__Camera_ga3dce6e71508cba24250679f67bbb8e11}} 
\index{EPhysics Camera@{EPhysics Camera}!ephysics\_camera\_perspective\_enabled\_set@{ephysics\_camera\_perspective\_enabled\_set}}
\index{ephysics\_camera\_perspective\_enabled\_set@{ephysics\_camera\_perspective\_enabled\_set}!EPhysics Camera@{EPhysics Camera}}
\doxysubsubsection{\texorpdfstring{ephysics\_camera\_perspective\_enabled\_set()}{ephysics\_camera\_perspective\_enabled\_set()}}
{\footnotesize\ttfamily EAPI void ephysics\+\_\+camera\+\_\+perspective\+\_\+enabled\+\_\+set (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$}]{camera,  }\item[{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}}}]{enabled }\end{DoxyParamCaption})}



Set if perspective should be applied. 

The applied perspective can be set with \mbox{\hyperlink{group__EPhysics__Camera_gabe63cac3d18202ddb8596f50adbc3206}{ephysics\+\_\+camera\+\_\+perspective\+\_\+set()}}.


\begin{DoxyParams}{Parameters}
{\em camera} & The world\textquotesingle{}s camera. \\
\hline
{\em enabled} & {\ttfamily EINA\+\_\+\+TRUE} if perspective should be used, or {\ttfamily EINA\+\_\+\+FALSE} if it shouldn\textquotesingle{}t.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__EPhysics__Camera_gabe63cac3d18202ddb8596f50adbc3206}{ephysics\+\_\+camera\+\_\+perspective\+\_\+set()}} for more details. 

\mbox{\hyperlink{group__EPhysics__Camera_gabe75c8755354b2d4e20ff1bcdb66302b}{ephysics\+\_\+camera\+\_\+perspective\+\_\+enabled\+\_\+get()}}. 
\end{DoxySeeAlso}
\mbox{\Hypertarget{group__EPhysics__Camera_gabe75c8755354b2d4e20ff1bcdb66302b}\label{group__EPhysics__Camera_gabe75c8755354b2d4e20ff1bcdb66302b}} 
\index{EPhysics Camera@{EPhysics Camera}!ephysics\_camera\_perspective\_enabled\_get@{ephysics\_camera\_perspective\_enabled\_get}}
\index{ephysics\_camera\_perspective\_enabled\_get@{ephysics\_camera\_perspective\_enabled\_get}!EPhysics Camera@{EPhysics Camera}}
\doxysubsubsection{\texorpdfstring{ephysics\_camera\_perspective\_enabled\_get()}{ephysics\_camera\_perspective\_enabled\_get()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} ephysics\+\_\+camera\+\_\+perspective\+\_\+enabled\+\_\+get (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__EPhysics__Camera_ga945948dcbf4d98beb457c77b6537116f}{EPhysics\+\_\+\+Camera}} $\ast$}]{camera }\end{DoxyParamCaption})}



Return if perspective is enabled or not. 


\begin{DoxyParams}{Parameters}
{\em camera} & The world\textquotesingle{}s camera. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily EINA\+\_\+\+TRUE} if perspective is enabled, or {\ttfamily EINA\+\_\+\+FALSE} if it isn\textquotesingle{}t, or on error.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__EPhysics__Camera_gabe63cac3d18202ddb8596f50adbc3206}{ephysics\+\_\+camera\+\_\+perspective\+\_\+set()}} for more details. 

\mbox{\hyperlink{group__EPhysics__Camera_ga3dce6e71508cba24250679f67bbb8e11}{ephysics\+\_\+camera\+\_\+perspective\+\_\+enabled\+\_\+set()}}. 
\end{DoxySeeAlso}
