Effect Modules


EffectModule.gif

Introduction
Effect Modules are Modules that alter an object's motion, point displacement or both. With the possible exception of Shader Modules, Effect Modules are the most (potentially) complex module in messiah. Effect Modules respond to AN messages (see Access Notification) and can have GUI(s) (see GUI). Each Effect Module has 1 or more "targets" which are the objects that they affect. Each Effect Module has an associated "tool" to help it perform it's duties, and each tool might have 1 or more sub-tools. Effect Modules can have animated parameters or "channels" which can be controlled through the Effect Module's manipulator and linked directly to your Effect Module's data.
Effect Data
Target Data
Common AN's
You'll probably always want to respond to O_CREATE(), O_DESTROY() and S_MODULE_INIT(). Depending on the type of Effect Module you are writing you will also want to respond to P_POST_POINT_DISPLACE(), P_POST_MOTION(), P_PRE_IK() and P_POST_IK(). If your Effect Module has a GUI you will want to respond to IN_CREATE(). If you need to do any calculations based on the relative positions of objects/points while in Setup Mode you will want to respond to O_ENTER_SETUP() and O_EXIT_SETUP().
Module Initiation
There is a little bit of initialization that you need to do when your Effect Module module is registered. The first AN message you will recieve is S_MODULE_INIT(), this message is sent once for each module registered; provided of course that it is requested prior to the module's registration. You must let messiah know three things about your Effect Module when responding to this AN message.
The first is the type of manipulator your Effect Module will use. Effect Module are object based items, that means that they have some representation in messiah's world view. The only question is "how are they represented?" Currently you can use a Null or a Slider as the manipulator type for your Effect Module depending on your needs. Use the fxInitEffectManipulator() function to do this.

fxInitEffectManipulator( FX_MANIPULATOR_SLIDER, FX_NOFLAG);
Next you'll want to set the color of the icons used by your Effect Module. Use the fxInitEffectColor() function like so:

// grey icons
fxInitEffectColor((FXubyte)100, (FXubyte)100, (FXubyte)100);
Finally you'll use the fxInitEffectTool() function to set the type of tool used by your Effect Module. You can choose from any of the FX_TOOLTYPE_*'s defined in messiah_object.h.

fxInitEffectTool( FX_TOOLTYPE_NULL, FX_NOFLAG);


© 2003 pmG WorldWide, LLC.


www.projectmessiah.com

groups.yahoo.com/pmGmessiah

Last Updated on Thu Jul 10 04:49:36 2003