Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RpAtomic
[Basic Geometry]


Modules

PlayStation 2

Data Structures

struct   RpAtomic
struct   RpTie

Typedefs

typedef RpAtomic *(*  RpAtomicCallBackRender )(RpAtomic *atomic)
typedef RpAtomic *(*  RpAtomicCallBack )(RpAtomic *atomic, void *data)

Enumerations

enum   RpAtomicFlag { rpATOMICCOLLISIONTEST = 0x01, rpATOMICRENDER = 0x04, rpATOMICFLAGFORCEENUMSIZEINT = RWFORCEENUMSIZEINT }
enum   RpAtomicSetGeomFlag { rpATOMICSAMEBOUNDINGSPHERE = 0x01, rpATOMICSETGEOMFLAGFORCEENUMSIZEINT = RWFORCEENUMSIZEINT }

Functions

const RwSphere RpAtomicGetWorldBoundingSphere (RpAtomic *atomic)
void  RpAtomicSetFreeListCreateParams (RwInt32 blockSize, RwInt32 numBlocksToPrealloc)
RpAtomic RpAtomicRender (RpAtomic *atomic)
RpAtomic RpAtomicCreate (void)
RpAtomic RpAtomicSetGeometry (RpAtomic *atomic, RpGeometry *geometry, RwUInt32 flags)
RpGeometry RpAtomicGetGeometry (const RpAtomic *atomic)
RwBool  RpAtomicDestroy (RpAtomic *atomic)
void  RpAtomicSetRenderCallBack (RpAtomic *atomic, RpAtomicCallBackRender callback)
RpAtomicCallBackRender  RpAtomicGetRenderCallBack (const RpAtomic *atomic)
RpInterpolator RpAtomicGetInterpolator (RpAtomic *atomic)
RpClump RpAtomicGetClump (const RpAtomic *atomic)
RwSphere RpAtomicGetBoundingSphere (RpAtomic *atomic)
RpAtomic RpAtomicClone (RpAtomic *atomic)
RwUInt32  RpAtomicStreamGetSize (RpAtomic *atomic)
RpAtomic RpAtomicStreamWrite (RpAtomic *atomic, RwStream *stream)
RpAtomic RpAtomicStreamRead (RwStream *stream)
RwInt32  RpAtomicRegisterPlugin (RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor constructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB)
RwInt32  RpAtomicRegisterPluginStream (RwUInt32 pluginID, RwPluginDataChunkReadCallBack readCB, RwPluginDataChunkWriteCallBack writeCB, RwPluginDataChunkGetSizeCallBack getSizeCB)
RwInt32  RpAtomicSetStreamAlwaysCallBack (RwUInt32 pluginID, RwPluginDataChunkAlwaysCallBack alwaysCB)
RwInt32  RpAtomicSetStreamRightsCallBack (RwUInt32 pluginID, RwPluginDataChunkRightsCallBack rightsCB)
RwInt32  RpAtomicGetPluginOffset (RwUInt32 pluginID)
RwBool  RpAtomicValidatePlugins (const RpAtomic *atomic)
RwFrame RpAtomicGetFrame (const RpAtomic *atomic)
RpAtomic RpAtomicSetFrame (RpAtomic *atomic, RwFrame *frame)
RpAtomic RpAtomicSetFlags (RpAtomic *atomic, RwUInt32 flags)
RwUInt32  RpAtomicGetFlags (const RpAtomic *atomic)
RwBool  RpAtomicInstance (RpAtomic *atomic)
RpWorld RpAtomicGetWorld (const RpAtomic *atomic)
RpAtomic RpAtomicForAllWorldSectors (RpAtomic *atomic, RpWorldSectorCallBack callback, void *data)
RxPipeline RpAtomicSetDefaultPipeline (RxPipeline *pipeline)
RxPipeline RpAtomicGetDefaultPipeline (void)
RpAtomic RpAtomicSetPipeline (RpAtomic *atomic, RxPipeline *pipeline)
const RpAtomic RpAtomicGetPipeline (const RpAtomic *const atomic, RxPipeline **pipeline)

Detailed Description

Atomics

RpAtomic Overview

Requirements

Overview

Atomics are container objects for Geometry and Frame objects. Complex models are often built up of sections grouped into a hierarchy and Atomics provide the necessary linkage with Frame RwFrame objects to enable this. When used in this way, related Atomics are usually grouped together by adding them to a Clump RpClump object for convenience, although this is not mandatory. Atomics contain a reference to a Geometry RpGeometry , which holds the actual model data. In addition, a reference to a Frame can be added; indeed, this is required if the Atomic is to be rendered as it cannot be positioned without one.

Further information is available in the Dynamic Models chapter of the User Guide.


Typedef Documentation

typedef RpAtomic*(* RpAtomicCallBack)(RpAtomic * atomic, void *data)
 

RpAtomicCallBack represents the function called from RpWorldSectorForAllAtomics and RpClumpForAllAtomics for all atomics in a given world sector or clump. This function should return a pointer to the current atomic to indicate success. The callback may return NULL to terminate further callbacks on the world sector.

Parameters:
atomic  Pointer to the current atomic, supplied by iterator.
data  Pointer to developer-defined data structure.
Returns:
Returns a pointer to the current atomic
typedef RpAtomic*(* RpAtomicCallBackRender)(RpAtomic * atomic)
 

RpAtomicCallBackRender represents the function called from RpAtomicRender when the specified atomic lies inside the current camera's view frustum. The default callback initiates execution of the atomic rendering pipeline. This function should return a pointer to the atomic to indicate success.

Parameters:
atomic  Pointer to the current atomic, supplied by iterator.
Returns:
Returns a pointer to the atomic to indicate success.
See also:
RpAtomicRender

Enumeration Type Documentation

enum RpAtomicFlag
 

The bit-field type RpAtomicFlag specifies the options available for controlling the behavior of atomics. See API function RpAtomicSetFlags.

See also:
RpAtomicSetFlags , RpAtomicGetFlags , RpWorldSectorForAllCollisionAtomics
Enumeration values:
rpATOMICCOLLISIONTEST  A generic collision flag to indicate that the atomic should be considered in collision tests.
rpATOMICRENDER  The atomic is rendered if it is in the view frustum.
enum RpAtomicSetGeomFlag
 

RpAtomicSetGeomFlag defines how an atomic references a new geometry

See also:
RpAtomicSetGeometry
Enumeration values:
rpATOMICSAMEBOUNDINGSPHERE  The bounding-sphere for the new geometry is assumed to be the same as the old one, if any, and should not be recalculated.

Function Documentation

RpAtomic* RpAtomicClone RpAtomic   atomic
 

RpAtomicClone is used to duplicate the specified atomic. This function creates and initializes a new atomic.

This function will copy the original atomic's flags, interpolator, bounding sphere, render callback function, referenced geometry and pipeline to the new one. If there are any plugins registered with the atomic then the associated plugin data is also copied to the new atomic using the registered copy constructor function. Note that the new atomic is created without a frame.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to the atomic.
Returns:
Returns pointer to the new atomic if successful or NULL if there is an error.
See also:
RpAtomicCreate , RpAtomicSetFrame , RpClumpClone , RwFrameCloneHierarchy , RpAtomicRegisterPlugin , RpWorldPluginAttach
RpAtomic* RpAtomicCreate void   
 

RpAtomicCreate is used to create and initialize a new atomic. An atomic can be thought of as an instance of geometry which defines the atomic's physical structure. The geometry may hold one or more morph targets each containing vertex position and vertex normal data. The atomic's structure in any one instance is defined by its interpolator which linearly blends the morph target data according to the current interpolator value and scale. If only one morph target is defined the atomic's structure is defined solely by that morph target. The interpolator for a newly created atomic is set such that the start and end morph targets point to the first morph target in the atomic's geometry and the interpolator's value and scale are zero and one, respectively.

Before the atomic can be used in any rendering it must be attached to a frame and added to a world (unless it is part of a clump, then adding the clump to the world will suffice). The frame enables the atomic to be positioned and oriented within the world. The frame may also be attached to an existing frame hierarchy containing other atomics grouped together into an articulated clump.

The world plugin must be attached before using this function.

Returns:
Returns a pointer to the new atomic if successful or NULL if there is an error.
See also:
RpAtomicClone , RpAtomicSetGeometry , RpAtomicGetGeometry , RpAtomicSetFrame , RpAtomicGetFrame , RpAtomicGetInterpolator , RpAtomicGetBoundingSphere , RpAtomicSetFlags , RpAtomicGetFlags , RpAtomicDestroy , RpAtomicSetRenderCallBack , RpAtomicGetRenderCallBack , RpWorldAddAtomic , RpAtomicRender , RpClumpAddAtomic , RpGeometryCreate , RpWorldPluginAttach
RwBool RpAtomicDestroy RpAtomic   atomic
 

RpAtomicDestroy is used to destroy the specified atomic. It is recommended that the atomic is first removed from the world, if necessary, before calling this function.

If the atomic references a geometry, the geometry is also destroyed if the geometry's reference count is zero.

Note also that if the atomic is attached to a frame, the frame is not destroyed by this function and should be done so explicitly if required.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to the atomic.
Returns:
Returns TRUE if successful or FALSE if there is an error.
See also:
RpAtomicCreate , RpWorldRemoveAtomic , RpAtomicGetWorld , RpWorldAddAtomic , RpGeometryDestroy , RpWorldPluginAttach
RpAtomic* RpAtomicForAllWorldSectors RpAtomic   atomic,
RpWorldSectorCallBack    callback,
void *    data
 

RpAtomicForAllWorldSectors is used to apply the given callback function to all world sectors the specified atomic is in. The format of the callback function is:

RpWorldSector *(*RpWorldSectorCallBack)( RpWorldSector *sector, void *data);

where data is a user-supplied data pointer to pass to the callback function.

If any invocation of the callback function returns a failure status the iteration is terminated. However, RpAtomicForAllWorldSectors will still return successfully.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to the atomic.
callback  Callback function to be called with each world sector.
data  Pointer to user-supplied data to pass to callback function.
Returns:
Returns the atomic pointer on success, or NULL on failure.
See also:
RpWorldSectorForAllAtomics , RpWorldPluginAttach
RwSphere* RpAtomicGetBoundingSphere RpAtomic   atomic
 

RpAtomicGetBoundingSphere is used to retrieve the specified atomic's bounding sphere. This is the interpolated sphere obtained from the geometry's morph target's bounding spheres based upon the current interpolation value and scale. The bounding sphere is generally only valid after the atomic has been instanced just prior to rendering.

Initially the atomic's bounding sphere equals the bounding sphere of the first morph target in the atomic's geometry. Hence, the atomic's bounding* sphere is only valid if the morph target's sphere has been set (this must be done explicitly using RpMorphTargetCalcBoundingSphere and RpMorphTargetSetBoundingSphere). The bounding sphere returned by this function is specified in object-space.

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.

Initially, the atomic's bounding sphere equals the bounding sphere of the first morph target in the atomic's geometry.

Parameters:
atomic  Pointer to the atomic.
Returns:
Returns pointer to the atomic's bounding sphere if successful or NULL if there is an error.
See also:
RpAtomicGetGeometry , RpAtomicSetGeometry , RpAtomicGetInterpolator , RpAtomicGetFlags , RpAtomicSetFlags , RpAtomicGetFrame , RpAtomicSetFrame , RpAtomicGetWorld , RpWorldAddAtomic , RpAtomicGetRenderCallBack , RpAtomicSetRenderCallBack , RpWorldPluginAttach
RpClump* RpAtomicGetClump const RpAtomic   atomic
 

RpAtomicGetClump is used to retrieve the specified atomic's parent clump.

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:
atomic  Pointer to the atomic.
Returns:
Returns pointer to the parent clump if successful or NULL if there is an error or if the atomic has no parent clump.
See also:
RpClumpAddAtomic , RpClumpRemoveAtomic , RpAtomicGetGeometry , RpAtomicSetGeometry , RpAtomicGetInterpolator , RpAtomicGetFlags , RpAtomicSetFlags , RpAtomicGetBoundingSphere , RpAtomicGetFrame , RpAtomicSetFrame , RpAtomicGetWorld , RpWorldAddAtomic , RpAtomicGetRenderCallBack , RpAtomicSetRenderCallBack , RpWorldPluginAttach
RxPipeline* RpAtomicGetDefaultPipeline void   
 

RpAtomicGetDefaultPipeline retrieves the default object pipeline used by atomics. The pipeline has a modular structure and contains operations necessary for taking potentially compressed objects within RenderWare and decompressing them and caching this decompressed (instanced) representation for use over multiple frames.

If an atomic's pipeline is NULL, the default Atomic pipeline will be used.

The generic form of the default atomic object pipeline is detailed in RpAtomicGetGenericPipeline and platform-specific versions in RpAtomicGetDefaultPipeline

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.

Returns:
Returns pointer to the pipeline if successful or NULL if there is an error.
See also:
RpAtomicGetGenericPipeline , RpAtomicGetDefaultPipeline (platform-specific) , RpAtomicGetPipeline , RpAtomicSetDefaultPipeline , RpAtomicSetPipeline , RpMaterialGetGenericPipeline , RpMaterialGetDefaultPipeline , RpMaterialGetDefaultPipeline (platform-specific) , RpMaterialGetPipeline , RpMaterialSetDefaultPipeline , RpMaterialSetPipeline , RpWorldGetGenericSectorPipeline , RpWorldGetDefaultSectorPipeline , RpWorldGetDefaultSectorPipeline (platform-specific) , RpWorldGetSectorPipeline , RpWorldSectorGetPipeline , RpWorldSectorSetPipeline , RpWorldSetDefaultSectorPipeline , RpWorldSetSectorPipeline
RwUInt32 RpAtomicGetFlags const RpAtomic   atomic
 

RpAtomicGetFlags is used to retrieve the property flags from the specified atomic.

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:
atomic  Pointer to the atomic.
Returns:
Returns a 32-bit integer bit-field whose value is the bit-wise OR of the values defined in the RpAtomicFlag enumerated type.
See also:
RpAtomicSetFlags , RpAtomicCreate , RpAtomicGetGeometry , RpAtomicSetGeometry , RpAtomicGetInterpolator , RpAtomicGetBoundingSphere , RpAtomicSetRenderCallBack , RpAtomicGetRenderCallBack , RpAtomicGetWorld , RpWorldAddAtomic , RpWorldPluginAttach
RwFrame* RpAtomicGetFrame const RpAtomic   atomic
 

RpAtomicGetFrame is used to retrieve the frame, if any, attached to the specified atomic.

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:
atomic  Pointer to the atomic.
Returns:
Returns pointer to the atomic's frame if successful or NULL if there is an error or if the atomic has no frame attached.
See also:
RpAtomicSetFrame , RpAtomicCreate , RpAtomicGetGeometry , RpAtomicSetGeometry , RpAtomicGetInterpolator , RpAtomicGetBoundingSphere , RpAtomicSetFlags , RpAtomicGetFlags , RpAtomicSetRenderCallBack , RpAtomicGetRenderCallBack , RpAtomicGetWorld , RpWorldAddAtomic , RwFrameCreate , RwFrameAddChild , RwFrameRemoveChild , RpWorldPluginAttach
RpGeometry* RpAtomicGetGeometry const RpAtomic   atomic
 

RpAtomicGetGeometry is used to retrieve the geometry referenced by the specified atomic.

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:
atomic  Pointer to the atomic containing the geometry.
Returns:
Returns pointer to the atomic's geometry if successful or NULL if there is an error or if the geometry is undefined.
See also:
RpAtomicSetGeometry , RpAtomicSetFrame , RpAtomicGetFrame , RpAtomicGetInterpolator , RpAtomicGetBoundingSphere , RpAtomicSetFlags , RpAtomicGetFlags , RpAtomicSetRenderCallBack , RpAtomicGetRenderCallBack , RpAtomicGetWorld , RpWorldAddAtomic , RpGeometryCreate , RpWorldPluginAttach
RpInterpolator* RpAtomicGetInterpolator RpAtomic   atomic
 

RpAtomicGetInterpolator is used to retrieve the interpolator used by the specified atomic. The interpolator is responsible for defining which morph targets will be linearly blended into a geometry that can be rendered. The proportion of each morph target is determined by the interpolator's current value and scale.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to the atomic containing the interpolator.
Returns:
Returns pointer to the atomic's interpolator if successful or NULL if there is an error.
See also:
RpInterpolatorSetStartMorphTarget , RpInterpolatorGetStartMorphTarget , RpInterpolatorSetEndMorphTarget , RpInterpolatorGetEndMorphTarget , RpInterpolatorSetValue , RpInterpolatorGetValue , RpInterpolatorSetScale , RpInterpolatorGetScale , RpWorldPluginAttach
const RpAtomic* RpAtomicGetPipeline const RpAtomic *const    atomic,
RxPipeline **    pipeline
 

RpAtomicGetPipeline retrieves the object pipeline for the specified atomic. The pipeline has a modular structure and contains operations necessary for taking potentially compressed objects within RenderWare and decompressing them and caching this decompressed (instanced) representation for use over multiple frames.

If the atomic's pipeline is NULL, the default Atomic pipeline will be used.

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:
atomic  Pointer to the atomic.
pipeline  Pointer to receive the pipeline.
Returns:
Returns pointer to the atomic if successful or NULL if there is an error.
See also:
RpAtomicGetGenericPipeline , RpAtomicGetDefaultPipeline , RpAtomicGetDefaultPipeline (platform-specific) , RpAtomicSetDefaultPipeline , RpAtomicSetPipeline , RpMaterialGetGenericPipeline , RpMaterialGetDefaultPipeline , RpMaterialGetDefaultPipeline (platform-specific) , RpMaterialGetPipeline , RpMaterialSetDefaultPipeline , RpMaterialSetPipeline , RpWorldGetGenericSectorPipeline , RpWorldGetDefaultSectorPipeline , RpWorldGetDefaultSectorPipeline (platform-specific) , RpWorldGetSectorPipeline , RpWorldSectorGetPipeline , RpWorldSectorSetPipeline , RpWorldSetDefaultSectorPipeline , RpWorldSetSectorPipeline
RwInt32 RpAtomicGetPluginOffset RwUInt32    pluginID
 

RpAtomicGetPluginOffset is used to get the offset of a previously registered atomic plugin.

The world plugin must be attached before using this function.

Parameters:
pluginID  A RwUInt32 value equal to the plugin ID.
Returns:
Returns the data block offset if successful or -1 if the plugin is not registered.
See also:
RpAtomicRegisterPlugin , RpAtomicRegisterPluginStream , RpAtomicSetStreamAlwaysCallBack , RpAtomicValidatePlugins , RpWorldPluginAttach
RpAtomicCallBackRender RpAtomicGetRenderCallBack const RpAtomic   atomic
 

RpAtomicGetRenderCallBack is used to retrieve the render callback function of the specified atomic. The render callback is the function that is executed from RpAtomicRender when an atomic lies inside the camera's view frustum, giving the application the opportunity to alter the way in which an atomic is rendered.

Note:
If the atomic does not have a custom render callback, then the default RenderWare Graphics atomic render callback is returned.
The format of the callback function is:
   RpAtomic *(*RpAtomicCallBackRender)(RpAtomic *atomic);
   
Note:
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:
atomic  Pointer to the atomic.
Returns:
Returns pointer to the callback function if successful or NULL if there is an error.
See also:
RpAtomicSetRenderCallBack , RpAtomicRender , RpAtomicSetGeometry , RpAtomicSetFrame , RpAtomicGetFrame , RpAtomicGetInterpolator , RpAtomicGetBoundingSphere , RpAtomicSetFlags , RpAtomicGetFlags , RpAtomicGetWorld , RpWorldAddAtomic , RpWorldPluginAttach
RpWorld* RpAtomicGetWorld const RpAtomic   atomic
 

RpAtomicGetWorld is used to determine the world the specified atomic belongs to, if any.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to the atomic.
Returns:
Returns pointer to the world which contains the atomic if successful or NULL if there is an error or if the atomic does not belong to any world.
See also:
RpWorldAddAtomic , RpWorldRemoveAtomic , RpAtomicCreate , RpWorldPluginAttach
const RwSphere* RpAtomicGetWorldBoundingSphere RpAtomic   atomic
 

RpAtomicGetWorldBoundingSphere is used to retrieve the specified atomic's world bounding sphere. This is the atomic's bounding sphere transformed to world space using the atomic's LTM. The bounding sphere returned by this function is specified in world space.

The world bounding sphere is typically used in rejection test such as RwCameraFrustumTestSphere.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to the atomic.
Returns:
Returns pointer to the atomic's world bounding sphere if successful or NULL if there is an error.
See also:
RpAtomicGetGeometry , RpAtomicSetGeometry , RpAtomicGetInterpolator , RpAtomicGetFlags , RpAtomicSetFlags , RpAtomicGetFrame , RpAtomicSetFrame , RpAtomicGetBoundingSphere , RpAtomicGetRenderCallBack , RpAtomicSetRenderCallBack , RpWorldPluginAttach
RwBool RpAtomicInstance RpAtomic   atomic
 

RpAtomicInstance is used to instance a geometry outside of the resource arena. This means that the geometry will never be instanced again.

Once this function has been call two representations of the geometry will exist, one platform independent (PI) and one platform specific (PS).

If the geometry is serialized RpGeometryStreamWrite, RpAtomicStreamWrite or RpClumpStreamWrite after RpAtomicInstance has been called only the PS representation will be saved. When the geometry is reloaded by RpGeometryStreamRead, RpAtomicStreamRead or RpClumpStreamRead only the PS representation will exist. This data can only be loaded and used on the platform it was created on.

All PI geometry data will be lost so certain things will no longer work. For example, collision detection will not work as this relies on a PI data. A second low res collision geometry can be used to solve this problem.

The number of vertices in a geometry RpGeometryGetNumVertices and the number of triangles RpGeometryGetNumTriangles are preserved. Meshes RpMesh are also preserved but the indices themselves are not present.

The correct rendering pipelines must be attached to the atomic and materials before this function is called as those rendering pipelines may introduce PS data that is required to give the desired rendering effect.

This function must be called between RwCameraBeginUpdate and RwCameraEndUpdate as this function has to execute the rendering pipelines to guarantee that all the needed data is generated. In essence this function behaves exactly like RpAtomicRender, the only difference being that the instance data does not get created in the resource arena but is allocated from the heap and is therefore persistent. All geometry will be processed and instanced even if not inside the camera frustum.

e.g.


    if (RwCameraBeginUpdate(Camera))
    {
        RpAtomicInstance(Atomic);

        RwCameraEndUpdate(Camera);
    }
    

NOTE: See the platform specific documentation to see if this feature is not supported on your target platform.

Geometry with more than one morph target is not supported. It is only safe to use this function on geometry with one morph target or skinned geometry.

The data generated by this function should be considered as being highly volatile and the binary format will change.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to a RpAtomic that contains the geometry to be instanced.
Returns:
Returns TRUE if successful or FALSE if there is an error
See also:
RpWorldPluginAttach , RpGeometryGetNumVertices , RpGeometryGetNumTriangles , RpGeometryForAllMeshes , RpGeometryStreamWrite , RpGeometryStreamRead
RwInt32 RpAtomicRegisterPlugin RwInt32    size,
RwUInt32    pluginID,
RwPluginObjectConstructor    constructCB,
RwPluginObjectDestructor    destructCB,
RwPluginObjectCopy    copyCB
 

RpAtomicRegisterPlugin is used to register a plugin and reserve some space within an atomic. This must happen after the engine has been initialized but before the engine is opened.

The world plugin must be attached before using this function.

Parameters:
size  A RwInt32 value equal to the size of the memory block to reserve.
pluginID  A RwInt32 value equal to the plugin ID (must be unique; used to identify binary chunks).
constructCB  Constructor for the plugin data block.
destructCB  Destructor for the plugin data block.
copyCB  Copy constructor for the plugin data block.
Returns:
Returns a RwInt32 value equal to the byte offset within the atomic of memory reserved for this plugin or a negative value if there is an error.
See also:
RpAtomicValidatePlugins , RpAtomicGetPluginOffset , RpAtomicRegisterPluginStream , RpAtomicSetStreamAlwaysCallBack , RpWorldPluginAttach
RwInt32 RpAtomicRegisterPluginStream RwUInt32    pluginID,
RwPluginDataChunkReadCallBack    readCB,
RwPluginDataChunkWriteCallBack    writeCB,
RwPluginDataChunkGetSizeCallBack    getSizeCB
 

RpAtomicRegisterPluginStream is used to associate a set of binary stream functionality with a previously registered plugin.

The world plugin must be attached before using this function.

Parameters:
pluginID  A RwInt32 value equal to the plugin ID (must be unique; used to identify binary chunks).
readCB  Callback used when a chunk is read that is identified as being for this plugin.
writeCB  Callback used when a chunk should be written out for this plugin.
getSizeCB  Callback used to determine the binary stream size required for this plugin (return negative to suppress chunk writing).
Returns:
Returns a RwInt32 value equal to the byte offset within the atomic of memory reserved for this plugin or a negative value if there is an error.
See also:
RpAtomicSetStreamAlwaysCallBack , RpAtomicValidatePlugins , RpAtomicRegisterPlugin , RpAtomicGetPluginOffset , RpWorldPluginAttach
RpAtomic* RpAtomicRender RpAtomic   atomic
 

RpAtomicRender is used to explicitly render the specified atomic into the current camera's image raster. Rendering is attempted whether or not the atomic (bounding-sphere) actually falls inside the camera's view frustum.

This function should only be called from within the context of a RwCameraBeginUpdate...RwCameraEndUpdate block. This ensures that any rendering that takes place is directed towards an image raster connected to a camera. It also ensures that the atomic's local transformation matrix is recalculated, if necessary, so that the atomic is rendered in its correct position and orientation (also taking account of the current interpolation value).

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:
atomic  Pointer to the atomic.
Returns:
Returns a pointer to the atomic if successful or NULL if there is an error.
See also:
RwCameraBeginUpdate , RwCameraEndUpdate , RpAtomicGetRenderCallBack , RpAtomicSetRenderCallBack , RpClumpRender , RpWorldRender , RpWorldSectorRender , RwCameraShowRaster , RpWorldPluginAttach
RxPipeline* RpAtomicSetDefaultPipeline RxPipeline   pipeline
 

RpAtomicSetDefaultPipeline determines the default object pipeline used by atomics. The pipeline has a modular structure and contains operations necessary for taking potentially compressed objects within RenderWare and decompressing them and caching this decompressed (instanced) representation for use over multiple frames.

If the parameter is NULL, the default default atomic object pipeline is reinstated.

If an atomic's pipeline is NULL, the default Atomic pipeline will be used.

The world plugin must be attached before using this function.

Parameters:
pipeline  Pointer to the pipeline or NULL.
Returns:
Returns pointer to the pipeline if successful or NULL if there is an error.
See also:
RpAtomicGetGenericPipeline , RpAtomicGetDefaultPipeline , RpAtomicGetDefaultPipeline , RpAtomicGetDefaultPipeline (platform-specific) , RpAtomicSetPipeline , RpMaterialGetGenericPipeline , RpMaterialGetDefaultPipeline , RpMaterialGetDefaultPipeline (platform-specific) , RpMaterialGetPipeline , RpMaterialSetDefaultPipeline , RpMaterialSetPipeline , RpWorldGetGenericSectorPipeline , RpWorldGetDefaultSectorPipeline , RpWorldGetDefaultSectorPipeline (platform-specific) , RpWorldGetSectorPipeline , RpWorldSectorGetPipeline , RpWorldSectorSetPipeline , RpWorldSetDefaultSectorPipeline , RpWorldSetSectorPipeline
RpAtomic* RpAtomicSetFlags RpAtomic   atomic,
RwUInt32    flags
 

RpAtomicSetFlags is used to define the property flags for the specified atomic.

Note that this function replaces existing flags with the new ones, hence any previously set flags are lost. Therefore, if any of the old flags are still required they must be set again with this function.

Note also that if the collision test flag has changed, the API function RwFrameUpdateObjects should be immediately called on the atomic's frame to reflect the change.

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:
atomic  Pointer to the atomic.
flags  A 32-bit integer bit-field specifying the atomic's properties: Valid values for this parameter are defined in the RpAtomicFlag enumerated type.
Returns:
Returns pointer to the atomic if successful or NULL if there is an error.
See also:
RpAtomicGetFlags , RpAtomicCreate , RpAtomicGetGeometry , RpAtomicSetGeometry , RpAtomicGetInterpolator , RpAtomicGetBoundingSphere , RpAtomicSetRenderCallBack , RpAtomicGetRenderCallBack , RpAtomicGetWorld , RpWorldAddAtomic , RpWorldPluginAttach
RpAtomic* RpAtomicSetFrame RpAtomic   atomic,
RwFrame   frame
 

RpAtomicSetFrame is used to attach the specified frame to the given atomic. The frame describes the atomic's position and orientation with respect to the world.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to the atomic.
frame  Pointer to the frame.
Returns:
Returns pointer to the atomic if successful or NULL if there is an error.
See also:
RpAtomicGetFrame , RpAtomicCreate , RpAtomicGetGeometry , RpAtomicSetGeometry , RpAtomicGetInterpolator , RpAtomicGetBoundingSphere , RpAtomicSetFlags , RpAtomicGetFlags , RpAtomicSetRenderCallBack , RpAtomicGetRenderCallBack , RpAtomicGetWorld , RpWorldAddAtomic , RwFrameCreate , RwFrameAddChild , RwFrameRemoveChild , RpWorldPluginAttach
void RpAtomicSetFreeListCreateParams RwInt32    blockSize,
RwInt32    numBlocksToPrealloc
 

RpAtomicSetFreeListCreateParams allows the developer to specify how many RpAtomic 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* RpAtomicSetGeometry RpAtomic   atomic,
RpGeometry   geometry,
RwUInt32    flags
 

RpAtomicSetGeometry is used to attach the specified geometry to the given atomic. The geometry defines the physical structure of the atomic via one or more morph targets each containing vertex position and vertex normal data. The atomic's structure in any one instance is defined by the atomic's interpolator which blends the morph target data according to the current interpolator value and scale. If only one morph target is defined the atomic's structure is defined solely by that morph target. The atomic's bounding sphere is also defined as the interpolation of the morph targets' bounding spheres.

Setting the geometry also sets the atomic's bounding sphere equal to the bounding sphere of the first morph target. The atomic's bounding sphere will be recalculated, if necessary, when the atomic is instanced (just prior to rendering) according to the current interpolator value and scale.

If the flags parameter is zero, setting the geometry also sets the atomic's bounding sphere equal to the bounding sphere of the first morph target. Otherwise, it is assumed the bounding-sphere has not changed and should not be recalculated (useful for LOD models). Also, the atomic's bounding sphere will be recalculated, if necessary, when the atomic is instanced (just prior to rendering) according to the current interpolator value and scale.

If a geometry is already attached to the given atomic then that geometry is destroyed (unless it is still used by another atomic) before the new one is added.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to the atomic.
geometry  Pointer to the geometry.
flags  A RwUInt32 value which defines how the atomic references the new geometry. The range of know values are defined in the RpAtomicSetGeomFlag enumerated type. Specify zero to have the bounding-sphere recalculated.
Returns:
Returns pointer to the atomic if successful or NULL if there was an error.
See also:
RpAtomicGetGeometry , RpAtomicSetFrame , RpAtomicGetFrame , RpAtomicGetInterpolator , RpAtomicGetBoundingSphere , RpAtomicSetFlags , RpAtomicGetFlags , RpAtomicSetRenderCallBack , RpAtomicGetRenderCallBack , RpAtomicGetWorld , RpWorldAddAtomic , RpGeometryCreate , RpGeometryDestroy , RpWorldPluginAttach
RpAtomic* RpAtomicSetPipeline RpAtomic   atomic,
RxPipeline   pipeline
 

RpAtomicSetPipeline determines the object pipeline for the specified atomic. The pipeline has a modular structure and contains operations necessary for taking potentially compressed objects within RenderWare and decompressing them and caching this decompressed (instanced) representation for use over multiple frames.

If the atomic's pipeline is NULL, the default Atomic pipeline will be used.

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:
atomic  Pointer to the atomic.
pipeline  Pointer to the pipeline.
Returns:
Returns pointer to the atomic if successful or NULL if there is an error.
See also:
RpAtomicGetGenericPipeline , RpAtomicGetDefaultPipeline , RpAtomicGetDefaultPipeline (platform-specific) , RpAtomicGetPipeline , RpAtomicSetDefaultPipeline , RpMaterialGetGenericPipeline , RpMaterialGetDefaultPipeline , RpMaterialGetDefaultPipeline (platform-specific) , RpMaterialGetPipeline , RpMaterialSetDefaultPipeline , RpMaterialSetPipeline , RpWorldGetGenericSectorPipeline , RpWorldGetDefaultSectorPipeline , RpWorldGetDefaultSectorPipeline (platform-specific) , RpWorldGetSectorPipeline , RpWorldSectorGetPipeline , RpWorldSectorSetPipeline , RpWorldSetDefaultSectorPipeline , RpWorldSetSectorPipeline
void RpAtomicSetRenderCallBack RpAtomic   atomic,
RpAtomicCallBackRender    callback
 

RpAtomicSetRenderCallBack is used to define the render callback function for the specified atomic. The callback function is executed from RpAtomicRender when the atomic lies inside the current camera's view frustum, giving the application the opportunity to alter the way in which the atomic is rendered. The default callback function will invoke the atomic rendering pipeline. The default function can be reinstated by specifying NULL in the callback function parameter.

The format of the callback function is:

void (*RpAtomicCallBackRender)(RpAtomic *atomic);

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:
atomic  Pointer to the atomic.
callback  Pointer to the render callback function. See RpAtomicCallBackRender.
Returns:
Returns no value.
See also:
RpAtomicGetRenderCallBack , RpAtomicRender , RpAtomicSetGeometry , RpAtomicSetFrame , RpAtomicGetFrame , RpAtomicGetInterpolator , RpAtomicGetBoundingSphere , RpAtomicSetFlags , RpAtomicGetFlags , RpAtomicGetWorld , RpWorldAddAtomic , RpWorldPluginAttach
RwInt32 RpAtomicSetStreamAlwaysCallBack RwUInt32    pluginID,
RwPluginDataChunkAlwaysCallBack    alwaysCB
 

RpAtomicSetStreamAlwaysCallBack is used to associate a binary stream callback with a previously registered plugin. This callback is called for all plugins after stream data reading has completed.

The world plugin must be attached before using this function.

Parameters:
pluginID  A RwInt32 value equal to the plugin ID (must be unique; used to identify binary chunks).
alwaysCB  Callback used when object base and plugin data reading is complete.
Returns:
Returns a RwInt32 value equal to the byte offset within the atomic of memory reserved for this plugin or a negative value if there is an error.
See also:
RpAtomicRegisterPluginStream , RpAtomicValidatePlugins , RpAtomicRegisterPlugin , RpWorldPluginAttach
RwInt32 RpAtomicSetStreamRightsCallBack RwUInt32    pluginID,
RwPluginDataChunkRightsCallBack    rightsCB
 

RpAtomicSetStreamRightsCallBack is used to associate a binary stream callback with a previously registered plugin. This callback is called for the plugin whose rights are asserted on the read atomic. Rights are asserted if the atomic had an attached pipeline with a plugin id when it was streamed.

The world plugin must be attached before using this function.

Parameters:
pluginID  A RwInt32 value equal to the plugin ID (must be unique; used to identify binary chunks).
rightsCB  Callback used when object base and plugin data reading is complete.
Returns:
Returns a RwInt32 value equal to the byte offset within the atomic of memory reserved for this plugin or a negative value if there is an error.
See also:
RpAtomicRegisterPluginStream , RpAtomicValidatePlugins , RpAtomicRegisterPlugin , RpWorldPluginAttach
RwUInt32 RpAtomicStreamGetSize RpAtomic   atomic
 

RpAtomicStreamGetSize is used to determine the size in bytes of the binary representation of the given atomic. This is used in the binary chunk header to indicate the size of the chunk. The size does not include the size of the chunk header.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to the atomic.
Returns:
Returns a RwUInt32 value equal to the chunk size (in bytes) of the atomic or zero if there is an error.
See also:
RpAtomicStreamRead , RpAtomicStreamWrite , RpWorldPluginAttach
RpAtomic* RpAtomicStreamRead RwStream   stream
 

RpAtomicStreamRead is used to read an atomic object from the specified binary stream. Note that prior to this function call a binary atomic chunk must be found in the stream using the RwStreamFindChunk API function.

The world plugin must be attached before using this function.

The sequence to locate and read an atomic from a binary stream connected to a disk file is as follows:

   RwStream *stream;
   RpAtomic *newAtomic;

   stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx");
   if( stream )
   {
       if( RwStreamFindChunk(stream, rwID_ATOMIC, NULL, NULL) )
       {
           newAtomic = RpAtomicStreamRead(stream);
       }

       RwStreamClose(stream, NULL);
   }
Parameters:
stream  Pointer to the stream.
Returns:
Returns pointer to the atomic if successful or NULL if there is an error.
See also:
RpAtomicStreamWrite , RpAtomicStreamGetSize , RwStreamOpen , RwStreamClose , RwStreamFindChunk , RpWorldPluginAttach
RpAtomic* RpAtomicStreamWrite RpAtomic   atomic,
RwStream   stream
 

RpAtomicStreamWrite is used to write the specified atomic to the given binary stream. Note that the stream will have been opened prior to this function call.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to the atomic.
stream  Pointer to the stream.
Returns:
Returns pointer to the atomic if successful or NULL if there is an error.
See also:
RpAtomicStreamRead , RwStreamOpen , RwStreamClose , RpWorldPluginAttach
RwBool RpAtomicValidatePlugins const RpAtomic   atomic
 

RpAtomicValidatePlugins is used to validate the plugin memory allocated within the specified atomic. This function is useful for determining where memory trampling may be occuring within an application.

This function only returns a meaningful response under a debug library.

The world plugin must be attached before using this function.

Parameters:
atomic  Pointer to the atomic to validate.
Returns:
Returns TRUE is the atomic data is valid or FALSE if there is an error or if the atomic data has become corrupt.
See also:
RpAtomicRegisterPlugin , RpAtomicRegisterPluginStream , RpAtomicSetStreamAlwaysCallBack , 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)