- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# FCDMaterialInstance Class Reference
[COLLADA Document Object Model.]

A COLLADA material instance. More...

`#include <FCDMaterialInstance.h>`

Inheritance diagram for FCDMaterialInstance:

List of all members.

## Public Member Functions
| FCDMaterialInstance (FCDocument *document, FCDEntityInstance *parent)
| Constructor.
virtual | ~FCDMaterialInstance ()
| Destructor.
| DEPRECATED (3.05A, HasType(FCDMaterialInstance::GetClassType())) virtual Type GetType() const
| Retrieves the type of entity instance.
FCDEntityInstance * | GetParent ()
| Retrieves the parent instance.
const FCDEntityInstance * | GetParent () const
| See above.
const fstring & | GetSemantic () const
| Retrieves the symbolic name used to link the polygons sets with the material of this instance.
void | SetSemantic (const fchar *_semantic)
| Sets the symbolic name used to link polygons sets with this instance.
void | SetSemantic (const fstring &_semantic)
| See above.
FCDMaterial * | GetMaterial ()
| Retrieves the material entity used by this instance.
const FCDMaterial * | GetMaterial () const
| See above.
void | SetMaterial (FCDMaterial *_material)
| Sets the material entity used by this instance.
| DEPRECATED (3.05A, GetBindingCount and GetBinding(index)) inline void GetBindings() const
| Retrieves the parameter bindings of the instance.
const FCDMaterialInstanceBind * | FindBinding (const char *semantic)
| Retrieves a given binding.
size_t | GetBindingCount () const
| Retrieves the number of parameter bindings for this instance.
FCDMaterialInstanceBind * | GetBinding (size_t index)
| Retrieves a parameter binding.
const FCDMaterialInstanceBind * | GetBinding (size_t index) const
| See above.
FCDObject * | GetGeometryTarget ()
| Retrieves the geometry target that this instance affects.
FCDMaterialInstanceBind * | AddBinding ()
| Adds a new parameter binding.
FCDMaterialInstanceBind * | AddBinding (const char *semantic, const char *target)
| Adds a new parameter binding.
void | RemoveBinding (size_t index)
| Removes a parameter binding.
| DEPRECATED (3.05A, GetVertexInputBindingCount and GetVertexInputBinding(index)) inline void GetVertexInputBindings()
| Retrieves the vertex input bindings.
size_t | GetVertexInputBindingCount () const
| Retrieves the number of vertex input bindings.
FCDMaterialInstanceBindVertexInput * | GetVertexInputBinding (size_t index)
| Retrieves a vertex input binding.
const FCDMaterialInstanceBindVertexInput * | GetVertexInputBinding (size_t index) const
| See above.
FCDMaterialInstanceBindVertexInput * | FindVertexInputBinding (const char *semantic)
| Retrieves a given vertex input binding.
const FCDMaterialInstanceBindVertexInput * | FindVertexInputBinding (const char *semantic) const
| See above.
FCDMaterialInstanceBindVertexInput * | AddVertexInputBinding ()
| Adds a new vertex input binding.
FCDMaterialInstanceBindVertexInput * | AddVertexInputBinding (const char *semantic, FUDaeGeometryInput::Semantic inputSemantic, int32 inputSet)
| Adds a new vertex input binding.
| DEPRECATED (3.05A, not recommended) FCDMaterial *FlattenMaterial()
| Creates a flattened version of the instantiated material.
virtual FCDEntityInstance * | Clone (FCDEntityInstance *clone=NULL) const
| Clones the material instance.

## Detailed Description

A COLLADA material instance.

A material instance is used to given polygon sets with a COLLADA material entity. It is also used to bind data sources with the inputs of an effect.

## Constructor & Destructor Documentation

FCDMaterialInstance::FCDMaterialInstance | ( | FCDocument * | document,
|  | FCDEntityInstance * | parent
| ) |

  | Constructor. Parameters:
  | parent | The entity instance that owns this material instance.

## Member Function Documentation

FCDMaterialInstanceBind* FCDMaterialInstance::AddBinding | ( | const char * | semantic,
|  | const char * | target
| ) |

  | Adds a new parameter binding. Parameters:
  | semantic | The token that identifies the material or effect parameter.
  | target | The fully-qualified target pointer to the bind scene graph object.
Returns: The parameter binding.

FCDMaterialInstanceBind* FCDMaterialInstance::AddBinding | ( |  | ) |

| Adds a new parameter binding. Returns: An empty parameter binding.

FCDMaterialInstanceBindVertexInput* FCDMaterialInstance::AddVertexInputBinding | ( | const char * | semantic,
|  | FUDaeGeometryInput::Semantic | inputSemantic,
|  | int32 | inputSet
| ) |

  | Adds a new vertex input binding. Together, the data source type and set should always define a unique data source. Parameters:
  | semantic | The token identify the shader varying input.
  | inputSemantic | The polygons set data source type to bind.
  | inputSet | The polygons set data source set to bind.
Returns: The new vertex input binding.

FCDMaterialInstanceBindVertexInput* FCDMaterialInstance::AddVertexInputBinding | ( |  | ) |

| Adds a new vertex input binding. Returns: An empty vertex input binding.

virtual FCDEntityInstance* FCDMaterialInstance::Clone | ( | FCDEntityInstance * | clone = `NULL` | ) | const`[virtual]`

  | Clones the material instance. Parameters:
  | clone | The material instance to become the clone.
Returns: The cloned material instance. Reimplemented from FCDEntityInstance.

FCDMaterialInstance::DEPRECATED | ( | 3. | 05A,
|  | not | recommended
| ) | `[inline]`

| Creates a flattened version of the instantiated material. This is the preferred way to generate viewer materials from a COLLADA document. Returns: The flattened version of the instantiated material. You will need to delete this pointer manually. This pointer will be NULL when there is no material attached to this instance.

FCDMaterialInstance::DEPRECATED | ( | 3. | 05A,
|  | GetVertexInputBindingCount and | GetVertexInputBinding(index)
| ) | `[inline]`

| Retrieves the vertex input bindings. Returns: The vertex input bindings.

FCDMaterialInstance::DEPRECATED | ( | 3. | 05A,
|  | GetBindingCount and | GetBinding(index)
| ) | const`[inline]`

| Retrieves the parameter bindings of the instance. Each material instance may re-define any number of material or effect parameters. Returns: The parameter bindings.

FCDMaterialInstance::DEPRECATED | ( | 3. | 05A,
|  | HasType(FCDMaterialInstance::GetClassType()) |
| ) | const`[inline]`

| Retrieves the type of entity instance. Deprecated: Use the following code, instead: entityInstance->HasType(FCDMaterialInstance::GetClassType()). Returns: The type of entity instance.

const FCDMaterialInstanceBind* FCDMaterialInstance::FindBinding | ( | const char * | semantic | ) |

  | Retrieves a given binding. Parameters:
  | semantic | The binding's semantic.
Returns: The found binding, or NULL if there is no such binding.

FCDMaterialInstanceBindVertexInput* FCDMaterialInstance::FindVertexInputBinding | ( | const char * | semantic | ) | `[inline]`

  | Retrieves a given vertex input binding. This is useful when trying to match textures with the texture coordinate sets. Parameters:
  | semantic | A given vertex input binding semantic.
Returns: The vertex input binding information structure. This pointer will be NULL if the given semantic is not bound within the material instance.

FCDMaterialInstanceBind* FCDMaterialInstance::GetBinding | ( | size_t | index | ) | `[inline]`

  | Retrieves a parameter binding. Parameters:
  | index | The index of the parameter binding.
Returns: The parameter binding at the given index.

size_t FCDMaterialInstance::GetBindingCount | ( |  | ) | const`[inline]`

| Retrieves the number of parameter bindings for this instance. Returns: The number of parameter bindings.

FCDObject* FCDMaterialInstance::GetGeometryTarget | ( |  | ) |

| Retrieves the geometry target that this instance affects. Note that this function uses the parent geometry instance and searches for the polygon set. Therefore, the application should buffer the retrieved pointer.

FCDMaterial* FCDMaterialInstance::GetMaterial | ( |  | ) | `[inline]`

| Retrieves the material entity used by this instance. Returns: The instanced material.

FCDEntityInstance* FCDMaterialInstance::GetParent | ( |  | ) | `[inline]`

| Retrieves the parent instance. Returns: The parent instance. Reimplemented from FCDEntityInstance.

const fstring& FCDMaterialInstance::GetSemantic | ( |  | ) | const`[inline]`

| Retrieves the symbolic name used to link the polygons sets with the material of this instance. Returns: The symbolic name of the material instance.

FCDMaterialInstanceBindVertexInput* FCDMaterialInstance::GetVertexInputBinding | ( | size_t | index | ) | `[inline]`

  | Retrieves a vertex input binding. Parameters:
  | index | The index of the vertex input binding.
Returns: The vertex input binding at the given index.

size_t FCDMaterialInstance::GetVertexInputBindingCount | ( |  | ) | const`[inline]`

| Retrieves the number of vertex input bindings. Returns: The number of vertex input bindings.

void FCDMaterialInstance::RemoveBinding | ( | size_t | index | ) |

  | Removes a parameter binding. Parameters:
  | index | The index of the parameter binding to remove.

void FCDMaterialInstance::SetMaterial | ( | FCDMaterial * | _material | ) | `[inline]`

  | Sets the material entity used by this instance. Parameters:
  | _material | The new instanced material.

void FCDMaterialInstance::SetSemantic | ( | const fchar * | _semantic | ) | `[inline]`

  | Sets the symbolic name used to link polygons sets with this instance. This name should always match against the symbolic name assigned to a polygons set. See also: FCDGeometryPolygons. Parameters:
  | _semantic | The new symbolic name of this instance.

The documentation for this class was generated from the following file:

- FCDocument/FCDMaterialInstance.h