Basic Renderer
|
A material is associated with textures and a shader to define the look of an object. More...
#include <Material.h>
Public Types | |
typedef std::unordered_map< std::string, TexturePtr > | TextureMap |
typedef std::unordered_map< std::string, vmml::Vector3f > | Vector3Map |
typedef std::unordered_map< std::string, GLfloat > | ScalarMap |
Public Member Functions | |
Material () | |
Constructor. More... | |
virtual | ~Material () |
Virtual destructor. More... | |
virtual void | initialize (ObjectManager *o, const MaterialData &materialData, ShaderPtr shader) |
Initializes the geometry object based on material data and a shader. More... | |
virtual void | bind () |
Bind the shader and pass the attributes of the material. More... | |
const TextureMap & | getTextures () |
Returns the textures associated with the material. More... | |
TexturePtr | getTexture (const std::string &name) |
Returns a texture associated with the material. More... | |
const Vector3Map & | getVectors () |
Returns the vectors associated with the material. More... | |
vmml::Vector3f | getVector (const std::string &name) |
Returns a vector associated with the material. More... | |
const ScalarMap & | getScalars () |
Returns the scalars associated with the material. More... | |
GLfloat | getScalar (const std::string &name) |
Returns a scalar associated with the material. More... | |
void | setTextures (const TextureMap &arg) |
Sets all textures for the material. More... | |
void | setTexture (const std::string &name, TexturePtr arg) |
Sets a texture for the material. More... | |
void | setVectors (const Vector3Map &arg) |
Sets all vectors for the material. More... | |
void | setVector (const std::string &name, const vmml::Vector3f &arg) |
Sets a vector for the material. More... | |
void | setScalars (const ScalarMap &arg) |
Sets all scalars for the material. More... | |
void | setScalar (const std::string &name, GLfloat arg) |
Sets a scalar for the material. More... | |
ShaderPtr | getShader () |
Returns the shader of the material. More... | |
void | setShader (ShaderPtr arg) |
Sets the shader of the material. More... | |
const std::string & | getName () |
Returns the name of the material. More... | |
void | setName (const std::string &arg) |
Sets the name of the material. More... | |
A material is associated with textures and a shader to define the look of an object.
typedef std::unordered_map<std::string, GLfloat> Material::ScalarMap |
typedef std::unordered_map<std::string, TexturePtr> Material::TextureMap |
typedef std::unordered_map<std::string, vmml::Vector3f> Material::Vector3Map |
|
inline |
Constructor.
|
inlinevirtual |
Virtual destructor.
|
virtual |
Bind the shader and pass the attributes of the material.
|
inline |
Returns the name of the material.
|
inline |
Returns a scalar associated with the material.
[in] | name | Name of the scalar |
|
inline |
Returns the scalars associated with the material.
|
inline |
Returns the shader of the material.
|
inline |
Returns a texture associated with the material.
[in] | name | Name of the texture |
|
inline |
Returns the textures associated with the material.
|
inline |
Returns a vector associated with the material.
[in] | name | Name of the vector |
|
inline |
Returns the vectors associated with the material.
|
virtual |
Initializes the geometry object based on material data and a shader.
[in] | o | Object management |
[in] | materialData | |
[in] | shader |
|
inline |
Sets the name of the material.
[in] | arg | Name for the material |
|
inline |
Sets a scalar for the material.
[in] | name | Name of the scalar |
[in] | arg | Scalar for the material |
|
inline |
Sets all scalars for the material.
[in] | arg | Scalar for the material |
|
inline |
Sets the shader of the material.
[in] | arg | Shader for the material |
|
inline |
Sets a texture for the material.
[in] | name | Name of the texture |
[in] | arg | Texture for the material |
|
inline |
Sets all textures for the material.
[in] | arg | Textures for the material |
|
inline |
Sets a vector for the material.
[in] | name | Name of the vector |
[in] | arg | Vector for the material |
|
inline |
Sets all vectors for the material.
[in] | arg | Vectors for the material |