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


Utility class for provides optimised functions.  




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

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_ogre_1_1_optimised_util_a4f137d0ced0f82abd042d9b4eb99b105}{Optimised\+Util}} (void)
\item 
virtual \mbox{\hyperlink{class_ogre_1_1_optimised_util_a7d548511ecbd6b39d6d1689ce30db8f2}{$\sim$\+Optimised\+Util}} ()
\item 
virtual void \mbox{\hyperlink{class_ogre_1_1_optimised_util_a7fa20b34357e375a489383f0ccb4a15c}{calculate\+Face\+Normals}} (const float $\ast$positions, const \mbox{\hyperlink{struct_ogre_1_1_edge_data_1_1_triangle}{Edge\+Data\+::\+Triangle}} $\ast$triangles, \mbox{\hyperlink{namespace_ogre_a739a289a4d5235f5f509a1795f5ffd5b}{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 \mbox{\hyperlink{class_ogre_1_1_optimised_util_a9270e6273fcf190d039030bd5de1df2f}{calculate\+Light\+Facing}} (const \mbox{\hyperlink{namespace_ogre_a739a289a4d5235f5f509a1795f5ffd5b}{Vector4}} \&light\+Pos, const \mbox{\hyperlink{namespace_ogre_a739a289a4d5235f5f509a1795f5ffd5b}{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 \mbox{\hyperlink{class_ogre_1_1_optimised_util_aa625f93ec757b2820935369c9884c45d}{concatenate\+Affine\+Matrices}} (const \mbox{\hyperlink{class_ogre_1_1_affine3}{Affine3}} \&base\+Matrix, const \mbox{\hyperlink{class_ogre_1_1_affine3}{Affine3}} $\ast$src\+Matrices, \mbox{\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 \mbox{\hyperlink{class_ogre_1_1_optimised_util_a5b411cfc1b916483d75df4f4f9c86252}{extrude\+Vertices}} (const \mbox{\hyperlink{namespace_ogre_a739a289a4d5235f5f509a1795f5ffd5b}{Vector4}} \&light\+Pos, \mbox{\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 \mbox{\hyperlink{class_ogre_1_1_optimised_util_a431efac44c070695de7011243b13b7af}{software\+Vertex\+Morph}} (\mbox{\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 \mbox{\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 \mbox{\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}
\doxysubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static \mbox{\hyperlink{class_ogre_1_1_optimised_util}{Optimised\+Util}} $\ast$ \mbox{\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}


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

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


\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_optimised_util_a4f137d0ced0f82abd042d9b4eb99b105}\label{class_ogre_1_1_optimised_util_a4f137d0ced0f82abd042d9b4eb99b105}} 
\index{Ogre::OptimisedUtil@{Ogre::OptimisedUtil}!OptimisedUtil@{OptimisedUtil}}
\index{OptimisedUtil@{OptimisedUtil}!Ogre::OptimisedUtil@{Ogre::OptimisedUtil}}
\doxysubsubsection{\texorpdfstring{OptimisedUtil()}{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::OptimisedUtil@{Ogre::OptimisedUtil}!````~OptimisedUtil@{$\sim$OptimisedUtil}}
\index{````~OptimisedUtil@{$\sim$OptimisedUtil}!Ogre::OptimisedUtil@{Ogre::OptimisedUtil}}
\doxysubsubsection{\texorpdfstring{$\sim$OptimisedUtil()}{~OptimisedUtil()}}
{\footnotesize\ttfamily virtual Ogre\+::\+Optimised\+Util\+::$\sim$\+Optimised\+Util (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_optimised_util_aec3039ddfa064375bb4065a4415a8eda}\label{class_ogre_1_1_optimised_util_aec3039ddfa064375bb4065a4415a8eda}} 
\index{Ogre::OptimisedUtil@{Ogre::OptimisedUtil}!getImplementation@{getImplementation}}
\index{getImplementation@{getImplementation}!Ogre::OptimisedUtil@{Ogre::OptimisedUtil}}
\doxysubsubsection{\texorpdfstring{getImplementation()}{getImplementation()}}
{\footnotesize\ttfamily static \mbox{\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::OptimisedUtil@{Ogre::OptimisedUtil}!softwareVertexSkinning@{softwareVertexSkinning}}
\index{softwareVertexSkinning@{softwareVertexSkinning}!Ogre::OptimisedUtil@{Ogre::OptimisedUtil}}
\doxysubsubsection{\texorpdfstring{softwareVertexSkinning()}{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 \mbox{\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::OptimisedUtil@{Ogre::OptimisedUtil}!softwareVertexMorph@{softwareVertexMorph}}
\index{softwareVertexMorph@{softwareVertexMorph}!Ogre::OptimisedUtil@{Ogre::OptimisedUtil}}
\doxysubsubsection{\texorpdfstring{softwareVertexMorph()}{softwareVertexMorph()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Optimised\+Util\+::software\+Vertex\+Morph (\begin{DoxyParamCaption}\item[{\mbox{\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::OptimisedUtil@{Ogre::OptimisedUtil}!concatenateAffineMatrices@{concatenateAffineMatrices}}
\index{concatenateAffineMatrices@{concatenateAffineMatrices}!Ogre::OptimisedUtil@{Ogre::OptimisedUtil}}
\doxysubsubsection{\texorpdfstring{concatenateAffineMatrices()}{concatenateAffineMatrices()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Optimised\+Util\+::concatenate\+Affine\+Matrices (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{class_ogre_1_1_affine3}{Affine3}} \&}]{base\+Matrix,  }\item[{const \mbox{\hyperlink{class_ogre_1_1_affine3}{Affine3}} $\ast$}]{src\+Matrices,  }\item[{\mbox{\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::OptimisedUtil@{Ogre::OptimisedUtil}!calculateFaceNormals@{calculateFaceNormals}}
\index{calculateFaceNormals@{calculateFaceNormals}!Ogre::OptimisedUtil@{Ogre::OptimisedUtil}}
\doxysubsubsection{\texorpdfstring{calculateFaceNormals()}{calculateFaceNormals()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Optimised\+Util\+::calculate\+Face\+Normals (\begin{DoxyParamCaption}\item[{const float $\ast$}]{positions,  }\item[{const \mbox{\hyperlink{struct_ogre_1_1_edge_data_1_1_triangle}{Edge\+Data\+::\+Triangle}} $\ast$}]{triangles,  }\item[{\mbox{\hyperlink{namespace_ogre_a739a289a4d5235f5f509a1795f5ffd5b}{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 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::OptimisedUtil@{Ogre::OptimisedUtil}!calculateLightFacing@{calculateLightFacing}}
\index{calculateLightFacing@{calculateLightFacing}!Ogre::OptimisedUtil@{Ogre::OptimisedUtil}}
\doxysubsubsection{\texorpdfstring{calculateLightFacing()}{calculateLightFacing()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Optimised\+Util\+::calculate\+Light\+Facing (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_a739a289a4d5235f5f509a1795f5ffd5b}{Vector4}} \&}]{light\+Pos,  }\item[{const \mbox{\hyperlink{namespace_ogre_a739a289a4d5235f5f509a1795f5ffd5b}{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::OptimisedUtil@{Ogre::OptimisedUtil}!extrudeVertices@{extrudeVertices}}
\index{extrudeVertices@{extrudeVertices}!Ogre::OptimisedUtil@{Ogre::OptimisedUtil}}
\doxysubsubsection{\texorpdfstring{extrudeVertices()}{extrudeVertices()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Optimised\+Util\+::extrude\+Vertices (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_a739a289a4d5235f5f509a1795f5ffd5b}{Vector4}} \&}]{light\+Pos,  }\item[{\mbox{\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 
\mbox{\hyperlink{_ogre_optimised_util_8h}{Ogre\+Optimised\+Util.\+h}}\end{DoxyCompactItemize}
