# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions

# vl::ProjViewTransfCallback Class Reference

Callback class to update the state of the `projection`, `view`, `transform` and `normal` matrices of a GLSLProgram or fixed function pipeline. More...

`#include <ProjViewTransfCallback.hpp>`

Inheritance diagram for vl::ProjViewTransfCallback:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| ProjViewTransfCallback ()
virtual void | updateMatrices (bool cam_changed, bool transf_changed, const GLSLProgram *glsl_program, const Camera *camera, const Transform *transform, bool is_gl_compatible)
| Update matrices of the current GLSLProgram, if glsl_program == NULL then fixed function pipeline is active.

## Detailed Description

Callback class to update the state of the `projection`, `view`, `transform` and `normal` matrices of a GLSLProgram or fixed function pipeline.

By default it updates the GL_PROJECTION and GL_MODELVIEW matrices. If GLSL is used and any of `vl_ModelViewMatrix`, `vl_ProjectionMatrix`, `vl_ModelViewProjectionMatrix` or `vl_NormalMatrix` is used, then no legacy uniform matrix is updated (GL_MODELVIEW, gl_ModelViewMatrix etc.) but only the vl_* ones. Reimplement the updateMatrices() method to update any other camera/transform matrix you might need such as the ones defined in http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.10.59.pdf pag 45.

Definition at line 55 of file ProjViewTransfCallback.hpp.

## Constructor & Destructor Documentation

vl::ProjViewTransfCallback::ProjViewTransfCallback | ( | ) | `[inline]`

Definition at line 60 of file ProjViewTransfCallback.hpp.

References VL_DEBUG_SET_OBJECT_NAME.

## Member Function Documentation

virtual const char* vl::ProjViewTransfCallback::className | ( | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

Definition at line 58 of file ProjViewTransfCallback.hpp.

void ProjViewTransfCallback::updateMatrices | ( | bool | cam_changed,
|  | bool | transf_changed,
|  | const GLSLProgram * | glsl_program,
|  | const Camera * | camera,
|  | const Transform * | transform,
|  | bool | is_gl_compatible
| ) |  | `[virtual]`

Update matrices of the current GLSLProgram, if glsl_program == NULL then fixed function pipeline is active.

Definition at line 42 of file ProjViewTransfCallback.cpp.

References vl::Matrix4< T_Scalar >::as3x3(), vl::Matrix4< T_Scalar >::invert(), vl::Camera::projectionMatrix(), vl::Matrix4< T_Scalar >::ptr(), vl::Matrix4< T_Scalar >::transpose(), vl::Camera::viewMatrix(), VL_CHECK_OGL, VL_glLoadMatrix, vl::GLSLProgram::vl_ModelViewMatrix(), vl::GLSLProgram::vl_ModelViewProjectionMatrix(), vl::GLSLProgram::vl_NormalMatrix(), vl::GLSLProgram::vl_ProjectionMatrix(), and vl::ITransform::worldMatrix().

Referenced by vl::Renderer::render(), and vl::OcclusionCullRenderer::render_pass2().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/ProjViewTransfCallback.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/ProjViewTransfCallback.cpp

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