This reference page is linked to from the following overview topics: Kinds of Plug-ins, Scene Graph, Mesh and Topology, Writing Plug-ins.
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"
#include <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. |
|
| virtual Vector ConvertToTangent | ( | unsigned int | iVertexIndex, |
| const Vector & | vVector | ||
| ) | const [virtual] |
Convert an object space vector to tangent space.
| [in] | iVertexIndex | index of the associated vertex |
| [in] | vVector | object space vector to be converted to tangent space |
| virtual Vector ConvertToObject | ( | unsigned int | iVertexIndex, |
| const Vector & | vVector | ||
| ) | const [virtual] |
Convert a tangent space vector to object space.
| [in] | iVertexIndex | index of the associated vertex |
| [in] | vVector | tangent space vector to be converted to object space |
| virtual Base LocalBase | ( | unsigned int | iFaceIndex, |
| unsigned int | iCornerIndex | ||
| ) | [virtual] |
Returns the Base of the tangent space for a face vertex (a=tangent, b=normal, c=binormal).
| [in] | iFaceIndex | index of the face |
| [in] | iCornerIndex | corner index of the vertex in question (0 to 2 for triangular faces, 0 to 3 for quads) |
| virtual void SetNormalization | ( | bool | bNormalize | ) | [virtual] |
Turns normalization for the tangent and binormal vectors on or off.
| [in] | bNormalize | If true, tangent and binormal vectors will be normalized. |