Using a Deformer
 
 
 

A Deformer derived object implements a Deformer::Map() method that takes an object's point and returns a new object. Any modifier can use a deformer, but a simple modifier requires that this mechanism is used. A modifier that inherits from SimpleMod must override SimpleMod::GetDeformer() and return an object that inherits from the Deformer base class.

The Deformer::Map() is called by the system for each point in the modified mesh or selection and returns the modified (deformed) point.

Alternatively a deformer can be passed to a deformable object's Object::Deform() method.

Bend Example

In the Bend example the BendDeformer class inherits from Deformer. The BendDeformer::Map() function operates on the incoming point in a different coordinate system. Thus it first converts the point into local coordinates by multiplying it a transform matrix. Various operations are done upon the point, and then the point is converted back into a different coordinate system and returned.