Public Member Functions | Protected Member Functions | Protected Attributes | Friends

sp::scene::MaterialNode Class Reference

#include <spMaterialNode.hpp>

Inheritance diagram for sp::scene::MaterialNode:
sp::scene::RenderNode sp::scene::SceneNode sp::Node sp::BaseObject sp::scene::Billboard sp::scene::Mesh sp::scene::Terrain

List of all members.

Public Member Functions

virtual ~MaterialNode ()
virtual void render ()=0
virtual bool compare (const MaterialNode *Other) const
void setMaterial (const video::MaterialStates *Material)
video::MaterialStatesgetMaterial ()
const video::MaterialStatesgetMaterial () const
void setShader (video::Shader *ShaderObject)
void setShaderClass (video::ShaderClass *ShaderObject)
 Sets the shader class directly.
video::ShaderClassgetShaderClass () const
 Returns pointer to the ShaderClass object.
void setMaterialEnable (bool Enable)
 Enables or disables the material. If disabled the last - in renderer set - material will be used.
bool getMaterialEnable () const
 Returns true if the material is enabled otherwise false. By default true.

Protected Member Functions

 MaterialNode (const ENodeTypes Type)

Protected Attributes

video::MaterialStates Material_
bool EnableMaterial_


class SceneGraph
bool cmpMeshesDefault (Mesh *&obj1, Mesh *&obj2)
bool cmpMeshesFast (Mesh *&obj1, Mesh *&obj2)

Detailed Description

MaterialNode objects are the root of Mesh, Billboard and Terrain objects. The main content of these objects is the MaterialStates member with all its interface functions. It also has a shader object.

Constructor & Destructor Documentation

sp::scene::MaterialNode::~MaterialNode (  )  [virtual]
sp::scene::MaterialNode::MaterialNode ( const ENodeTypes  Type  )  [protected]

Member Function Documentation

bool sp::scene::MaterialNode::compare ( const MaterialNode Other  )  const [virtual]
video::MaterialStates* sp::scene::MaterialNode::getMaterial (  )  [inline]
Pointer to the video::MaterialStates object.
const video::MaterialStates* sp::scene::MaterialNode::getMaterial (  )  const [inline]
Constant pointer to the video::MaterialStates object.
bool sp::scene::MaterialNode::getMaterialEnable (  )  const [inline]

Returns true if the material is enabled otherwise false. By default true.

video::ShaderClass* sp::scene::MaterialNode::getShaderClass (  )  const [inline]

Returns pointer to the ShaderClass object.

virtual void sp::scene::MaterialNode::render (  )  [pure virtual]

Renders the object. In this case rendering does not only mean drawing a 3d mesh. It can also be a light source.

True if the object has been rendered. Otherwise the object has been sorted out by frustum culling.

Implements sp::scene::RenderNode.

Implemented in sp::scene::Billboard, sp::scene::Mesh, and sp::scene::Terrain.

void sp::scene::MaterialNode::setMaterial ( const video::MaterialStates Material  ) 

Sets the mesh's material. In materials many configurations are stored. One of these are Diffuse or Ambient colors, ZBuffer- or Lighitng enabling and a Shader object. The most of these things can be set by special functions but you have more controll of the material by setting it directly. The material affects the whole mesh (each surface). If you want a mesh with multiple materials you have to created multiple Mesh object and one of them has to be the parent object of the others (use "setParent").

[in] Material Pointer to a MaterialStates object which holds the whole material's data.
void sp::scene::MaterialNode::setMaterialEnable ( bool  Enable  )  [inline]

Enables or disables the material. If disabled the last - in renderer set - material will be used.

void sp::scene::MaterialNode::setShader ( video::Shader ShaderObject  )  [inline]

Sets the shader object. Shader can be used for high performance graphics effects. e.g. water reflection and refraction (more about shaders in the Shader class).

ShaderObject,: Pointer to a Shader object.
void sp::scene::MaterialNode::setShaderClass ( video::ShaderClass ShaderObject  )  [inline]

Sets the shader class directly.

Friends And Related Function Documentation

bool cmpMeshesDefault ( Mesh *&  obj1,
Mesh *&  obj2 
) [friend]
bool cmpMeshesFast ( Mesh *&  obj1,
Mesh *&  obj2 
) [friend]
friend class SceneGraph [friend]

Reimplemented in sp::scene::Billboard, and sp::scene::Mesh.

Member Data Documentation

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines