Modifier::ApplyModifier
Defined in:
Applies a modifier to an instanced world.
C4Modifiers.h
Prototype
virtual void ApplyModifier(World *world, Instance *instance);
Parameters
world |
The main world inside which the instanced world has been expanded. |
instance |
The instance node to which the modifier is attached. |
Description
The ApplyModifier
function is called for each modifier attached to an instance node immediately after the instanced world is loaded. The ApplyModifier
function should be overridden by subclasses of the Modifier
class, and it can make any changes to the subnodes of the instance node specified by the instance
parameter that are necessary to implement the modifier's functionality.Note that the instanced world will be preprocessed after all modifiers have been applied. The
ApplyModifier
function itself should not call the Node::PreprocessNode
function for any new nodes that it creates, and it should not call the Node::AppendNewSubnode
function to add nodes to the instanced world because that function calls the PreprocessNode
function. (The AppendSubnode
function should be called instead.)A modifier should not make changes to any
Object
classes attached to a node because they are shared among all copies of the instanced world. Any changes made to these objects would affect all instances and not just the one to which the modifier is applied.The
ApplyModifier
function is not permitted to delete the instance node specified by the instance
parameter.The default implementation of the
ApplyModifier
function performs no action.
See Also