Go to the documentation of this file.
28 #ifndef _OgreTangentSpaceCalc_H_
29 #define _OgreTangentSpaceCalc_H_
181 unsigned short sourceTexCoordSet = 0,
unsigned short index = 1);
209 parity(0), oppositeParityIndex(0) {}
217 unsigned short sourceTexCoordSet,
unsigned short index);
229 template <
typename T>
248 for (
int v = 0; v < 3; ++v, ++pBuf)
void calculateFaceTangentSpace(const size_t *vertInd, Vector3 &tsU, Vector3 &tsV, Vector3 &tsN)
Calculate face tangent space, U and V are weighted by UV area, N is normalised.
@ VES_TANGENT
Tangent (X axis if normal is Z)
list< IndexRemap >::type IndexRemapList
List of indexes that were remapped (split vertices).
void processFaces(Result &result)
bool getSplitRotated() const
Sets whether or not to split vertices when tangent space rotates more than 90 degrees around a vertex...
void remapIndexes(T *ibuf, size_t indexSet, Result &res)
void setSplitMirrored(bool split)
Sets whether or not to split vertices when a mirrored tangent space transition is detected (matrix pa...
Information about a remapped index.
void setVertexData(VertexData *v_in)
Set the incoming vertex data (which will be modified)
Result build(VertexElementSemantic targetSemantic=VES_TANGENT, unsigned short sourceTexCoordSet=0, unsigned short index=1)
Build a tangent space basis from the provided data.
void clear()
Reset the calculation object.
std::pair< size_t, size_t > VertexSplit
void populateVertexArray(unsigned short sourceTexCoordSet)
void extendBuffers(VertexSplits &splits)
IndexRemapList indexesRemapped
A list of indexes which were affected by splits.
size_t oppositeParityIndex
@ OT_TRIANGLE_LIST
A list of triangles, 3 vertices per triangle.
size_t indexSet
Index data set (can be >0 if more than one index data was added)
Class for calculating a tangent space basis.
list< VertexSplit >::type VertexSplits
void addFaceTangentSpaceToVertices(size_t indexSet, size_t faceIndex, size_t *localVertInd, const Vector3 &faceTsU, const Vector3 &faceTsV, const Vector3 &faceNorm, Result &result)
VertexInfoArray mVertexArray
Summary class collecting together vertex source information.
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents.
void setStoreParityInW(bool enabled)
Sets whether to store tangent space parity in the W of a 4-component tangent or not.
bool getSplitMirrored() const
Gets whether or not to split vertices when a mirrored tangent space transition is detected.
void remapIndexes(Result &res)
size_t faceIndex
The position in the index buffer that's affected.
void insertTangents(Result &res, VertexElementSemantic targetSemantic, unsigned short sourceTexCoordSet, unsigned short index)
vector< VertexInfo >::type VertexInfoArray
vector< RenderOperation::OperationType >::type OpTypeList
Standard 2-dimensional vector.
int calculateParity(const Vector3 &u, const Vector3 &v, const Vector3 &n)
void addIndexData(IndexData *i_in, RenderOperation::OperationType opType=RenderOperation::OT_TRIANGLE_LIST)
Add a set of index data that references the vertex data.
float Real
Software floating point type.
OperationType
The rendering operation type to perform.
Real calculateAngleWeight(size_t v0, size_t v1, size_t v2)
bool getStoreParityInW() const
Gets whether to store tangent space parity in the W of a 4-component tangent or not.
vector< IndexData * >::type IndexDataList
The result of having built a tangent space basis.
IndexRemap(size_t i, size_t f, const VertexSplit &s)
Summary class collecting together index data source information.
Standard 3-dimensional vector.
void setSplitRotated(bool split)
Sets whether or not to split vertices when tangent space rotates more than 90 degrees around a vertex...
VertexSplit splitVertex
The old and new vertex index.
VertexSplits vertexSplits
A list of vertex indices which were split off into new vertices because of mirroring.
virtual ~TangentSpaceCalc()
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.