\hypertarget{class_ogre_1_1_sphere}{}\section{Ogre\+:\+:Sphere Class Reference}
\label{class_ogre_1_1_sphere}\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}


A sphere primitive, mostly used for bounds checking.  




{\ttfamily \#include $<$Ogre\+Sphere.\+h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_ogre_1_1_sphere_a93cb05f8025668db930ef81a34dca47b}{Sphere} ()
\begin{DoxyCompactList}\small\item\em Standard constructor -\/ creates a unit sphere around the origin. \end{DoxyCompactList}\item 
\hyperlink{class_ogre_1_1_sphere_abd0dc8dd45b400a07d71115652d2dc20}{Sphere} (const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&center, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} radius)
\begin{DoxyCompactList}\small\item\em Constructor allowing arbitrary spheres. \end{DoxyCompactList}\item 
const \hyperlink{class_ogre_1_1_vector3}{Vector3} \& \hyperlink{class_ogre_1_1_sphere_a1b7261dda9e5c48e48dd4fb2badd14a4}{get\+Center} (void) const
\begin{DoxyCompactList}\small\item\em Returns the center point of the sphere. \end{DoxyCompactList}\item 
\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} \hyperlink{class_ogre_1_1_sphere_a6306310d834dc7844c73dd24ec7a318d}{get\+Radius} (void) const
\begin{DoxyCompactList}\small\item\em Returns the radius of the sphere. \end{DoxyCompactList}\item 
bool \hyperlink{class_ogre_1_1_sphere_a01e832a0542bde80df107ab6b26b56f9}{intersects} (const \hyperlink{class_ogre_1_1_sphere}{Sphere} \&s) const
\begin{DoxyCompactList}\small\item\em Returns whether or not this sphere intersects another sphere. \end{DoxyCompactList}\item 
bool \hyperlink{class_ogre_1_1_sphere_a77798ca00493f6b1f9da7f3eff782642}{intersects} (const \hyperlink{class_ogre_1_1_axis_aligned_box}{Axis\+Aligned\+Box} \&box) const
\begin{DoxyCompactList}\small\item\em Returns whether or not this sphere intersects a box. \end{DoxyCompactList}\item 
bool \hyperlink{class_ogre_1_1_sphere_a774730a3d40a4375144128b13afc39ef}{intersects} (const \hyperlink{class_ogre_1_1_plane}{Plane} \&plane) const
\begin{DoxyCompactList}\small\item\em Returns whether or not this sphere intersects a plane. \end{DoxyCompactList}\item 
bool \hyperlink{class_ogre_1_1_sphere_a4a30ba4b71475bf2da82c91dcc13e97a}{intersects} (const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&v) const
\begin{DoxyCompactList}\small\item\em Returns whether or not this sphere intersects a point. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_sphere_a9e9104e8e57c2fa2d30920989c725d1a}{merge} (const \hyperlink{class_ogre_1_1_sphere}{Sphere} \&oth)
\begin{DoxyCompactList}\small\item\em Merges another \hyperlink{class_ogre_1_1_sphere}{Sphere} into the current sphere. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_sphere_af2cd29ca81e68cdeb65b91a2667d6fbc}{set\+Center} (const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&center)
\begin{DoxyCompactList}\small\item\em Sets the center point of the sphere. \end{DoxyCompactList}\item 
void \hyperlink{class_ogre_1_1_sphere_aafe80cad31edd668b09981a6f836c8b1}{set\+Radius} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} radius)
\begin{DoxyCompactList}\small\item\em Sets the radius of the sphere. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A sphere primitive, mostly used for bounds checking. 

\begin{DoxyRemark}{Remarks}
A sphere in math texts is normally represented by the function x$^\wedge$2 + y$^\wedge$2 + z$^\wedge$2 = r$^\wedge$2 (for sphere\textquotesingle{}s centered on the origin). \hyperlink{namespace_ogre}{Ogre} stores spheres simply as a center point and a radius. 
\end{DoxyRemark}


\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_sphere_a93cb05f8025668db930ef81a34dca47b}\label{class_ogre_1_1_sphere_a93cb05f8025668db930ef81a34dca47b}} 
\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}!Sphere@{Sphere}}
\index{Sphere@{Sphere}!Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}
\subsubsection{\texorpdfstring{Sphere()}{Sphere()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Ogre\+::\+Sphere\+::\+Sphere (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Standard constructor -\/ creates a unit sphere around the origin. 

\mbox{\Hypertarget{class_ogre_1_1_sphere_abd0dc8dd45b400a07d71115652d2dc20}\label{class_ogre_1_1_sphere_abd0dc8dd45b400a07d71115652d2dc20}} 
\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}!Sphere@{Sphere}}
\index{Sphere@{Sphere}!Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}
\subsubsection{\texorpdfstring{Sphere()}{Sphere()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Ogre\+::\+Sphere\+::\+Sphere (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{center,  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{radius }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Constructor allowing arbitrary spheres. 


\begin{DoxyParams}{Parameters}
{\em center} & The center point of the sphere. \\
\hline
{\em radius} & The radius of the sphere. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_sphere_a6306310d834dc7844c73dd24ec7a318d}\label{class_ogre_1_1_sphere_a6306310d834dc7844c73dd24ec7a318d}} 
\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}!get\+Radius@{get\+Radius}}
\index{get\+Radius@{get\+Radius}!Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}
\subsubsection{\texorpdfstring{get\+Radius()}{getRadius()}}
{\footnotesize\ttfamily \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} Ogre\+::\+Sphere\+::get\+Radius (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Returns the radius of the sphere. 



Referenced by Ogre\+::\+Plane\+Bounded\+Volume\+::intersects(), and merge().

\mbox{\Hypertarget{class_ogre_1_1_sphere_aafe80cad31edd668b09981a6f836c8b1}\label{class_ogre_1_1_sphere_aafe80cad31edd668b09981a6f836c8b1}} 
\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}!set\+Radius@{set\+Radius}}
\index{set\+Radius@{set\+Radius}!Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}
\subsubsection{\texorpdfstring{set\+Radius()}{setRadius()}}
{\footnotesize\ttfamily void Ogre\+::\+Sphere\+::set\+Radius (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{radius }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Sets the radius of the sphere. 

\mbox{\Hypertarget{class_ogre_1_1_sphere_a1b7261dda9e5c48e48dd4fb2badd14a4}\label{class_ogre_1_1_sphere_a1b7261dda9e5c48e48dd4fb2badd14a4}} 
\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}!get\+Center@{get\+Center}}
\index{get\+Center@{get\+Center}!Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}
\subsubsection{\texorpdfstring{get\+Center()}{getCenter()}}
{\footnotesize\ttfamily const \hyperlink{class_ogre_1_1_vector3}{Vector3}\& Ogre\+::\+Sphere\+::get\+Center (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Returns the center point of the sphere. 



Referenced by Ogre\+::\+Plane\+Bounded\+Volume\+::intersects(), and merge().

\mbox{\Hypertarget{class_ogre_1_1_sphere_af2cd29ca81e68cdeb65b91a2667d6fbc}\label{class_ogre_1_1_sphere_af2cd29ca81e68cdeb65b91a2667d6fbc}} 
\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}!set\+Center@{set\+Center}}
\index{set\+Center@{set\+Center}!Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}
\subsubsection{\texorpdfstring{set\+Center()}{setCenter()}}
{\footnotesize\ttfamily void Ogre\+::\+Sphere\+::set\+Center (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{center }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Sets the center point of the sphere. 

\mbox{\Hypertarget{class_ogre_1_1_sphere_a01e832a0542bde80df107ab6b26b56f9}\label{class_ogre_1_1_sphere_a01e832a0542bde80df107ab6b26b56f9}} 
\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}!intersects@{intersects}}
\index{intersects@{intersects}!Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}
\subsubsection{\texorpdfstring{intersects()}{intersects()}\hspace{0.1cm}{\footnotesize\ttfamily [1/4]}}
{\footnotesize\ttfamily bool Ogre\+::\+Sphere\+::intersects (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_sphere}{Sphere} \&}]{s }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Returns whether or not this sphere intersects another sphere. 



References Ogre\+::\+Math\+::\+Sqr().

\mbox{\Hypertarget{class_ogre_1_1_sphere_a77798ca00493f6b1f9da7f3eff782642}\label{class_ogre_1_1_sphere_a77798ca00493f6b1f9da7f3eff782642}} 
\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}!intersects@{intersects}}
\index{intersects@{intersects}!Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}
\subsubsection{\texorpdfstring{intersects()}{intersects()}\hspace{0.1cm}{\footnotesize\ttfamily [2/4]}}
{\footnotesize\ttfamily bool Ogre\+::\+Sphere\+::intersects (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_axis_aligned_box}{Axis\+Aligned\+Box} \&}]{box }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Returns whether or not this sphere intersects a box. 



References Ogre\+::\+Math\+::intersects().

\mbox{\Hypertarget{class_ogre_1_1_sphere_a774730a3d40a4375144128b13afc39ef}\label{class_ogre_1_1_sphere_a774730a3d40a4375144128b13afc39ef}} 
\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}!intersects@{intersects}}
\index{intersects@{intersects}!Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}
\subsubsection{\texorpdfstring{intersects()}{intersects()}\hspace{0.1cm}{\footnotesize\ttfamily [3/4]}}
{\footnotesize\ttfamily bool Ogre\+::\+Sphere\+::intersects (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_plane}{Plane} \&}]{plane }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Returns whether or not this sphere intersects a plane. 



References Ogre\+::\+Math\+::intersects().

\mbox{\Hypertarget{class_ogre_1_1_sphere_a4a30ba4b71475bf2da82c91dcc13e97a}\label{class_ogre_1_1_sphere_a4a30ba4b71475bf2da82c91dcc13e97a}} 
\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}!intersects@{intersects}}
\index{intersects@{intersects}!Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}
\subsubsection{\texorpdfstring{intersects()}{intersects()}\hspace{0.1cm}{\footnotesize\ttfamily [4/4]}}
{\footnotesize\ttfamily bool Ogre\+::\+Sphere\+::intersects (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_vector3}{Vector3} \&}]{v }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Returns whether or not this sphere intersects a point. 



References Ogre\+::\+Math\+::\+Sqr().

\mbox{\Hypertarget{class_ogre_1_1_sphere_a9e9104e8e57c2fa2d30920989c725d1a}\label{class_ogre_1_1_sphere_a9e9104e8e57c2fa2d30920989c725d1a}} 
\index{Ogre\+::\+Sphere@{Ogre\+::\+Sphere}!merge@{merge}}
\index{merge@{merge}!Ogre\+::\+Sphere@{Ogre\+::\+Sphere}}
\subsubsection{\texorpdfstring{merge()}{merge()}}
{\footnotesize\ttfamily void Ogre\+::\+Sphere\+::merge (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_sphere}{Sphere} \&}]{oth }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Merges another \hyperlink{class_ogre_1_1_sphere}{Sphere} into the current sphere. 



References get\+Center(), get\+Radius(), Ogre\+::\+Math\+::\+Sqr(), Ogre\+::\+Math\+::\+Sqrt(), and Ogre\+::\+Vector3\+::squared\+Length().



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\hyperlink{_ogre_sphere_8h}{Ogre\+Sphere.\+h}\end{DoxyCompactItemize}
