Basic Renderer
|
A properties object caches data to pass to a shader (such as matrices, vectors and scalars) and can be associated with a drawable object. More...
#include <Properties.h>
Public Types | |
typedef std::map< std::string, vmml::Matrix4f > | Matrix4x4Map |
typedef std::map< std::string, vmml::Matrix3f > | Matrix3x3Map |
typedef std::map< std::string, vmml::Vector4f > | Vector4Map |
typedef std::map< std::string, vmml::Vector3f > | Vector3Map |
typedef std::map< std::string, GLfloat > | ScalarMap |
Public Member Functions | |
virtual | ~Properties () |
Virtual destructor. More... | |
const Matrix4x4Map & | getMatrices4x4 () |
Returns all 4x4 matrices. More... | |
vmml::Matrix4f | getMatrix4x4 (const std::string &name) |
Returns a 4x4 matrix. More... | |
const Matrix3x3Map & | getMatrices3x3 () |
Returns all 3x3 matrices. More... | |
vmml::Matrix3f | getMatrix3x3 (const std::string &name) |
Returns a 3x3 matrix. More... | |
const Vector4Map & | getVectors4 () |
Returns all 4x1 vectors. More... | |
vmml::Vector4f | getVector4 (const std::string &name) |
Returns a 4x1 vector. More... | |
const Vector3Map & | getVectors3 () |
Returns all 3x1 vectors. More... | |
vmml::Vector3f | getVector3 (const std::string &name) |
Returns a 3x1 vector. More... | |
const ScalarMap & | getScalars () |
Returns all scalars. More... | |
GLfloat | getScalar (const std::string &name) |
Returns a scalar. More... | |
void | setMatrices4x4 (const Matrix4x4Map &arg) |
Sets all 4x4 matrices. More... | |
void | setMatrix (const std::string &name, const vmml::Matrix4f &arg) |
Sets a 4x4 matrix. More... | |
void | setMatrices3x3 (const Matrix3x3Map &arg) |
Sets all 3x3 matrices. More... | |
void | setMatrix (const std::string &name, const vmml::Matrix3f &arg) |
Sets a 3x3 matrix. More... | |
void | setVectors4 (const Vector4Map &arg) |
Sets all 4x1 vectors. More... | |
void | setVector (const std::string &name, const vmml::Vector4f &arg) |
Sets a 4x1 vector. More... | |
void | setVectors3 (const Vector3Map &arg) |
Sets all 3x1 vectors. More... | |
void | setVector (const std::string &name, const vmml::Vector3f &arg) |
Sets a 3x1 vector. More... | |
void | setScalars (const ScalarMap &arg) |
Sets all scalars. More... | |
void | setScalar (const std::string &name, GLfloat arg) |
Sets a scalar. More... | |
const std::string & | getName () |
Returns the name of the properties. More... | |
void | setName (const std::string &arg) |
Sets the name of the properties. More... | |
void | passToShader (ShaderPtr shader) |
Pass properties to specified shader. More... | |
void | clear () |
Clear all properties. More... | |
A properties object caches data to pass to a shader (such as matrices, vectors and scalars) and can be associated with a drawable object.
The properties may be passed to the shader as uniforms. The names of the stored objects should therefore be chosen to match the names of the uniforms in the shader.
typedef std::map<std::string, vmml::Matrix3f> Properties::Matrix3x3Map |
typedef std::map<std::string, vmml::Matrix4f> Properties::Matrix4x4Map |
typedef std::map<std::string, GLfloat> Properties::ScalarMap |
typedef std::map<std::string, vmml::Vector3f> Properties::Vector3Map |
typedef std::map<std::string, vmml::Vector4f> Properties::Vector4Map |
|
inlinevirtual |
Virtual destructor.
|
inline |
Clear all properties.
|
inline |
Returns all 3x3 matrices.
|
inline |
Returns all 4x4 matrices.
|
inline |
Returns a 3x3 matrix.
[in] | name | Name of the matrix |
|
inline |
Returns a 4x4 matrix.
[in] | name | Name of the matrix |
|
inline |
Returns the name of the properties.
|
inline |
Returns a scalar.
[in] | name | Name of the scalar |
|
inline |
Returns all scalars.
|
inline |
Returns a 3x1 vector.
[in] | name | Name of the vector |
|
inline |
Returns a 4x1 vector.
[in] | name | Name of the vector |
|
inline |
Returns all 3x1 vectors.
|
inline |
Returns all 4x1 vectors.
|
inline |
Pass properties to specified shader.
[in] | shader | The shader the properties are passed to |
|
inline |
Sets all 3x3 matrices.
[in] | arg | 3x3 matrices |
|
inline |
Sets all 4x4 matrices.
[in] | arg | 4x4 matrices |
|
inline |
Sets a 4x4 matrix.
[in] | name | Name of the matrix |
[in] | arg | 4x4 matrix |
|
inline |
Sets a 3x3 matrix.
[in] | name | Name of the matrix |
[in] | arg | 3x3 matrix |
|
inline |
Sets the name of the properties.
[in] | arg | Name for the properties |
|
inline |
Sets a scalar.
[in] | name | Name of the scalar |
[in] | arg | Scalar |
|
inline |
Sets all scalars.
[in] | arg | Scalar |
|
inline |
Sets a 4x1 vector.
[in] | name | Name of the vector |
[in] | arg | 4x1 vector |
|
inline |
Sets a 3x1 vector.
[in] | name | Name of the vector |
[in] | arg | 3x1 vector |
|
inline |
Sets all 3x1 vectors.
[in] | arg | 3x1 vectors |
|
inline |
Sets all 4x1 vectors.
[in] | arg | 4x1 Vectors |