Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RpUVAnim
[Animation Tools]


Data Structures

struct  RpUVAnimInterpFrame
struct  RpUVAnimKeyFrame
union  RpUVAnimKeyFrameData
struct  RpUVAnimLinearKeyFrameData
struct  RpUVAnimMaterialExtension
struct  RpUVAnimParamKeyFrameData

Defines

#define RP_UVANIM_MAXSLOTS   (8)
#define RP_UVANIM_APPLIEDCHANNELS   (2)
#define RP_UVANIM_MAXNAME   (32)

Typedefs

typedef RtAnimAnimation RpUVAnim
typedef RtAnimInterpolator RpUVAnimInterpolator
typedef enum RpUVAnimKeyFrameType RpUVAnimKeyFrameType
typedef RpUVAnimLinearKeyFrameData RpUVAnimLinearKeyFrameData
typedef RpUVAnimParamKeyFrameData RpUVAnimParamKeyFrameData
typedef RpUVAnimKeyFrameData RpUVAnimKeyFrameData
typedef RpUVAnimKeyFrame RpUVAnimKeyFrame
typedef RpUVAnimInterpFrame RpUVAnimInterpFrame
typedef RpUVAnimMaterialExtension RpUVAnimMaterialExtension

Functions

RtDictSchemaRpUVAnimGetDictSchema ()
RpUVAnimKeyFrameRpUVAnimKeyFrameInit (const RtAnimAnimation *animation, RpUVAnimKeyFrame *keyFrame, RpUVAnimKeyFrame *prevFrame, RwReal time, const RwMatrix *matrix)
RtAnimAnimationRpUVAnimKeyFrameStreamRead (RwStream *stream, RtAnimAnimation *animation)
RwBool RpUVAnimKeyFrameStreamWrite (const RtAnimAnimation *animation, RwStream *stream)
RwInt32 RpUVAnimKeyFrameStreamGetSize (const RtAnimAnimation *animation)
void RpUVAnimLinearKeyFrameBlend (void *voidOut, void *voidIn1, void *voidIn2, RwReal alpha)
void RpUVAnimLinearKeyFrameMulRecip (void *voidFrame, void *voidStart)
void RpUVAnimLinearKeyFrameAdd (void *voidOut, void *voidIn1, void *voidIn2)
RpUVAnimLinearKeyFrameDataRpUVAnimLinearKeyFrameDataInitFromMatrix (RpUVAnimLinearKeyFrameData *data, const RwMatrix *matrix)
void RpUVAnimParamKeyFrameBlend (void *voidOut, void *voidIn1, void *voidIn2, RwReal alpha)
void RpUVAnimParamKeyFrameMulRecip (void *voidFrame, void *voidStart)
void RpUVAnimParamKeyFrameAdd (void *voidOut, void *voidIn1, void *voidIn2)
RpUVAnimParamKeyFrameDataRpUVAnimParamKeyFrameDataInitFromMatrix (RpUVAnimParamKeyFrameData *data, const RwMatrix *matrix)
RwBool RpUVAnimPluginAttach (void)
RpUVAnimRpUVAnimCreate (const RwChar *name, RwUInt32 numNodes, RwUInt32 numFrames, RwReal duration, RwUInt32 *nodeIndexToUVChannelMap, RpUVAnimKeyFrameType keyframeType)
RwBool RpUVAnimDestroy (RpUVAnim *anim)
RpUVAnimRpUVAnimAddRef (RpUVAnim *anim)
RpMaterialRpMaterialUVAnimApplyUpdate (RpMaterial *material)
const RwCharRpUVAnimGetName (const RpUVAnim *anim)
RpMaterialRpMaterialSetUVAnim (RpMaterial *material, RpUVAnim *anim, RwUInt32 slot)
RpUVAnimInterpolatorRpMaterialUVAnimGetInterpolator (RpMaterial *material, RwUInt32 slot)
RpMaterialRpMaterialUVAnimSetInterpolator (RpMaterial *material, RpUVAnimInterpolator *interp, RwUInt32 slot)
RpMaterialRpMaterialUVAnimSetCurrentTime (RpMaterial *material, RwReal time)
RpMaterialRpMaterialUVAnimAddAnimTime (RpMaterial *material, RwReal deltaTime)
RpMaterialRpMaterialUVAnimSubAnimTime (RpMaterial *material, RwReal deltaTime)
RwBool RpMaterialUVAnimExists (const RpMaterial *material)

Detailed Description

UV Animation Plugin for RenderWare Graphics.

RpUVAnim Plugin Overview

Requirements

Overview

This plugin provides facilities for UV animation.

Materials are extended with an optional link to a UV animation. These animations may be stored in a dictionary.


Define Documentation

#define RP_UVANIM_APPLIEDCHANNELS   (2)
 

is the number of UV channels that will be updated via the default implementation of RpMaterialUVAnimApplyUpdate

#define RP_UVANIM_MAXNAME   (32)
 

is the maximum number of chars stored in a UV animation name, including the terminating NULL

#define RP_UVANIM_MAXSLOTS   (8)
 

is the maximum number of separate UV animations that can be applied to a single material


Typedef Documentation

typedef RtAnimAnimation RpUVAnim
 

RpUVAnim typedef for struct RpUVAnim

typedef struct RpUVAnimInterpFrame RpUVAnimInterpFrame
 

RpUVAnimInterpFrame typedef for struct RpUVAnimInterpFrame. Based on RtAnimInterpFrameHeader.

typedef RtAnimInterpolator RpUVAnimInterpolator
 

RpUVAnimInterpolator typedef for struct RpUVAnimInterpolator

typedef struct RpUVAnimKeyFrame RpUVAnimKeyFrame
 

RpUVAnimKeyFrame typedef for struct RpUVAnimKeyFrame. Based on RtAnimKeyFrameHeader.

typedef union RpUVAnimKeyFrameData RpUVAnimKeyFrameData
 

RpUVAnimKeyFrameData typedef for union RpUVAnimKeyFrameData

typedef enum RpUVAnimKeyFrameType RpUVAnimKeyFrameType
 

RpUVAnimKeyFrameType typedef for enum RpUVAnimKeyFrameType

typedef struct RpUVAnimLinearKeyFrameData RpUVAnimLinearKeyFrameData
 

RpUVAnimLinearKeyFrameData typedef for struct RpUVAnimLinearKeyFrameData

typedef struct RpUVAnimMaterialExtension RpUVAnimMaterialExtension
 

RpUVAnimMaterialExtension typedef for struct RpUVAnimMaterialExtension

typedef struct RpUVAnimParamKeyFrameData RpUVAnimParamKeyFrameData
 

RpUVAnimParamKeyFrameData typedef for struct RpUVAnimParamKeyFrameData


Function Documentation

RpMaterial* RpMaterialSetUVAnim RpMaterial   material,
RpUVAnim   anim,
RwUInt32    slot
 

RpMaterialSetUVAnim sets a UV animation on a material by creating an interpolator in the given slot and setting its current animation to the supplied animation. It is an error to set an animation on a slot that's already used.

Parameters:
material  The material on which to set the animation
anim  The animation to set upon the material
slot  The animation slot to use. Up to RP_UVANIM_MAXSLOTS are allowed.
Returns:
The material on success, NULL otherwise.

RpMaterial* RpMaterialUVAnimAddAnimTime RpMaterial   material,
RwReal    deltaTime
 

RpMaterialUVAnimAddAnimTime moves the animations on a material forwards in time

Parameters:
material  The material
deltaTime  The time to move forwards (in seconds)
Returns:
The material

RpMaterial* RpMaterialUVAnimApplyUpdate RpMaterial   material
 

RpMaterialUVAnimApplyUpdate updates the UV transform matrices for a given material according to the current state of the animations applied. This implementation looks through each UV animation slot in the material, and accumulates update matrices for the single and dual pass UV channels by preconcatenation. The accumulation is done when a node of an animation is mapped to one of these channels. This function must only be called on materials that have an rpMATFXEFFECTUVTRANSFORM or rpMATFXEFFECTDUALUVTRANSFORM effect set. You are free to implement your own ApplyUpdate functions, as the underlying RtAnimInterpolators are exposed through RpMaterialUVAnimGetInterpolator and RpMaterialUVAnimGetInterpolator.

Parameters:
material  The material to apply the UV animation update to
Returns:
The material
See also:
RtMaterialUVAnimAddAnimTime , RtMaterialUVAnimSubAnimTime

RwBool RpMaterialUVAnimExists const RpMaterial   material
 

RpMaterialUVAnimExists determines if a material has a UV animation on it.

Parameters:
material  The material
Returns:
TRUE if there's an animation, FALSE otherwise

RpUVAnimInterpolator* RpMaterialUVAnimGetInterpolator RpMaterial   material,
RwUInt32    slot
 

RpMaterialUVAnimGetInterpolator gets the interpolator in a given slot on the material.

Parameters:
material  The material
slot  The slot to get the interpolator from
Returns:
The interpolator in the specified slot

RpMaterial* RpMaterialUVAnimSetCurrentTime RpMaterial   material,
RwReal    time
 

RpMaterialUVAnimSetCurrentTime moves the animations on a material to a specific time

Parameters:
material  The material
time  The time to move to
Returns:
The material

RpMaterial* RpMaterialUVAnimSetInterpolator RpMaterial   material,
RpUVAnimInterpolator   interp,
RwUInt32    slot
 

RpMaterialUVAnimSetInterpolator sets an interpolator in a given slot on the material. Does not check if there is already an interpolator there; you are responsible for destroying the old interpolator if one exists.

Parameters:
material  The material
interp  The interpolator to set
slot  The slot to place the interpolator in; maximum is RP_UVANIM_MAXSLOTS
Returns:
The material

RpMaterial* RpMaterialUVAnimSubAnimTime RpMaterial   material,
RwReal    deltaTime
 

RpMaterialUVAnimSubAnimTime moves the animations on a material backward in time.

Parameters:
material  The material
deltaTime  The time to move backwards (in seconds)
Returns:
The material

RpUVAnim* RpUVAnimAddRef RpUVAnim   anim
 

RpUVAnimAddRef registers that the caller has a reference to the anim.

Parameters:
anim  A pointer to the anim for which a reference is needed
Returns:
The anim
See also:
RpUVAnimCreate , RpUVAnimDestroy

RpUVAnim* RpUVAnimCreate const RwChar   name,
RwUInt32    numNodes,
RwUInt32    numFrames,
RwReal    duration,
RwUInt32   nodeIndexToUVChannelMap,
RpUVAnimKeyFrameType    keyframeType
 

RpUVAnimCreate creates and returns an RpUVAnim. An RpUVAnim is an RtAnimAnimation with some custom data. All RtAnimAnimation functions can be used upon RpUVAnim s. Each node within an RpUVAnim may be mapped to a nominal UV channel. Only channel 0 and channel 1 mappings are used by the supplied RpMaterialUVAnimApplyUpdate, which is sufficient for single pass and dual pass UV animations. It is also possible to get access to the individual interpolators and implement your own update function, which may be useful for animating UV channels used by multitexture effects.

Parameters:
name  Name of the animation; maximum length is RP_UVANIM_MAXNAME
numNodes  Number of nodes within the animation
numFrames  Total number of keyframes over all nodes within the animation
duration  Time of very last keyframe in the animation
nodeIndexToUVChannelMap  Array by RP_UVANIM_MAXSLOTS defining which nominal UV channel gets modified by each node
numNodes  representing the nominal UV channel that node controls
keyframeType  Specify which interpolator scheme to use
Returns:
A pointer to the new anim on success, NULL if there is an error.
See also:
RpUVAnimDestroy , RtAnimInterpolatorCreate , RtAnimInterpolatorDestroy

RwBool RpUVAnimDestroy RpUVAnim   anim
 

RpUVAnimDestroy destroys a UV animation. UV animations are reference counted, so calling this function will not necessarily free the animation unless the caller holds the last reference to it.

Parameters:
anim  A pointer to the animation to be destroyed.
Returns:
TRUE
See also:
RpUVAnimCreate , RtAnimInterpolatorCreate , RtAnimInterpolatorDestroy

RtDictSchema* RpUVAnimGetDictSchema  
 

RpUVAnimGetDictSchema returns the dictionary schema used for dictionaries of UV animations

Returns:
The UV animation dictionary schema
See also:
RtDictSchemaCreateDict

const RwChar* RpUVAnimGetName const RpUVAnim   anim
 

RpUVAnimGetName returns the name of the UV animation

Parameters:
anim  A pointer to the anim for which the name is required
Returns:
The anim
See also:
RpUVAnimCreate , RpUVAnimDestroy

RpUVAnimKeyFrame* RpUVAnimKeyFrameInit const RtAnimAnimation   animation,
RpUVAnimKeyFrame   keyFrame,
RpUVAnimKeyFrame   prevFrame,
RwReal    time,
const RwMatrix   matrix
 

RpUVAnimKeyFrameInit sets up a UV animation keyframe.

Parameters:
animation  The animation the keyframe will be present within
keyFrame  The keyframe to set
prevFrame  The previous keyframe in the sequence
time  The time for the keyframe
matrix  The matrix to convert to a keyframe
Returns:
A pointer to the keyframe that was set, or NULL if an error occurs

RwInt32 RpUVAnimKeyFrameStreamGetSize const RtAnimAnimation   animation
 

RpUVAnimKeyFrameStreamGetSize calculates the size of the UV animation keyframes when written to a stream.

Parameters:
animation  A pointer to the UV animation
Returns:
Size of the UV animation keyframes in bytes.

RtAnimAnimation* RpUVAnimKeyFrameStreamRead RwStream   stream,
RtAnimAnimation   pAnimation
 

RpUVAnimKeyFrameStreamRead reads a UV animation from a stream.

Parameters:
stream  A pointer to the stream to be read from.
pAnimation  A pointer to the animation into which to read the data
Returns:
A pointer to the animation, or NULL if an error occurs

RwBool RpUVAnimKeyFrameStreamWrite const RtAnimAnimation   pAnimation,
RwStream   stream
 

RpUVAnimKeyFrameStreamWrite writes a UV animation to a stream.

Parameters:
pAnimation  A pointer to the animation to be written.
stream  A pointer to the stream to be written to.
Returns:
TRUE on success, or FALSE if an error occurs.

void RpUVAnimLinearKeyFrameAdd void *    pVoidOut,
void *    pVoidIn1,
void *    pVoidIn2
 

RpUVAnimLinearKeyFrameAdd adds two linearly interpolated keyframes together.

Parameters:
pVoidOut  A void pointer to the output frame.
pVoidIn1  A void pointer to the first frame to add.
pVoidIn2  A void pointer to the second frame to add.
Returns:
None

void RpUVAnimLinearKeyFrameBlend void *    pVoidOut,
void *    pVoidIn1,
void *    pVoidIn2,
RwReal    fAlpha
 

RpUVAnimLinearKeyFrameBlend blends between two linearly interpolated RpUVAnimInterpFrame objects using a given blend factor.

Parameters:
pVoidOut  A pointer to the output frame.
pVoidIn1  A pointer to the first input frame.
pVoidIn2  A pointer to the second input frame.
fAlpha  The blending factor.
Returns:
None

RpUVAnimLinearKeyFrameData* RpUVAnimLinearKeyFrameDataInitFromMatrix RpUVAnimLinearKeyFrameData   data,
const RwMatrix   matrix
 

RpUVAnimLinearKeyFrameDataInitFromMatrix sets up linear keyframe data from a matrix. Note that this keyframe must live inside an animation that has been setup to use linear keyframes

Parameters:
data  The linear keyframe to setup
matrix  The matrix to set the keyframe from
Returns:
The keyframe on success, NULL on failure

void RpUVAnimLinearKeyFrameMulRecip void *    pVoidFrame,
void *    pVoidStart
 

RpUVAnimLinearKeyFrameMulRecip multiplies one linearly interpolated keyframe by the reciprocal of another (in place).

Parameters:
pVoidFrame  A void pointer to the keyframe to modify.
pVoidStart  A void pointer to the start keyframe to multiply by.
Returns:
None

void RpUVAnimParamKeyFrameAdd void *    pVoidOut,
void *    pVoidIn1,
void *    pVoidIn2
 

RpUVAnimParamKeyFrameAdd adds two parametrically interpolated keyframes together.

Parameters:
pVoidOut  A void pointer to the output frame.
pVoidIn1  A void pointer to the first frame to add.
pVoidIn2  A void pointer to the second frame to add.
Returns:
None

void RpUVAnimParamKeyFrameBlend void *    pVoidOut,
void *    pVoidIn1,
void *    pVoidIn2,
RwReal    fAlpha
 

RpUVAnimParamKeyFrameBlend blends between two parametric interpolated RpUVAnimInterpFrame objects using a given blend factor.

Parameters:
pVoidOut  A pointer to the output frame.
pVoidIn1  A pointer to the first input frame.
pVoidIn2  A pointer to the second input frame.
fAlpha  The blending factor.
Returns:
None

RpUVAnimParamKeyFrameData* RpUVAnimParamKeyFrameDataInitFromMatrix RpUVAnimParamKeyFrameData   data,
const RwMatrix   matrix
 

RpUVAnimParamKeyFrameDataInitFromMatrix sets up parameterized keyframe data from a matrix. Note that this keyframe must live inside an animation that has been setup to use parameterized keyframes.

Parameters:
data  The parameterized keyframe to setup
matrix  The matrix to set the keyframe from
Returns:
The keyframe on success, NULL on failure

void RpUVAnimParamKeyFrameMulRecip void *    pVoidFrame,
void *    pVoidStart
 

RpUVAnimParamKeyFrameMulRecip multiplies one parametrically interpolated keyframe by the reciprocal of another (in place).

Parameters:
pVoidFrame  A void pointer to the keyframe to modify.
pVoidStart  A void pointer to the start keyframe to multiply by.
Returns:
None

RwBool RpUVAnimPluginAttach void   
 

RpUVAnimPluginAttach is called by the application to indicate that the UV animation plugin should be used. The call to this function should be placed between RwEngineInit and RwEngineOpen.

Returns:
True on success, false otherwise
See also:
RpWorldPluginAttach


Criterion Software © 1993-2004 Criterion Software Limited. All rights reserved. Built Thu Feb 12 13:47:05 2004. Send Feedback