public interface MikkTSpaceContext
| Modifier and Type | Method and Description |
|---|---|
void |
getNormal(float[] normOut,
int face,
int vert) |
int |
getNumFaces()
Returns the number of faces (triangles/quads) on the mesh to be
processed.
|
int |
getNumVerticesOfFace(int face)
Returns the number of vertices on face number iFace iFace is a number in
the range {0, 1, ..., getNumFaces()-1}
|
void |
getPosition(float[] posOut,
int face,
int vert)
returns the position/normal/texcoord of the referenced face of vertex
number iVert.
|
void |
getTexCoord(float[] texOut,
int face,
int vert) |
void |
setTSpace(float[] tangent,
float[] biTangent,
float magS,
float magT,
boolean isOrientationPreserving,
int face,
int vert)
This function is used to return tangent space results to the application.
|
void |
setTSpaceBasic(float[] tangent,
float sign,
int face,
int vert)
The call-backsetTSpaceBasic() is sufficient for basic normal mapping.
|
int getNumFaces()
int getNumVerticesOfFace(int face)
face - which face (≥0, <numFaces)void getPosition(float[] posOut,
int face,
int vert)
posOut - storage for the results (modified)face - which face (≥0, <numFaces)vert - which vertex in the face (≥0, <numVertices)void getNormal(float[] normOut,
int face,
int vert)
void getTexCoord(float[] texOut,
int face,
int vert)
void setTSpaceBasic(float[] tangent,
float sign,
int face,
int vert)
tangent - the desired tangent vector (unaffected)sign - the desired signface - which face (≥0, <numFaces)vert - which vertex in the face (≥0, <numVertices)void setTSpace(float[] tangent,
float[] biTangent,
float magS,
float magT,
boolean isOrientationPreserving,
int face,
int vert)
fSign = bIsOrientationPreserving ? 1.0f : (-1.0f); bitangent = fSign * cross(vN, tangent);Note that the results are returned unindexed. It is possible to generate a new index list. But averaging/overwriting tangent spaces by using an already existing index list WILL produce INCORRECT results. DO NOT! use an already existing index list.
tangent - the desired tangent vector (unaffected)biTangent - the desired bitangent vector (unaffected)magS - true magnitude of SmagT - true magnitude of TisOrientationPreserving - true→preserves, false→doesn't
preserveface - which face (≥0, <numFaces)vert - which vertex in the face (≥0, <numVertices)