AnimUVHandler
Availability LightWaveŽ 8.0
Component Layout
Header lwanimuv.h
The AnimUV plug-in class allows the developer to transform the UV
coordinates of a texture during animation..
Handler Activation Function
XCALL_( int ) AnimUVActive( int version, GlobalFunc *global,
LWAnimUVHandler *local, void *serverData );
The local argument to a motion handler's activation function is an
LWAnimUVHandler.
typedef struct st_LWAnimUVHandler {
LWInstanceFuncs *inst;
LWItemFuncs *item;
int (*GetOptions)( LWInstance, char * );
int (*SetOptions)( LWInstance, char * );
int (*Begin)( LWInstance, char *, double, int, int, int );
int (*Evaluate)( LWInstance, int, double * );
int (*End)( LWInstance );
} LWAnimUVHandler;
The first two members of this structure are standard handler
functions. The context argument to the inst->create function is
the LWItemID of the item associated with this instance.
In addition to the standard handler functions, a motion handler provides an evaluation
function and a flags function.
- success = Begin( instance, options, time,
vertCount, wRepeat, hRepeat )
- This function is called for each new surface, before it is
drawn. This function should return one (1) if the UV coordinates
were successfully updated, or zero (0) on error.
-
-
success = Evaluate( instance, vertexNumber, uv )
- This function is called for each vertex, just before it is drawn.
vertexNumber indicates which vertex is currently being
evaluated (i.e., 0, 1, 2..). uv is an array of UV
values for the indicated vertex. This function should return one
(1) if the UV coordinates were successfully updated, or zero (0) on
error.
success = End( instance )
- This function is called after each vertex has been drawn. This
function should return one (1) if the UV coordinates were successfully
updated, or zero (0) on error.
-
- success = SetOptions( instance, options )
- Copies the options array into the AnimUV options structure. This
function should return one (1) if the UV coordinates were successfully
updated, or zero (0) if it failed to copy the options array.
- success = GetOptions( instance, options )
- Returns the number and the array of options data. If the options array
is NULL, simply return the number of bytes in options array. This
function should return the number of options bytes. If the options array
is not NULL, then the options bytes are copied into the array.
Interface Activation Function
XCALL_( int ) AnimUVInterface( int version, GlobalFunc *global,
LWInterface *local, void *serverData );
The interface activation's local data is the standard interface
structure for handlers.
Example
The AnimUV SDK sample project
illustrates the usage of this class.
|