TangentGenerator Class Reference

This reference page is linked to from the following overview topics: Kinds of Plug-ins, Scene Graph, Mesh and Topology, Writing Plug-ins.



Detailed Description

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.

#include <mesh.h>

Inheritance diagram for TangentGenerator:
Inheritance graph
[legend]

List of all members.

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.

Member Function Documentation

virtual Vector ConvertToTangent ( unsigned int  iVertexIndex,
const Vector vVector 
) const [virtual]

Convert an object space vector to tangent space.

Parameters:
[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.

Parameters:
[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).

Parameters:
[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.

Parameters:
[in] bNormalize If true, tangent and binormal vectors will be normalized.

The documentation for this class was generated from the following file:

TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator
TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator TangentGenerator