This class generates three arrays containing tangent-space basis vectors.
Inheritance:
Public Methods
-
TangentSpaceGenerator()
-
TangentSpaceGenerator(const TangentSpaceGenerator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY)
-
void generate(osg::Geometry* geo, int normal_map_tex_unit = 0)
-
inline osg::Vec4Array* getTangentArray()
-
inline const osg::Vec4Array* getTangentArray() const
-
inline void setTangentArray(osg::Vec4Array* array)
-
inline osg::Vec4Array* getNormalArray()
-
inline const osg::Vec4Array* getNormalArray() const
-
inline void setNormalArray(osg::Vec4Array* array)
-
inline osg::Vec4Array* getBinormalArray()
-
inline const osg::Vec4Array* getBinormalArray() const
-
inline void setBinormalArray(osg::Vec4Array* array)
Protected Methods
-
virtual ~TangentSpaceGenerator()
-
TangentSpaceGenerator& operator=(const TangentSpaceGenerator &)
-
void compute_basis_vectors(osg::PrimitiveSet* pset, const osg::Array* vx, const osg::Array* nx, const osg::Array* tx, int iA, int iB, int iC)
Documentation
This 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.
- TangentSpaceGenerator()
- TangentSpaceGenerator(const TangentSpaceGenerator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY)
- void generate(osg::Geometry* geo, int normal_map_tex_unit = 0)
- inline osg::Vec4Array* getTangentArray()
- inline const osg::Vec4Array* getTangentArray() const
- inline void setTangentArray(osg::Vec4Array* array)
- inline osg::Vec4Array* getNormalArray()
- inline const osg::Vec4Array* getNormalArray() const
- inline void setNormalArray(osg::Vec4Array* array)
- inline osg::Vec4Array* getBinormalArray()
- inline const osg::Vec4Array* getBinormalArray() const
- inline void setBinormalArray(osg::Vec4Array* array)
- virtual ~TangentSpaceGenerator()
- TangentSpaceGenerator& operator=(const TangentSpaceGenerator &)
- void compute_basis_vectors(osg::PrimitiveSet* pset, const osg::Array* vx, const osg::Array* nx, const osg::Array* tx, int iA, int iB, int iC)
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.