\hypertarget{classPhysicsEngine}{}\doxysection{Physics\+Engine Class Reference}
\label{classPhysicsEngine}\index{PhysicsEngine@{PhysicsEngine}}


{\ttfamily \#include $<$Physics\+Engine.\+hpp$>$}

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classPhysicsEngine_a7fc9180ea453680df0b863fa157c5b92}{Physics\+Engine}} ()
\item 
\mbox{\hyperlink{classPhysicsEngine_ae5f076ee99bbfdbc79ab2d27366d8476}{$\sim$\+Physics\+Engine}} ()
\item 
void \mbox{\hyperlink{classPhysicsEngine_aaa69a81964d980456a6ac48816d2f756}{Add\+Component}} (\mbox{\hyperlink{classIPhysicsComponent}{IPhysics\+Component}} $\ast$new\+Component)
\item 
void \mbox{\hyperlink{classPhysicsEngine_a30d283b6067980e42765340dea6eb62a}{Update}} ()
\item 
void \mbox{\hyperlink{classPhysicsEngine_a65b58126356b154d20e3081ccb6a402e}{Set\+Gravity}} (float new\+Gravity)
\end{DoxyCompactItemize}
\doxysubsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
float \mbox{\hyperlink{classPhysicsEngine_aac07745baaaa47e949089444ecd41247}{m\+\_\+gravity}} = 2.\+0f
\item 
std\+::vector$<$ \mbox{\hyperlink{classIPhysicsComponent}{IPhysics\+Component}} $\ast$ $>$ \mbox{\hyperlink{classPhysicsEngine_add4a407cb22c67709b399c68c99b621e}{m\+\_\+components}}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
A class to handle all collisions and gravity interactions between \doxylink{classIPhysicsComponent}{IPhysics\+Components }. 

\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{classPhysicsEngine_a7fc9180ea453680df0b863fa157c5b92}\label{classPhysicsEngine_a7fc9180ea453680df0b863fa157c5b92} 
\index{PhysicsEngine@{PhysicsEngine}!PhysicsEngine@{PhysicsEngine}}
\index{PhysicsEngine@{PhysicsEngine}!PhysicsEngine@{PhysicsEngine}}
\doxysubsubsection{\texorpdfstring{PhysicsEngine()}{PhysicsEngine()}}
{\footnotesize\ttfamily Physics\+Engine\+::\+Physics\+Engine (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Construct a new Physics \doxylink{classEngine}{Engine} object \Hypertarget{classPhysicsEngine_ae5f076ee99bbfdbc79ab2d27366d8476}\label{classPhysicsEngine_ae5f076ee99bbfdbc79ab2d27366d8476} 
\index{PhysicsEngine@{PhysicsEngine}!````~PhysicsEngine@{$\sim$PhysicsEngine}}
\index{````~PhysicsEngine@{$\sim$PhysicsEngine}!PhysicsEngine@{PhysicsEngine}}
\doxysubsubsection{\texorpdfstring{$\sim$PhysicsEngine()}{\string~PhysicsEngine()}}
{\footnotesize\ttfamily Physics\+Engine\+::$\sim$\+Physics\+Engine (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Destroy the Physics \doxylink{classEngine}{Engine} object 

\doxysubsection{Member Function Documentation}
\Hypertarget{classPhysicsEngine_aaa69a81964d980456a6ac48816d2f756}\label{classPhysicsEngine_aaa69a81964d980456a6ac48816d2f756} 
\index{PhysicsEngine@{PhysicsEngine}!AddComponent@{AddComponent}}
\index{AddComponent@{AddComponent}!PhysicsEngine@{PhysicsEngine}}
\doxysubsubsection{\texorpdfstring{AddComponent()}{AddComponent()}}
{\footnotesize\ttfamily void Physics\+Engine\+::\+Add\+Component (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classIPhysicsComponent}{IPhysics\+Component}} $\ast$}]{new\+Component }\end{DoxyParamCaption})}

Adds a new \doxylink{classIPhysicsComponent}{IPhysics\+Component} to be handled by the \doxylink{classPhysicsEngine}{Physics\+Engine}.


\begin{DoxyParams}{Parameters}
{\em new\+Component} & a pointer to the added \doxylink{classIPhysicsComponent}{IPhysics\+Component} \\
\hline
\end{DoxyParams}
Here is the caller graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{db/df5/classPhysicsEngine_aaa69a81964d980456a6ac48816d2f756_icgraph}
\end{center}
\end{figure}
\Hypertarget{classPhysicsEngine_a65b58126356b154d20e3081ccb6a402e}\label{classPhysicsEngine_a65b58126356b154d20e3081ccb6a402e} 
\index{PhysicsEngine@{PhysicsEngine}!SetGravity@{SetGravity}}
\index{SetGravity@{SetGravity}!PhysicsEngine@{PhysicsEngine}}
\doxysubsubsection{\texorpdfstring{SetGravity()}{SetGravity()}}
{\footnotesize\ttfamily void Physics\+Engine\+::\+Set\+Gravity (\begin{DoxyParamCaption}\item[{float}]{new\+Gravity }\end{DoxyParamCaption})}

Change gravity to the new value.


\begin{DoxyParams}{Parameters}
{\em new\+Gravity} & the new value for acceleration due to gravity \\
\hline
\end{DoxyParams}
\Hypertarget{classPhysicsEngine_a30d283b6067980e42765340dea6eb62a}\label{classPhysicsEngine_a30d283b6067980e42765340dea6eb62a} 
\index{PhysicsEngine@{PhysicsEngine}!Update@{Update}}
\index{Update@{Update}!PhysicsEngine@{PhysicsEngine}}
\doxysubsubsection{\texorpdfstring{Update()}{Update()}}
{\footnotesize\ttfamily void Physics\+Engine\+::\+Update (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Update all IPhysics\+Components. Resolve collisions between Components all at once. TODO\+: scale by delta\+Time\+: the Engine-\/calculated difference between update calls using SDL\+\_\+\+Get\+Ticks() Here is the call graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{db/df5/classPhysicsEngine_a30d283b6067980e42765340dea6eb62a_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{db/df5/classPhysicsEngine_a30d283b6067980e42765340dea6eb62a_icgraph}
\end{center}
\end{figure}


\doxysubsection{Member Data Documentation}
\Hypertarget{classPhysicsEngine_add4a407cb22c67709b399c68c99b621e}\label{classPhysicsEngine_add4a407cb22c67709b399c68c99b621e} 
\index{PhysicsEngine@{PhysicsEngine}!m\_components@{m\_components}}
\index{m\_components@{m\_components}!PhysicsEngine@{PhysicsEngine}}
\doxysubsubsection{\texorpdfstring{m\_components}{m\_components}}
{\footnotesize\ttfamily std\+::vector$<$\mbox{\hyperlink{classIPhysicsComponent}{IPhysics\+Component}}$\ast$$>$ Physics\+Engine\+::m\+\_\+components\hspace{0.3cm}{\ttfamily [private]}}

Collection of all physics components \Hypertarget{classPhysicsEngine_aac07745baaaa47e949089444ecd41247}\label{classPhysicsEngine_aac07745baaaa47e949089444ecd41247} 
\index{PhysicsEngine@{PhysicsEngine}!m\_gravity@{m\_gravity}}
\index{m\_gravity@{m\_gravity}!PhysicsEngine@{PhysicsEngine}}
\doxysubsubsection{\texorpdfstring{m\_gravity}{m\_gravity}}
{\footnotesize\ttfamily float Physics\+Engine\+::m\+\_\+gravity = 2.\+0f\hspace{0.3cm}{\ttfamily [private]}}

The acceleration due to gravity in the game. This can safely change during runtime 

The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
include/Physics\+Engine.\+hpp\item 
src/Physics\+Engine.\+cpp\end{DoxyCompactItemize}
