FCDMaterialInstance Class Reference
[COLLADA Document Object Model.]

A COLLADA material instance. More...

#include <FCDMaterialInstance.h>

Inheritance diagram for FCDMaterialInstance:

FCDEntityInstance FCDObject FUTracker FUParameterizable FUTrackable FUObject 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.
FCDEntityInstanceGetParent ()
 Retrieves the parent instance.
const FCDEntityInstanceGetParent () const
 See above.
const fstringGetSemantic () 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.
FCDMaterialGetMaterial ()
 Retrieves the material entity used by this instance.
const FCDMaterialGetMaterial () 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 FCDMaterialInstanceBindFindBinding (const char *semantic)
 Retrieves a given binding.
size_t GetBindingCount () const
 Retrieves the number of parameter bindings for this instance.
FCDMaterialInstanceBindGetBinding (size_t index)
 Retrieves a parameter binding.
const FCDMaterialInstanceBindGetBinding (size_t index) const
 See above.
FCDObjectGetGeometryTarget ()
 Retrieves the geometry target that this instance affects.
FCDMaterialInstanceBindAddBinding ()
 Adds a new parameter binding.
FCDMaterialInstanceBindAddBinding (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.
FCDMaterialInstanceBindVertexInputGetVertexInputBinding (size_t index)
 Retrieves a vertex input binding.
const FCDMaterialInstanceBindVertexInputGetVertexInputBinding (size_t index) const
 See above.
FCDMaterialInstanceBindVertexInputFindVertexInputBinding (const char *semantic)
 Retrieves a given vertex input binding.
const FCDMaterialInstanceBindVertexInputFindVertexInputBinding (const char *semantic) const
 See above.
FCDMaterialInstanceBindVertexInputAddVertexInputBinding ()
 Adds a new vertex input binding.
FCDMaterialInstanceBindVertexInputAddVertexInputBinding (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 FCDEntityInstanceClone (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:
Generated on Thu Feb 14 16:58:39 2008 for FCollada by  doxygen 1.4.6-NO