Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RtWorld
[Basic Geometry]


Functions

RpGeometry RtGeometryCalculateVertexNormals (RpGeometry *geometry)
RpAtomic RtAtomicOptimize (RpAtomic *atomic, RwReal dist)
RpClump RtClumpOptimize (RpClump *clump, RwReal dist)
RwInt32  RtWorldGetNumWorldSectors (RpWorld *world)
RwInt32  RtWorldGetNumVertices (RpWorld *world)
RwInt32  RtWorldGetNumPolygons (RpWorld *world)
RpMaterial RtWorldFindMaterialWithTextureName (RpWorld *world, RwChar *name)
RwInt32  RtWorldFindMaterialNum (RpWorld *world, RpMaterial *material)

Detailed Description

World Import Toolkit for RenderWare.

RtWorld Toolkit Overview

Requirements

Overview

Provides the following functionality in addition to that already contained within the RpWorld plugin:

Function Documentation

RpAtomic* RtAtomicOptimize RpAtomic   atomic,
RwReal    dist
 

RtAtomicOptimize is used to optimize the specified atomic for rendering by eliminating duplicated materials in the atomic’s geometry. It also searches the atomic’s geometry for vertices that are within the given distance of each other and replaces them with a single vertex. Their normals must also be within the given tolerance for the replacement to occur. This function may be used to eliminate vertices from the geometry that are considered coincident within the specified tolerance.

Note that only vertices that have the same pre-light color and texture coordinates can be replaced with a single vertex. Also, if there is more than one morph target within the geometry, the position and normal of a specific vertex must be within the specified tolerance over all morph targets for this optimization to be performed.

The world plugin must be attached before using this function. The include file rtworld.h and the library file rtworld.lib are also required.

Parameters:
atomic  Pointer to the atomic.
dist  A RwReal value equal to the tolerance.
Returns:
Returns a pointer to the atomic if successful or NULL if there is an error.
See also:
RtClumpOptimize , RpWorldPluginAttach
RpClump* RtClumpOptimize RpClump   clump,
RwReal    dist
 

RtClumpOptimize is used to optimize the specified clump for rendering by eliminating duplicated materials in geometry referenced by each atomic constituting the clump. It also searches the geometry for vertices that are within the given distance of each other and replaces them with a single vertex. Their normals must also be within the given tolerance for the replacement to occur. This function may be used to eliminate vertices from the geometry that are considered coincident within the specified tolerance.

Note that only vertices that have the same pre-light color and texture coordinates can be replaced with a single vertex. Also, if there is more than one morph target within the geometry, the position and normal of a specific vertex must be within the specified tolerance over all morph targets for this optimization to be performed.

The world plugin must be attached before using this function. The include file rtworld.h and the library file rtworld.lib are also required.

Parameters:
clump  Pointer to the clump.
dist  A RwReal value equal to the tolerance.
Returns:
Returns pointer to the clump if successful or NULL if there is an error.
See also:
RtAtomicOptimize , RpWorldPluginAttach
RpGeometry* RtGeometryCalculateVertexNormals RpGeometry   geometry
 

RtGeometryCalculateVertexNormals is used to calculate a normal vector for each vertex defining the specified geometry. The geometry must have been created with the rpGEOMETRYNORMALS flag so that the data array holding the vertex normals is available.

A vertex normal is calculated by averaging the face normals of all connecting polygons that share the vertex, weighted by the angle of each polygon at the vertex. If the vertex is not shared a normal equal to the face normal is used. The resulting vertex normals are of unit length.

The geometry is unlocked after the vertex normals have been calculated.

The world plugin must be attached before using this function. The include file rtworld.h and the library file rtworld.lib are also required.

Parameters:
geometry  Pointer to the geometry.
Returns:
pointer to the geometry if successful or NULL if there is an error.
See also:
RpGeometryCreate , RpWorldPluginAttach
RwInt32 RtWorldFindMaterialNum RpWorld   world,
RpMaterial   material
 

RtWorldFindMaterialNum is used to retrieve the index of the specified material (used by static geometry) in the given world. The index is into the world’s material list.

The world plugin must be attached before using this function. The include file rtworld.h and the library file rtworld.lib are also required to use this function.

Parameters:
world  Pointer to the world.
material  Pointer to the material.
Returns:
Returns a RwInt32 value equal to the index of the material if successful or -1 if there is an error.
See also:
RtWorldFindMaterialWithTextureName , RtWorldGetNumPolygons , RtWorldGetNumVertices , RtWorldGetNumWorldSectors , RpWorldPluginAttach
RpMaterial* RtWorldFindMaterialWithTextureName RpWorld   world,
RwChar   name
 

RtWorldFindMaterialWithTextureName is used to find a material in the specified world’s material list (static geometry only) that references a texture with the given name.

The world plugin must be attached before using this function. The include file rtworld.h and the library file rtworld.lib are also required to use this function.

Parameters:
world  Pointer to the world.
name  Pointer to a string containing the name of the texture.
Returns:
Returns a pointer to the material if successful or NULL if there is an error.
See also:
RtWorldFindMaterialNum , RtWorldGetNumPolygons , RtWorldGetNumVertices , RtWorldGetNumWorldSectors , RpWorldPluginAttach
RwInt32 RtWorldGetNumPolygons RpWorld   world
 

RtWorldGetNumPolygons is used to retrieve the number of polygons constituting all static geometry in the specified world. Polygons which are not used by static geometry are not counted.

The world plugin must be attached before using this function. The include file rtworld.h and the library file rtworld.lib are also required to use this function.

Parameters:
world  Pointer to the world.
Returns:
Returns a RwInt32 value equal to the number of polygons if successful or -1 if there is an error.
See also:
RtWorldFindMaterialNum , RtWorldFindMaterialWithTextureName , RtWorldGetNumVertices , RtWorldGetNumWorldSectors , RpWorldPluginAttach
RwInt32 RtWorldGetNumVertices RpWorld   world
 

RtWorldGetNumVertices is used to retrieve the number of vertices constituting all static geometry in the specified world. Vertices which are not used by static geometry are not counted.

The world plugin must be attached before using this function. The include file rtworld.h and the library file rtworld.lib are also required to use this function.

Parameters:
world  Pointer to the world.
Returns:
Returns a RwInt32 value equal to the number of vertices if successful or -1 if there is an error.
See also:
RtWorldFindMaterialNum , RtWorldFindMaterialWithTextureName , RtWorldGetNumPolygons , RtWorldGetNumWorldSectors , RpWorldPluginAttach
RwInt32 RtWorldGetNumWorldSectors RpWorld   world
 

RtWorldGetNumWorldSectors is used to retrieve the number of world sectors constituting all static geometry in the specified world.

The world plugin must be attached before using this function. The include file rtworld.h and the library file rtworld.lib are also required to use this function.

Parameters:
world  Pointer to the world.
Returns:
Returns a RwInt32 value equal to the number of world sectors if successful or -1 if there is an error.
See also:
RtWorldFindMaterialNum , RtWorldFindMaterialWithTextureName , RtWorldGetNumPolygons , RtWorldGetNumVertices , RpWorldPluginAttach

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