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:
SinWaveObject
derived from WaveObject
.SinWaveMod
derived from WaveMod
.SinWaveOMod
derived from WaveOMod
.LinWaveObject
derived from WaveObject
.LinWaveMod
derived from WaveOMod
.LinWaveOMod
derived from WaveOMod
.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 .