IFXModifier

IFXModifier is the interface that defines the visual representation of objects in the scene. Every object supporting the IFXModifier interface is part of a linked list of modifiers for a particular object in the scene. If the scenegraph determines that an object must be rendered, then the node associated with the object is told to render. This results in the first modifier in the list being triggered. Each modifier performs whatever actions it is designed to do for the object, after which the next modifier in the list is triggered by the node. Modifiers might generate new geometry, generate texture coordinates, or deform the mesh. A modifier might depend upon dynamic parameters, which may or may not change every frame, or do nothing at all when told to render.

IFXModifier inherits the IFXMarker and IFXUnknown interfaces. CIFXModifier provides a default implementation of the IFXModifier interface, from which modifiers can inherit, but not all modifiers will use CIFXModifier.

When to Use

IFXModifier methods will be called to manage the list of modifiers for an object. The interface allows modifiers to be added and removed. The interface also provides handles to a modifier's IFXModelData interface, which is necessary for associating modifiers with specific mesh data.

Interface Methods

Description

AddModifier

Attaches a new modifier to the end of the linked list

GetNextModifier

Retrieves a pointer to the next modifier in the list

SetNextModifier

Inserts a new modifier into the list

GetContainer

Retrieves the container for the modifier

SetContainer

Assigns the container number

GetScenegraph

Retrieves a pointer to the scenegraph

GetModelData

Retrieves a pointer to this modifier's IFXModelData

SetModelData

Assigns an IFXModelData pointer to this modifier

Update

Pointer to the model and modifier parameter used with the modifier

Render

Executes the rendering actions of this modifier; in effect, have the modifier do its modifications to the object which is associated with this list of modifiers

GetIndexInModifierChain

Retrieves the index number of the modifier in the modifier chain

SetIndexInModifierChain

Assigns the index number of the modifier in the modifier chain

GetParamSupported

Queries whether modifier parameter is supported


IFXModifier::AddModifier(IFXModifier* pInModifier)

This method causes the modifier to attach the specified modifier onto the end of the linked list of modifiers.

Parameters:

pInModifier

A pointer to the IFXModifier interface of the modifier to be added to the end of the list

Return Values

Comments:

Every IFXModifier is essentially the interface to a list of modifiers. AddModifier() can be used to join two lists of modifiers, if the specified input modifier is the first modifier in a pre-existing list. It is not necessary to call AddRef() on the specified modifier.


IFXModifier::GetNextModifier()

This method returns a pointer to the interface of the next modifier in the linked list.

Parameters:

None

Return Values:

IFXModifier* - The pointer to the interface of the next modifier. This value can be NULL, if the modifier is at the end of the list.

Comments:

You must call Release() on the returned pointer when it will no longer be used. The method can return a NULL pointer.


IFXModifier::SetNextModifier(IFXModifier* pInNextModifier)

This method inserts the specified modifier into the list after the modifier that is called. In other words, the modifier makes the specified modifier its NextModifier. The list is not otherwise disrupted. The input modifier, however, is treated as a single element and subsequently has its NextModifier assigned as well. If the input modifier was part of a pre-existing list, that list becomes broken, unless steps are taken to patch the extraction.

Parameters:

pInNextModifier

A pointer to the IFXModifier interface of the modifier to be inserted into the list

Return Values:

None

Comments:

Be sure to consider whether or not the input modifier is already part of a list, as passing it to SetNextModifier of any other modifier (even in the same list) will effectively orphan any trailing modifiers that were attached to the input modifier. It is not necessary to call AddRef() on the specified modifier, as this is done in the method.


IFXModifier::GetContainer()

This methods gets the container for the modifier.

Parameters:

None

Return Values:

U32


IFXModifier::SetContainer(U32 uContainer)

This methods sets the container for the modifier.

Parameters:

uContainer

Container ID

Return Values:

None


IFXModifier::GetSceneGraph(IFXSceneGraph** ppSceneGraph)

This methods gets the scenegraph.

Parameters:

ppSceneGraph

Pointer to a scenegraph

Return Values


IFXModifier::GetModelData()

This method returns a pointer to the interface of the model data associated with the modifier.

Parameters:

None

Return Values:

IFXModelData* - A pointer to the interface of the model data associated with the modifier.

Comments:

You must call Release() on the returned pointer when it will no longer be used. The method can return a NULL pointer.


IFXModifier::SetModelData(IFXModelData* pInModelData)

This method assigns a model data interface to the modifier.

Parameters:

pInModelData

A pointer to the interface of the model data that will be assigned to the modifier

Return Values:

None

Comments:

A NULL interface pointer can be specified.


IFXModifier::Update(IFXModel* pInModel, IFXModifierParam* pInModifierParam)

This method updates the modifier, linking to the IFXModel and IFXModifierParameter.

Parameters:

pInModel

Pointer to an IFXModel

pInModifierParam

Pointer to an IFXModifierParam

Return Values


IFXModifier::Render(IFXRenderLayer* pInRenderLayer,IFXModel* pInModel,IFXModifierParam* pInModifierParam,U32 uInNumberOfLights,IFXLight** ppInLightList,IFXView* pInView)

This method uses the provided interfaces, along with the modifier's IFXModelData interface, to apply its modifications. Typically, the modifier will query for the IFXShader interface for each mesh in its ModelData's meshgroup and apply the shader to the mesh.

Parameters:

pInRenderLayer

A pointer to the interface of the rendering layer that the modifier will use

pInModel

A pointer to a model interface

pInModifierParam

A pointer to the interface of a parameter group that this modifier will use

uInNumberOfLights

Specifies how many lights this modifier will use

ppInLightList

An array of pointers to IFXLight interfaces

pInView

A pointer to the interface of the view that the modifier will use

Return Values


IFXModifier::GetIndexInModifierChain(U32* puIndex)

This method gets the ID number of the modifier.

Parameters:

puIndex

A pointer to the IFXModifier ID

Return Values


IFXModifier::SetIndexInModifierChain(U32 uIndex)

This method causes the modifier to attach the specified modifier onto the end of the linked list of modifiers.

Parameters:

uIndex

IFXModifier ID

Return Values


IFXModifier::GetParamSupported()

This method queries whether the modifier parameter is supported.

Parameters:

None

Return Values:

BOOL

§See asterisked (*) statement at Legal Information © 2001 Intel Corporation.