World Space Modifier Plug-in Overview
Writing a WSM involves creating instances of two key classes. One is derived from class WSMObject
. The other class is derived from Modifier
. These two classes work together. The object handles the display and management of its user interface parameters, the display of the WSM node in the scene, and provides a world space orientation. The modifier handles the actual deformation of the geometry of nodes bound to the space warp.
The SinWave
.cpp example has six plug-ins in a single source file. These are:
- The Ripple WSM Object - Implemented by
SinWaveObject
derived fromWaveObject
. - The Ripple WSM Modifier - Implemented by
SinWaveMod
derived fromWaveMod
. - The Ripple Object Space Modifier - Implemented by
SinWaveOMod
derived fromWaveOMod
. - The Wave WSM Object - Implemented by
LinWaveObject
derived fromWaveObject
. - The Wave WSM Modifier - Implemented by
LinWaveMod
derived fromWaveOMod
. - The Wave Object Space Modifier - Implemented by
LinWaveOMod
derived fromWaveOMod
.
The WaveObject
class is derived from SimpleWSMObject
, the WaveMod
class is derived from SimpleWSMMod
and the WaveOMod
is derived from SimpleMod
.
The interface for WSM objects and modifiers is designed to be as general as possible so that virtually any type of space warp is possible. However, a larger number of useful space warp objects and modifiers may be fairly simple, following a standard format. The SimpleWSMMod
and SimpleWSMObject
classes encapsulates the common behavior of these types of modifiers and objects. This translates to fewer methods that must be implemented by the developer.
The SimpleWSMObject
source code can be found in \MAXSDK\HOWTO\SOURCECODEEXAMPLES\SIMPOBJ.CPP and the source code for SimpleWSMMod
is available in \MAXSDK\HOWTO\SOURCECODEEXAMPLES\SIMPMOD.CPP .