opensurgsim
Public Member Functions | Static Public Member Functions | List of all members
SurgSim::Graphics::TangentSpaceGenerator Class Reference

Node visitor which calculates the tangent space basis vectors from the texture coordinates of any geometry it encounters. More...

#include <TangentSpaceGenerator.h>

Inheritance diagram for SurgSim::Graphics::TangentSpaceGenerator:

Public Member Functions

 TangentSpaceGenerator (int textureCoordUnit, int tangentAttribIndex, int bitangentAttribIndex)
 Constructor. More...
 
virtual ~TangentSpaceGenerator ()
 Destructor.
 
void setBasisOrthonormality (bool orthonormal)
 Sets whether the three tangent space basis vectors are made to be orthonormal; otherwise, each tangent is separately orthonormal to the normal, but not to each other. More...
 
bool getBasisOrthonormality ()
 Gets whether the three tangent space basis vectors are made to be orthonormal; otherwise, each tangent is separately orthonormal to the normal, but not to each other.
 
void apply (osg::Geode &geode) override
 Generates tangent space vectors for all geometry in the geode. More...
 

Static Public Member Functions

static void generateTangentSpace (osg::Geometry *geometry, int textureCoordUnit, int tangentAttribIndex, int bitangentAttribIndex, bool orthonormal)
 Generates tangent space basis vectors for the geometry. More...
 

Detailed Description

Node visitor which calculates the tangent space basis vectors from the texture coordinates of any geometry it encounters.

Constructor & Destructor Documentation

§ TangentSpaceGenerator()

SurgSim::Graphics::TangentSpaceGenerator::TangentSpaceGenerator ( int  textureCoordUnit,
int  tangentAttribIndex,
int  bitangentAttribIndex 
)

Constructor.

Parameters
textureCoordUnitTexture unit of texture coordinates to use for calculating the tangent space
tangentAttribIndexIndex of the vertex attribute array to store the calculated tangents
bitangentAttribIndexIndex of the vertex attribute array to store the calculated bitangents

Member Function Documentation

§ apply()

void SurgSim::Graphics::TangentSpaceGenerator::apply ( osg::Geode &  geode)
override

Generates tangent space vectors for all geometry in the geode.

Parameters
geodeGeode to generate tangent space vectors

§ generateTangentSpace()

void SurgSim::Graphics::TangentSpaceGenerator::generateTangentSpace ( osg::Geometry *  geometry,
int  textureCoordUnit,
int  tangentAttribIndex,
int  bitangentAttribIndex,
bool  orthonormal 
)
static

Generates tangent space basis vectors for the geometry.

Parameters
geometryGeometry to generate normals
textureCoordUnitTexture unit of texture coordinates to use for calculating the tangent space
tangentAttribIndexIndex of the vertex attribute array to store the calculated tangents
bitangentAttribIndexIndex of the vertex attribute array to store the calculated bi-tangents
orthonormalWhether or not to create a fully orthonormal basis; otherwise, each tangent is separately orthonormal to the normal, but not to each other

§ setBasisOrthonormality()

void SurgSim::Graphics::TangentSpaceGenerator::setBasisOrthonormality ( bool  orthonormal)

Sets whether the three tangent space basis vectors are made to be orthonormal; otherwise, each tangent is separately orthonormal to the normal, but not to each other.

Parameters
orthonormalWhether or not to create a fully orthonormal basis

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