OpenCOVER
|
#include <coVRShader.h>
Public Member Functions | |
coTangentSpaceGenerator () | |
coTangentSpaceGenerator (const coTangentSpaceGenerator ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
void | generate (osg::Geometry *geo) |
osg::Vec4Array * | getTangentArray () |
const osg::Vec4Array * | getTangentArray () const |
void | setTangentArray (osg::Vec4Array *array) |
osg::Vec4Array * | getNormalArray () |
const osg::Vec4Array * | getNormalArray () const |
void | setNormalArray (osg::Vec4Array *array) |
osg::Vec4Array * | getBinormalArray () |
const osg::Vec4Array * | getBinormalArray () const |
void | setBinormalArray (osg::Vec4Array *array) |
osg::IndexArray * | getIndices () |
Protected Member Functions | |
virtual | ~coTangentSpaceGenerator () |
coTangentSpaceGenerator & | operator= (const coTangentSpaceGenerator &) |
void | compute (osg::PrimitiveSet *pset, const osg::Array *vx, const osg::Array *nx, int iA, int iB, int iC) |
Protected Attributes | |
osg::ref_ptr< osg::Vec4Array > | T_ |
osg::ref_ptr< osg::Vec4Array > | B_ |
osg::ref_ptr< osg::Vec4Array > | N_ |
osg::ref_ptr< osg::UIntArray > | indices_ |
The coTangentSpaceGenerator 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; then you can retrieve the TBN arrays by calling getTangentArray(), getNormalArray() and getBinormalArray() methods.
opencover::coTangentSpaceGenerator::coTangentSpaceGenerator | ( | ) |
opencover::coTangentSpaceGenerator::coTangentSpaceGenerator | ( | const coTangentSpaceGenerator & | copy, |
const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY |
||
) |
|
inlineprotectedvirtual |
|
protected |
void opencover::coTangentSpaceGenerator::generate | ( | osg::Geometry * | geo | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |