Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RpMorphTarget
[Basic Geometry]


Data Structures

struct   RpMorphTarget

Functions

RpMorphTarget RpMorphTargetSetBoundingSphere (RpMorphTarget *morphTarget, const RwSphere *boundingSphere)
RwSphere RpMorphTargetGetBoundingSphere (RpMorphTarget *morphTarget)
const RpMorphTarget RpMorphTargetCalcBoundingSphere (const RpMorphTarget *morphTarget, RwSphere *boundingSphere)
RwV3d RpMorphTargetGetVertices (const RpMorphTarget *morphTarget)
RwV3d RpMorphTargetGetVertexNormals (const RpMorphTarget *morphTarget)

Detailed Description

Morph Targets

RpMorphTarget Overview

Requirements

Overview

This object defines a keyframe for animation. When a model with multiple keyframe animation is loaded or created, the keyframes are stored in Morph Targets. During playback, RenderWare Graphics will morph the 3D model geometry over time from one Morph Target to the next, until the last in the sequence has been reached, at which point the cycle is reset. (An optional callback function can be triggered at this point.)

When animating between Morph Targets, RenderWare creates an interpolated model, the data for which lives in an RpInterpolator object. If the animation cycle is exactly on a Morph Target, the data from that object is simply copied to an RpInterpolator object. All Geometry objects have at least one RpInterpolator object, regardless of whether any animation data exists.


Function Documentation

const RpMorphTarget* RpMorphTargetCalcBoundingSphere const RpMorphTarget   morphTarget,
RwSphere   boundingSphere
 

RpMorphTargetCalcBoundingSphere is used to calculate the specified morph target's optimal bounding sphere. The bounding sphere is used in collision and picking tests at the atomic and clump level. Note that this function does not modify the center and radius of the bounding sphere. Use the API function RpMorphTargetSetBoundingSphere to change the morph target's actual bounding sphere.

The world plugin must be attached before using this function.

Parameters:
morphTarget  Pointer to the morph target.
boundingSphere  Pointer to a RwSphere value that will receive the bounding sphere.
Returns:
Returns pointer to the morph target if successful or NULL if there is an error.
See also:
RpMorphTargetSetBoundingSphere , RpMorphTargetGetBoundingSphere , RpWorldPluginAttach
RwSphere* RpMorphTargetGetBoundingSphere RpMorphTarget   morphTarget
 

RpMorphTargetGetBoundingSphere is used to get the bounding sphere from a morph target. The bounding sphere is a sphere that encloses all the vertices in the given morph target. This bounding sphere is used in collision and pick testing.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

The world plugin must be attached before using this function.

Parameters:
morphTarget  Pointer to the morph target.
Returns:
Returns pointer to a RwSphere value if successful or NULL if there is an error.
See also:
RpMorphTargetCalcBoundingSphere , RpMorphTargetSetBoundingSphere , RpWorldPluginAttach
RwV3d* RpMorphTargetGetVertexNormals const RpMorphTarget   morphTarget
 

RpMorphTargetGetVertexNormals is used to retrieve the array of vertex normals from the specified morph target. The array only exists if the morph target's geometry has been created using the rpGEOMETRYNORMALS flag. Use this function to initialize or redefine the morph target's vertex normal list. There is a one-to-one correspondence between the vertex list array and the vertex normal array.

The geometry must be locked before the vertex normal data can be modified.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

The world plugin must be attached before using this function.

Parameters:
morphTarget  Pointer to the morph target containing the vertex normal array.
Returns:
Returns a pointer to an array of RwV3d values if successful or NULL if there is an error.
See also:
RpMorphTargetGetVertices , RpGeometryGetNumVertices , RpGeometryGetMorphTarget , RpGeometryCreate , RpGeometryLock , RpGeometryUnlock , RpWorldPluginAttach
RwV3d* RpMorphTargetGetVertices const RpMorphTarget   morphTarget
 

RpMorphTargetGetVertices is used to retrieve the array of vertex positions from the specified morph target. Use this function to initialize or redefine the morph target's vertex list.

The geometry must be locked before the vertex data can be modified.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

The world plugin must be attached before using this function.

Parameters:
morphTarget  Pointer to the morph target containing the vertex array.
Returns:
Returns a pointer to an array of RwV3d values if successful or NULL if there is an error.
See also:
RpMorphTargetGetVertexNormals , RpGeometryGetNumVertices , RpGeometryGetMorphTarget , RpGeometryCreate , RpGeometryLock , RpGeometryUnlock , RpWorldPluginAttach
RpMorphTarget* RpMorphTargetSetBoundingSphere RpMorphTarget   morphTarget,
const RwSphere   boundingSphere
 

RpMorphTargetSetBoundingSphere is used to modify the specified morph target's bounding sphere. This function is typically used in conjunction with RpMorphTargetCalcBoundingSphere to calculate and store the center and radius of a sphere enclosing all the vertices in the given morph target. This bounding sphere is used in collision and pick testing; therefore, if the given sphere has not been calculated using RpMorphTargetCalcBoundingSphere incorrect results will occur.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

The world plugin must be attached before using this function.

Parameters:
morphTarget  Pointer to the morph target.
boundingSphere  Pointer to a RwSphere value describing the new bounding sphere.
Returns:
Returns pointer to the morph target if successful or NULL if there is an error.
See also:
RpMorphTargetCalcBoundingSphere , RpmorphTargetGetBoundingSphere , RpWorldPluginAttach

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:18 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)