UniformMatrix Class Reference
[Basic]

Container for GLSL matrix uniform variables. More...

#include <UniformMatrix.hpp>

Inheritance diagram for UniformMatrix:
Uniform Node Applicable Suppressable

List of all members.

Public Member Functions

 UniformMatrix (const Tag &tag)
virtual void apply ()
virtual string toString () const

Static Public Member Functions

static bool hasChild (Node *node, const string &name)
static bool isDefault (const string &name, GLenum type)
static bool isDefaultName (const string &name)

Protected Member Functions

void setTypeFromAs ()
void setTypeFromName ()

Private Types

enum  MatrixType {
  MODELVIEW,
  PROJECTION,
  MODELVIEW_PROJECTION,
  NORMAL,
  IDENTITY
}

Private Attributes

GLfloat value [16]
MatrixType matrixType
string as

Detailed Description

Container for GLSL matrix uniform variables.

XML Name

XML attributes

type mat4
name Name of the variable in the shader program
as Use OpenGL transformation state as the value

Valid values for as attribute

In addition, UniformMatrix will automatically apply an 'as' attribute for several default names if it is not explicitly set in the scene file by the user. The names in the following list correspond to the values in the previous list.

Example

   <program>
     <shader file="shader.vert" />
     <shader file="shader.frag" />
     <uniform type="mat4" name="MVPMatrix" />
     <cube />
   </program>
 

Default names


Constructor & Destructor Documentation

UniformMatrix ( const Tag tag  ) 
Exceptions:
NodeException if matrix type not supported.

Member Function Documentation

bool isDefaultName ( const string &  name  )  [static]
Returns:
True if name matches one of the default matrix names.
void setTypeFromAs (  )  [protected]
Exceptions:
NodeException if as not supported.
void setTypeFromName (  )  [protected]
Exceptions:
NodeException if default name not supported.
string toString (  )  const [virtual]

Forms a string from the object's attributes.

Reimplemented from Uniform.


The documentation for this class was generated from the following files:
Generated on Wed Jun 9 01:36:37 2010 for Gander by  doxygen 1.6.3