28#ifndef __OptimisedUtil_H__
29#define __OptimisedUtil_H__
100 const float *srcPosPtr,
float *destPosPtr,
101 const float *srcNormPtr,
float *destNormPtr,
102 const float *blendWeightPtr,
const unsigned char* blendIndexPtr,
103 const Matrix4*
const* blendMatrices,
104 size_t srcPosStride,
size_t destPosStride,
105 size_t srcNormStride,
size_t destNormStride,
106 size_t blendWeightStride,
size_t blendIndexStride,
107 size_t numWeightsPerVertex,
108 size_t numVertices) = 0;
126 const float *srcPos1,
const float *srcPos2,
128 size_t pos1VSize,
size_t pos2VSize,
size_t dstVSize,
130 bool morphNormals) = 0;
145 size_t numMatrices) = 0;
159 const float *positions,
162 size_t numTriangles) = 0;
184 size_t numFaces) = 0;
203 const float* srcPositions,
204 float* destPositions,
205 size_t numVertices) = 0;
215 return (
const T*)((
const char*)(ptr) + offset);
221 return (T*)((
char*)(ptr) + offset);
Class encapsulating a standard 4x4 homogeneous matrix.
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 ot...
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.
static OptimisedUtil * _detectImplementation(void)
Detect best implementation based on run-time environment.
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.
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.
static OptimisedUtil * getImplementation(void)
Gets the implementation of this class.
OptimisedUtil & operator=(const OptimisedUtil &rhs)
Privated operator=, to prevent misuse.
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.
OptimisedUtil(const OptimisedUtil &rhs)
Privated copy constructor, to prevent misuse.
static OptimisedUtil * msImplementation
Store a pointer to the implementation.
4-dimensional homogeneous vector.
static FORCEINLINE void advanceRawPointer(const T *&ptr, ptrdiff_t offset)
Advance the pointer with raw offset.
static FORCEINLINE const T * rawOffsetPointer(const T *ptr, ptrdiff_t offset)
Returns raw offseted of the given pointer.
float Real
Software floating point type.
Basic triangle structure.