Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes

vl::TextureMatrix Class Reference

The TextureMatrix class uses a 4x4 matrix to transform the texture coordinates of a texture unit. More...

#include <Shader.hpp>

Inheritance diagram for vl::TextureMatrix:
vl::TextureState vl::RenderState vl::Object

List of all members.

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 mat4matrix () const
const TextureMatrixsetMatrix (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

Detailed Description

The TextureMatrix class uses a 4x4 matrix to transform the texture coordinates of a texture unit.

See also:
Shader, TextureUnit, Texture, TexGen, TexParameter, Effect, Actor

Definition at line 976 of file Shader.hpp.


Constructor & Destructor Documentation

vl::TextureMatrix::TextureMatrix ( int  texunit ) [inline]

Definition at line 980 of file Shader.hpp.


Member Function Documentation

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().


Member Data Documentation

Definition at line 998 of file Shader.hpp.

Definition at line 999 of file Shader.hpp.


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

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:46.
Permission is granted to use this page to write and publish articles regarding Visualization Library.