TangentGenerator is a class that defines the tangent space used
by.
Mesh objects. "Tangent space" is a coordinate system defined
per vertex on a mesh, with its coordinate basis defined by the
normal vector (which points away from the mesh), and the binormal
and tangent vectors which are all orthagonal to each other. They
can be calculated in different ways.
TangentGenerator is derived from
TreeNode, so that it can be made a child of the mesh. If your
graphics pipeline demands its own particular way of defining
tangent space, you can override this class and its methods. To
create your own: 1. Write a plug-in that defines your own class
derived from
TangentGenerator. 2. If you need to, override the TreeNode::OnLinked()
method. This will be called when your
TangentGenerator node is linked to a mesh object. You can
initialize any internal data. 3. Delete the existing
TangentGenerator plugin, and copy yours into the plug-in
folder. On OSX, this plugin (TangentGenerator.dylib) is found in
the Mudbox 2010 module, under Contents>MacOS>plugins. On the
PC, it is found in the work dir folder, under "plugins"
Definition at line 1519 of file mesh.h.
Public Member Functions
|
virtual
Vector |
ConvertToTangent (unsigned int iVertexIndex, const Vector &vVector)
const |
|
Convert an object space vector to tangent
space.
|
virtual
Vector |
ConvertToObject (unsigned int iVertexIndex, const Vector &vVector)
const |
|
Convert a tangent space vector to object
space.
|
virtual
Base |
LocalBase (unsigned int iFaceIndex, unsigned int
iCornerIndex) |
|
Returns the
Base of the tangent space for a face vertex (a=tangent,
b=normal, c=binormal).
|
virtual
void |
SetNormalization (bool bNormalize) |
|
Turns normalization for the tangent and
binormal vectors on or off.
|