|
| TangentSpaceGenerator () |
|
| TangentSpaceGenerator (const TangentSpaceGenerator ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) |
|
void | generate (osg::Geometry *geo, int normal_map_tex_unit=0) |
|
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 () |
|
| Referenced () |
|
| Referenced (bool threadSafeRefUnref) |
|
| Referenced (const Referenced &) |
|
Referenced & | operator= (const Referenced &) |
|
virtual void | setThreadSafeRefUnref (bool threadSafe) |
| Set whether to use a mutex to ensure ref() and unref() are thread safe. More...
|
|
bool | getThreadSafeRefUnref () const |
| Get whether a mutex is used to ensure ref() and unref() are thread safe. More...
|
|
OpenThreads::Mutex * | getRefMutex () const |
| Get the mutex used to ensure thread safety of ref()/unref(). More...
|
|
int | ref () const |
| Increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
|
|
int | unref () const |
| Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
|
|
int | unref_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
|
|
int | referenceCount () const |
| Return the number of pointers currently referencing this object. More...
|
|
ObserverSet * | getObserverSet () const |
| Get the ObserverSet if one is attached, otherwise return NULL. More...
|
|
ObserverSet * | getOrCreateObserverSet () const |
| Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet. More...
|
|
void | addObserver (Observer *observer) const |
| Add a Observer that is observing this object, notify the Observer when this object gets deleted. More...
|
|
void | removeObserver (Observer *observer) const |
| Remove Observer that is observing this object. More...
|
|
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.