\hypertarget{class_ogre_1_1_optimised_util}{}\section{Ogre\+:\+:Optimised\+Util Class Reference}
\label{class_ogre_1_1_optimised_util}\index{Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}}


Utility class for provides optimised functions.  




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

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_ogre_1_1_optimised_util_a4f137d0ced0f82abd042d9b4eb99b105}{Optimised\+Util} (void)
\item 
virtual \hyperlink{class_ogre_1_1_optimised_util_a7d548511ecbd6b39d6d1689ce30db8f2}{$\sim$\+Optimised\+Util} ()
\item 
virtual void \hyperlink{class_ogre_1_1_optimised_util_a7fa20b34357e375a489383f0ccb4a15c}{calculate\+Face\+Normals} (const float $\ast$positions, const \hyperlink{struct_ogre_1_1_edge_data_1_1_triangle}{Edge\+Data\+::\+Triangle} $\ast$triangles, \hyperlink{class_ogre_1_1_vector4}{Vector4} $\ast$face\+Normals, size\+\_\+t num\+Triangles)=0
\begin{DoxyCompactList}\small\item\em Calculate the face normals for the triangles based on position information. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_optimised_util_a9270e6273fcf190d039030bd5de1df2f}{calculate\+Light\+Facing} (const \hyperlink{class_ogre_1_1_vector4}{Vector4} \&light\+Pos, const \hyperlink{class_ogre_1_1_vector4}{Vector4} $\ast$face\+Normals, char $\ast$light\+Facings, size\+\_\+t num\+Faces)=0
\begin{DoxyCompactList}\small\item\em Calculate the light facing state of the triangle\textquotesingle{}s face normals. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_optimised_util_aa625f93ec757b2820935369c9884c45d}{concatenate\+Affine\+Matrices} (const \hyperlink{class_ogre_1_1_affine3}{Affine3} \&base\+Matrix, const \hyperlink{class_ogre_1_1_affine3}{Affine3} $\ast$src\+Matrices, \hyperlink{class_ogre_1_1_affine3}{Affine3} $\ast$dst\+Matrices, size\+\_\+t num\+Matrices)=0
\begin{DoxyCompactList}\small\item\em Concatenate an affine matrix to an array of affine matrices. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_optimised_util_a5b411cfc1b916483d75df4f4f9c86252}{extrude\+Vertices} (const \hyperlink{class_ogre_1_1_vector4}{Vector4} \&light\+Pos, \hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} extrude\+Dist, const float $\ast$src\+Positions, float $\ast$dest\+Positions, size\+\_\+t num\+Vertices)=0
\begin{DoxyCompactList}\small\item\em Extruding vertices by a fixed distance based on light position. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_optimised_util_a431efac44c070695de7011243b13b7af}{software\+Vertex\+Morph} (\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real} t, const float $\ast$src\+Pos1, const float $\ast$src\+Pos2, float $\ast$dst\+Pos, size\+\_\+t pos1\+V\+Size, size\+\_\+t pos2\+V\+Size, size\+\_\+t dst\+V\+Size, size\+\_\+t num\+Vertices, bool morph\+Normals)=0
\begin{DoxyCompactList}\small\item\em Performs a software vertex morph, of the kind used for morph animation although it can be used for other purposes. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_optimised_util_ae0e1fe21bead4433568514258a2fb965}{software\+Vertex\+Skinning} (const float $\ast$src\+Pos\+Ptr, float $\ast$dest\+Pos\+Ptr, const float $\ast$src\+Norm\+Ptr, float $\ast$dest\+Norm\+Ptr, const float $\ast$blend\+Weight\+Ptr, const unsigned char $\ast$blend\+Index\+Ptr, const \hyperlink{class_ogre_1_1_affine3}{Affine3} $\ast$const $\ast$blend\+Matrices, size\+\_\+t src\+Pos\+Stride, size\+\_\+t dest\+Pos\+Stride, size\+\_\+t src\+Norm\+Stride, size\+\_\+t dest\+Norm\+Stride, size\+\_\+t blend\+Weight\+Stride, size\+\_\+t blend\+Index\+Stride, size\+\_\+t num\+Weights\+Per\+Vertex, size\+\_\+t num\+Vertices)=0
\begin{DoxyCompactList}\small\item\em Performs software vertex skinning. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static \hyperlink{class_ogre_1_1_optimised_util}{Optimised\+Util} $\ast$ \hyperlink{class_ogre_1_1_optimised_util_aec3039ddfa064375bb4065a4415a8eda}{get\+Implementation} (void)
\begin{DoxyCompactList}\small\item\em Gets the implementation of this class. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Utility class for provides optimised functions. 

\begin{DoxyNote}{Note}
This class are supposed used by internal engine only. 
\end{DoxyNote}


\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_optimised_util_a4f137d0ced0f82abd042d9b4eb99b105}\label{class_ogre_1_1_optimised_util_a4f137d0ced0f82abd042d9b4eb99b105}} 
\index{Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}!Optimised\+Util@{Optimised\+Util}}
\index{Optimised\+Util@{Optimised\+Util}!Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}}
\subsubsection{\texorpdfstring{Optimised\+Util()}{OptimisedUtil()}}
{\footnotesize\ttfamily Ogre\+::\+Optimised\+Util\+::\+Optimised\+Util (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{class_ogre_1_1_optimised_util_a7d548511ecbd6b39d6d1689ce30db8f2}\label{class_ogre_1_1_optimised_util_a7d548511ecbd6b39d6d1689ce30db8f2}} 
\index{Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}!````~Optimised\+Util@{$\sim$\+Optimised\+Util}}
\index{````~Optimised\+Util@{$\sim$\+Optimised\+Util}!Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}}
\subsubsection{\texorpdfstring{$\sim$\+Optimised\+Util()}{~OptimisedUtil()}}
{\footnotesize\ttfamily virtual Ogre\+::\+Optimised\+Util\+::$\sim$\+Optimised\+Util (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_optimised_util_aec3039ddfa064375bb4065a4415a8eda}\label{class_ogre_1_1_optimised_util_aec3039ddfa064375bb4065a4415a8eda}} 
\index{Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}!get\+Implementation@{get\+Implementation}}
\index{get\+Implementation@{get\+Implementation}!Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}}
\subsubsection{\texorpdfstring{get\+Implementation()}{getImplementation()}}
{\footnotesize\ttfamily static \hyperlink{class_ogre_1_1_optimised_util}{Optimised\+Util}$\ast$ Ogre\+::\+Optimised\+Util\+::get\+Implementation (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Gets the implementation of this class. 

\begin{DoxyNote}{Note}
Don\textquotesingle{}t cache the pointer returned by this function, it\textquotesingle{}ll change due run-\/time environment detection to pick up the best implementation. 
\end{DoxyNote}
\mbox{\Hypertarget{class_ogre_1_1_optimised_util_ae0e1fe21bead4433568514258a2fb965}\label{class_ogre_1_1_optimised_util_ae0e1fe21bead4433568514258a2fb965}} 
\index{Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}!software\+Vertex\+Skinning@{software\+Vertex\+Skinning}}
\index{software\+Vertex\+Skinning@{software\+Vertex\+Skinning}!Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}}
\subsubsection{\texorpdfstring{software\+Vertex\+Skinning()}{softwareVertexSkinning()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Optimised\+Util\+::software\+Vertex\+Skinning (\begin{DoxyParamCaption}\item[{const float $\ast$}]{src\+Pos\+Ptr,  }\item[{float $\ast$}]{dest\+Pos\+Ptr,  }\item[{const float $\ast$}]{src\+Norm\+Ptr,  }\item[{float $\ast$}]{dest\+Norm\+Ptr,  }\item[{const float $\ast$}]{blend\+Weight\+Ptr,  }\item[{const unsigned char $\ast$}]{blend\+Index\+Ptr,  }\item[{const \hyperlink{class_ogre_1_1_affine3}{Affine3} $\ast$const $\ast$}]{blend\+Matrices,  }\item[{size\+\_\+t}]{src\+Pos\+Stride,  }\item[{size\+\_\+t}]{dest\+Pos\+Stride,  }\item[{size\+\_\+t}]{src\+Norm\+Stride,  }\item[{size\+\_\+t}]{dest\+Norm\+Stride,  }\item[{size\+\_\+t}]{blend\+Weight\+Stride,  }\item[{size\+\_\+t}]{blend\+Index\+Stride,  }\item[{size\+\_\+t}]{num\+Weights\+Per\+Vertex,  }\item[{size\+\_\+t}]{num\+Vertices }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Performs software vertex skinning. 


\begin{DoxyParams}{Parameters}
{\em src\+Pos\+Ptr} & Pointer to source position buffer. \\
\hline
{\em dest\+Pos\+Ptr} & Pointer to destination position buffer. \\
\hline
{\em src\+Norm\+Ptr} & Pointer to source normal buffer, if N\+U\+LL, means blend position only. \\
\hline
{\em dest\+Norm\+Ptr} & Pointer to destination normal buffer, it\textquotesingle{}s ignored if src\+Norm\+Ptr is N\+U\+LL. \\
\hline
{\em blend\+Weight\+Ptr} & Pointer to blend weight buffer. \\
\hline
{\em blend\+Index\+Ptr} & Pointer to blend index buffer. \\
\hline
{\em blend\+Matrices} & An array of pointer of blend matrix, the matrix must be aligned to S\+I\+MD alignment, but not necessary for the array itself. \\
\hline
{\em src\+Pos\+Stride} & The stride of source position in bytes. \\
\hline
{\em dest\+Pos\+Stride} & The stride of destination position in bytes. \\
\hline
{\em src\+Norm\+Stride} & The stride of source normal in bytes, it\textquotesingle{}s ignored if src\+Norm\+Ptr is N\+U\+LL. \\
\hline
{\em dest\+Norm\+Stride} & The stride of destination normal in bytes, it\textquotesingle{}s ignored if src\+Norm\+Ptr is N\+U\+LL. \\
\hline
{\em blend\+Weight\+Stride} & The stride of blend weight buffer in bytes. \\
\hline
{\em blend\+Index\+Stride} & The stride of blend index buffer in bytes. \\
\hline
{\em num\+Weights\+Per\+Vertex} & Number of blend weights per-\/vertex, as well as for blend indices. \\
\hline
{\em num\+Vertices} & Number of vertices to blend. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_optimised_util_a431efac44c070695de7011243b13b7af}\label{class_ogre_1_1_optimised_util_a431efac44c070695de7011243b13b7af}} 
\index{Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}!software\+Vertex\+Morph@{software\+Vertex\+Morph}}
\index{software\+Vertex\+Morph@{software\+Vertex\+Morph}!Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}}
\subsubsection{\texorpdfstring{software\+Vertex\+Morph()}{softwareVertexMorph()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Optimised\+Util\+::software\+Vertex\+Morph (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{t,  }\item[{const float $\ast$}]{src\+Pos1,  }\item[{const float $\ast$}]{src\+Pos2,  }\item[{float $\ast$}]{dst\+Pos,  }\item[{size\+\_\+t}]{pos1\+V\+Size,  }\item[{size\+\_\+t}]{pos2\+V\+Size,  }\item[{size\+\_\+t}]{dst\+V\+Size,  }\item[{size\+\_\+t}]{num\+Vertices,  }\item[{bool}]{morph\+Normals }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Performs a software vertex morph, of the kind used for morph animation although it can be used for other purposes. 

\begin{DoxyRemark}{Remarks}
This function will linearly interpolate positions between two source buffers, into a third buffer. 
\end{DoxyRemark}

\begin{DoxyParams}{Parameters}
{\em t} & Parametric distance between the start and end positions \\
\hline
{\em src\+Pos1} & Pointer to buffer for the start positions \\
\hline
{\em src\+Pos2} & Pointer to buffer for the end positions \\
\hline
{\em dst\+Pos} & Pointer to buffer for the destination positions \\
\hline
{\em pos1\+V\+Size,pos2\+V\+Size,dst\+V\+Size} & Vertex sizes in bytes of each of the 3 buffers referenced \\
\hline
{\em num\+Vertices} & Number of vertices to morph, which agree with the number in start, end and destination buffer. Bear in mind three floating-\/point values per vertex \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_optimised_util_aa625f93ec757b2820935369c9884c45d}\label{class_ogre_1_1_optimised_util_aa625f93ec757b2820935369c9884c45d}} 
\index{Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}!concatenate\+Affine\+Matrices@{concatenate\+Affine\+Matrices}}
\index{concatenate\+Affine\+Matrices@{concatenate\+Affine\+Matrices}!Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}}
\subsubsection{\texorpdfstring{concatenate\+Affine\+Matrices()}{concatenateAffineMatrices()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Optimised\+Util\+::concatenate\+Affine\+Matrices (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_affine3}{Affine3} \&}]{base\+Matrix,  }\item[{const \hyperlink{class_ogre_1_1_affine3}{Affine3} $\ast$}]{src\+Matrices,  }\item[{\hyperlink{class_ogre_1_1_affine3}{Affine3} $\ast$}]{dst\+Matrices,  }\item[{size\+\_\+t}]{num\+Matrices }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Concatenate an affine matrix to an array of affine matrices. 

\begin{DoxyNote}{Note}
An affine matrix is a 4x4 matrix with row 3 equal to (0, 0, 0, 1), e.\+g. no projective coefficients. 
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em base\+Matrix} & The matrix used as first operand. \\
\hline
{\em src\+Matrices} & An array of matrix used as second operand. \\
\hline
{\em dst\+Matrices} & An array of matrix to store matrix concatenate results. \\
\hline
{\em num\+Matrices} & Number of matrices in the array. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_optimised_util_a7fa20b34357e375a489383f0ccb4a15c}\label{class_ogre_1_1_optimised_util_a7fa20b34357e375a489383f0ccb4a15c}} 
\index{Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}!calculate\+Face\+Normals@{calculate\+Face\+Normals}}
\index{calculate\+Face\+Normals@{calculate\+Face\+Normals}!Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}}
\subsubsection{\texorpdfstring{calculate\+Face\+Normals()}{calculateFaceNormals()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Optimised\+Util\+::calculate\+Face\+Normals (\begin{DoxyParamCaption}\item[{const float $\ast$}]{positions,  }\item[{const \hyperlink{struct_ogre_1_1_edge_data_1_1_triangle}{Edge\+Data\+::\+Triangle} $\ast$}]{triangles,  }\item[{\hyperlink{class_ogre_1_1_vector4}{Vector4} $\ast$}]{face\+Normals,  }\item[{size\+\_\+t}]{num\+Triangles }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Calculate the face normals for the triangles based on position information. 


\begin{DoxyParams}{Parameters}
{\em positions} & Pointer to position information, which packed in (x, y, z) format, indexing by vertex index in the triangle. No alignment requests. \\
\hline
{\em triangles} & The triangles need to calculate face normal, the vertex positions is indexed by vertex index to position information. \\
\hline
{\em face\+Normals} & The array of \hyperlink{class_ogre_1_1_vector4}{Vector4} used to store triangles face normal, Must be aligned to S\+I\+MD alignment. \\
\hline
{\em num\+Triangles} & Number of triangles to calculate face normal. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_optimised_util_a9270e6273fcf190d039030bd5de1df2f}\label{class_ogre_1_1_optimised_util_a9270e6273fcf190d039030bd5de1df2f}} 
\index{Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}!calculate\+Light\+Facing@{calculate\+Light\+Facing}}
\index{calculate\+Light\+Facing@{calculate\+Light\+Facing}!Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}}
\subsubsection{\texorpdfstring{calculate\+Light\+Facing()}{calculateLightFacing()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Optimised\+Util\+::calculate\+Light\+Facing (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_vector4}{Vector4} \&}]{light\+Pos,  }\item[{const \hyperlink{class_ogre_1_1_vector4}{Vector4} $\ast$}]{face\+Normals,  }\item[{char $\ast$}]{light\+Facings,  }\item[{size\+\_\+t}]{num\+Faces }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Calculate the light facing state of the triangle\textquotesingle{}s face normals. 

\begin{DoxyRemark}{Remarks}
This is normally the first stage of calculating a silhouette, i.\+e. establishing which tris are facing the light and which are facing away. 
\end{DoxyRemark}

\begin{DoxyParams}{Parameters}
{\em light\+Pos} & 4D position of the light in object space, note that for directional lights (which have no position), the w component is 0 and the x/y/z position are the direction. \\
\hline
{\em face\+Normals} & An array of face normals for the triangles, the face normal are unit vector orthogonal to the triangles, plus distance from origin. This array must be aligned to S\+I\+MD alignment. \\
\hline
{\em light\+Facings} & An array of flags for store light facing state results, the result flag is true if corresponding face normal facing the light, false otherwise. This array no alignment requires. \\
\hline
{\em num\+Faces} & Number of face normals to calculate. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_optimised_util_a5b411cfc1b916483d75df4f4f9c86252}\label{class_ogre_1_1_optimised_util_a5b411cfc1b916483d75df4f4f9c86252}} 
\index{Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}!extrude\+Vertices@{extrude\+Vertices}}
\index{extrude\+Vertices@{extrude\+Vertices}!Ogre\+::\+Optimised\+Util@{Ogre\+::\+Optimised\+Util}}
\subsubsection{\texorpdfstring{extrude\+Vertices()}{extrudeVertices()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Optimised\+Util\+::extrude\+Vertices (\begin{DoxyParamCaption}\item[{const \hyperlink{class_ogre_1_1_vector4}{Vector4} \&}]{light\+Pos,  }\item[{\hyperlink{namespace_ogre_aa3a7b6dfb905e6572d62f0dfa3d4274d}{Real}}]{extrude\+Dist,  }\item[{const float $\ast$}]{src\+Positions,  }\item[{float $\ast$}]{dest\+Positions,  }\item[{size\+\_\+t}]{num\+Vertices }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Extruding vertices by a fixed distance based on light position. 


\begin{DoxyParams}{Parameters}
{\em light\+Pos} & 4D light position, when w=0.\+0f this represents a directional light, otherwise, w must be equal to 1.\+0f, which represents a point light. \\
\hline
{\em extrude\+Dist} & The distance to extrude. \\
\hline
{\em src\+Positions} & Pointer to source vertex\textquotesingle{}s position buffer, which the position is a 3D vector packed in xyz format. No S\+I\+MD alignment requirement but loss performance for unaligned data. \\
\hline
{\em dest\+Positions} & Pointer to destination vertex\textquotesingle{}s position buffer, which the position is a 3D vector packed in xyz format. No S\+I\+MD alignment requirement but loss performance for unaligned data. \\
\hline
{\em num\+Vertices} & Number of vertices need to extruding, which agree with source and destination buffers. \\
\hline
\end{DoxyParams}


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