OGRE  1.10.12
Object-Oriented Graphics Rendering Engine
Ogre::OptimisedUtil Class Referenceabstract

Utility class for provides optimised functions. More...

#include <OgreOptimisedUtil.h>

Public Member Functions

 OptimisedUtil (void)
 
virtual ~OptimisedUtil ()
 
virtual void calculateFaceNormals (const float *positions, const EdgeData::Triangle *triangles, Vector4 *faceNormals, size_t numTriangles)=0
 Calculate the face normals for the triangles based on position information. More...
 
virtual void calculateLightFacing (const Vector4 &lightPos, const Vector4 *faceNormals, char *lightFacings, size_t numFaces)=0
 Calculate the light facing state of the triangle's face normals. More...
 
virtual void concatenateAffineMatrices (const Matrix4 &baseMatrix, const Matrix4 *srcMatrices, Matrix4 *dstMatrices, size_t numMatrices)=0
 Concatenate an affine matrix to an array of affine matrices. More...
 
virtual void extrudeVertices (const Vector4 &lightPos, Real extrudeDist, const float *srcPositions, float *destPositions, size_t numVertices)=0
 Extruding vertices by a fixed distance based on light position. More...
 
virtual void softwareVertexMorph (Real t, const float *srcPos1, const float *srcPos2, float *dstPos, size_t pos1VSize, size_t pos2VSize, size_t dstVSize, size_t numVertices, bool morphNormals)=0
 Performs a software vertex morph, of the kind used for morph animation although it can be used for other purposes. More...
 
virtual void softwareVertexSkinning (const float *srcPosPtr, float *destPosPtr, const float *srcNormPtr, float *destNormPtr, const float *blendWeightPtr, const unsigned char *blendIndexPtr, const Matrix4 *const *blendMatrices, size_t srcPosStride, size_t destPosStride, size_t srcNormStride, size_t destNormStride, size_t blendWeightStride, size_t blendIndexStride, size_t numWeightsPerVertex, size_t numVertices)=0
 Performs software vertex skinning. More...
 

Static Public Member Functions

static OptimisedUtilgetImplementation (void)
 Gets the implementation of this class. More...
 

Detailed Description

Utility class for provides optimised functions.

Note
This class are supposed used by internal engine only.

Constructor & Destructor Documentation

◆ OptimisedUtil()

Ogre::OptimisedUtil::OptimisedUtil ( void  )
inline

◆ ~OptimisedUtil()

virtual Ogre::OptimisedUtil::~OptimisedUtil ( )
inlinevirtual

Member Function Documentation

◆ getImplementation()

static OptimisedUtil* Ogre::OptimisedUtil::getImplementation ( void  )
inlinestatic

Gets the implementation of this class.

Note
Don't cache the pointer returned by this function, it'll change due run-time environment detection to pick up the best implementation.

◆ softwareVertexSkinning()

virtual void Ogre::OptimisedUtil::softwareVertexSkinning ( const float *  srcPosPtr,
float *  destPosPtr,
const float *  srcNormPtr,
float *  destNormPtr,
const float *  blendWeightPtr,
const unsigned char *  blendIndexPtr,
const Matrix4 *const *  blendMatrices,
size_t  srcPosStride,
size_t  destPosStride,
size_t  srcNormStride,
size_t  destNormStride,
size_t  blendWeightStride,
size_t  blendIndexStride,
size_t  numWeightsPerVertex,
size_t  numVertices 
)
pure virtual

Performs software vertex skinning.

Parameters
srcPosPtrPointer to source position buffer.
destPosPtrPointer to destination position buffer.
srcNormPtrPointer to source normal buffer, if NULL, means blend position only.
destNormPtrPointer to destination normal buffer, it's ignored if srcNormPtr is NULL.
blendWeightPtrPointer to blend weight buffer.
blendIndexPtrPointer to blend index buffer.
blendMatricesAn array of pointer of blend matrix, the matrix must be aligned to SIMD alignment, but not necessary for the array itself.
srcPosStrideThe stride of source position in bytes.
destPosStrideThe stride of destination position in bytes.
srcNormStrideThe stride of source normal in bytes, it's ignored if srcNormPtr is NULL.
destNormStrideThe stride of destination normal in bytes, it's ignored if srcNormPtr is NULL.
blendWeightStrideThe stride of blend weight buffer in bytes.
blendIndexStrideThe stride of blend index buffer in bytes.
numWeightsPerVertexNumber of blend weights per-vertex, as well as for blend indices.
numVerticesNumber of vertices to blend.

◆ softwareVertexMorph()

virtual void Ogre::OptimisedUtil::softwareVertexMorph ( Real  t,
const float *  srcPos1,
const float *  srcPos2,
float *  dstPos,
size_t  pos1VSize,
size_t  pos2VSize,
size_t  dstVSize,
size_t  numVertices,
bool  morphNormals 
)
pure virtual

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

Remarks
This function will linearly interpolate positions between two source buffers, into a third buffer.
Parameters
tParametric distance between the start and end positions
srcPos1Pointer to buffer for the start positions
srcPos2Pointer to buffer for the end positions
dstPosPointer to buffer for the destination positions
pos1VSize,pos2VSize,dstVSizeVertex sizes in bytes of each of the 3 buffers referenced
numVerticesNumber of vertices to morph, which agree with the number in start, end and destination buffer. Bear in mind three floating-point values per vertex

◆ concatenateAffineMatrices()

virtual void Ogre::OptimisedUtil::concatenateAffineMatrices ( const Matrix4 baseMatrix,
const Matrix4 srcMatrices,
Matrix4 dstMatrices,
size_t  numMatrices 
)
pure virtual

Concatenate an affine matrix to an array of affine matrices.

Note
An affine matrix is a 4x4 matrix with row 3 equal to (0, 0, 0, 1), e.g. no projective coefficients.
Parameters
baseMatrixThe matrix used as first operand.
srcMatricesAn array of matrix used as second operand.
dstMatricesAn array of matrix to store matrix concatenate results.
numMatricesNumber of matrices in the array.

◆ calculateFaceNormals()

virtual void Ogre::OptimisedUtil::calculateFaceNormals ( const float *  positions,
const EdgeData::Triangle triangles,
Vector4 faceNormals,
size_t  numTriangles 
)
pure virtual

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

Parameters
positionsPointer to position information, which packed in (x, y, z) format, indexing by vertex index in the triangle. No alignment requests.
trianglesThe triangles need to calculate face normal, the vertex positions is indexed by vertex index to position information.
faceNormalsThe array of Vector4 used to store triangles face normal, Must be aligned to SIMD alignment.
numTrianglesNumber of triangles to calculate face normal.

◆ calculateLightFacing()

virtual void Ogre::OptimisedUtil::calculateLightFacing ( const Vector4 lightPos,
const Vector4 faceNormals,
char *  lightFacings,
size_t  numFaces 
)
pure virtual

Calculate the light facing state of the triangle's face normals.

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.
Parameters
lightPos4D 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.
faceNormalsAn 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 SIMD alignment.
lightFacingsAn 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.
numFacesNumber of face normals to calculate.

◆ extrudeVertices()

virtual void Ogre::OptimisedUtil::extrudeVertices ( const Vector4 lightPos,
Real  extrudeDist,
const float *  srcPositions,
float *  destPositions,
size_t  numVertices 
)
pure virtual

Extruding vertices by a fixed distance based on light position.

Parameters
lightPos4D light position, when w=0.0f this represents a directional light, otherwise, w must be equal to 1.0f, which represents a point light.
extrudeDistThe distance to extrude.
srcPositionsPointer to source vertex's position buffer, which the position is a 3D vector packed in xyz format. No SIMD alignment requirement but loss performance for unaligned data.
destPositionsPointer to destination vertex's position buffer, which the position is a 3D vector packed in xyz format. No SIMD alignment requirement but loss performance for unaligned data.
numVerticesNumber of vertices need to extruding, which agree with source and destination buffers.

The documentation for this class was generated from the following file: