Class ModContext

3DS Max Plug-In SDK

Class ModContext

See Also: Class LocalModData.

class ModContext : public BaseInterfaceServer

Description:

The ModContext stores information about the space the modifier was applied in, and allows the modifier to store data is needs for its operation. All methods are implemented by the system.

Data Members:

public:

Matrix3 *tm;

This matrix represents the space the modifier was applied in. The modifier plug-in uses this matrix when it deforms an object. The plug-in first transforms the points with this matrix. Next it applies its own deformation. Then it transforms the points back through the inverse of this transformation matrix.

Box3 *box;

The Bounding Box of the Deformation. This represents the scale of the modifier. For a single object it is the bounding box of the object. If the modifier is being applied to a sub-object selection it represents the bounding box of the sub-object selection. If the modifier is being applied to a selection set of objects, then this is the bounding box of the entire selection set. For a selection set of objects the bounding box is constant. In the case of a single object, the bounding box is not constant.

LocalModData *localData;

A pointer to an instance of a class derived from the LocalModData class. This is the part of the ModContext that the plug-in developer controls. It is the place where a modifier may store application specific data.

Methods:

Prototype:

ModContext();

Remarks:

Constructor. The transformation matrix, bounding box, and local data pointer are initialized to NULL.

Prototype:

~ModContext();

Remarks:

Destructor. The tm, bounding box and local data are freed.

Prototype:

ModContext(const ModContext& mc);

Remarks:

Constructor. The tm, bounding box and local data are initialized to those of the specified ModContext.

Parameters:

const ModContext& mc

The ModContext to copy.

Prototype:

ModContext(Matrix3 *tm, Box3 *box, LocalModData *localData);

Remarks:

Constructor. The tm, bounding box, and local data are initialized to those specified.

Parameters:

Matrix3 *tm

The transform matrix to copy.

Box3 *box

The bounding box to copy.

LocalModData *localData

The local data that will be cloned.