Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RpLODAtomic
[Scene Management]


Functions

void  RpLODAtomicCacheSetFreeListCreateParams (RwInt32 blockSize, RwInt32 numBlocksToPrealloc)
RwBool  RpLODAtomicPluginAttach (void)
RpAtomic RpLODAtomicSetGeometry (RpAtomic *atomic, RwInt32 lodIdx, RpGeometry *geometry)
RpGeometry RpLODAtomicGetGeometry (RpAtomic *atomic, RwInt32 lodIdx)
RpAtomic RpLODAtomicSetCurrentLOD (RpAtomic *atomic, RwInt32 lodIdx)
RwInt32  RpLODAtomicGetCurrentLOD (RpAtomic *atomic)
RpAtomic RpLODAtomicSetRange (RpAtomic *atomic, RwReal farRange)
RwReal  RpLODAtomicGetRange (RpAtomic *atomic)
void  RpLODAtomicSetCamera (RwCamera *camera)
RpAtomic RpLODAtomicSetLODCallBack (RpAtomic *atomic, RpLODAtomicLODCallBack callback)
RpAtomic RpLODAtomicSelectLOD (RpAtomic *atomic)
RpAtomic RpLODAtomicForAllLODGeometries (RpAtomic *atomic, RpGeometryCallBack callback, void *pData)
RpAtomic RpLODAtomicHookRender (RpAtomic *atomic)
RpAtomic RpLODAtomicUnHookRender (RpAtomic *atomic)

Detailed Description

Level of Detail Management Plugin for RenderWare Graphics.

RpLODAtomic Plugin Overview

Requirements

Overview

This plugin provides high-level support for LOD management in your models and extends RenderWare Graphics by providing dynamic level-of-detail support for the RpAtomic datatype exposed by RpWorld.

LOD management is linked to individual RpAtomic datatypes. The process is usually as follows:

The RpLODAtomic plugin will then take care of switching between the different RpGeometry objects for the atomic.

Function Documentation

void RpLODAtomicCacheSetFreeListCreateParams RwInt32    blockSize,
RwInt32    numBlocksToPrealloc
 

RpLODAtomicCacheSetFreeListCreateParams allows the developer to specify how many RpLODAtomicCache s to preallocate space for. Call before RwEngineInit.

Parameters:
blockSize  number of entries per freelist block.
numBlocksToPrealloc  number of blocks to allocate on RwFreeListCreateAndPreallocateSpace.
See also:
RwFreeList
RpAtomic* RpLODAtomicForAllLODGeometries RpAtomic   atomic,
RpGeometryCallBack    callback,
void *    pData
 

RpLODAtomicForAllLODGeometries applies the callback to all LOD in the atomic.

Parameters:
atomic  The LOD atomic
callback  The callback function.
pData  Application private data.
Returns:
The atomic if successful. NULL otherwise.
See also:
RpLODAtomicGetCurrentLOD , RpLODAtomicGetGeometry , RpLODAtomicGetRange , RpLODAtomicHookRender , RpLODAtomicPluginAttach , RpLODAtomicSelectLOD , RpLODAtomicSetCamera , RpLODAtomicSetCurrentLOD , RpLODAtomicSetGeometry , RpLODAtomicSetLODCallBack , RpLODAtomicSetRange , RpLODAtomicUnHookRender
RwInt32 RpLODAtomicGetCurrentLOD RpAtomic   atomic
 

RpLODAtomicGetCurrentLOD gets the current LOD.

Parameters:
atomic  The LOD's atomic.
Returns:
The LOD if successful, -1 otherwise.
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetGeometry , RpLODAtomicGetRange , RpLODAtomicHookRender , RpLODAtomicPluginAttach , RpLODAtomicSelectLOD , RpLODAtomicSetCamera , RpLODAtomicSetCurrentLOD , RpLODAtomicSetGeometry , RpLODAtomicSetLODCallBack , RpLODAtomicSetRange , RpLODAtomicUnHookRender
RpGeometry* RpLODAtomicGetGeometry RpAtomic   atomic,
RwInt32    lodIdx
 

RpLODAtomicGetGeometry is used to retrieve the LOD geometry in the specified atomic that is indexed with the given value.

The index of the highest LOD geometry is zero (this is the base geometry). The maximum number of possible levels is 10 (indices 0 to 9)

The LOD plugin must be attached before using this function.

Parameters:
atomic  The LOD's atomic.
lodIdx  LOD level.
Returns:
The geometry if successful, NULL otherwise.
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetCurrentLOD , RpLODAtomicGetRange , RpLODAtomicHookRender , RpLODAtomicPluginAttach , RpLODAtomicSelectLOD , RpLODAtomicSetCamera , RpLODAtomicSetCurrentLOD , RpLODAtomicSetGeometry , RpLODAtomicSetLODCallBack , RpLODAtomicSetRange , RpLODAtomicUnHookRender
RwReal RpLODAtomicGetRange RpAtomic   atomic
 

RpLODAtomicGetRange gets the far range

Parameters:
atomic  The LOD's atomic.
Returns:
The far range if successful, -1 otherwise.
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetCurrentLOD , RpLODAtomicGetGeometry , RpLODAtomicHookRender , RpLODAtomicPluginAttach , RpLODAtomicSelectLOD , RpLODAtomicSetCamera , RpLODAtomicSetCurrentLOD , RpLODAtomicSetGeometry , RpLODAtomicSetLODCallBack , RpLODAtomicSetRange , RpLODAtomicUnHookRender
RpAtomic* RpLODAtomicHookRender RpAtomic   atomic
 

RpLODAtomicHookRender hooks into the atomic's callback. This effectively enables the LOD.

Parameters:
atomic  The LOD atomic
Returns:
The atomic if successful. NULL otherwise.
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetCurrentLOD , RpLODAtomicGetGeometry , RpLODAtomicGetRange , RpLODAtomicPluginAttach , RpLODAtomicSelectLOD , RpLODAtomicSetCamera , RpLODAtomicSetCurrentLOD , RpLODAtomicSetGeometry , RpLODAtomicSetLODCallBack , RpLODAtomicSetRange , RpLODAtomicUnHookRender
RwBool RpLODAtomicPluginAttach void   
 

RpLODAtomicPluginAttach is used to attach the LOD plugin to the RenderWare system to enable the use of level-of-detail modelling for atomics. The LOD plugin must be attached between initializing the system with RwEngineInit and opening it with RwEngineOpen.

Note that the include file rplodatm.h is required and must be included by an application wishing to use this plugin. The LOD plugin library is contained in the file rplodatm.lib.

Returns:
True on success, false otherwise
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetCurrentLOD , RpLODAtomicGetGeometry , RpLODAtomicGetRange , RpLODAtomicHookRender , RpLODAtomicSelectLOD , RpLODAtomicSetCamera , RpLODAtomicSetCurrentLOD , RpLODAtomicSetGeometry , RpLODAtomicSetLODCallBack , RpLODAtomicSetRange , RpLODAtomicUnHookRender
RpAtomic* RpLODAtomicSelectLOD RpAtomic   atomic
 

RpLODAtomicSelectLOD applies the select LOD callback to set the current geometry without rendering.

Parameters:
atomic  The LOD atomic
Returns:
The atomic if successful. NULL otherwise.
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetCurrentLOD , RpLODAtomicGetGeometry , RpLODAtomicGetRange , RpLODAtomicHookRender , RpLODAtomicPluginAttach , RpLODAtomicSetCamera , RpLODAtomicSetCurrentLOD , RpLODAtomicSetGeometry , RpLODAtomicSetLODCallBack , RpLODAtomicSetRange , RpLODAtomicUnHookRender
void RpLODAtomicSetCamera RwCamera   camera
 

RpLODAtomicSetCamera is used to register the specified camera as the one for determining the range of an atomic and, therefore, the LOD geometry that is used for rendering. Usually, this camera is the same one that is used for rendering LOD atomics. This camera is used for selecting LOD based on the distance of object from the viewer.

The LOD plugin must be attached before using this function.

Parameters:
camera  The LOD's camera.
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetCurrentLOD , RpLODAtomicGetGeometry , RpLODAtomicGetRange , RpLODAtomicHookRender , RpLODAtomicPluginAttach , RpLODAtomicSelectLOD , RpLODAtomicSetCurrentLOD , RpLODAtomicSetGeometry , RpLODAtomicSetLODCallBack , RpLODAtomicSetRange , RpLODAtomicUnHookRender
RpAtomic* RpLODAtomicSetCurrentLOD RpAtomic   atomic,
RwInt32    lodIdx
 

RpLODAtomicSetCurrentLOD sets the LOD for the atomic.

Parameters:
atomic  The LOD's atomic.
lodIdx  LOD level.
Returns:
The atomic if successful, NULL otherwise.
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetCurrentLOD , RpLODAtomicGetGeometry , RpLODAtomicGetRange , RpLODAtomicHookRender , RpLODAtomicPluginAttach , RpLODAtomicSelectLOD , RpLODAtomicSetCamera , RpLODAtomicSetGeometry , RpLODAtomicSetLODCallBack , RpLODAtomicSetRange , RpLODAtomicUnHookRender
RpAtomic* RpLODAtomicSetGeometry RpAtomic   atomic,
RwInt32    lodIdx,
RpGeometry   lodGeom
 

RpLODAtomicSetGeometry is used to define the LOD geometry for the specified atomic.

The index of the highest LOD geometry is zero (this is the base geometry). The maximum number of possible levels is 10 (indices 0 to 9). If the LOD geometry for the given index already exists, it is first destroyed before the new one is registered. For each LOD level, the default geometry is NULL, which is an allowed value; for any levels with NULL geometry the atomic is not rendered.

The LOD plugin must be attached before using this function.

Parameters:
atomic  The LOD's atomic.
lodIdx  LOD level.
lodGeom  Geometry for this LOD.
Returns:
The atomic if successful, NULL otherwise.
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetCurrentLOD , RpLODAtomicGetGeometry , RpLODAtomicGetRange , RpLODAtomicHookRender , RpLODAtomicPluginAttach , RpLODAtomicSelectLOD , RpLODAtomicSetCamera , RpLODAtomicSetCurrentLOD , RpLODAtomicSetLODCallBack , RpLODAtomicSetRange , RpLODAtomicUnHookRender
RpAtomic* RpLODAtomicSetLODCallBack RpAtomic   atomic,
RpLODAtomicLODCallBack    callback
 

RpLODAtomicSetLODCallBack is used to define a callback function that determines which LOD geometry should be used to render the specified atomic.

A default callback is defined for all atomics that calculates the LOD level using linear interpolation between zero and the LOD far range. For distances beyond the far range the lowest LOD geometry is used for rendering the atomic.

The format of the callback function is:

RwInt32 (*RpLODAtomicLODCallBack) (RpAtoimc *atomic);

where the return value is the index of the LOD geometry.

The LOD plugin must be attached before using this function.

Parameters:
atomic  The LOD atomic
callback  The callback function.
Returns:
The atomic if successful. NULL otherwise.
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetCurrentLOD , RpLODAtomicGetGeometry , RpLODAtomicGetRange , RpLODAtomicHookRender , RpLODAtomicPluginAttach , RpLODAtomicSelectLOD , RpLODAtomicSetCamera , RpLODAtomicSetCurrentLOD , RpLODAtomicSetGeometry , RpLODAtomicSetRange , RpLODAtomicUnHookRender
RpAtomic* RpLODAtomicSetRange RpAtomic   atomic,
RwReal    farRange
 

RpLODAtomicSetRange RpLODAtomicSetRange is used to define the range from the camera over which LOD switching for the specified atomic takes place.

The range is used by the atomic's default LOD callback to determine which LOD geometry should be used to render the atomic, given the distance of the atomic from the camera. The default LOD callback calculates the LOD level using linear interpolation between zero and the far range. For distances beyond the far range only the lowest LOD geometry is used for rendering the atomic.

The LOD plugin must be attached before using this function.

Parameters:
atomic  The LOD's atomic.
farRange  Maximum Range of the LODs.
Returns:
The atomic if successful, NULL otherwise.
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetCurrentLOD , RpLODAtomicGetGeometry , RpLODAtomicGetRange , RpLODAtomicHookRender , RpLODAtomicPluginAttach , RpLODAtomicSelectLOD , RpLODAtomicSetCamera , RpLODAtomicSetCurrentLOD , RpLODAtomicSetGeometry , RpLODAtomicSetLODCallBack , RpLODAtomicUnHookRender
RpAtomic* RpLODAtomicUnHookRender RpAtomic   atomic
 

RpLODAtomicUnHookRender unhooks into the atomic's callback. This effectively disable the LOD.

Parameters:
atomic  The LOD atomic
Returns:
The atomic if successful. NULL otherwise.
See also:
RpLODAtomicForAllLODGeometries , RpLODAtomicGetCurrentLOD , RpLODAtomicGetGeometry , RpLODAtomicGetRange , RpLODAtomicHookRender , RpLODAtomicPluginAttach , RpLODAtomicSelectLOD , RpLODAtomicSetCamera , RpLODAtomicSetCurrentLOD , RpLODAtomicSetGeometry , RpLODAtomicSetLODCallBack , RpLODAtomicSetRange

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