6 #include "vmmlib/matrix.hpp"
24 typedef std::map<std::string, vmml::Vector4f>
Vector4Map;
25 typedef std::map<std::string, vmml::Vector3f>
Vector3Map;
41 vmml::Matrix4f
getMatrix4x4(
const std::string &name) {
return _matrices4x4[name]; }
50 vmml::Matrix3f
getMatrix3x3(
const std::string &name) {
return _matrices3x3[name]; }
59 vmml::Vector4f
getVector4(
const std::string &name) {
return _vectors4[name]; }
68 vmml::Vector3f
getVector3(
const std::string &name) {
return _vectors3[name]; }
77 GLfloat
getScalar(
const std::string &name) {
return _scalars[name]; }
88 void setMatrix(
const std::string &name,
const vmml::Matrix4f &arg) { _matrices4x4[name] = arg; }
99 void setMatrix(
const std::string &name,
const vmml::Matrix3f &arg) { _matrices3x3[name] = arg; }
110 void setVector(
const std::string &name,
const vmml::Vector4f &arg) { _vectors4[name] = arg; }
121 void setVector(
const std::string &name,
const vmml::Vector3f &arg) { _vectors3[name] = arg; }
132 void setScalar(
const std::string &name, GLfloat arg) { _scalars[name] = arg; }
136 const std::string &
getName() {
return _name; }
141 void setName(
const std::string &arg) { _name = arg; }
148 shader->setUniforms(_matrices4x4);
149 shader->setUniforms(_matrices3x3);
150 shader->setUniforms(_vectors4);
151 shader->setUniforms(_vectors3);
152 shader->setUniforms(_scalars);
159 _matrices4x4.clear();
160 _matrices3x3.clear();
170 Matrix4x4Map _matrices4x4;
171 Matrix3x3Map _matrices3x3;
172 Vector4Map _vectors4;
173 Vector3Map _vectors3;
void setVectors4(const Vector4Map &arg)
Sets all 4x1 vectors.
Definition: Properties.h:104
std::map< std::string, vmml::Matrix4f > Matrix4x4Map
Definition: Properties.h:22
void setVector(const std::string &name, const vmml::Vector4f &arg)
Sets a 4x1 vector.
Definition: Properties.h:110
void clear()
Clear all properties.
Definition: Properties.h:157
void setMatrix(const std::string &name, const vmml::Matrix4f &arg)
Sets a 4x4 matrix.
Definition: Properties.h:88
std::shared_ptr< Shader > ShaderPtr
Definition: Shader.h:211
std::shared_ptr< Properties > PropertiesPtr
Definition: Properties.h:179
const Vector4Map & getVectors4()
Returns all 4x1 vectors.
Definition: Properties.h:54
GLfloat getScalar(const std::string &name)
Returns a scalar.
Definition: Properties.h:77
std::map< std::string, vmml::Vector3f > Vector3Map
Definition: Properties.h:25
void passToShader(ShaderPtr shader)
Pass properties to specified shader.
Definition: Properties.h:146
void setMatrix(const std::string &name, const vmml::Matrix3f &arg)
Sets a 3x3 matrix.
Definition: Properties.h:99
void setMatrices3x3(const Matrix3x3Map &arg)
Sets all 3x3 matrices.
Definition: Properties.h:93
std::map< std::string, vmml::Matrix3f > Matrix3x3Map
Definition: Properties.h:23
void setMatrices4x4(const Matrix4x4Map &arg)
Sets all 4x4 matrices.
Definition: Properties.h:82
const std::string & getName()
Returns the name of the properties.
Definition: Properties.h:136
virtual ~Properties()
Virtual destructor.
Definition: Properties.h:32
const Matrix3x3Map & getMatrices3x3()
Returns all 3x3 matrices.
Definition: Properties.h:45
const Vector3Map & getVectors3()
Returns all 3x1 vectors.
Definition: Properties.h:63
void setName(const std::string &arg)
Sets the name of the properties.
Definition: Properties.h:141
void setVector(const std::string &name, const vmml::Vector3f &arg)
Sets a 3x1 vector.
Definition: Properties.h:121
std::map< std::string, GLfloat > ScalarMap
Definition: Properties.h:26
void setVectors3(const Vector3Map &arg)
Sets all 3x1 vectors.
Definition: Properties.h:115
vmml::Vector4f getVector4(const std::string &name)
Returns a 4x1 vector.
Definition: Properties.h:59
void setScalar(const std::string &name, GLfloat arg)
Sets a scalar.
Definition: Properties.h:132
void setScalars(const ScalarMap &arg)
Sets all scalars.
Definition: Properties.h:126
vmml::Vector3f getVector3(const std::string &name)
Returns a 3x1 vector.
Definition: Properties.h:68
std::map< std::string, vmml::Vector4f > Vector4Map
Definition: Properties.h:24
A properties object caches data to pass to a shader (such as matrices, vectors and scalars) and can b...
Definition: Properties.h:17
const ScalarMap & getScalars()
Returns all scalars.
Definition: Properties.h:72
const Matrix4x4Map & getMatrices4x4()
Returns all 4x4 matrices.
Definition: Properties.h:36
vmml::Matrix4f getMatrix4x4(const std::string &name)
Returns a 4x4 matrix.
Definition: Properties.h:41
vmml::Matrix3f getMatrix3x3(const std::string &name)
Returns a 3x3 matrix.
Definition: Properties.h:50