RtAnim is an animation toolkit, enabling the user to create, stream and play any type of keyframed animation.
RtAnimAnimation's are a block of keyframe data representing an animation. For each node (i.e. joint) in the object that the animation is applied to, the .ANM file contains a start keyframe, an end keyframe, and any number of intermediate keyframes as necessary. This is normally created by loading an .ANM file. When a node is at a time where no keyframe is applied, the actual state of that node will be positioned by linear interpolation between the two adjacent keyframes.
RtAnim supports the concept of overloadable interpolation schemes. This requires specifying a custom keyframe type (identified by a unique ID) and a set of callbacks for manipulating the keyframes. The callback functions will implement tasks such as interpolation and converting to final result. Animations are associated with a particular scheme using the ID, and the relevant callbacks are automatically used whenever an animation is updated by the standard RtAnim API interface. To support this, the keyframe types must share a common header giving a pointer to the previous keyframe, and the time of the keyframe. See RtAnimRegisterInterpolationScheme for more information.
|
Typedef for struct RtAnimAnimation. |
|
RtAnimCallBack defines a callback function for use with the RtAnimInterpolatorSetAnimCallBack and RtAnimInterpolatorSetAnimLoopCallBack functions.
|
|
RtAnimInterpFrameHeader Typedef for struct RtAnimInterpFrameHeader |
|
RtAnimInterpolator Typedef for struct RtAnimInterpolator |
|
RtAnimInterpolatorInfo Typedef for struct RtAnimInterpolatorInfo |
|
RtAnimKeyFrameAddCallBack defines a callback function for adding two interpolated keyframes together. This is used when adding the states of two RtAnimInterpolator objects, such as when adding a delta animation to a base animation.
|
|
RtAnimKeyFrameApplyCallBack defines a callback function for converting an interpolated animation keyframe into the required result.
|
|
RtAnimKeyFrameBlendCallBack defines a callback function for blending between two interpolated keyframes by the given blend factor. This is used for blending the states of two different RtAnimInterpolator objects. The RtAnimKeyFrameInterpolateCallBack is used for interpolating actual animation keyframes into an interpolated frame.
|
|
RtAnimKeyFrameHeader Typedef for struct RtAnimKeyFrameHeader |
|
RtAnimKeyFrameInterpolateCallBack defines a callback function for interpolating between two animation keyframes according to the given time. The output is an interpolated frame object residing in an RtAnimInterpolator and will usually have the same structure as the keyframe apart from the header data (RtAnimInterpFrameHeader).
|
|
RtAnimKeyFrameMulRecipCallBack defines a callback function for multiplying a keyframe by the inverse of another keyframe. This is used for creating delta animations.
|
|
RtAnimKeyFrameStreamGetSizeCallBack defines a callback function for calculating the binary stream size of keyframe data within an animation.
|
|
RtAnimKeyFrameStreamReadCallBack defines a callback function for reading in keyframes from an RwStream for the given animation.
|
|
RtAnimKeyFrameStreamWriteCallBack defines a callback function for writing keyframes from the given animation to an RwStream.
|
|
RtAnimAnimationCreate creates an animation, and allocates space for the number of keyframes required. This keyframe block should be filled with keyframe sequences. See RtAnimAnimation for details of the required layout of the keyframes.
|
|
RtAnimAnimationDestroy destroys an animation.
|
|
RtAnimAnimationFreeListCreateParams allows the developer to specify how many RtAnimAnimation's to preallocate space for. Call before RwEngineInit.
|
|
RtAnimAnimationGetNumNodes returns the number of nodes supported by the animation, that is, the number of nodes required for an interpolator to read the animation.
|
|
Returns the typeID of an animation
|
|
RtAnimAnimationMakeDelta makes a delta animation from a given RtAnimAnimation. It requires the number of nodes to decode the animation and a time from which to make the delta. This will give you an animation which can be added on to another animation, e.g. characters leaning whilst running. This calls the overloaded interpolation scheme RtAnimKeyFrameMulRecipCallBack which multiplies the incoming keyframe by the reciprocal of the start keyframe given.
|
|
RtAnimAnimationRead is a wrapper around RtAnimAnimationStreamRead. Read opens the stream and searches for the appropriate chunk header and then calls RtAnimAnimationStreamRead. Reads a .ANM animation file from disk.
|
|
RtAnimAnimationStreamGetSize is used in stream writing and will call the overloaded interpolator RtAnimKeyFrameStreamGetSizeCallBack function in order to acquire the size of the keyframe data.
|
|
RtAnimAnimationStreamRead creates and reads in animation data. Upon reading, it will look up pointers to interpolation functions based on the interpolation scheme ID which was written out to the file. If the interpolation scheme is not available then the read will fail. This function calls the overloaded RtAnimKeyFrameStreamReadCallBack function for the particular keyframe type allowing keyframes to be of varying sizes/data types etc. This not only allows interpolation schemes to perform higher order interpolation but allows them to attach extra data to achieve it or compress data in order to save memory space. The sequence to locate and read animation data from a binary stream is as follows: RwStream *stream; RtAnimAnimation *newAnimAnimation; stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx"); if( stream ) { if( RwStreamFindChunk(stream, rwID_HANIMANIMATION, NULL, NULL) ) { newAnimAnimation = RtAnimAnimationStreamRead(stream); } RwStreamClose(stream, NULL); }
|
|
RtAnimAnimationStreamWrite writes an animation to a stream. This function calls the overloaded RtAnimKeyFrameStreamWriteCallBack function for the particular keyframe type allowing keyframes to be of varying sizes/data types etc. This not only allows interpolation schemes to perform higher order interpolation but allows them to attach extra data to achieve it or compress data in order to save memory space.
|
|
RtAnimAnimationWrite is a wrapper around RtAnimAnimationStreamWrite. Write will open a stream and call RtAnimAnimationStreamWrite. Writes a .ANM animation file to disk.
|
|
RtAnimGetInterpolatorInfo retrieves the information for the interpolation scheme of the given type ID. The scheme must first have been registered using RtAnimRegisterInterpolationScheme, unless it is provided as standard. The RpHAnim plugin provides a standard animation scheme.
|
|
RtAnimInitialize is used to initialize the animation toolkit with the RenderWare Graphics system to enable the manipulation of keyframed animation. The toolkit must be initialized between initializing the system with RwEngineInit and opening it with RwEngineOpen.
|
|
RtAnimInterpolatorAddAnimTime adds time to the animation's current time and will step through the keyframes to find the current pair for each node to interpolate. These will then be interpolated by calling the appropriate overloaded interpolation scheme functions. If the animation loops or passes the time set in RtAnimInterpolatorSetAnimCallBack then the appropriate callback will be called. By default the animation will simply loop continuously. The added time must be positive. For backwards playing, use RtAnimInterpolatorSubAnimTime. If an animation has been playing backwards prior to RtAnimInterpolatorAddAnimTime being called, then this will be detected and the change will be handled appropriately.
|
|
RtAnimInterpolatorAddSubInterpolator adds together two animation interpolators. Each animation interpolator should have an animation attached, and the result will be the addition of the two input animation interpolators. The output animation interpolator must be identical in structure to either the main or sub-animation interpolator.
|
|
RtAnimInterpolatorAddTogether adds together two animation interpolators. Each animation interpolator should have an animation attached, and the result will be the addition of the two input animation interpolators. This is mainly useful where the second animation interpolator's pose is a delta from a set pose to be added to the pose held in the first animation interpolator. For example, a walk animation could have a crouch pose added to it as a delta from a standing pose.
|
|
RtAnimInterpolatorBlend interpolates between two animation interpolators. The result will be interpolated between the current state of the two input animation interpolators.
|
|
RtAnimInterpolatorBlendSubInterpolator interpolates the nodes in a sub-animation interpolator with it parent animation interpolator. Each animation interpolator should have an animation attached, and the result will be interpolated between the current state of the two input animation interpolators. Either source animation interpolator can be the sub-animation interpolator, the blend is performed from inAnim1 to inAnim2. The output animation interpolator must be identical in structure to either the main or sub-animation interpolator.
|
|
RtAnimInterpolatorCopy copies the state of nodes in the in-animation interpolator into the out-animation interpolator.
|
|
RtAnimInterpolatorCreate creates an instanced version of an animation. Each RtAnimAnimation object contains a full sequence of keyframes to be interpolated as time advances. The RtAnimInterpolator object contains the current state of an animation at a particular point in time. Any number of interpolators may be connected to a single RtAnimAnimation. Internally, the interpolator stores a table of interpolated keyframes. When calling RtAnimInterpolatorAddAnimTime, RtAnimInterpolatorSubAnimTime, or RtAnimInterpolatorSetCurrentTime the contents of the interpolated keyframe table is updated using the callbacks registered in the corresponding RtAnimInterpolatorInfo for the animation. The interpolator also manages user callbacks that may be triggered when the animation reaches a particular time, or loops back to the start. For advanced purposes such as procedural animation, the table of interpolated frames can be accessed using the macro rtANIMGETINTERPFRAME(anim, nodeIndex), where anim is a pointer to an RtAnimInterpolator, and nodeIndex is the index of the keyframe/node. Note, however, that each interpolated frame has an RtAnimInterpFrameHeader rather than an RtAnimKeyFrameHeader and this header data should not be modified .
|
|
RtAnimInterpolatorCreateSubInterpolator creates a sub-animation interpolator of a given main animation interpolator. The parent-animation interpolator and the offset into the animation interpolator are provided along with flags defining the sub-animation interpolators settings. You can specify a different maxkeyframesize for the sub-animation interpolator and use different types of keyframe on sub-animation interpolators and main animation interpolators. Specifying -1 will adopt the parent animation interpolators size settings. The sub-animation interpolator can then be used to run a different animation from the base animation interpolator.
|
|
RtAnimInterpolatorDestroy destroys an RtAnimInterpolator object.
|
|
RtAnimInterpolatorGetCurrentAnim return the current animation on the animation interpolator.
|
|
RtAnimInterpolatorSetAnimCallBack is used to set a callback function that will be called when an animation interpolator reaches a specified time. The callback function should return a pointer to the animation interpolator if the function should continue to be called, or NULL if it should never be called again.
|
|
RtAnimInterpolatorSetAnimLoopCallBack is used to set a callback function that will be called when an animation interpolator's animation loops. The callback function should return a pointer to the animation interpolator if the function should continue to be called, or NULL if it should never be called again.
|
|
RtAnimInterpolatorSetCurrentAnim sets the current animation on the animation interpolator. It is assumed that the animation is designed for the animation interpolator it is being set on since no animation interpolator structure comparisons are made. The animation defines the interpolation schemes used and they will be setup on the animation interpolator at this call. The maximum keyframe size of the animation interpolator must be sufficient to support the keyframe size required by the interpolation scheme. The animation is initialized to time zero at this call.
|
|
RtAnimInterpolatorSetCurrentTime sets the current animation time of an animation interpolator.
|
|
RtAnimInterpolatorSetKeyFrameCallBacks sets up the callbacks to be used by the animation interpolator. These callbacks perform keyframe blending, interpolation and conversion to matrices. The callback setup is implicitly performed when setting the current animation on an animation interpolator. However if you wish to fully procedurally drive the keyframe data this function allows the callbacks to be set up.
|
|
RtAnimInterpolatorSubAnimTime subtracts time from the current animation time and will step through the keyframes to find the current pair for each node to interpolate. These will then be interpolated by calling the appropriate overloaded interpolation scheme functions. If the animation loops or passes the time set in RtAnimInterpolatorSetAnimCallBack then the appropriate callback will be called. By default the animation will simply loop continuously.
|
|
RtAnimKeyFrameAddTogether adds two interpolated keyframes together. These would normally be from two different RtAnimInterpolator objects, with the results being stored in a third RtAnimInterpolator.
|
|
RtAnimKeyFrameApply converts an interpolated keyframe structure into a usable format, such as a matrix in the case of hierarchical animation.
|
|
RtAnimKeyFrameBlend blends between two interpolated keyframes using a given blend factor. These would normally be from different RtAnimInterpolator objects, with the results being stored in a third RtAnimInterpolator.
|
|
RtAnimKeyFrameInterpolate interpolates between two keyframes and returns the result.
|
|
RtAnimRegisterInterpolationScheme registers a keyframe interpolation scheme. The function must be called before any animations using the scheme are created or read from a stream. An RtAnimInterpolatorInfo structure should be filled with the type ID of the scheme, the size of the keyframe structure and a list of callbacks for processing keyframes, before being passed to this function. The type ID must be unique and it is recommended that values in the range 1 to 255 are reserved for internal use by RenderWare Graphics. It is suggested that developers construct unique IDs using MAKECHUNKID(vendorID, typeID). An animation using the scheme may be created by passing in the type ID. The keyframe structure should always begin with a standard header (RtAnimKeyFrameHeader), i.e. the first 4 bytes hold a pointer to the previous keyframe for the particular node, and the second 4 bytes hold the time of the keyframe. This allows the keyframe type to function with RtAnimInterpolatorAddAnimTime etc. The header size should be included in the animKeyFrameSize entry. For an interpolated keyframe, a different header is used (RtAnimInterpFrameHeader) which has the same size and should be included in the interpKeyFrameSize entry. See RtAnimInterpolatorInfo for information about the callbacks.
|
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |