| Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials |
#include <SMaterial.h>
Public Member Functions | |
| bool | getFlag (E_MATERIAL_FLAG flag) const |
| Gets the Material flag. | |
| ITexture * | getTexture (u32 i) const |
| Gets the i-th texture. | |
| const core::matrix4 & | getTextureMatrix (u32 i) const |
| Gets the immutable texture transformation matrix for level i. | |
| core::matrix4 & | getTextureMatrix (u32 i) |
| Gets the texture transformation matrix for level i. | |
| bool | isTransparent () const |
| bool | operator!= (const SMaterial &b) const |
| Inequality operator. | |
| SMaterial & | operator= (const SMaterial &other) |
| Assignment operator. | |
| bool | operator== (const SMaterial &b) const |
| Equality operator. | |
| void | setFlag (E_MATERIAL_FLAG flag, bool value) |
| Sets the Material flag to the given value. | |
| void | setTexture (u32 i, ITexture *tex) |
| Sets the i-th texture. | |
| void | setTextureMatrix (u32 i, const core::matrix4 &mat) |
| Sets the i-th texture transformation matrix. | |
| SMaterial (const SMaterial &other) | |
| Copy constructor. | |
| SMaterial () | |
| Default constructor. Creates a solid, lit material with white colors. | |
Public Attributes | |
| SColor | AmbientColor |
| How much ambient light (a global light) is reflected by this material. | |
| bool | BackfaceCulling |
| Is backface culling enabled? Default: true. | |
| SColor | DiffuseColor |
| How much diffuse light coming from a light source is reflected by this material. | |
| SColor | EmissiveColor |
| Light emitted by this material. Default is to emit no light. | |
| bool | FogEnable |
| Is fog enabled? Default: false. | |
| bool | FrontfaceCulling |
| Is frontface culling enabled? Default: false. | |
| bool | GouraudShading |
| Flat or Gouraud shading? Default: true. | |
| bool | Lighting |
| Will this material be lighted? Default: true. | |
| E_MATERIAL_TYPE | MaterialType |
| Type of the material. Specifies how everything is blended together. | |
| f32 | MaterialTypeParam |
| Free parameter, dependent on the material type. | |
| f32 | MaterialTypeParam2 |
| Second free parameter, dependent on the material type. | |
| bool | NormalizeNormals |
| Should normals be normalized? Default: false. | |
| bool | PointCloud |
| Draw as point cloud or filled triangles? Default: false. | |
| f32 | Shininess |
| Value affecting the size of specular highlights. | |
| SColor | SpecularColor |
| How much specular light (highlights from a light) is reflected. | |
| SMaterialLayer | TextureLayer [MATERIAL_MAX_TEXTURES] |
| Texture layer array. | |
| f32 | Thickness |
| Thickness of non-3dimensional elements such as lines and points. | |
| bool | Wireframe |
| Draw as wireframe or filled triangles? Default: false. | |
| char | ZBuffer |
| Is the ZBuffer enabled? Default: 1. | |
| bool | ZWriteEnable |
| Is the zbuffer writeable or is it read-only. Default: true. | |
Definition at line 65 of file SMaterial.h.
| irr::video::SMaterial::SMaterial | ( | ) | [inline] |
Default constructor. Creates a solid, lit material with white colors.
Definition at line 69 of file SMaterial.h.
| irr::video::SMaterial::SMaterial | ( | const SMaterial & | other | ) | [inline] |
Copy constructor.
| other | Material to copy from. |
Definition at line 80 of file SMaterial.h.
References irr::video::MATERIAL_MAX_TEXTURES, and TextureLayer.
| bool irr::video::SMaterial::getFlag | ( | E_MATERIAL_FLAG | flag | ) | const [inline] |
Gets the Material flag.
| flag | The flag to query. |
Definition at line 338 of file SMaterial.h.
References irr::video::SMaterialLayer::AnisotropicFilter, BackfaceCulling, irr::video::SMaterialLayer::BilinearFilter, irr::video::EMF_ANISOTROPIC_FILTER, irr::video::EMF_BACK_FACE_CULLING, irr::video::EMF_BILINEAR_FILTER, irr::video::EMF_FOG_ENABLE, irr::video::EMF_FRONT_FACE_CULLING, irr::video::EMF_GOURAUD_SHADING, irr::video::EMF_LIGHTING, irr::video::EMF_MATERIAL_FLAG_COUNT, irr::video::EMF_NORMALIZE_NORMALS, irr::video::EMF_POINTCLOUD, irr::video::EMF_TEXTURE_WRAP, irr::video::EMF_TRILINEAR_FILTER, irr::video::EMF_WIREFRAME, irr::video::EMF_ZBUFFER, irr::video::EMF_ZWRITE_ENABLE, FogEnable, FrontfaceCulling, GouraudShading, Lighting, NormalizeNormals, PointCloud, TextureLayer, irr::video::SMaterialLayer::TextureWrap, irr::video::SMaterialLayer::TrilinearFilter, Wireframe, ZBuffer, and ZWriteEnable.
Gets the i-th texture.
| i | The desired level. |
Definition at line 263 of file SMaterial.h.
References irr::video::MATERIAL_MAX_TEXTURES, irr::video::SMaterialLayer::Texture, and TextureLayer.
| const core::matrix4& irr::video::SMaterial::getTextureMatrix | ( | u32 | i | ) | const [inline] |
Gets the immutable texture transformation matrix for level i.
| i | The desired level. |
Definition at line 242 of file SMaterial.h.
References irr::video::SMaterialLayer::getTextureMatrix(), irr::core::IdentityMatrix, irr::video::MATERIAL_MAX_TEXTURES, and TextureLayer.
| core::matrix4& irr::video::SMaterial::getTextureMatrix | ( | u32 | i | ) | [inline] |
Gets the texture transformation matrix for level i.
| i | The desired level. Must not be larger than MATERIAL_MAX_TEXTURES. |
Definition at line 234 of file SMaterial.h.
References irr::video::SMaterialLayer::getTextureMatrix(), and TextureLayer.
| bool irr::video::SMaterial::isTransparent | ( | ) | const [inline] |
Definition at line 418 of file SMaterial.h.
References irr::video::EMT_TRANSPARENT_ADD_COLOR, irr::video::EMT_TRANSPARENT_ALPHA_CHANNEL, irr::video::EMT_TRANSPARENT_REFLECTION_2_LAYER, irr::video::EMT_TRANSPARENT_VERTEX_ALPHA, and MaterialType.
| bool irr::video::SMaterial::operator!= | ( | const SMaterial & | b | ) | const [inline] |
Inequality operator.
| b | Material to compare to. |
Definition at line 383 of file SMaterial.h.
References AmbientColor, BackfaceCulling, DiffuseColor, EmissiveColor, FogEnable, FrontfaceCulling, GouraudShading, Lighting, irr::video::MATERIAL_MAX_TEXTURES, MaterialType, MaterialTypeParam, MaterialTypeParam2, NormalizeNormals, PointCloud, Shininess, SpecularColor, TextureLayer, Thickness, Wireframe, ZBuffer, and ZWriteEnable.
Assignment operator.
| other | Material to copy from. |
Definition at line 90 of file SMaterial.h.
References AmbientColor, BackfaceCulling, DiffuseColor, EmissiveColor, FogEnable, FrontfaceCulling, GouraudShading, Lighting, irr::video::MATERIAL_MAX_TEXTURES, MaterialType, MaterialTypeParam, MaterialTypeParam2, NormalizeNormals, PointCloud, Shininess, SpecularColor, TextureLayer, Thickness, Wireframe, ZBuffer, and ZWriteEnable.
| bool irr::video::SMaterial::operator== | ( | const SMaterial & | b | ) | const [inline] |
Equality operator.
| b | Material to compare to. |
Definition at line 415 of file SMaterial.h.
| void irr::video::SMaterial::setFlag | ( | E_MATERIAL_FLAG | flag, | |
| bool | value | |||
| ) | [inline] |
Sets the Material flag to the given value.
| flag | The flag to be set. | |
| value | The new value for the flag. |
Definition at line 282 of file SMaterial.h.
References BackfaceCulling, irr::video::EMF_ANISOTROPIC_FILTER, irr::video::EMF_BACK_FACE_CULLING, irr::video::EMF_BILINEAR_FILTER, irr::video::EMF_FOG_ENABLE, irr::video::EMF_FRONT_FACE_CULLING, irr::video::EMF_GOURAUD_SHADING, irr::video::EMF_LIGHTING, irr::video::EMF_NORMALIZE_NORMALS, irr::video::EMF_POINTCLOUD, irr::video::EMF_TEXTURE_WRAP, irr::video::EMF_TRILINEAR_FILTER, irr::video::EMF_WIREFRAME, irr::video::EMF_ZBUFFER, irr::video::EMF_ZWRITE_ENABLE, FogEnable, FrontfaceCulling, GouraudShading, Lighting, irr::video::MATERIAL_MAX_TEXTURES, NormalizeNormals, PointCloud, TextureLayer, Wireframe, ZBuffer, and ZWriteEnable.
Referenced by irr::scene::ISceneNode::setMaterialFlag().
Sets the i-th texture.
If i>=MATERIAL_MAX_TEXTURES this setting will be ignored.
| i | The desired level. | |
| tex | Texture for texture level i. |
Definition at line 272 of file SMaterial.h.
References irr::video::MATERIAL_MAX_TEXTURES, irr::video::SMaterialLayer::Texture, and TextureLayer.
Referenced by irr::scene::ISceneNode::setMaterialTexture().
| void irr::video::SMaterial::setTextureMatrix | ( | u32 | i, | |
| const core::matrix4 & | mat | |||
| ) | [inline] |
Sets the i-th texture transformation matrix.
| i | The desired level. | |
| mat | Texture matrix for texture level i. |
Definition at line 253 of file SMaterial.h.
References irr::video::MATERIAL_MAX_TEXTURES, irr::video::SMaterialLayer::setTextureMatrix(), and TextureLayer.
How much ambient light (a global light) is reflected by this material.
The default is full white, meaning objects are completely globally illuminated. Reduce this if you want to see diffuse or specular light effects.
Definition at line 132 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Is backface culling enabled? Default: true.
Definition at line 214 of file SMaterial.h.
Referenced by getFlag(), operator!=(), operator=(), and setFlag().
How much diffuse light coming from a light source is reflected by this material.
The default is full white.
Definition at line 136 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Light emitted by this material. Default is to emit no light.
Definition at line 139 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Is fog enabled? Default: false.
Definition at line 220 of file SMaterial.h.
Referenced by getFlag(), operator!=(), operator=(), and setFlag().
Is frontface culling enabled? Default: false.
Definition at line 217 of file SMaterial.h.
Referenced by getFlag(), operator!=(), operator=(), and setFlag().
Flat or Gouraud shading? Default: true.
Definition at line 203 of file SMaterial.h.
Referenced by getFlag(), operator!=(), operator=(), and setFlag().
Will this material be lighted? Default: true.
Definition at line 206 of file SMaterial.h.
Referenced by getFlag(), operator!=(), operator=(), and setFlag().
Type of the material. Specifies how everything is blended together.
Definition at line 126 of file SMaterial.h.
Referenced by isTransparent(), operator!=(), operator=(), and irr::scene::ISceneNode::setMaterialType().
Free parameter, dependent on the material type.
Mostly ignored, used for example in EMT_PARALLAX_MAP_SOLID and EMT_TRANSPARENT_ALPHA_CHANNEL.
Definition at line 181 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Second free parameter, dependent on the material type.
Mostly ignored.
Definition at line 185 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Should normals be normalized? Default: false.
Definition at line 223 of file SMaterial.h.
Referenced by getFlag(), operator!=(), operator=(), and setFlag().
Draw as point cloud or filled triangles? Default: false.
Definition at line 200 of file SMaterial.h.
Referenced by getFlag(), operator!=(), operator=(), and setFlag().
Value affecting the size of specular highlights.
A value of 20 is common. If set to 0, no specular highlights are being used. To activate, simply set the shininess of a material to a value other than 0:
sceneNode->getMaterial(0).Shininess = 20.0f;
You can change the color of the highlights using
sceneNode->getMaterial(0).SpecularColor.set(255,255,255,255);
The specular color of the dynamic lights (SLight::SpecularColor) will influence the the highlight color too, but they are set to a useful value by default when creating the light scene node. Here is a simple example on how to use specular highlights:
// load and display mesh scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( smgr->getMesh("data/faerie.md2")); node->setMaterialTexture(0, driver->getTexture("data/Faerie2.pcx")); // set diffuse texture node->setMaterialFlag(video::EMF_LIGHTING, true); // enable dynamic lighting node->getMaterial(0).Shininess = 20.0f; // set size of specular highlights // add white light scene::ILightSceneNode* light = smgr->addLightSceneNode(0, core::vector3df(5,5,5), video::SColorf(1.0f, 1.0f, 1.0f));
Definition at line 176 of file SMaterial.h.
Referenced by operator!=(), and operator=().
How much specular light (highlights from a light) is reflected.
The default is to reflect white specular light. See SMaterial::Shininess on how to enable specular lights.
Definition at line 144 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Texture layer array.
Definition at line 191 of file SMaterial.h.
Referenced by getFlag(), getTexture(), getTextureMatrix(), operator!=(), operator=(), setFlag(), setTexture(), setTextureMatrix(), and SMaterial().
Thickness of non-3dimensional elements such as lines and points.
Definition at line 188 of file SMaterial.h.
Referenced by operator!=(), and operator=().
Draw as wireframe or filled triangles? Default: false.
The user can access a material flag using
material.Wireframe=true
material.setFlag(EMF_WIREFRAME, true);
Definition at line 197 of file SMaterial.h.
Referenced by getFlag(), operator!=(), operator=(), and setFlag().
Is the ZBuffer enabled? Default: 1.
Changed from bool to integer (0 == ZBuffer Off, 1 == ZBuffer LessEqual, 2 == ZBuffer Equal)
Definition at line 229 of file SMaterial.h.
Referenced by getFlag(), operator!=(), operator=(), and setFlag().
Is the zbuffer writeable or is it read-only. Default: true.
This flag is ignored if the MaterialType is a transparent type.
Definition at line 211 of file SMaterial.h.
Referenced by getFlag(), operator!=(), operator=(), and setFlag().
| The Irrlicht
Engine Documentation © 2003-2008 by Nikolaus Gebhardt. Generated
on Sun Dec 14 08:04:59 2008 by Doxygen
(1.5.6) |