Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RtGCond
[Basic Geometry]


Data Structures

struct   RtGCondGeometryList
struct   RtGCondParameters
struct   RtGCondPolygon
struct   RtGCondUserdataCallBacks
struct   RtGCondVertex

Typedefs

typedef RwBool(*  RtGCondDestroyVertexUserdataCallBack )(void **pUserdata)
typedef RwBool(*  RtGCondCloneVertexUserdataCallBack )(void **pUserdataDst, void **pUserdataSrc)
typedef RwBool(*  RtGCondInterpVertexUserdataCallBack )(void **pUserdataDst, void **pUserdata1, void **pUserdata2, RwReal delta)
typedef RwBool(*  RtGCondDestroyPolygonUserdataCallBack )(void **pUserdata)
typedef RwBool(*  RtGCondSplitPolygonUserdataCallBack )(void **pUserdataDst, void **pUserdataSrc)

Enumerations

enum   RtGCondFlag { rtGCONDNORMALS = 0x01, rtGCONDTEXTURES = 0x02, rtGCONDPRELIT = 0x04, rtGCONDFLAGFORCEENUMSIZEINT = RWFORCEENUMSIZEINT }

Functions

void  RtGCondNormalize (RwV3d *vec)
RwReal  RtGCondLength (RwV3d *vec)
RwBool  RtGCondVectorsEqual (RwV3d *v1, RwV3d *v2, RwReal tol)
RwBool  RtGCondColinearVertices (RwV3d *v1, RwV3d *v2, RwV3d *v3, RwBool strictOrder)
void  RtGCondSnapPipelineNode (RtGCondGeometryList *geometryList, RwReal weldThreshold)
void  RtGCondSnapUVsPipelineNode (RtGCondGeometryList *geometryList, RwReal weldThreshold)
RwReal  RtGCondAreaOfPolygon (RtGCondGeometryList *geometryList, RtGCondPolygon *polygon)
void  RtGCondCullZeroAreaPolygonsPipelineNode (RtGCondGeometryList *geometryList, RwReal areaThreshold)
void  RtGCondLimitUVsPipelineNode (RtGCondGeometryList *geometryList, RwReal limitUVMin, RwReal limitUVMax)
void  RtGCondRemapVerticesPipelineNode (RtGCondGeometryList *geometryList)
void  RtGCondSortVerticesOnMaterialPipelineNode (RtGCondGeometryList *geometryList)
void  RtGCondUnshareVerticesOnMaterialBoundariesPipelineNode (RtGCondGeometryList *geometryList)
void  RtGCondUnshareVerticesPipelineNode (RtGCondGeometryList *geometryList)
RwInt32 RtGCondWeldVerticesPipelineNode (RtGCondGeometryList *geometryList, RwReal weldThreshold, RwReal normalWeldThreshold, RwReal uvThreshold, RwReal preLitThreshold, RwBool ignoreTextures, RwBool remap, RwBool implicit, RwBool averageAttributes)
void  RtGCondRemoveIdenticalPolygonsPipelineNode (RtGCondGeometryList *geometryList)
void  RtGCondRemoveSliversPipelineNode (RtGCondGeometryList *geometryList)
void  RtGCondFixAndFilterGeometryPipeline (RtGCondGeometryList *geometryList)
void  RtGCondDecimateAndWeldGeometryPipeline (RtGCondGeometryList *geometryList)
void  RtGCondSetGeometryConditioningPipeline (RtGCondGeometryConditioningPipeline pipeline)
RtGCondGeometryConditioningPipeline  RtGCondGetGeometryConditioningPipeline (void)
void  RtGCondApplyGeometryConditioningPipeline (RtGCondGeometryList *geometryList)
void  RtGCondFreeVertices (RtGCondGeometryList *geometryList)
void  RtGCondAllocateVertices (RtGCondGeometryList *geometryList, RwInt32 num)
void  RtGCondFreePolygons (RtGCondGeometryList *geometryList)
void  RtGCondAllocatePolygons (RtGCondGeometryList *geometryList, RwInt32 num)
void  RtGCondFreeIndices (RtGCondPolygon *polygon)
void  RtGCondAllocateIndices (RtGCondPolygon *polygon, RwInt32 num)
void  RtGCondReallocateIndices (RtGCondPolygon *polygon, RwInt32 num)
void  RtGCondReallocateVertices (RtGCondGeometryList *geometryList, RwInt32 num)
void  RtGCondReallocatePolygons (RtGCondGeometryList *geometryList, RwInt32 num)
void  RtGCondParametersSet (RtGCondParameters *gcParams)
RtGCondParameters RtGCondParametersGet (void)
void  RtGCondParametersInit (RtGCondParameters *gcParams)
void  RtGCondSetUserdataCallBacks (RtGCondCloneVertexUserdataCallBack cloneVertexUserdataCB, RtGCondInterpVertexUserdataCallBack interpVertexUserdataCB, RtGCondSplitPolygonUserdataCallBack splitPolygonUserdataCB, RtGCondDestroyVertexUserdataCallBack destroyVertexUserdataCB, RtGCondDestroyPolygonUserdataCallBack destroyPolygonUserdataCB)

Detailed Description

Geometry Conditioning toolkit for RenderWare Graphics.

RtGCond Toolkit Overview

Requirements

Overview

The functions in this toolkit allow geometric (vertex and polygon) and attribute (uvs, prelights, etc.) operations in a simple and independent manner. Some of the functions make heavy use of the winged/half-edge edge data structure (RtWing Toolkit Overview) for the sake of efficiency.


Typedef Documentation

typedef RwBool(* RtGCondCloneVertexUserdataCallBack)(void **pUserdataDst, void **pUserdataSrc)
 

RtGCondCloneVertexUserdataCallBack Callback for vertex cloning, for example, on unsharing

Parameters:
pUserdataDst  A handle to the userdata for the destination
pUserdataSrc  A handle to the userdata for the source
Returns:
TRUE on success, FALSE otherwise
See also:
RtGCondSetUserdataCallBacks
typedef RwBool(* RtGCondDestroyPolygonUserdataCallBack)(void **pUserdata)
 

RtGCondDestroyPolygonUserdataCallBack Callback for polygon destruction, for example, zero areas

Parameters:
pUserdata  A handle to the userdata
Returns:
TRUE on success, FALSE otherwise
See also:
RtGCondSetUserdataCallBacks
typedef RwBool(* RtGCondDestroyVertexUserdataCallBack)(void **pUserdata)
 

RtGCondDestroyVertexUserdataCallBack is the type for the callback function for vertex destruction, for example, those welded

Parameters:
pUserdata  A handle to the userdata
Returns:
TRUE on success, FALSE otherwise
See also:
RtGCondSetUserdataCallBacks
typedef RwBool(* RtGCondInterpVertexUserdataCallBack)(void **pUserdataDst, void **pUserdata1, void **pUserdata2, RwReal delta)
 

RtGCondInterpVertexUserdataCallBack Callback for vertex interpolation, for example, sliver removal

Parameters:
pUserdataDst  A handle to the userdata for the destination
pUserdata1  A handle to the first source
pUserdata2  A handle to the second source
delta  The delta between the two sources
Returns:
TRUE on success, FALSE otherwise
See also:
RtGCondSetUserdataCallBacks
typedef RwBool(* RtGCondSplitPolygonUserdataCallBack)(void **pUserdataDst, void **pUserdataSrc)
 

RtGCondSplitPolygonUserdataCallBack Callback for polygon division, for example, convex partitioning

Parameters:
pUserdataDst  A handle to the userdata for the destination
pUserdataSrc  A handle to the userdata for the source
Returns:
TRUE on success, FALSE otherwise
See also:
RtGCondSetUserdataCallBacks

Enumeration Type Documentation

enum RtGCondFlag
 

RtGCondFlag

An enumeration of geometry attribute flags.

Enumeration values:
rtGCONDNORMALS  has normals
rtGCONDTEXTURES  has texture coordinates
rtGCONDPRELIT  has luminance values

Function Documentation

void RtGCondAllocateIndices RtGCondPolygon   polygon,
RwInt32    num
 

RtGCondAllocateIndices allocates space for a number of indices of a polygon.

Parameters:
polygon  a pointer to the polygon
num  the number of indices to allocate
See also:
RtGCondReallocateIndices , RtGCondFreeIndices
void RtGCondAllocatePolygons RtGCondGeometryList   geometryList,
RwInt32    num
 

RtGCondAllocatePolygons allocates space for a number of polygons

Parameters:
geometryList  a pointer to the list of geometry
num  the number of polygons to allocate
See also:
RtGCondAllocateVertices , RtGCondFreePolygons
void RtGCondAllocateVertices RtGCondGeometryList   geometryList,
RwInt32    num
 

RtGCondAllocateVertices allocates space for a number of vertices

Parameters:
geometryList  a pointer to the list of geometry
num  the number of vertices to allocate
See also:
RtGCondAllocatePolygons , RtGCondFreeVertices
void RtGCondApplyGeometryConditioningPipeline RtGCondGeometryList   geometryList
 

RtGCondApplyGeometryConditioningPipeline actions the geometry conditioning pipeline set by RtGCondSetGeometryConditioningPipeline.

Parameters:
geometryList  a pointer to the list of geometry
See also:
RtGCondSetGeometryConditioningPipeline , RtGCondGetGeometryConditioningPipeline , RtGCondFixAndFilterGeometryPipeline , RtGCondDecimateAndWeldGeometryPipeline
RwReal RtGCondAreaOfPolygon RtGCondGeometryList   geometryList,
RtGCondPolygon   polygon
 

RtGCondAreaOfPolygon finds the area of a polygon

Parameters:
geometryList  a pointer to the list of geometry containing the polygons
polygon  a pointer to the polygon
Returns:
area of the polygon
See also:
RtGCondCullZeroAreaPolygonsPipelineNode
RwBool RtGCondColinearVertices RwV3d   v1,
RwV3d   v2,
RwV3d   v3,
RwBool    strictOrder
 

RtGCondColinearVertices calculates if the given three vertices are colinear.

Parameters:
v1  pointer to first vertex
v2  pointer to second vertex
v3  pointer to third vertex
strictOrder  TRUE if a---b---c order assumed, FALSE otherwise (e.g. a---c---b)
Returns:
Returns TRUE if colinear, FALSE otherwise.
void RtGCondCullZeroAreaPolygonsPipelineNode RtGCondGeometryList   geometryList,
RwReal    areaThreshold
 

RtGCondCullZeroAreaPolygonsPipelineNode removes all polygons whose area is less than the tolerance (then it remaps).

Note:
This should be treated with respect, since applying the filter to a scene stand-alone could lead to holes appearing in meshes where slivers once stood and if too high, polygons around the tops of fine spheres and cones, for example, can go missing. In the former case weld vertices first, in the latter, make sure the threshold is significantly small, preferably zero.
Parameters:
geometryList  a pointer to the list of geometry containing the polygons
areaThreshold  the area below which polygons are culled
See also:
RtGCondWeldVerticesPipelineNode , RtGCondRemapVerticesPipelineNode , RtGCondAreaOfPolygon , RtGCondRemoveSliversPipelineNode
void RtGCondDecimateAndWeldGeometryPipeline RtGCondGeometryList   geometryList
 

RtGCondDecimateAndWeldGeometryPipeline a provided, custom pipeline used by RenderWare Graphics' RtWorldImport under geometry conditioning. Comprises a number of pipelined tools (welders). Prepares geometry for platform specific conditioning.

Parameters:
geometryList  a pointer to the list of geometry
See also:
RtWingCreate , RtWingEdgeDecimation
void RtGCondFixAndFilterGeometryPipeline RtGCondGeometryList   geometryList
 

RtGCondFixAndFilterGeometryPipeline a provided, custom pipeline used by RenderWare Graphics' RtWorldImport under geometry conditioning. Comprises a number of pipelined tools (filters and fixers). Prepares geometry for polygon welding and platform specific conditioning.

Parameters:
geometryList  a pointer to the list of geometry
See also:
RtGCondCullZeroAreaPolygonsPipelineNode , RtGCondUnshareVerticesOnMaterialBoundariesPipelineNode , RtGCondLimitUVsPipelineNode , RtGCondWeldVerticesPipelineNode
void RtGCondFreeIndices RtGCondPolygon   polygon
 

RtGCondFreeIndices destroys the indices of the given polygon.

Parameters:
polygon  a pointer to the polygon
See also:
RtGCondAllocateIndices
void RtGCondFreePolygons RtGCondGeometryList   geometryList
 

RtGCondFreePolygons destroys the polygons in the geometry list.

Parameters:
geometryList  a pointer to the list of geometry
See also:
RtGCondAllocatePolygons
void RtGCondFreeVertices RtGCondGeometryList   geometryList
 

RtGCondFreeVertices destroys the vertices in the geometry list.

Parameters:
geometryList  a pointer to the list of geometry
See also:
RtGCondAllocateVertices
RtGCondGeometryConditioningPipeline RtGCondGetGeometryConditioningPipeline void   
 

RtGCondGetGeometryConditioningPipeline gets the geometry conditioning pipeline that RtGCondApplyGeometryConditioningPipeline will call.

Returns:
a pointer to the RtGCondGeometryConditioningPipeline
See also:
RtGCondSetGeometryConditioningPipeline , RtGCondApplyGeometryConditioningPipeline , RtGCondFixAndFilterGeometryPipeline , RtGCondDecimateAndWeldGeometryPipeline
RwReal RtGCondLength RwV3d   vec
 

RtGCondLength returns the length of given vector to high precision (using the sqrt function), succeeds even if the vector is zero length.

Parameters:
vec  A pointer to a vector
Returns:
The length of the vector
void RtGCondLimitUVsPipelineNode RtGCondGeometryList   geometryList,
RwReal    limitUVMin,
RwReal    limitUVMax
 

RtGCondLimitUVsPipelineNode shifts uvs values into the interval between the given minimum and maximum values. It tries to preserve continuity if possible.

Note:
If the uv range of any polygon is greater than the interval, the filter will obviously fail.
Parameters:
geometryList  a pointer to the list of geometry
limitUVMin  minimum allowable uv value
limitUVMax  maximum allowable uv value
See also:
RtGCondFixAndFilterGeometryPipeline
void RtGCondNormalize RwV3d   vec
 

RtGCondNormalize normalizes a given vector to high precision (using the sqrt function). It also has useful asserts.

Parameters:
vec  A pointer to a vector requiring normalizing
See also:
RtGCondColinearVertices
RtGCondParameters* RtGCondParametersGet void   
 

RtGCondParametersGet is used to get a list of geometry conditioning parameters used by the provided geometry conditioning pipelines.

Returns:
a pointer to RtGCondParameters
See also:
RtGCondParametersSet , RtGCondParametersInit , RtGCondFixAndFilterGeometryPipeline
void RtGCondParametersInit RtGCondParameters   gcParams
 

RtGCondParametersInit is used to initialize a list of geometry conditioning parameters used by the provided geometry conditioning pipelines.

Parameters:
gcParams  a pointer to RtGCondParameters
See also:
RtGCondParametersSet , RtGCondParametersGet , RtGCondFixAndFilterGeometryPipeline
void RtGCondParametersSet RtGCondParameters   gcParams
 

RtGCondParametersSet is used to set up a list of geometry conditioning parameters used by the provided geometry conditioning pipelines.

Parameters:
gcParams  a pointer to RtGCondParameters
See also:
RtGCondParametersGet , RtGCondParametersInit , RtGCondFixAndFilterGeometryPipeline
void RtGCondReallocateIndices RtGCondPolygon   polygon,
RwInt32    num
 

RtGCondReallocateIndices reallocates space for a number of indices of a polygon.

Parameters:
polygon  a pointer to the polygon
num  the number of indices to allocate
See also:
RtGCondAllocateIndices
void RtGCondReallocatePolygons RtGCondGeometryList   geometryList,
RwInt32    num
 

RtGCondReallocatePolygons reallocates space for a number of polygons.

Parameters:
geometryList  a pointer to the list of geometry
num  the number of polygons to reallocate
See also:
RtGCondReallocateIndices , RtGCondReallocateVertices , RtGCondAllocatePolygons
void RtGCondReallocateVertices RtGCondGeometryList   geometryList,
RwInt32    num
 

RtGCondReallocateVertices reallocates space for a number of vertices.

Parameters:
geometryList  a pointer to the list of geometry
num  the number of vertices to reallocate
See also:
RtGCondReallocateIndices , RtGCondReallocatePolygons , RtGCondAllocateVertices
void RtGCondRemapVerticesPipelineNode RtGCondGeometryList   geometryList
 

RtGCondRemapVerticesPipelineNode cross-references polygon indices with vertices, if there are any vertices which are not references they are removed, and the entire lists is shifted before the polygon indices are remapped.

Parameters:
geometryList  a pointer to the list of geometry
See also:
RtGCondCullZeroAreaPolygonsPipelineNode , RtGCondRemoveSliversPipelineNode
void RtGCondRemoveIdenticalPolygonsPipelineNode RtGCondGeometryList   geometryList
 

RtGCondRemoveIdenticalPolygonsPipelineNode removes all but one polygon that occupies the exactly same space and has the same material as another - this leads to bad welding and z-fighting, and ideally should not be in the geometry in the first place.

Parameters:
geometryList  a pointer to the list of geometry
See also:
RtGCondCullZeroAreaPolygonsPipelineNode , RtGCondUnshareVerticesOnMaterialBoundariesPipelineNode , RtGCondLimitUVsPipelineNode , RtGCondWeldVerticesPipelineNode
void RtGCondRemoveSliversPipelineNode RtGCondGeometryList   geometryList
 

RtGCondRemoveSliversPipelineNode removes slivers and faces with fewer than three vertices. Subsequently, it remaps removing any unused vertices.

Parameters:
geometryList  a pointer to the list of geometry
See also:
RtGCondCullZeroAreaPolygonsPipelineNode , RtGCondUnshareVerticesOnMaterialBoundariesPipelineNode , RtGCondLimitUVsPipelineNode , RtGCondWeldVerticesPipelineNode
void RtGCondSetGeometryConditioningPipeline RtGCondGeometryConditioningPipeline    pipeline
 

RtGCondSetGeometryConditioningPipeline sets the geometry conditioning pipeline that RtGCondApplyGeometryConditioningPipeline will call.

Parameters:
pipeline  a pointer to a predefined RtGCondGeometryConditioningPipeline
See also:
RtGCondGetGeometryConditioningPipeline , RtGCondApplyGeometryConditioningPipeline , RtGCondFixAndFilterGeometryPipeline , RtGCondDecimateAndWeldGeometryPipeline
void RtGCondSetUserdataCallBacks RtGCondCloneVertexUserdataCallBack    cloneVertexUserdataCB,
RtGCondInterpVertexUserdataCallBack    interpVertexUserdataCB,
RtGCondSplitPolygonUserdataCallBack    splitPolygonUserdataCB,
RtGCondDestroyVertexUserdataCallBack    destroyVertexUserdataCB,
RtGCondDestroyPolygonUserdataCallBack    destroyPolygonUserdataCB
 

RtGCondSetUserdataCallBacks sets user callbacks which are called when cloning, interpolation, splitting and destroying operation are processed.

Parameters:
cloneVertexUserdataCB  the callback for cloning
interpVertexUserdataCB  the callback for interpolating
splitPolygonUserdataCB  the callback for splitting
destroyVertexUserdataCB  the callback for destroying vertices
destroyPolygonUserdataCB  the callback for destroying polygons
void RtGCondSnapPipelineNode RtGCondGeometryList   geometryList,
RwReal    weldThreshold
 

RtGCondSnapPipelineNode snaps the given vertices to a grid.

Note:
This should only be used if the side effects are appreciated - such as a voxelized geometry appearance if the tolerance too high.
RtGCondWeldVerticesPipelineNode should be used for welding near-by neighbors
Parameters:
geometryList  a pointer to the list of geometry to be snapped
weldThreshold  the effective grid resolution
See also:
RtGCondWeldVerticesPipelineNode , RtGCondSnapUVsPipelineNode
void RtGCondSnapUVsPipelineNode RtGCondGeometryList   geometryList,
RwReal    weldThreshold
 

RtGCondSnapUVsPipelineNode snaps the given vertex uv's to a grid. RtGCondWeldVerticesPipelineNode should be used for welding near-by vertices with similar uvs.

Parameters:
geometryList  a pointer to the list of geometry to be snapped
weldThreshold  the effective grid resolution
See also:
RtGCondWeldVerticesPipelineNode , RtGCondSnapPipelineNode
void RtGCondSortVerticesOnMaterialPipelineNode RtGCondGeometryList   geometryList
 

RtGCondSortVerticesOnMaterialPipelineNode makes sure the vertex list is ordered by material.

Parameters:
geometryList  a pointer to the list of geometry
void RtGCondUnshareVerticesOnMaterialBoundariesPipelineNode RtGCondGeometryList   geometryList
 

RtGCondUnshareVerticesOnMaterialBoundariesPipelineNode ensures that vertices are not shared between two polygons which have different materials

Parameters:
geometryList  a pointer to the list of geometry
See also:
RtGCondUnshareVerticesPipelineNode
void RtGCondUnshareVerticesPipelineNode RtGCondGeometryList   geometryList
 

RtGCondUnshareVerticesPipelineNode ensures that no vertices are not shared between multiple polygons

Parameters:
geometryList  a pointer to the list of geometry
See also:
RtGCondUnshareVerticesOnMaterialBoundariesPipelineNode
RwBool RtGCondVectorsEqual RwV3d   v1,
RwV3d   v2,
RwReal    tol
 

RtGCondVectorsEqual compares two vectors to see if they match orthogonally within the tolerance.

Parameters:
v1  pointer to first vector
v2  pointer to second vector
tol  tolerance
Returns:
Returns TRUE if matching, FALSE otherwise.
RwInt32* RtGCondWeldVerticesPipelineNode RtGCondGeometryList   geometryList,
RwReal    weldThreshold,
RwReal    normalWeldThreshold,
RwReal    uvThreshold,
RwReal    preLitThreshold,
RwBool    ignoreMaterials,
RwBool    remap,
RwBool    implicit,
RwBool    averageAttributes
 

RtGCondWeldVerticesPipelineNode clusters all nearby vertices that share near identical normal, uv and preLights, and welds them into a single vertex - then remaps the polygons.

Note:
This function does exactly what it says - this is NOT a mesh decimator and should not be used as one! The weldThreshold must be smaller than the smallest triangle (in its smallest dimension), otherwise the algorithm cannot be guaranteed to be correct, and it might lead to holes, tucks and other topological oddities that will affect such things as PVS not to mention the appearance of the objects in the scene!
Parameters:
geometryList  a pointer to the list of geometry
weldThreshold  the positional threshold in 3-space
normalWeldThreshold  the normal threshold in degrees
uvThreshold  the UV threshold in uv-units
preLitThreshold  the prelight threshold in range 0..1, r, g b and a are all checked against this single value
ignoreMaterials  FALSE by default. Set it to true for non-aesthetic welding, such as collision worlds.
remap  TRUE if remapping required, FALSE otherwise. TRUE by default.
implicit  TRUE if the function should only calculate remap information only without any action, FALSE otherwise. FALSE by default.
averageAttributes  TRUE if the attributes (normals, uvs, prelights) are to be averaged.
Note:
postitions are averaged by default if implicit parameter is FALSE.
Returns:
remap information, (an index to index map). This is of use if implict is TRUE.
See also:
RtGCondRemapVerticesPipelineNode

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