osg::TexMat Class Reference

A texture matrix state class that encapsulates OpenGL texture matrix functionality. More...

Inheritance diagram for osg::TexMat:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 TexMat ()
 TexMat (const Matrix &matrix)
 TexMat (const TexMat &texmat, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.
 META_StateAttribute (osg, TexMat, TEXMAT)
virtual bool isTextureAttribute () const
 Return true if StateAttribute is a type which controls texturing and needs to be issued w.r.t to specific texture unit.
virtual int compare (const StateAttribute &sa) const
 Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
void setMatrix (const Matrix &matrix)
 Set the texture matrix.
MatrixgetMatrix ()
 Get the texture matrix.
const MatrixgetMatrix () const
 Get the const texture matrix.
void setScaleByTextureRectangleSize (bool flag)
 Switch on/off the post scaling of the TexMat matrix by the size of the last applied texture rectangle.
bool getScaleByTextureRectangleSize () const
 Get whether the post scaling of the TexMat matrix, by the size of the last applied texture rectangle, is switched on/off.
virtual void apply (State &state) const
 Apply texture matrix to OpenGL state.

Protected Member Functions

virtual ~TexMat (void)

Protected Attributes

Matrix _matrix
bool _scaleByTextureRectangleSize


Detailed Description

A texture matrix state class that encapsulates OpenGL texture matrix functionality.


Constructor & Destructor Documentation

osg::TexMat::TexMat (  ) 

osg::TexMat::TexMat ( const Matrix matrix  )  [inline]

osg::TexMat::TexMat ( const TexMat texmat,
const CopyOp copyop = CopyOp::SHALLOW_COPY 
) [inline]

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual osg::TexMat::~TexMat ( void   )  [protected, virtual]


Member Function Documentation

osg::TexMat::META_StateAttribute ( osg  ,
TexMat  ,
TEXMAT   
)

virtual bool osg::TexMat::isTextureAttribute (  )  const [inline, virtual]

Return true if StateAttribute is a type which controls texturing and needs to be issued w.r.t to specific texture unit.

Reimplemented from osg::StateAttribute.

virtual int osg::TexMat::compare ( const StateAttribute sa  )  const [inline, virtual]

Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.

Implements osg::StateAttribute.

void osg::TexMat::setMatrix ( const Matrix matrix  )  [inline]

Set the texture matrix.

Matrix& osg::TexMat::getMatrix (  )  [inline]

Get the texture matrix.

const Matrix& osg::TexMat::getMatrix (  )  const [inline]

Get the const texture matrix.

void osg::TexMat::setScaleByTextureRectangleSize ( bool  flag  )  [inline]

Switch on/off the post scaling of the TexMat matrix by the size of the last applied texture rectangle.

Use a TexMat alongside a TextureRectangle with this scaling applied allows one to treat a TextureRectnagles texture coordinate range as if it were the usual non dimensional 0.0 to 1.0 range. Note, the TexMat matrix itself is not modified by the post scaling, its purely an operation passed to OpenGL to do the post scaling once the the TexMat matrix has been loaded.

bool osg::TexMat::getScaleByTextureRectangleSize (  )  const [inline]

Get whether the post scaling of the TexMat matrix, by the size of the last applied texture rectangle, is switched on/off.

virtual void osg::TexMat::apply ( State state  )  const [virtual]

Apply texture matrix to OpenGL state.

Reimplemented from osg::StateAttribute.


Member Data Documentation

Matrix osg::TexMat::_matrix [protected]

bool osg::TexMat::_scaleByTextureRectangleSize [protected]


The documentation for this class was generated from the following file:
Generated at Sun Oct 14 02:12:17 2007 for the OpenSceneGraph by doxygen 1.5.3.