Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
The TextureMatrix class uses a 4x4 matrix to transform the texture coordinates of a texture unit. More...
#include <Shader.hpp>
Public Member Functions | |
| virtual const char * | className () |
| Returns the name of the class. | |
| TextureMatrix (int texunit) | |
| virtual ERenderState | type () const |
| virtual void | apply (const Camera *, OpenGLContext *ctx) const |
| The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it. | |
| const mat4 & | matrix () const |
| const TextureMatrix & | setMatrix (const mat4 &matrix) |
| void | setUseCameraRotationInverse (bool use) |
| Set this to true when you want your cubemap to appear in world space rather than eye space. | |
| bool | useCameraRotationInverse () const |
Protected Attributes | |
| mat4 | mMatrix |
| bool | mUseCameraRotationInverse |
The TextureMatrix class uses a 4x4 matrix to transform the texture coordinates of a texture unit.
Definition at line 976 of file Shader.hpp.
| vl::TextureMatrix::TextureMatrix | ( | int | texunit ) | [inline] |
Definition at line 980 of file Shader.hpp.
| virtual const char* vl::TextureMatrix::className | ( | ) | [inline, virtual] |
Returns the name of the class.
Reimplemented from vl::TextureState.
Definition at line 979 of file Shader.hpp.
| virtual ERenderState vl::TextureMatrix::type | ( | ) | const [inline, virtual] |
Reimplemented from vl::RenderState.
Definition at line 981 of file Shader.hpp.
References vl::RS_TextureMatrix0.
| void TextureMatrix::apply | ( | const Camera * | camera, |
| OpenGLContext * | ctx | ||
| ) | const [virtual] |
The parameter cameara is NULL if we are disabling the state, non-NULL if we are enabling it.
Implements vl::RenderState.
Definition at line 917 of file Shader.cpp.
References vl::Matrix4< T_Scalar >::as3x3(), vl::Camera::inverseViewMatrix(), matrix(), vl::TextureState::textureUnit(), useCameraRotationInverse(), VL_CHECK, VL_CHECK_OGL, vl::VL_glActiveTexture(), VL_glLoadMatrix, and VL_MAX_TEXTURE_UNITS.
| const mat4& vl::TextureMatrix::matrix | ( | ) | const [inline] |
Definition at line 983 of file Shader.hpp.
Referenced by apply().
| const TextureMatrix& vl::TextureMatrix::setMatrix | ( | const mat4 & | matrix ) | [inline] |
Definition at line 984 of file Shader.hpp.
| void vl::TextureMatrix::setUseCameraRotationInverse | ( | bool | use ) | [inline] |
Set this to true when you want your cubemap to appear in world space rather than eye space.
When setUseCameraRotationInverse() is true the texture matrix is computed as:
matrix()*camera->inverseViewMatrix().as3x3()
This way matrix() represents the transform of the texture in world coordinates, for example if you want to reorient your cubemap in world space or when you want to rotate the direction of one or more highlights prerendered in a cubemap.
Definition at line 995 of file Shader.hpp.
| bool vl::TextureMatrix::useCameraRotationInverse | ( | ) | const [inline] |
Definition at line 996 of file Shader.hpp.
Referenced by apply().
mat4 vl::TextureMatrix::mMatrix [protected] |
Definition at line 998 of file Shader.hpp.
bool vl::TextureMatrix::mUseCameraRotationInverse [protected] |
Definition at line 999 of file Shader.hpp.