The TangentSpaceGenerator class generates three arrays containing tangent-space basis vectors.
More...
List of all members.
Detailed Description
The TangentSpaceGenerator class generates three arrays containing tangent-space basis vectors.
It takes a texture-mapped Geometry object as input, traverses its primitive sets and computes Tangent, Normal and Binormal vectors for each vertex, storing them into arrays. The resulting arrays can be used as vertex program varying (per-vertex) parameters, enabling advanced effects like bump-mapping. To use this class, simply call the generate() method specifying the Geometry object you want to process and the texture unit that contains UV mapping for the normal map; then you can retrieve the TBN arrays by calling getTangentArray(), getNormalArray() and getBinormalArray() methods.
Constructor & Destructor Documentation
osgUtil::TangentSpaceGenerator::TangentSpaceGenerator |
( |
|
) |
|
virtual osgUtil::TangentSpaceGenerator::~TangentSpaceGenerator |
( |
|
) |
[inline, protected, virtual] |
Member Function Documentation
void osgUtil::TangentSpaceGenerator::generate |
( |
osg::Geometry * |
geo, |
|
|
int |
normal_map_tex_unit = 0 | |
|
) |
| | |
osg::Vec4Array* osgUtil::TangentSpaceGenerator::getBinormalArray |
( |
|
) |
[inline] |
const osg::Vec4Array* osgUtil::TangentSpaceGenerator::getBinormalArray |
( |
|
) |
const [inline] |
osg::Vec4Array* osgUtil::TangentSpaceGenerator::getNormalArray |
( |
|
) |
[inline] |
const osg::Vec4Array* osgUtil::TangentSpaceGenerator::getNormalArray |
( |
|
) |
const [inline] |
osg::Vec4Array* osgUtil::TangentSpaceGenerator::getTangentArray |
( |
|
) |
[inline] |
const osg::Vec4Array* osgUtil::TangentSpaceGenerator::getTangentArray |
( |
|
) |
const [inline] |
void osgUtil::TangentSpaceGenerator::setBinormalArray |
( |
osg::Vec4Array * |
array |
) |
[inline] |
void osgUtil::TangentSpaceGenerator::setNormalArray |
( |
osg::Vec4Array * |
array |
) |
[inline] |
void osgUtil::TangentSpaceGenerator::setTangentArray |
( |
osg::Vec4Array * |
array |
) |
[inline] |
Member Data Documentation
The documentation for this class was generated from the following file: