Utility class for provides optimised functions. More...
#include <OgreOptimisedUtil.h>
Public Member Functions | |
OptimisedUtil (void) | |
virtual | ~OptimisedUtil () |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
Static Public Member Functions | |
static OptimisedUtil * | getImplementation (void) |
Gets the implementation of this class. | |
Static Protected Member Functions | |
static OptimisedUtil * | _detectImplementation (void) |
Detect best implementation based on run-time environment. | |
Static Protected Attributes | |
static OptimisedUtil * | msImplementation |
Store a pointer to the implementation. | |
Private Member Functions | |
OptimisedUtil (const OptimisedUtil &rhs) | |
Privated copy constructor, to prevent misuse. | |
OptimisedUtil & | operator= (const OptimisedUtil &rhs) |
Privated operator=, to prevent misuse. |
Utility class for provides optimised functions.
Definition at line 47 of file OgreOptimisedUtil.h.
Ogre::OptimisedUtil::OptimisedUtil | ( | const OptimisedUtil & | rhs | ) | [private] |
Privated copy constructor, to prevent misuse.
Ogre::OptimisedUtil::OptimisedUtil | ( | void | ) |
Definition at line 64 of file OgreOptimisedUtil.h.
virtual Ogre::OptimisedUtil::~OptimisedUtil | ( | ) | [virtual] |
Definition at line 66 of file OgreOptimisedUtil.h.
static OptimisedUtil* Ogre::OptimisedUtil::_detectImplementation | ( | void | ) | [static, protected] |
Detect best implementation based on run-time environment.
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.
positions | Pointer to position information, which packed in (x, y, z) format, indexing by vertex index in the triangle. No alignment requests. | |
triangles | The triangles need to calculate face normal, the vertex positions is indexed by vertex index to position information. | |
faceNormals | The array of Vector4 used to store triangles face normal, Must be aligned to SIMD alignment. | |
numTriangles | Number of triangles to calculate face normal. |
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.
lightPos | 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. | |
faceNormals | 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 SIMD alignment. | |
lightFacings | 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. | |
numFaces | Number of face normals to calculate. |
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.
baseMatrix | The matrix used as first operand. | |
srcMatrices | An array of matrix used as second operand. | |
dstMatrices | An array of matrix to store matrix concatenate results. | |
numMatrices | Number of matrices in the array. |
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.
lightPos | 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. | |
extrudeDist | The distance to extrude. | |
srcPositions | Pointer 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. | |
destPositions | Pointer 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. | |
numVertices | Number of vertices need to extruding, which agree with source and destination buffers. |
static OptimisedUtil* Ogre::OptimisedUtil::getImplementation | ( | void | ) | [static] |
Gets the implementation of this class.
Definition at line 73 of file OgreOptimisedUtil.h.
OptimisedUtil& Ogre::OptimisedUtil::operator= | ( | const OptimisedUtil & | rhs | ) | [private] |
Privated operator=, to prevent misuse.
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.
t | Parametric distance between the start and end positions | |
srcPos1 | Pointer to buffer for the start positions | |
srcPos2 | Pointer to buffer for the end positions | |
dstPos | Pointer to buffer for the destination positions | |
pos1VSize,pos2VSize,dstVSize | Vertex sizes in bytes of each of the 3 buffers referenced | |
numVertices | 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 |
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.
srcPosPtr | Pointer to source position buffer. | |
destPosPtr | Pointer to destination position buffer. | |
srcNormPtr | Pointer to source normal buffer, if NULL, means blend position only. | |
destNormPtr | Pointer to destination normal buffer, it's ignored if srcNormPtr is NULL. | |
blendWeightPtr | Pointer to blend weight buffer. | |
blendIndexPtr | Pointer to blend index buffer. | |
blendMatrices | An array of pointer of blend matrix, the matrix must be aligned to SIMD alignment, but not necessary for the array itself. | |
srcPosStride | The stride of source position in bytes. | |
destPosStride | The stride of destination position in bytes. | |
srcNormStride | The stride of source normal in bytes, it's ignored if srcNormPtr is NULL. | |
destNormStride | The stride of destination normal in bytes, it's ignored if srcNormPtr is NULL. | |
blendWeightStride | The stride of blend weight buffer in bytes. | |
blendIndexStride | The stride of blend index buffer in bytes. | |
numWeightsPerVertex | Number of blend weights per-vertex, as well as for blend indices. | |
numVertices | Number of vertices to blend. |
OptimisedUtil* Ogre::OptimisedUtil::msImplementation [static, protected] |
Store a pointer to the implementation.
Definition at line 57 of file OgreOptimisedUtil.h.
Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri May 25 23:38:29 2012