Container for GLSL matrix uniform variables. More...
#include <UniformMatrix.hpp>
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 |
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
UniformMatrix | ( | const Tag & | tag | ) |
NodeException | if matrix type not supported. |
bool isDefaultName | ( | const string & | name | ) | [static] |
void setTypeFromAs | ( | ) | [protected] |
NodeException | if as not supported. |
void setTypeFromName | ( | ) | [protected] |
NodeException | if default name not supported. |
string toString | ( | ) | const [virtual] |
Forms a string from the object's attributes.
Reimplemented from Uniform.