Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RtToonGeo
[RtToon]


Functions

RwInt32 RtToonGeoGetNumEdges (const RpToonGeo *toonGeo)
RpToonEdgeRtToonGeoGetEdges (const RpToonGeo *toonGeo)
RwUInt16 RtToonGeoFindEdgeIndex (const RpToonGeo *toonGeo, RwInt32 rwV0, RwInt32 rwV1)
void RtToonGeoSetEdgeInkID (RpToonGeo *toonGeo, RwUInt16 edgeIndex, RpToonInkType type, RwInt32 inkID)
void RtToonGeoGetVertexRemap (const RpToonGeo *toonGeo, const RwV3d *positions, RwInt32 *vertexRemap)
RwInt32 RtToonGeoGetInkIDFromName (RpToonGeo *toonGeo, const RwChar *inkName)
RpToonGeoRtToonGeoOptimizeEdgeInkIDs (RpToonGeo *toonGeo)

Function Documentation

RwUInt16 RtToonGeoFindEdgeIndex const RpToonGeo   toonGeo,
RwInt32    rwV0,
RwInt32    rwV1
 

RtToonGeoFindEdgeIndex returns the index of the toon edge which lies between vertices with indices rwV0 and rwV1. This index can then be used to specify ink properties for the edge via RtToonGeoSetEdgeInkID.

It is an error to ask for an edge that doesn't exist.

This function is very expensive, should be called at export time only and therefore is only available on PC platforms

Parameters:
toonGeo  the RpToonGeo
rwV0  the first vertex index, corresponding to a remapped vertex from RtToonGeoGetVertexRemap
rwV1  the 2nd vertex index, corresponding to a remapped vertex from RtToonGeoGetVertexRemap
Returns:
the edge index.
See also:
RtToonGeoGetNumEdges , RtToonGeoGetEdges , RtToonGeoGetVertexRemap , RpToonInkType , RtToonGeoGetInkIDFromName , RtToonGeoOptimizeEdgeInkIDs

RpToonEdge* RtToonGeoGetEdges const RpToonGeo   toonGeo
 

RtToonGeoGetEdges is used to retrieve a pointer of the edges RpToon built from the source geometry

Parameters:
toonGeo  A pointer to toon geometry.
Returns:
A pointer to the edge list.

RwInt32 RtToonGeoGetInkIDFromName RpToonGeo   toonGeo,
const RwChar   inkName
 

RtToonGeoGetInkIDFromName is used to get from an ink name an RwInt32 identifying that ink uniquely for this RpToonGeo. If the RpToonGeo doesn't have an ID for that name already, it will make a new one and note the ink name. Otherwise it will return the existing ID. This ID can then be used to specify per edge which ink style an edge is meant to use with RtToonGeoSetEdgeInkID.

It's done this way because each edge needs to reference an ink, but names are too long to store efficiently, pointers don't stream well, and it's assumed that you need only a few inks per object anyway.

You don't need to worry about this unless you're writing an exporter.

Parameters:
toonGeo  the RpToonGeo
inkName  the name of the RpToonInk to identify
Returns:
an RwInt32 indentifying this ink name with respect to this RpToonGeo
See also:
RtToonGeoSetEdgeInkID

RwInt32 RtToonGeoGetNumEdges const RpToonGeo   toonGeo
 

RtToonGeoGetNumEdges is used to retrieve the number of edges RpToon built from the source geometry.

Parameters:
toonGeo  A pointer to toon geometry.
Returns:
RwInt32 number of edges.

void RtToonGeoGetVertexRemap const RpToonGeo   toonGeo,
const RwV3d   positions,
RwInt32   vertexRemap
 

RtToonGeoGetVertexRemap attempts to find unique edges on a mesh to minimize the number of edges that need to be tested and rendered. Mesh rendering on the other hand dictates that vertices must be replicated where normals, UVs, colors, etc, are not shared. This function analyzes a set of RwV3d positions which may contain duplicates, and for each vertex puts the index of the first unique position in the vertexRemap. this gives a mapping of RenderWare geometry vertices to toon vertices, hence a toon edge can be identified by 2 RenderWare geometry vertex indices "remapped" off this array.

This function is very expensive, should be called at export time only and therefore is only available on PC platforms

Parameters:
toonGeo  the RpToonGeo
positions  a set of vertex positions to analyze
vertexRemap  an array of RwInt32s (one for each vertex) to hold the result.
See also:
RtToonGeoGetNumEdges , RtToonGeoGetEdges , RtToonGeoFindEdgeIndex , RpToonInkType , RtToonGeoGetInkIDFromName , RtToonGeoOptimizeEdgeInkIDs , RtToonGeoFindEdgeIndex

RpToonGeo* RtToonGeoOptimizeEdgeInkIDs RpToonGeo   toonGeo
 

RtToonGeoOptimizeEdgeInkIDs is used to convert an RpGeometry's RpToonGeo to a rendering

This function is very expensive, should be called at export time only and therefore is only available on PC platforms
Parameters:
toonGeo  the RpToonGeo
Returns:
a pointer to the RpToonGeo on success or NULL if an error occurred.
See also:
RtToonGeoGetNumEdges , RtToonGeoGetEdges , RpToonInkType , RtToonGeoGetInkIDFromName , RtToonWorldOptimize

void RtToonGeoSetEdgeInkID RpToonGeo   toonGeo,
RwUInt16    edgeIndex,
RpToonInkType    type,
RwInt32    inkID
 

RtToonGeoSetEdgeInkID is used to tag a particular RpToonEdge with an RpToonInkType and a RpToonInk to use when rendering.

You don't need to worry about this unless you're writing an exporter.

Flagging edges arbitrarily is convienient for specifying edges in an art package, but very tedious for rendering. So when you've finished using RtToonGeoSetEdgeInkID to change an RpToonGeo's edge's inks, you MUST call RtToonGeoOptimizeEdgeInkIDs to pack the changes into a format convientient for rendering. This will reorder the edges, restrip all the meshes and possibly introduce new materials to accomodate multiple silhouette ink styles.

In the case of worlds you should use RtToonGeoSetEdgeInkID on all the world sectors, then call RtToonWorldOptimize instead of RtToonGeoOptimizeEdgeInkIDs when you've finished.

Parameters:
toonGeo  the RpToonGeo
edgeIndex  the edge to identify
type  the RpToonInkType to render this edge with
inkID  the ink ID, gotten from RtToonGeoGetInkIDFromName, to render this edge with.
See also:
RtToonGeoGetNumEdges , RtToonGeoGetEdges , RpToonInkType , RtToonGeoGetInkIDFromName , RtToonGeoOptimizeEdgeInkIDs , RtToonWorldOptimize
Returns:
none.


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