Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RpDMorph
[Delta Morphing]


Data Structures

struct  RpDMorphAnimation
struct  RpDMorphTarget

Enumerations

enum  RpDMorphType { rpNADMORPHTYPE = 0, rpDMORPHTYPEGENERIC = 1, rpDMORPHTYPEFORCEENUMSIZEINT = RWFORCEENUMSIZEINT }

Functions

RpDMorphAnimationRpDMorphAnimationCreate (RwUInt32 numDMorphTargets)
RpDMorphAnimationRpDMorphAnimationDestroy (RpDMorphAnimation *anim)
RpDMorphAnimationRpDMorphAnimationCreateFrames (RpDMorphAnimation *anim, RwUInt32 dMorphTargetIndex, RwUInt32 numFrames)
RpDMorphAnimationRpDMorphAnimationDestroyFrames (RpDMorphAnimation *anim, RwUInt32 dMorphTargetIndex)
RwUInt32 RpDMorphAnimationGetNumDMorphTargets (RpDMorphAnimation *animation)
RwUInt32 RpDMorphAnimationGetNumFrames (RpDMorphAnimation *animation, RwUInt32 dMorphTargetIndex)
RpDMorphAnimationRpDMorphAnimationStreamRead (RwStream *stream)
RpDMorphAnimationRpDMorphAnimationStreamWrite (RpDMorphAnimation *animation, RwStream *stream)
RwUInt32 RpDMorphAnimationStreamGetSize (RpDMorphAnimation *animation)
RpDMorphAnimationRpDMorphAnimationRead (const RwChar *filename)
RpDMorphAnimationRpDMorphAnimationWrite (RpDMorphAnimation *animation, const RwChar *filename)
RpDMorphAnimationRpDMorphAnimationFrameSet (RpDMorphAnimation *anim, RwUInt32 dMorphTargetIndex, RwUInt32 frameIndex, RwReal startValue, RwReal endValue, RwReal duration, RwUInt32 nextFrame)
RpDMorphAnimationRpDMorphAnimationFrameSetNext (RpDMorphAnimation *anim, RwUInt32 dMorphTargetIndex, RwUInt32 frameIndex, RwUInt32 nextFrame)
RwUInt32 RpDMorphAnimationFrameGetNext (RpDMorphAnimation *anim, RwUInt32 dMorphTargetIndex, RwUInt32 frameIndex)
RpDMorphAnimationRpDMorphAnimationFrameSetStartValue (RpDMorphAnimation *anim, RwUInt32 dMorphTargetIndex, RwUInt32 frameIndex, RwReal startValue)
RwReal RpDMorphAnimationFrameGetStartValue (RpDMorphAnimation *anim, RwUInt32 dMorphTargetIndex, RwUInt32 frameIndex)
RpDMorphAnimationRpDMorphAnimationFrameSetEndValue (RpDMorphAnimation *anim, RwUInt32 dMorphTargetIndex, RwUInt32 frameIndex, RwReal endValue)
RwReal RpDMorphAnimationFrameGetEndValue (RpDMorphAnimation *anim, RwUInt32 dMorphTargetIndex, RwUInt32 frameIndex)
RpDMorphAnimationRpDMorphAnimationFrameSetDuration (RpDMorphAnimation *anim, RwUInt32 dMorphTargetIndex, RwUInt32 frameIndex, RwReal duration)
RwReal RpDMorphAnimationFrameGetDuration (RpDMorphAnimation *anim, RwUInt32 dMorphTargetIndex, RwUInt32 frameIndex)
RpGeometryRpDMorphGeometryCreateDMorphTargets (RpGeometry *geometry, RwUInt32 number)
RpGeometryRpDMorphGeometryDestroyDMorphTargets (RpGeometry *geometry)
RpGeometryRpDMorphGeometryAddDMorphTarget (RpGeometry *geometry, RwUInt32 index, RwV3d *vertices, RwV3d *normals, RwRGBA *preLightColors, RwTexCoords *texCoords, RwUInt32 flags)
RpGeometryRpDMorphGeometryRemoveDMorphTarget (RpGeometry *geometry, RwUInt32 index)
RpDMorphTargetRpDMorphGeometryGetDMorphTarget (const RpGeometry *geometry, RwUInt32 index)
RwUInt32 RpDMorphGeometryGetNumDMorphTargets (const RpGeometry *geometry)
RpGeometryRpDMorphGeometryTransformDMorphTargets (RpGeometry *geometry, const RwMatrix *matrix)
const RwSphereRpDMorphTargetGetBoundingSphere (const RpDMorphTarget *dMorphTarget)
RpDMorphTargetRpDMorphTargetSetName (RpDMorphTarget *dMorphTarget, RwChar *name)
RwCharRpDMorphTargetGetName (RpDMorphTarget *dMorphTarget)
RpGeometryFlag RpDMorphTargetGetFlags (RpDMorphTarget *dMorphTarget)
RpAtomicRpDMorphAtomicInitialize (RpAtomic *atomic)
RpAtomicRpDMorphAtomicSetType (RpAtomic *atomic, RpDMorphType type)
RwRealRpDMorphAtomicGetDMorphValues (RpAtomic *atomic)
RpAtomicRpDMorphAtomicSetAnimation (RpAtomic *atomic, RpDMorphAnimation *animation)
RpDMorphAnimationRpDMorphAtomicGetAnimation (const RpAtomic *atomic)
RpAtomicRpDMorphAtomicAddTime (RpAtomic *atomic, RwReal time)
RwReal RpDMorphAtomicGetAnimTime (const RpAtomic *atomic)
RpAtomicRpDMorphAtomicSetAnimLoopCallBack (RpAtomic *atomic, RpAtomicCallBack callBack, void *data)
RpAtomicCallBack RpDMorphAtomicGetAnimLoopCallBack (const RpAtomic *atomic, void **callBackData)
RpAtomicRpDMorphAtomicSetAnimFrame (RpAtomic *atomic, RwUInt32 dMorphTargetIndex, RwUInt32 index)
RwUInt32 RpDMorphAtomicGetAnimFrame (const RpAtomic *atomic, RwUInt32 dMorphTargetIndex)
RpAtomicRpDMorphAtomicSetAnimFrameTime (RpAtomic *atomic, RwUInt32 dMorphTargetIndex, RwReal time)
RwReal RpDMorphAtomicGetAnimFrameTime (const RpAtomic *atomic, RwUInt32 dMorphTargetIndex)
RwBool RpDMorphPluginAttach (void)

Detailed Description

Delta Morphing Plugin for RenderWare Graphics.

RpDMorph Plugin Overview

Requirements

Overview

This plugin provides facilities for delta morphing. Delta morphing is a process where a base geometry has a number of deltas applied to it. These deltas are called delta morph targets. The targets can overlap and morph any combination of the base geometry's vertex components: positions, normals, pre light colors and texture coordinates.

The delta morph targets are stored as a plugin extension of the base geometry data, and are compressed by excluding sequences of vertices where the delta is zero.

Although it is possible to directly manipulate the amounts of each morph target applied to the base geometry, a standard animation system is provided.

Before any of the plugin functions are used, the plugin should be attached using RpDMorphPluginAttach.

Basic Usage
A delta morph atomic and an associated set of animations can be created within the exporter. In an application, the animation may be loaded and set on an atomic with
The animation of the atomic may then be advanced in time using

The morphing takes place during rendering. Delta morph geometry data can be detected by using

which returns the number of delta morph targets or zero if there none exist.
Delta Morph Geometry
These functions are available:
Delta Morph Targets
These functions are available:
Delta Morph Animations
An animation consists of control sequences for each delta morph target of an atomic. Each sequence consists of a chain of animation frames which correspond to units of linear interpolation, having a start value, an end value, and a duration.
Animations and frame sequences may be created and destroyed with:

The frame sequence data may be edited and queried with:

Animations may be written to and read from a binary stream using:

Running Animations
An animation may be set on a delta morph target and controlled using:
A loop callback may be defined to control what happens when an animation reaches the end and loops back to the start:

The current positions and times within the frame sequences for the delta morph targets may be queried or changed using the following. These could be used for recording the current position within an animation in order to jump directly back at a later time.

Direct Control of Morphing
An alternative to using the animation system is to directly modify the morph values. This can be done using:
This could be used for overriding a particular morph target on top of a standard animation, for performing a full procedural animation, or for implementing an alternative animation scheme to the standard one.


Enumeration Type Documentation

enum RpDMorphType
 

RpDMorphType defines the different ways a dmorph atomic can be rendered. Once a dmorph RpGeometry has been attached to an RpAtomic the atomic must be setup with the correct dmorph rendering pipeline with RpDMorphAtomicSetType.

Enumeration values:
rpNADMORPHTYPE  Invalid DMorph pipeline.
rpDMORPHTYPEGENERIC  Generic DMorph rendering.


Function Documentation

RpDMorphAnimation* RpDMorphAnimationCreate RwUInt32    numDMorphTargets
 

RpDMorphAnimationCreate is used to create a delta morph animation that may be used to control a delta morph atomic.

The animation contains a keyframe sequence for every delta morph target which specifies how the amount of that target varies over time. The sequences can be created for each target using RpDMorphAnimationCreateFrames. A sequence may be absent for morph targets which are not controlled by the animation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
numDMorphTargets  The number of delta morph targets that the animation will control.
Returns:
A pointer to the created animation, or NULL if there is an error.
See also:
RpDMorphAnimationGetNumDMorphTargets , RpDMorphAnimationDestroy , RpDMorphAnimationCreateFrames , RpDMorphAnimationFrameSet , RpDMorphAnimationStreamRead , RpDMorphAnimationStreamWrite , RpDMorphAnimationRead , RpDMorphAnimationWrite , RpDMorphAtomicSetAnimation

RpDMorphAnimation* RpDMorphAnimationCreateFrames RpDMorphAnimation   anim,
RwUInt32    dMorphTargetIndex,
RwUInt32    numFrames
 

RpDMorphAnimationCreateFrames creates a keyframe sequence in a delta morph animation for driving a particular morph target.

This function must be called to create a sequence for every morph target that is to be controlled by the animation. Some sequences may be left absent for morph targets which are unused or which are to be procedurally controlled externally.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  A pointer to the delta morph animation.
dMorphTargetIndex  Index of the delta morph target.
numFrames  Number of frames to create in the sequence.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the delta morph animation.
See also:
RpDMorphAnimationDestroyFrames , RpDMorphAnimationGetNumFrames , RpDMorphAnimationFrameSet

RpDMorphAnimation* RpDMorphAnimationDestroy RpDMorphAnimation   anim
 

RpDMorphAnimationDestroy destroys a delta morph animation and any keyframe sequences it contains.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  A pointer to the delta morph animation.
Returns:
NULL
See also:
RpDMorphAnimationCreate

RpDMorphAnimation* RpDMorphAnimationDestroyFrames RpDMorphAnimation   anim,
RwUInt32    dMorphTargetIndex
 

RpDMorphAnimationDestroyFrames destroys the keyframe sequence in a delta morph animation corresponding to a particular morph target.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  Pointer to the delta morph animation.
dMorphTargetIndex  Index of the delta morph target whose sequence is to be destroyed.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the delta morph animation.
See also:
RpDMorphAnimationCreateFrames , RpDMorphAnimationGetNumFrames

RwReal RpDMorphAnimationFrameGetDuration RpDMorphAnimation   anim,
RwUInt32    dMorphTargetIndex,
RwUInt32    frameIndex
 

RpDMorphAnimationFrameGetDuration is used to get the duration of the indexed frame for the indexed morph target sequence in a delta morph animation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  Pointer to the delta morph animation.
dMorphTargetIndex  Delta morph target index.
frameIndex  Index of the frame.
Returns:
Returns the duration of the frame.
See also:
RpDMorphAnimationFrameSetDuration

RwReal RpDMorphAnimationFrameGetEndValue RpDMorphAnimation   anim,
RwUInt32    dMorphTargetIndex,
RwUInt32    frameIndex
 

RpDMorphAnimationFrameGetEndValue is used to get the end value of the indexed frame for the indexed morph target sequence in a delta morph animation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  Pointer to the delta morph animation.
dMorphTargetIndex  Delta morph target index.
frameIndex  Index of the frame.
Returns:
Returns the end value of the frame.
See also:
RpDMorphAnimationFrameSetEndValue

RwUInt32 RpDMorphAnimationFrameGetNext RpDMorphAnimation   anim,
RwUInt32    dMorphTargetIndex,
RwUInt32    frameIndex
 

RpDMorphAnimationFrameGetNext is used to get the index of the next frame for a given frame in a morph target sequence of a delta morph animation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  Pointer to the delta morph animation.
dMorphTargetIndex  Delta morph target index.
frameIndex  Index of the frame.
Returns:
Returns the index of the next frame.
See also:
RpDMorphAnimationFrameSetNext

RwReal RpDMorphAnimationFrameGetStartValue RpDMorphAnimation   anim,
RwUInt32    dMorphTargetIndex,
RwUInt32    frameIndex
 

RpDMorphAnimationFrameGetStartValue is used to get the start value of the indexed frame for the indexed morph target sequence in a delta morph animation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  Pointer to the delta morph animation.
dMorphTargetIndex  Delta morph target index.
frameIndex  Index of the frame.
Returns:
Returns the start value of the frame.
See also:
RpDMorphAnimationFrameSetStartValue

RpDMorphAnimation* RpDMorphAnimationFrameSet RpDMorphAnimation   anim,
RwUInt32    dMorphTargetIndex,
RwUInt32    frameIndex,
RwReal    startValue,
RwReal    endValue,
RwReal    duration,
RwUInt32    nextFrame
 

RpDMorphAnimationFrameSet is used to set all the values of the indexed frame for the indexed morph target sequence in a delta morph animation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  Pointer to the delta morph animation.
dMorphTargetIndex  Delta morph target index.
frameIndex  Index of the frame.
startValue  Start value to be set.
endValue  End value to be set.
duration  Duration to be set.
nextFrame  Index of the next frame.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the animation.
See also:
RpDMorphAnimationFrameSetNext , RpDMorphAnimationFrameGetNext , RpDMorphAnimationFrameSetStartValue , RpDMorphAnimationFrameGetStartValue , RpDMorphAnimationFrameSetEndValue , RpDMorphAnimationFrameGetEndValue , RpDMorphAnimationFrameSetDuration , RpDMorphAnimationFrameGetDuration , RpDMorphAnimationCreateFrames , RpDMorphAnimationGetNumFrames

RpDMorphAnimation* RpDMorphAnimationFrameSetDuration RpDMorphAnimation   anim,
RwUInt32    dMorphTargetIndex,
RwUInt32    frameIndex,
RwReal    duration
 

RpDMorphAnimationFrameSetDuration is used to set the duration of the indexed frame for the indexed morph target sequence in a delta morph animation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  Pointer to the delta morph animation.
dMorphTargetIndex  Delta morph target index.
frameIndex  Index of the frame.
duration  Duration to be set.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the animation.
See also:
RpDMorphAnimationFrameSet , RpDMorphAnimationFrameGetDuration

RpDMorphAnimation* RpDMorphAnimationFrameSetEndValue RpDMorphAnimation   anim,
RwUInt32    dMorphTargetIndex,
RwUInt32    frameIndex,
RwReal    endValue
 

RpDMorphAnimationFrameSetEndValue is used to set the end value of the indexed frame for the indexed morph target sequence in a delta morph animation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  Pointer to the delta morph animation.
dMorphTargetIndex  Delta morph target index.
frameIndex  Index of the frame.
endValue  End value to be set.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the animation.
See also:
RpDMorphAnimationFrameSet , RpDMorphAnimationFrameGetEndValue

RpDMorphAnimation* RpDMorphAnimationFrameSetNext RpDMorphAnimation   anim,
RwUInt32    dMorphTargetIndex,
RwUInt32    frameIndex,
RwUInt32    nextFrame
 

RpDMorphAnimationFrameSetNext is used to set the next frame for a given frame in a morph target sequence of a delta morph animation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  Pointer to the delta morph animation.
dMorphTargetIndex  Delta morph target index.
frameIndex  Index of the frame.
nextFrame  Index of the next frame.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the animation.
See also:
RpDMorphAnimationFrameGetNext

RpDMorphAnimation* RpDMorphAnimationFrameSetStartValue RpDMorphAnimation   anim,
RwUInt32    dMorphTargetIndex,
RwUInt32    frameIndex,
RwReal    startValue
 

RpDMorphAnimationFrameSetStartValue is used to set the start value of the indexed frame for the indexed morph target sequence in a delta morph animation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
anim  Pointer to the delta morph animation.
dMorphTargetIndex  Delta morph target index.
frameIndex  Index of the frame.
startValue  Start value to be set.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the animation.
See also:
RpDMorphAnimationFrameSet , RpDMorphAnimationFrameGetStartValue

RwUInt32 RpDMorphAnimationGetNumDMorphTargets RpDMorphAnimation   animation
 

RpDMorphAnimationGetNumDMorphTargets returns the number of delta morph targets which may be controlled by a delta morph animation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
animation  Pointer to the delta morph animation.
Returns:
Returns the number of delta morph targets.
See also:
RpDMorphAnimationCreate , RpDMorphAnimationDestroy

RwUInt32 RpDMorphAnimationGetNumFrames RpDMorphAnimation   animation,
RwUInt32    dMorphTargetIndex
 

RpDMorphAnimationGetNumFrames returns the number of keyframes in the sequence of a delta morph animation corresponding to a particular morph target.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
animation  Pointer to the delta morph animation.
dMorphTargetIndex  Index of the delta morph target.
Returns:
Returns the number of keyframes.
See also:
RpDMorphAnimationCreateFrames , RpDMorphAnimationDestroyFrames , RpDMorphAnimationFrameSet

RpDMorphAnimation* RpDMorphAnimationRead const RwChar   filename
 

RpDMorphAnimationRead will read a delta morph animation from the named file. Internally, this opens a stream on the file, finds the delta morph animation chunk header and then calls RpDMorphAnimationStreamRead before closing the stream

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
filename  A pointer to the name of the file containing the animation.
Returns:
A pointer to the animation, or NULL if there is an error.
See also:
RpDMorphAnimationWrite , RpDMorphAnimationStreamRead

RwUInt32 RpDMorphAnimationStreamGetSize RpDMorphAnimation   animation
 

RpDMorphAnimationStreamGetSize obtains the size in bytes of the binary representation of a delta morph animation. This is used in the binary chunk header to indicate the size of the chunk. The size does not include the size of the chunk header.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
animation  Pointer to delta morph animation.
Returns:
Size in bytes of the binary representation.
See also:
RpDMorphAnimationStreamWrite , RpDMorphAnimationStreamRead

RpDMorphAnimation* RpDMorphAnimationStreamRead RwStream   stream
 

RpDMorphAnimationStreamRead read a delta morph animation from the specified binary stream. Note that prior to this function call, a binary delta morph animation chunk (rwID_DMORPHANIMATION) must be found in the stream using the RwStreamFindChunk API function.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

The sequence to locate and read a delta morph animation from a binary stream is as follows:

   RwStream *stream;
   RpDMorphAnimation *newDMorphAnimation;

   stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx");
   if( stream )
   {
       if( RwStreamFindChunk(stream, rwID_DMORPHANIMATION, NULL, NULL) )
       {
           newDMorphAnimation = RpDMorphAnimationStreamRead(stream);
       }

       RwStreamClose(stream, NULL);
   }
Parameters:
stream  Pointer to the stream.
Returns:
Pointer to the delta morph animation read from the stream, or NULL if there is an error.
See also:
RpDMorphAnimationStreamWrite , RpDMorphAnimationStreamGetSize , RpDMorphAnimationRead , RpDMorphAnimationWrite , RpDMorphAnimationDestroy , RwStreamOpen , RwStreamClose , RwStreamFindChunk , RpDMorphPluginAttach

RpDMorphAnimation* RpDMorphAnimationStreamWrite RpDMorphAnimation   animation,
RwStream   stream
 

RpDMorphAnimationStreamWrite writes a delta morph animation to the specified binary stream, which must have been opened prior to calling this function.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
animation  Pointer to the delta morph animation.
stream  Pointer to the binary stream.
Returns:
A pointer to the delta morph animation, or NULL if there is an error.
See also:
RpDMorphAnimationStreamWrite , RpDMorphAnimationStreamGetSize

RpDMorphAnimation* RpDMorphAnimationWrite RpDMorphAnimation   animation,
const RwChar   filename
 

RpDMorphAnimationWrite writes a delta morph animation to the named file. Internally, this opens a stream on the file, calls RpDMorphAnimationStreamWrite, and then closes the stream.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
animation  Pointer to the animation to be written.
filename  Pointer to the name of the file.
Returns:
Pointer to the delta morph animation, or NULL if there is an error.
See also:
RpDMorphAnimationRead

RpAtomic* RpDMorphAtomicAddTime RpAtomic   atomic,
RwReal    deltaTime
 

RpDMorphAtomicAddTime is used to advance the animation of a delta morph atomic by the given amount of time. An animation must have already been attached with RpDMorphAtomicSetAnimation. It is not possible to play an animation backwards, and adding negative time will produce invalid results.

Note that if the animation loops, the time returned by this function does not reset to zero. It is the total time added to the animation including loops.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the atomic.
deltaTime  The amount of time to add.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the atomic.
See also:
RpDMorphAtomicSetAnimFrameTime , RpDMorphAtomicGetAnimFrameTime

RpDMorphAnimation* RpDMorphAtomicGetAnimation const RpAtomic   atomic
 

RpDMorphAtomicGetAnimation is used to retrieve the current animation for a delta morph atomic. This would have previously been set using RpDMorphAtomicSetAnimation.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the atomic.
Returns:
A pointer to the animation, or NULL if one is not set.
See also:
RpDMorphAtomicSetAnimation , RpDMorphAtomicAddTime

RwUInt32 RpDMorphAtomicGetAnimFrame const RpAtomic   atomic,
RwUInt32    dMorphTargetIndex
 

RpDMorphAtomicGetAnimFrame is used to obtain the index of the current frame in an animation to which a specific delta morph target is attached.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the atomic.
dMorphTargetIndex  Index of the delta morph target.
Returns:
Returns the index of the frame, or rpDMORPHNULLFRAME if if the morph target is not connected to the animation.
See also:
RpDMorphAtomicSetAnimFrame

RwReal RpDMorphAtomicGetAnimFrameTime const RpAtomic   atomic,
RwUInt32    dMorphTargetIndex
 

RpDMorphAtomicGetAnimFrameTime returns the interpolation time within the current animation frame of the specified delta morph target. The time is zero at the start of the frame and equal to the frame duration at the end.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the atomic.
dMorphTargetIndex  Index of the delta morph target.
Returns:
Returns the interpolation time.
See also:
RpDMorphAtomicSetAnimation , RpDMorphAtomicAddTime , RpDMorphAtomicSetAnimFrame , RpDMorphAtomicGetAnimFrame , RpDMorphAtomicSetAnimFrameTime

RpAtomicCallBack RpDMorphAtomicGetAnimLoopCallBack const RpAtomic   atomic,
void **    callBackData
 

RpDMorphAtomicGetAnimLoopCallBack is used to retrieve the the function that will be called whenever a delta morph animation loops. The callback data pointer may also be returned if required.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the atomic.
callBackData  A pointer to the loop callback data is passed back via this pointer if not NULL.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the callback function.
See also:
RpDMorphAtomicSetAnimLoopCallBack

RwReal RpDMorphAtomicGetAnimTime const RpAtomic   atomic
 

RpDMorphAtomicGetAnimTime is used to obtain the total amount of time added to the animation of a delta morph atomic.

It is not possible to set the absolute animation time directly. However, this may be achieved by re-setting the animation using RpDMorphAtomicSetAnimation and then adding the appropriate time, with RpDMorphAtomicAddTime.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the delta morph atomic.
Returns:
Returns the animation time.
See also:
RpDMorphAtomicAddTime

RwReal* RpDMorphAtomicGetDMorphValues RpAtomic   atomic
 

RpDMorphAtomicGetDMorphValues is used to retrieve the array of values from a delta morph atomic specifying the amounts of each delta morph target in the current morph state.

The values may be altered to change the morph state. This may be done in combination with a standard delta morph animation (RpDMorphAnimation) or as part of an alternative animation system.

If the array does not currently exist then it will be created based on the number of delta morph targets in the geometry attached to the atomic.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the atomic.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the array of values.
See also:
RpDMorphAtomicInitialize , RpDMorphAtomicGetAnimation , RpDMorphAtomicGetAnimTime , RpDMorphAtomicGetAnimLoopCallBack , RpDMorphAtomicGetAnimFrame , RpDMorphAtomicGetAnimFrameTime

RpAtomic* RpDMorphAtomicInitialize RpAtomic   atomic
 

RpDMorphAtomicInitialize is used to setup the RpAtomic to render a delta morphed RpGeometry. The atomics' render callback is overloaded and chained after the delta morphing render callback.

RpDMorphAtomicInitialize should only be called once only per atomic, or after atomic's render callback is changed.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the atomic.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the atomic.

RpAtomic* RpDMorphAtomicSetAnimation RpAtomic   atomic,
RpDMorphAnimation   animation
 

RpDMorphAtomicSetAnimation is used to set the current animation for a delta morph atomic. This is only applicable where the atomic has a delta morph target geometry attached.

The atomic has an animation interpolator which is set to the initial frames in the delta morph animation for each morph target, and interpolation times are set to zero. The morph values are set to those at the start of the animation.

It is possible to override a delta morph animation on an atomic, or control the morphing without an animation, by directly accessing the morph values (see RpDMorphAtomicGetDMorphValues).

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the atomic.
animation  Pointer to the delta morph animation.
Returns:
A pointer to the atomic or NULL if there is an error.
See also:
RpDMorphAtomicInitialize , RpDMorphAnimationCreate , RpDMorphAnimationRead , RpDMorphAtomicAddTime , RpDMorphAtomicSetAnimLoopCallBack , RpDMorphAtomicGetAnimLoopCallBack

RpAtomic* RpDMorphAtomicSetAnimFrame RpAtomic   atomic,
RwUInt32    dMorphTargetIndex,
RwUInt32    frameIndex
 

RpDMorphAtomicSetAnimFrame will set the specified delta morph target to the start of a particular frame in an animation.

A value of rpDMORPHNULLFRAME may be specified for the frame index. This effectively disconnects a particular morph target from the animation. During RpDMorphAtomicAddTime the value for the delta morph target will not be updated. However, it may be modified directly for procedural animation (see RpDMorphAtomicGetDMorphValues).

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the atomic.
dMorphTargetIndex  Index of the delta morph target.
frameIndex  Index of the frame in the sequence.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the atomic.
See also:
RpDMorphAtomicGetAnimFrame , RpDMorphAtomicSetAnimFrameTime

RpAtomic* RpDMorphAtomicSetAnimFrameTime RpAtomic   atomic,
RwUInt32    dMorphTargetIndex,
RwReal    time
 

RpDMorphAtomicSetAnimFrameTime is used to set the interpolation time within the current animation frame for a particular delta morph target. A time of zero corresponds to the start of the frame, and the time should not bet set greater than the duration of the frame. The morph target value is updated according to the linear interpolation at the given time.

To set the interpolator to a different frame use RpDMorphAtomicSetAnimFrame.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the atomic.
dMorphTargetIndex  Index of the delta morph target.
time  The value for the interpolation time.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the atomic.
See also:
RpDMorphAtomicAddTime , RpDMorphAtomicGetAnimFrameTime , RpDMorphAtomicSetAnimFrame , RpDMorphAtomicGetAnimFrame

RpAtomic* RpDMorphAtomicSetAnimLoopCallBack RpAtomic   atomic,
RpAtomicCallBack    callBack,
void *    data
 

RpDMorphAtomicSetAnimLoopCallBack is used to set an atomic callback that will be called whenever a delta morph animation loops during RpDMorphAtomicAddTime. A pointer to some data may also be specified for passing to the callback.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
atomic  Pointer to the atomic.
callBack  Function pointer to the callback.
data  Pointer to user data to pass to the callback.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the atomic.
See also:
RpDMorphAtomicGetAnimLoopCallBack , RpDMorphAtomicAddTime

RpAtomic* RpDMorphAtomicSetType RpAtomic   atomic,
RpDMorphType    type
 

RpDMorphAtomicSetType

Sets up the delta morph RpAtomic with the correct rendering pipeline.

Parameters:
atomic  Pointer to the atomic.
type  Atomic rendering type.
Returns:
A pointer to the RpAtomic if successful, or NULL otherwise.
See also:
RpDMorphAtomicGetType

RpGeometry* RpDMorphGeometryAddDMorphTarget RpGeometry   geometry,
RwUInt32    index,
RwV3d   vertices,
RwV3d   normals,
RwRGBA   preLightColors,
RwTexCoords   texCoords,
RwUInt32    flags
 

RpDMorphGeometryAddDMorphTarget is used to add a delta morph target to the base geometry at the specified index.

The flags determine what geometry elements the delta morph target will contain. The adding process calculates the delta from the given data and the base. The delta is stored in a compressed format as much of the morph target will be identical to the base. Those vertices with a delta of zero (within a small tolerance) are stripped out.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
geometry  Pointer to the base geometry.
index  Index where the delta should be created.
vertices  Pointer to the delta's vertices or NULL if the delta is not morphing the positions.
normals  Pointer to the delta's normals or NULL if the delta is not morphing the normals.
preLightColors  Pointer to the delta's prelight colors or NULL if the delta is not morphing the prelight colors.
texCoords  Pointer to the delta's texture coordinates or NULL if the delta is not morphing the texture coordinates.
flags  One of
  • rpGEOMETRYPOSITIONS
  • rpGEOMETRYNORMALS
  • rpGEOMETRYPRELIT or
  • rpGEOMETRYTEXTURED
Returns:
Returns NULL if there is an error, or otherwise a pointer to the base geometry.
See also:
RpDMorphGeometryRemoveDMorphTarget , RpDMorphGeometryDestroyDMorphTargets , RpDMorphGeometryCreateDMorphTargets

RpGeometry* RpDMorphGeometryCreateDMorphTargets RpGeometry   geometry,
RwUInt32    number
 

RpDMorphGeometryCreateDMorphTargets is used to create space for a number of delta morph targets. Once the base geometry has been setup, RpDMorphGeometryAddDMorphTarget should be used to add delta morph targets to the base. When the delta morph targets are finished with they can be removed with RpDMorphGeometryRemoveDMorphTarget and emptied with RpDMorphGeometryDestroyDMorphTargets. This function cannot be called again on a geometry without first calling RpDMorphGeometryDestroyDMorphTargets to remove the old delta morph targets.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
geometry  Pointer to the base geometry.
number  The number of delta morph targets to create.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the base geometry.
See also:
RpDMorphGeometryDestroyDMorphTargets , RpDMorphGeometryAddDMorphTarget , RpDMorphGeometryRemoveDMorphTarget

RpGeometry* RpDMorphGeometryDestroyDMorphTargets RpGeometry   geometry
 

RpDMorphGeometryDestroyDMorphTargets is used to destroy the base geometry's delta morph targets. This should only be used after a call to RpDMorphGeometryCreateDMorphTargets. Any delta morph targets that have not been removed will be automatically removed.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
geometry  Pointer to the base geometry.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the base geometry.
See also:
RpDMorphGeometryCreateDMorphTargets , RpDMorphGeometryAddDMorphTarget , RpDMorphGeometryRemoveDMorphTarget

RpDMorphTarget* RpDMorphGeometryGetDMorphTarget const RpGeometry   geometry,
RwUInt32    index
 

RpDMorphGeometryGetDMorphTarget is used to get the indexed delta morph target of the base geometry.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
geometry  Pointer to the base geometry.
index  Index of the delta morph target.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the delta morph target.
See also:
RpDMorphGeometryCreateDMorphTargets , RpDMorphGeometryGetNumDMorphTargets

RwUInt32 RpDMorphGeometryGetNumDMorphTargets const RpGeometry   geometry
 

RpDMorphGeometryGetNumDMorphTargets is used to get the number of delta morph targets that were created by a call to RpDMorphGeometryCreateDMorphTargets.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
geometry  Pointer to the base geometry.
Returns:
Returns the number of delta morph targets.
See also:
RpDMorphGeometryCreateDMorphTargets , RpDMorphGeometryGetDMorphTarget

RpGeometry* RpDMorphGeometryRemoveDMorphTarget RpGeometry   geometry,
RwUInt32    index
 

RpDMorphGeometryRemoveDMorphTarget is used to remove the index delta morph target from the base geometry. Once removed the index is then available for a new delta morph target.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
geometry  Pointer to the base geometry.
index  Index of the delta morph target.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the base geometry.
See also:
RpDMorphGeometryDestroyDMorphTargets , RpDMorphGeometryCreateDMorphTargets , RpDMorphGeometryAddDMorphTarget

RpGeometry* RpDMorphGeometryTransformDMorphTargets RpGeometry   geometry,
const RwMatrix   matrix
 

RpDMorphGeometryTransformDMorphTargets is used to apply the specified transformation matrix to the given geometry. The transformation is applied equally to all delta morph targets defined on the base geometry and for each delta morph target transforms both the vertex position deltas and vertex normal deltas.

Note that the transformation modifies the delta morph target data and is permanent. It does not modify the base geometry, this should be done with RpGeometryTransform.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
geometry  Pointer to the base geometry.
matrix  Pointer to the matrix describing the transformation.
Returns:
Returns pointer to the geometry if successfull or NULL if there is an error.

RwBool RpDMorphPluginAttach void   
 

RpDMorphPluginAttach is called by the application to indicate that the delta morph plugin should be used. The call to this function should be placed between RwEngineInit and RwEngineOpen and the world plugin must already be attached.

The library rpdmorph and the header file rpdmorph.h are required.

Returns:
True on success, false otherwise
See also:
RpDMorphGeometryCreateDMorphTargets , RpDMorphAnimationCreate , RpDMorphAnimationRead , RpDMorphAtomicSetAnimation , RpDMorphAtomicAddTime , RpWorldPluginAttach

const RwSphere* RpDMorphTargetGetBoundingSphere const RpDMorphTarget   dMorphTarget
 

RpDMorphTargetGetBoundingSphere is used to get the bounding sphere of the delta morph target. The bounding sphere returned is returned as if the delta morph had been fully applied.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
dMorphTarget  Pointer to the delta morph target.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the bounding sphere.
See also:
RpDMorphGeometryAddDMorphTarget

RpGeometryFlag RpDMorphTargetGetFlags RpDMorphTarget   dMorphTarget
 

RpDMorphTargetGetFlags is used to get elements of geometry that the delta morph target contains.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
dMorphTarget  Pointer to the delta morph target.
Returns:
Returns the geometry flags of the delta morph target.
See also:
RpGeometryGetFlags , RpDMorphGeometryAddDMorphTarget

RwChar* RpDMorphTargetGetName RpDMorphTarget   dMorphTarget
 

RpDMorphTargetGetName is used to get the name of the delta morph target.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
dMorphTarget  Pointer to the delta morph target.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the name.
See also:
RpDMorphTargetSetName

RpDMorphTarget* RpDMorphTargetSetName RpDMorphTarget   dMorphTarget,
RwChar   name
 

RpDMorphTargetSetName is used to set the name of the delta morph target.

The world and delta morph plugins must be attached before using this function. The header file rpdmorph.h is required.

Parameters:
dMorphTarget  Pointer to the delta morph target.
name  Pointer to the given name of the delta morph target.
Returns:
Returns NULL if there is an error, or otherwise a pointer to the delta morph target.
See also:
RpDMorphTargetGetName


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