Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RpWorld
[Scene Management]


Modules

PlayStation 2

Data Structures

struct   RpWorld

Enumerations

enum   RpWorldFlag {
  rpWORLDTRISTRIP = 0x01, rpWORLDPOSITIONS = 0x02, rpWORLDTEXTURED = 0x04, rpWORLDPRELIT = 0x08,
  rpWORLDNORMALS = 0x10, rpWORLDLIGHT = 0x20, rpWORLDMODULATEMATERIALCOLOR = 0x40, rpWORLDTEXTURED2 = 0x80,
  rpWORLDNATIVE = 0x01000000, rpWORLDNATIVEINSTANCE = 0x02000000, rpWORLDFLAGSMASK = 0x000000FF, rpWORLDNATIVEFLAGSMASK = 0x0F000000,
  rpWORLDSECTORSOVERLAP = 0x40000000, rpWORLDFLAGFORCEENUMSIZEINT = RWFORCEENUMSIZEINT
}
enum   RpWorldRenderOrder { rpWORLDRENDERNARENDERORDER = 0, rpWORLDRENDERFRONT2BACK, rpWORLDRENDERBACK2FRONT, rpWORLDRENDERORDERFORCEENUMSIZEINT = RWFORCEENUMSIZEINT }

Functions

RwUInt32  RpWorldStreamGetSize (const RpWorld *world)
const RpWorld RpWorldStreamWrite (const RpWorld *world, RwStream *stream)
RpWorld RpWorldStreamRead (RwStream *stream)
RpWorld RpWorldLock (RpWorld *world)
RpWorld RpWorldUnlock (RpWorld *world)
const RwBBox RpWorldGetBBox (const RpWorld *world)
RwInt32  RpWorldGetNumMaterials (const RpWorld *world)
RpMaterial RpWorldGetMaterial (const RpWorld *world, RwInt32 matNum)
RwInt32  RpWorldGetNumClumps (RpWorld *world)
RpWorld RpWorldSetRenderOrder (RpWorld *world, RpWorldRenderOrder renderOrder)
RpWorldRenderOrder  RpWorldGetRenderOrder (const RpWorld *world)
RpWorld RpWorldRender (RpWorld *world)
RwBool  RpWorldDestroy (RpWorld *world)
RpWorld RpWorldSetSectorRenderCallBack (RpWorld *world, RpWorldSectorCallBackRender fpCallBack)
RpWorldSectorCallBackRender  RpWorldGetSectorRenderCallBack (const RpWorld *world)
RpWorld RpWorldCreate (RwBBox *boundingBox)
RwBool  RpWorldInstance (RpWorld *world)
RpWorld RpWorldForAllClumps (RpWorld *world, RpClumpCallBack fpCallBack, void *pData)
RpWorld RpWorldForAllMaterials (RpWorld *world, RpMaterialCallBack fpCallBack, void *pData)
RpWorld RpWorldForAllLights (RpWorld *world, RpLightCallBack fpCallBack, void *pData)
RpWorld RpWorldForAllWorldSectors (RpWorld *world, RpWorldSectorCallBack fpCallBack, void *pData)
RpWorld RpWorldSetFlags (RpWorld *world, RwUInt32 flags)
RwUInt32  RpWorldGetFlags (const RpWorld *world)
RwInt32  RpWorldRegisterPlugin (RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor constructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB)
RwInt32  RpWorldRegisterPluginStream (RwUInt32 pluginID, RwPluginDataChunkReadCallBack readCB, RwPluginDataChunkWriteCallBack writeCB, RwPluginDataChunkGetSizeCallBack getSizeCB)
RwInt32  RpWorldSetStreamAlwaysCallBack (RwUInt32 pluginID, RwPluginDataChunkAlwaysCallBack alwaysCB)
RwInt32  RpWorldSetStreamRightsCallBack (RwUInt32 pluginID, RwPluginDataChunkRightsCallBack rightsCB)
RwInt32  RpWorldGetPluginOffset (RwUInt32 pluginID)
RwBool  RpWorldValidatePlugins (RpWorld *world)
RwBool  RpWorldPluginAttach (void)
void  RpTieSetFreeListCreateParams (RwInt32 blockSize, RwInt32 numBlocksToPrealloc)
RpWorld RpWorldAddCamera (RpWorld *world, RwCamera *camera)
RpWorld RpWorldRemoveCamera (RpWorld *world, RwCamera *camera)
RpWorld RpWorldAddAtomic (RpWorld *world, RpAtomic *atomic)
RpWorld RpWorldRemoveAtomic (RpWorld *world, RpAtomic *atomic)
RpWorld RpWorldAddClump (RpWorld *world, RpClump *clump)
RpWorld RpWorldRemoveClump (RpWorld *world, RpClump *clump)
RpWorld RpWorldAddLight (RpWorld *world, RpLight *light)
RpWorld RpWorldRemoveLight (RpWorld *world, RpLight *light)
RxPipeline RpWorldSetDefaultSectorPipeline (RxPipeline *pipeline)
RxPipeline RpWorldGetDefaultSectorPipeline (void)
RpWorld RpWorldSetSectorPipeline (RpWorld *world, RxPipeline *pipeline)
RpWorld RpWorldGetSectorPipeline (RpWorld *world, RxPipeline **pipeline)

Detailed Description

RpWorld sub group

RpWorld Overview

Requirements

Overview

This is the 'master' object for RenderWare Graphics' Retained Mode API. It has a number of purposes:

World Sectors, and the BSP trees they live in, make up the basic structure of the World object. When a supported dynamic object, such as an Atomic or Light, is 'Added' to the World, the plugin calculates where new object is in the scene and adds it to the appropriate World Sector(s).

When rendering a World, using RpWorldRender, the World plugin traverses the BSP tree, rendering visible World Sectors as it does so. As each World Sector is rendered, the plugin also renders any dynamic scene objects that have been added to it too, resulting in the rendering of a complete scene.

Further information is available in the World & Static Models chapter of the User Guide.


Enumeration Type Documentation

enum RpWorldFlag
 

The bit-field type RpWorldFlag specifies the options available for creating the static geometry component of a world (see API function RpWorldSetFlags):

Enumeration values:
rpWORLDTRISTRIP  This world's meshes can be rendered as tri strips
rpWORLDPOSITIONS  This world has positions
rpWORLDTEXTURED  This world has only one set of texture coordinates
rpWORLDPRELIT  This world has luminance values
rpWORLDNORMALS  This world has normals
rpWORLDLIGHT  This world will be lit
rpWORLDMODULATEMATERIALCOLOR  Modulate material color with vertex colors (pre-lit + lit)
rpWORLDTEXTURED2  This world has 2 or more sets of texture coordinates
enum RpWorldRenderOrder
 

RpWorldRenderOrder represents the options available for the rendering order of world sectors in the camera's view frustum (see API function RpWorldSetRenderOrder).

Enumeration values:
rpWORLDRENDERFRONT2BACK  Renders nearest sectors first
rpWORLDRENDERBACK2FRONT  Renders furthest sectors first

Function Documentation

void RpTieSetFreeListCreateParams RwInt32    blockSize,
RwInt32    numBlocksToPrealloc
 

RpTieSetFreeListCreateParams allows the developer to specify how many RpTie 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
RpWorld* RpWorldAddAtomic RpWorld   world,
RpAtomic   atomic
 

RpWorldAddAtomic is used to add the specified atomic to the given world. Atomics must be added to a world if they are to be rendered using RpWorldRender or be illuminated by point, spot or soft spot lights.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world.
atomic  Pointer to the atomic.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldRemoveAtomic , RpWorldAddCamera , RpWorldRemoveCamera , RpWorldAddClump , RpWorldRemoveClump , RpWorldAddLight , RpWorldRemoveLight , RpWorldCreate , RpAtomicCreate , RpAtomicRender , RpClumpRender , RpWorldRender , RpWorldPluginAttach
RpWorld* RpWorldAddCamera RpWorld   world,
RwCamera   camera
 

RpWorldAddCamera is used to add the specified camera to the given world. Cameras must be added to a world before they can be used to render objects.

This function is a world plugin extension and the world plugin must be attached before using this function.

Parameters:
world  Pointer to the world.
camera  Pointer to the camera.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldRemoveCamera , RpWorldAddAtomic , RpWorldRemoveAtomic , RpWorldAddClump , RpWorldRemoveClump , RpWorldAddLight , RpWorldRemoveLight , RpWorldCreate , RwCameraCreate , RpWorldPluginAttach
RpWorld* RpWorldAddClump RpWorld   world,
RpClump   clump
 

RpWorldAddClump is used to add the specified clump to the given world. Clumps must be added to a world if they are to be rendered using RpWorldRender or be illuminated by point, spot or soft spot lights.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world.
clump  Pointer to the clump.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldRemoveClump , RpWorldAddCamera , RpWorldRemoveCamera , RpWorldAddAtomic , RpWorldRemoveAtomic , RpWorldAddLight , RpWorldRemoveLight , RpWorldCreate , RpClumpCreate , RpWorldRender , RpClumpRender , RpWorldPluginAttach
RpWorld* RpWorldAddLight RpWorld   world,
RpLight   light
 

RpWorldAddLight is used to add the specified light to the given world. Lights must be added to a world if they are to illuminate objects. Otherwise, they will not contribute to any rendering that takes place.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world.
light  Pointer to the light.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldRemoveLight , RpWorldAddCamera , RpWorldRemoveCamera , RpWorldAddClump , RpWorldRemoveClump , RpWorldAddAtomic , RpWorldRemoveAtomic , RpWorldCreate , RpLightCreate , RpWorldPluginAttach
RpWorld* RpWorldCreate RwBBox   boundingBox
 

RpWorldCreate is used to create a new world which has the specified bounding box. The newly created world contains no objects (static or otherwise) and one world sector covering the whole of the bounding box.

The world plugin must be attached before using this function.

Parameters:
boundingBox  Pointer to a RwBBox value equal to the bounding box.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldDestroy , RpWorldGetBBox , RpWorldSectorGetBBox , RpWorldStreamRead , RpWorldRender , RpWorldPluginAttach
RwBool RpWorldDestroy RpWorld   world
 

RpWorldDestroy is used to destroy the specified world. Only those parts of the world contained in static objects are destroyed. Other objects such as clumps, cameras and lights are not destroyed and it is recommended that they are removed from the world before calling this function. If necessary, non-static objects can then be destroyed using the appropriate functions.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world
Returns:
Returns TRUE if successful or FALSE if there is an error
See also:
RpWorldCreate , RpWorldRemoveCamera , RpWorldRemoveLight , RpWorldRemoveClump , RpWorldRemoveAtomic , RpWorldStreamRead , RpWorldStreamWrite , RpWorldPluginAttach
RpWorld* RpWorldForAllClumps RpWorld   world,
RpClumpCallBack    fpCallBack,
void *    pData
 

RpWorldForAllClumps is used to apply the given callback function to all clumps in the specified world. The format of the callback function is:

RpClump * (*RpClumpCallBack)(RpClump *clump, void *data)

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

Note that if any invocation of the callback function returns a failure status the iteration is terminated. However, RpWorldForAllClumps will still return successfully.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world containing the clumps.
fpCallBack  Pointer to the callback function to apply to each clump.
pData  Pointer to user-supplied data to pass to callback function.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldForAllLights , RpWorldForAllMaterials , RpWorldGetNumClumps , RpWorldGetNumMaterials , RpWorldGetMaterial , RpWorldCreate , RpWorldPluginAttach
RpWorld* RpWorldForAllLights RpWorld   world,
RpLightCallBack    fpCallBack,
void *    pData
 

RpWorldForAllLights is used to apply the given callback function to all lights in the specified world. The format of the callback function is:

RpLight * (*RpLightCallBack)(RpLight *light, void *data)

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

Note that if any invocation of the callback function returns a failure status the iteration is terminated. However, RpWorldForAllLights will still return successfully.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world containing the lights.
fpCallBack  Pointer to the callback function to apply to each light.
pData  Pointer to user-supplied data to pass to callback function.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldForAllClumps , RpWorldGetNumClumps , RpWorldForAllMaterials , RpWorldGetNumMaterials , RpWorldGetMaterial , RpWorldCreate , RpWorldPluginAttach
RpWorld* RpWorldForAllMaterials RpWorld   world,
RpMaterialCallBack    fpCallBack,
void *    pData
 

RpWorldForAllMaterials is used to apply the given callback function to all materials used by static objects in the specified world. The format of the callback function is:

RpMaterial * (*RpMaterialCallBack)(RpMaterial *material, void *data)

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

Note that if any invocation of the callback function returns a failure status the iteration is terminated. However, RpWorldForAllMaterials will still return successfully.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world containing the materials.
fpCallBack  Pointer to the callback function to apply to each material.
pData  Pointer to user-supplied data to pass to callback function.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldForAllLights , RpWorldForAllClumps , RpWorldGetNumClumps , RpWorldGetNumMaterials , RpWorldGetMaterial , RpWorldCreate , RpWorldPluginAttach
RpWorld* RpWorldForAllWorldSectors RpWorld   world,
RpWorldSectorCallBack    fpCallBack,
void *    pData
 

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

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

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

Note that if any invocation of the callback function returns a failure status the iteration is terminated. However, RpWorldForAllWorldSectors will still return successfully.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world containing the world sectors.
fpCallBack  Pointer to the callback function to apply to each world sector.
pData  Pointer to user-supplied data to pass to callback function.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldForAllLights , RpWorldForAllClumps , RpWorldForAllMaterials , RpWorldPluginAttach
const RwBBox* RpWorldGetBBox const RpWorld   world
 

RpWorldGetBBox is used to retrieve the specified world's bounding box. Use this function to determine the actual bounding box of the world which will differ from that specified at creation time. For efficiency reasons the bounding box is translated such that all coordinates within it are positive. The world's offset, describing the extent of the translation, can be used to bring objects defined relative to the original bounding box into the bounding box actually used.

Note the world offset is fixed at the time the world is created and describes the translation required to move the world's bounding box back to its original position.

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:
world  Pointer to the world.
Returns:
Returns pointer to a RwBBox value equal to the world's bounding box if successful or NULL if there is an error.
See also:
RpWorldSectorGetBBox , RpWorldCreate , RpWorldStreamRead , RpWorldPluginAttach
RxPipeline* RpWorldGetDefaultSectorPipeline void   
 

RpWorldGetDefaultSectorPipeline retrieves the global default world sector object pipeline. The pipeline is executed from the default sector render callback, and indirectly from RpWorldSectorRender and RpWorldRender) when a world sector enters the current camera's view frustum.

World sectors will use their specified pipeline, unless it is set to NULL, in which case they will use their world's specified pipeline. If the world's pipeline is set to NULL then the global default world sector pipeline will be used.

The generic form of the default world-sector object pipeline is detailed in RpWorldGetGenericSectorPipeline and platform-specific versions in RpWorldGetDefaultSectorPipeline (platform-specific)

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 , RpAtomicGetDefaultPipeline (platform-specific) , RpAtomicGetPipeline , RpAtomicSetDefaultPipeline , RpAtomicSetPipeline , RpMaterialGetGenericPipeline , RpMaterialGetDefaultPipeline , RpMaterialGetDefaultPipeline (platform-specific) , RpMaterialGetPipeline , RpMaterialSetDefaultPipeline , RpMaterialSetPipeline , RpWorldGetSectorPipeline , RpWorldSetSectorPipeline , RpWorldSectorGetPipeline , RpWorldSectorSetPipeline , RpWorldGetGenericSectorPipeline , RpWorldSetDefaultSectorPipeline , RpWorldGetDefaultSectorPipeline (platform-specific)
RwUInt32 RpWorldGetFlags const RpWorld   world
 

RpWorldGetFlags is used to retrieve the property flags from the specified world. The flags only pertain to the static component of the world's geometry.

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:
world  Pointer to the world.
Returns:
Returns a 32-bit integer bit-field whose value is the bit-wise OR of the following constants if successful or zero if there is an error or if the atomic's flags are unset:
  • rpWORLDTEXTURED - World has textures applied. Texture coordinates are specified on a per vertex basis.
  • rpWORLDPRELIT - World has pre-light colors.
  • rpWORLDNORMALS - World has vertex normals.
  • rpWORLDLIGHT - World is lit.
  • rpWORLDTRISTRIP - World's static geometry can be rendered as triangle strips.
  • rpWORLDMODULATEMATERIALCOLOR - World is rendered with material colors.
See also:
RpWorldSetFlags , RpWorldGetMaterial , RpWorldGetNumMaterials , RpWorldPluginAttach
RpMaterial* RpWorldGetMaterial const RpWorld   world,
RwInt32    matNum
 

RpWorldGetMaterial is used to retrieve the material with the given index from the specified world's material list. The material list only includes materials used by static surfaces in the world.

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:
world  Pointer to the world.
matNum  A RwInt32 value equal to the index of the material.
Returns:
Returns pointer to the material if successful or NULL if there is an error or if the index is out of range.
See also:
RpWorldGetNumMaterials , RpWorldForAllMaterials , RpWorldStreamRead , RpWorldStreamWrite , RpWorldPluginAttach
RwInt32 RpWorldGetNumClumps RpWorld   world
 

RpWorldGetNumClumps is used to retrieve the number of clumps in the specified world.

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:
world  Pointer to the world containing the clumps.
Returns:
Returns a RwInt32 value equal to the number of clumps if successful or -1 if there is an error.
See also:
RpWorldForAllClumps , RpWorldAddClump , RpWorldCreate , RpWorldPluginAttach
RwInt32 RpWorldGetNumMaterials const RpWorld   world
 

RpWorldGetNumMaterials is used to retrieve the number of different materials in use by all static surfaces in the specified world. Materials which are not referenced by static surfaces are not counted.

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:
world  Pointer to the world.
Returns:
Returns a RwInt32 value equal to the number of materials if successful or -1 if there is an error.
See also:
RpWorldGetMaterial , RpWorldForAllMaterials , RpWorldStreamRead , RpWorldStreamWrite , RpWorldPluginAttach
RwInt32 RpWorldGetPluginOffset RwUInt32    pluginID
 

RpWorldGetPluginOffset is used to get the offset of a previously registered world 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:
RpWorldRegisterPlugin , RpWorldRegisterPluginStream , RpWorldSetStreamAlwaysCallBack , RpWorldValidatePlugins , RpWorldSectorRegisterPlugin , RpWorldSectorRegisterPluginStream , RpWorldSectorSetStreamAlwaysCallBack , RpWorldSectorGetPluginOffset , RpWorldSectorValidatePlugins , RpWorldPluginAttach
RpWorldRenderOrder RpWorldGetRenderOrder const RpWorld   world
 

RpWorldGetRenderOrder is used to retrieve the order in which world sectors in the specified world are rendered with respect to the camera's frustum, which can be either front to back or back to front. Back to front produces the correct results with respect to alpha blending at low memory cost but can lead to higher frame-buffer bandwidth requirements.

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:
world  Pointer to the world.
Returns:
Returns value indicating the rendering order if successful or rpWORLDRENDERNARENDERORDER if there is an error:
  • rpWORLDRENDERNARENDERORDER - The world sector rendering order is not a supported type.
  • rpWORLDRENDERFRONT2BACK - World sectors will be rendered front to back.
  • rpWORLDRENDERBACK2FRONT - World sectors will be rendered back to front.
See also:
RpWorldSetRenderOrder , RpWorldRender , RpWorldPluginAttach
RpWorld* RpWorldGetSectorPipeline RpWorld   world,
RxPipeline **    pipeline
 

RpWorldGetSectorPipeline returns the default world sector object pipeline for the specified world. The pipeline is executed from the default render callback and indirectly from RpWorldSectorRender and RpWorldRender) when a world sector enters the current camera's view frustum.

World sectors in the current world will use this pipeline by default, unless they have their own pipeline specified. If the world's pipeline is NULL, this signifies that the global default world sector 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:
world  Pointer to the world.
pipeline  Pipeline pointer to receive the world's pipeline pointer.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpAtomicGetGenericPipeline , RpAtomicGetDefaultPipeline , RpAtomicGetDefaultPipeline (platform-specific) , RpAtomicGetPipeline , RpAtomicSetDefaultPipeline , RpAtomicSetPipeline , RpMaterialGetGenericPipeline , RpMaterialGetDefaultPipeline , RpMaterialGetDefaultPipeline (platform-specific) , RpMaterialGetPipeline , RpMaterialSetDefaultPipeline , RpMaterialSetPipeline , RpWorldGetGenericSectorPipeline , RpWorldGetDefaultSectorPipeline , RpWorldGetDefaultSectorPipeline (platform-specific) , RpWorldSectorGetPipeline , RpWorldSectorSetPipeline , RpWorldSetDefaultSectorPipeline , RpWorldSetSectorPipeline
RpWorldSectorCallBackRender RpWorldGetSectorRenderCallBack const RpWorld   world
 

RpWorldGetSectorRenderCallBack is used to retrieve the world sector render callback function of the specified world. The render callback is the function that is executed from RpWorldSectorRender (and indirectly from RpWorldRender) when a world sector lies inside the current camera's view frustum, giving the application the opportunity to alter the way in which static objects in the world sector are rendered.

The format of the callback function is:

RpWorldSector * (*RpWorldSectorCallBackRender)(RpWorldSector *sect)

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world.
Returns:
Returns pointer to the callback function if successful or NULL if there is an error.
See also:
RpWorldSetSectorRenderCallBack , RpWorldSectorRender , RpWorldRender , RpWorldPluginAttach
RwBool RpWorldInstance RpWorld   world
 

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

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

If the world is serialized, using RpWorldStreamWrite after RpWorldInstance has been called, only the PS representation will be saved. When the world is reloaded, using RpWorldStreamRead, 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 resolution collision world can be used to solve this problem.

The number of vertices in a world sector RpWorldSectorGetNumVertices and the number of polygons RpWorldSectorGetNumPolygons are preserved. Meshes RpMesh are also preserved but the indices themselves are not present.

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

Pre-instancing should not be attempted when PVS is enabled. PVS should be disabled as world sectors are not pre-instanced, if culled by PVS.

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 RpWorldRender, 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 world sectors will be processed and instanced even if they are not inside the camera frustum.

For example:


   RpWorldAddCamera(World, Camera);

   if (RwCameraBeginUpdate(Camera))
   {
       RpWorldInstance(World);

       RwCameraEndUpdate(Camera);
    }

   RpWorldRemoveCamera(World, Camera);

    
Note:
See the platform specific documentation to see if this feature is not supported on your target platform.
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:
world  Pointer to a RpWorld to instance
Returns:
Returns TRUE if successful or FALSE if there is an error
See also:
RpWorldPluginAttach , RpWorldSectorGetNumVertices , RpWorldSectorGetNumPolygons , RpWorldSectorForAllMeshes , RpWorldStreamWrite , RpWorldStreamRead
RpWorld* RpWorldLock RpWorld   world
 

RpWorldLock is used to lock the specified world so an application can access it's internal data structures. After the data has been modified the world should be unlocked so that the meshes can be rebuilt. When the world is locked the present meshes are destroyed.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldUnlock , RpWorldPluginAttach
RwBool RpWorldPluginAttach void   
 

RpWorldPluginAttach is used to attach the world plugin to the RenderWare system to enable scene management. The world plugin must be attached between initialising the system with RwEngineInit and opening it with RwEngineOpen.

Use this function if the application wishes to use the following system functionality: worlds and world sectors, clumps, atomics, geometry, lights, materials.

The include file rpworld.h is also required and must be included by an application wishing to use scene management

Returns:
Returns TRUE if successful or FALSE if there is an error
See also:
RwEngineInit , RwEngineOpen , RwEngineStart
RwInt32 RpWorldRegisterPlugin RwInt32    size,
RwUInt32    pluginID,
RwPluginObjectConstructor    constructCB,
RwPluginObjectDestructor    destructCB,
RwPluginObjectCopy    copyCB
 

RpWorldRegisterPlugin is used to register a plugin and reserve some space within a world. 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 world of memory reserved for this plugin or -1 if there is an error.
See also:
RpWorldValidatePlugins , RpWorldRegisterPluginStream , RpWorldSetStreamAlwaysCallBack , RpWorldGetPluginOffset , RpWorldSectorRegisterPlugin , RpWorldSectorRegisterPluginStream , RpWorldSectorSetStreamAlwaysCallBack , RpWorldSectorValidatePlugins , RpWorldSectorGetPluginOffset , RpWorldPluginAttach
RwInt32 RpWorldRegisterPluginStream RwUInt32    pluginID,
RwPluginDataChunkReadCallBack    readCB,
RwPluginDataChunkWriteCallBack    writeCB,
RwPluginDataChunkGetSizeCallBack    getSizeCB
 

RpWorldRegisterPluginStream is used to associate a set of binary stream functionality with a previously registered world 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 world of memory reserved for this plugin or -1 if there is an error.
See also:
RpWorldSetStreamAlwaysCallBack , RpWorldValidatePlugins , RpWorldRegisterPlugin , RpWorldGetPluginOffset , RpWorldSectorRegisterPlugin , RpWorldSectorRegisterPluginStream , RpWorldSectorSetStreamAlwaysCallBack , RpWorldSectorValidatePlugins , RpWorldSectorGetPluginOffset , RpWorldPluginAttach
RpWorld* RpWorldRemoveAtomic RpWorld   world,
RpAtomic   atomic
 

RpWorldRemoveAtomic is used to remove the specified atomic from the given world. Unlike RpAtomicDestroy this function preserves the atomic's definition, hence the atomic can be reused without creating it again.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world containing the atomic.
atomic  Pointer to the atomic.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldAddAtomic , RpWorldRemoveCamera , RpWorldAddCamera , RpWorldRemoveClump , RpWorldAddClump , RpWorldRemoveLight , RpWorldAddLight , RpAtomicDestroy , RpWorldPluginAttach
RpWorld* RpWorldRemoveCamera RpWorld   world,
RwCamera   camera
 

RpWorldRemoveCamera is used to remove the specified camera from the given world. Unlike RwCameraDestroy this function preserves the camera's definition, hence the camera can be reused without creating it again.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world containing the camera.
camera  Pointer to the camera.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldAddCamera , RpWorldRemoveAtomic , RpWorldAddAtomic , RpWorldRemoveClump , RpWorldAddClump , RpWorldRemoveLight , RpWorldAddLight , RwCameraDestroy , RpWorldPluginAttach
RpWorld* RpWorldRemoveClump RpWorld   world,
RpClump   clump
 

RpWorldRemoveClump is used to remove the specified clump from the given world. Unlike RpClumpDestroy this function preserves the clump's definition, hence the clump can be reused without creating it again.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world containing the clump.
clump  Pointer to the clump.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldAddClump , RpWorldRemoveCamera , RpWorldAddCamera , RpWorldRemoveAtomic , RpWorldAddAtomic , RpWorldRemoveLight , RpWorldAddLight , RpClumpDestroy , RpWorldPluginAttach
RpWorld* RpWorldRemoveLight RpWorld   world,
RpLight   light
 

RpWorldRemoveLight is used to remove the specified light from the given world. Unlike RpLightDestroy this function preserves the light's definition, hence the light can be reused without creating it again.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world containing the light.
light  Pointer to the light.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldAddLight , RpWorldRemoveCamera , RpWorldAddCamera , RpWorldRemoveClump , RpWorldAddClump , RpWorldRemoveAtomic , RpWorldAddAtomic , RpLightDestroy , RpWorldPluginAttach
RpWorld* RpWorldRender RpWorld   world
 

RpWorldRender is used to render all objects (static or otherwise) in the specified world to the current camera's image raster. Only objects that have been added to the world will be rendered.

RpWorldRender is used to render both world sectors and atomics, but only those that fall inside the current camera's view frustum will be rendered.

This function should only be called between RwCameraBeginUpdate and RwCameraEndUpdate to ensure that any rendering that takes place is directed towards an image raster connected to a camera.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world containing the camera.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldSetRenderOrder , RpWorldSetSectorRenderCallBack , RpWorldGetRenderOrder , RwCameraBeginUpdate , RwCameraEndUpdate , RpWorldSectorRender , RpClumpRender , RpAtomicRender , RpWorldAddAtomic , RpWorldAddClump , RwCameraShowRaster , RpWorldPluginAttach
RxPipeline* RpWorldSetDefaultSectorPipeline RxPipeline   pipeline
 

RpWorldSetDefaultSectorPipeline defines the global default world sector object pipeline. The pipeline is executed from the default render callback, unless overridden by a non-NULL world sector's pipeline or world's pipeline, and indirectly from RpWorldSectorRender and RpWorldRender) when a world sector enters the current camera's view frustum, giving the application the opportunity to alter the way in which static objects in the world sector are rendered.

If the parameter is NULL then the default world sector object pipeline will be reinstated (this is platform-specific).

World sectors will use their specified pipeline, unless it is set to NULL, in which case they will use their world's specified pipeline.. If the world's pipeline is set to NULL then the global default world sector 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 (platform-specific) , RpAtomicGetPipeline , RpAtomicSetDefaultPipeline , RpAtomicSetPipeline , RpMaterialGetGenericPipeline , RpMaterialGetDefaultPipeline , RpMaterialGetDefaultPipeline (platform-specific) , RpMaterialGetPipeline , RpMaterialSetDefaultPipeline , RpMaterialSetPipeline , RpWorldGetGenericSectorPipeline , RpWorldGetDefaultSectorPipeline , RpWorldGetDefaultSectorPipeline (platform-specific) , RpWorldGetSectorPipeline , RpWorldSectorGetPipeline , RpWorldSectorSetPipeline , RpWorldSetSectorPipeline
RpWorld* RpWorldSetFlags RpWorld   world,
RwUInt32    flags
 

RpWorldSetFlags is used to define the property flags for the specified world. The flags only pertain to the static component of the world's geometry.

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 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:
world  Pointer to the world.
flags  A 32-bit integer bit-field specifying the world's properties:
  • rpWORLDTEXTURED - World has textures applied. Texture coordinates are specified on a per vertex basis.
  • rpWORLDPRELIT - World has pre-light colors.
  • rpWORLDNORMALS - World has vertex normals.
  • rpWORLDLIGHT - World will be lit.
  • rpWORLDTRISTRIP - World's static geometry can be rendered as triangle strips.
  • rpWORLDMODULATEMATERIALCOLOR - World is rendered with material colors.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldGetFlags , RpWorldGetMaterial , RpWorldPluginAttach
RpWorld* RpWorldSetRenderOrder RpWorld   world,
RpWorldRenderOrder    renderOrder
 

RpWorldSetRenderOrder is used to set the order in which world sectors in the specified world are rendered with respect to the camera's frustum, which can be either front to back or back to front. On rendering a world sector, the contained atomics will not be sorted for rendering. If atomics contains transparencies, it is best to render them separately..

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:
world  Pointer to the world.
renderOrder  Value indicating the rendering order to be used. Supported values are:
  • rpWORLDRENDERFRONT2BACK - World sectors will be rendered front to back.
  • rpWORLDRENDERBACK2FRONT - World sectors will be rendered back to front.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldGetRenderOrder , RpWorldRender , RpWorldPluginAttach
RpWorld* RpWorldSetSectorPipeline RpWorld   world,
RxPipeline   pipeline
 

RpWorldSetSectorPipeline defines the default world sector object pipeline for the specified world. The pipeline is executed from the default render callback and indirectly from RpWorldSectorRender and RpWorldRender) when a world sector enters the current camera's view frustum, giving the application the opportunity to alter the way in which static objects in the world sector are rendered.

World sectors in the current world will use this pipeline by default, unless they have their own pipeline specified. If the world's pipeline is set to NULL then the global default world sector 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:
world  Pointer to the world.
pipeline  Pointer to the pipeline.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpAtomicGetGenericPipeline , RpAtomicGetDefaultPipeline , RpAtomicGetDefaultPipeline (platform-specific) , RpAtomicGetPipeline , RpAtomicSetDefaultPipeline , RpAtomicSetPipeline , RpMaterialGetGenericPipeline , RpMaterialGetDefaultPipeline , RpMaterialGetDefaultPipeline (platform-specific) , RpMaterialGetPipeline , RpMaterialSetDefaultPipeline , RpMaterialSetPipeline , RpWorldGetGenericSectorPipeline , RpWorldGetDefaultSectorPipeline , RpWorldGetSectorPipeline , RpWorldSectorGetPipeline , RpWorldSectorSetPipeline , RpWorldSetDefaultSectorPipeline , RpWorldGetDefaultSectorPipeline (platform-specific)
RpWorld* RpWorldSetSectorRenderCallBack RpWorld   world,
RpWorldSectorCallBackRender    fpCallBack
 

RpWorldSetSectorRenderCallBack is used to define the world sector render callback function for the specified world. The callback function is executed from RpWorldSectorRender (and indirectly from RpWorldRender) when a world sector lies inside the current camera's view frustum, giving the application the opportunity to alter the way in which static objects in the world sector are rendered. The default callback function will invoke the world rendering pipeline. The default function can be reinstated by specifying NULL in the callback function parameter.

The format of the callback function is:

RpWorldSector * (*RpWorldSectorCallBackRender)(RpWorldSector *sect)

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world.
fpCallBack  Pointer to the render callback function.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldGetSectorRenderCallBack , RpWorldSectorRender , RpWorldRender , RpWorldPluginAttach
RwInt32 RpWorldSetStreamAlwaysCallBack RwUInt32    pluginID,
RwPluginDataChunkAlwaysCallBack    alwaysCB
 

RpWorldSetStreamAlwaysCallBack is used to associate a binary stream callback with a previously registered world 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 world of memory reserved for this plugin or -1 if there is an error.
See also:
RpWorldRegisterPluginStream , RpWorldValidatePlugins , RpWorldRegisterPlugin , RpWorldGetPluginOffset , RpWorldSectorRegisterPlugin , RpWorldSectorRegisterPluginStream , RpWorldSectorSetStreamAlwaysCallBack , RpWorldSectorValidatePlugins , RpWorldSectorGetPluginOffset , RpWorldPluginAttach
RwInt32 RpWorldSetStreamRightsCallBack RwUInt32    pluginID,
RwPluginDataChunkRightsCallBack    rightsCB
 

RpWorldSetStreamRightsCallBack is used to associate a binary stream callback with a previously registered world plugin. This callback is called for the plugin with rights 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).
rightsCB  Callback used when object base and plugin data reading is complete.
Returns:
Returns a RwInt32 value equal to the byte offset within the world of memory reserved for this plugin or -1 if there is an error.
See also:
RpWorldRegisterPluginStream , RpWorldValidatePlugins , RpWorldRegisterPlugin , RpWorldGetPluginOffset , RpWorldSectorRegisterPlugin , RpWorldSectorRegisterPluginStream , RpWorldSectorSetStreamAlwaysCallBack , RpWorldSectorValidatePlugins , RpWorldSectorGetPluginOffset , RpWorldPluginAttach
RwUInt32 RpWorldStreamGetSize const RpWorld   world
 

RpWorldStreamGetSize is used to determine the size in bytes of the binary representation of the given world. Only static objects in the world are included. 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:
world  Pointer to the world.
Returns:
Returns a RwUInt32 value equal to the chunk size of the specified world in bytes if successful or zero if there is an error.
See also:
RpWorldStreamRead , RpWorldStreamWrite , RpWorldPluginAttach
RpWorld* RpWorldStreamRead RwStream   stream
 

RpWorldStreamRead is used to read a world from the specified binary stream. Note that prior to this function call a binary world chunk must be found in the stream using the RwStreamFindChunk API function. Note also that the world created by this function only contains static objects.

The world plugin must be attached before using this function.

The sequence to locate and read a world from a binary stream is as follows:

   RwStream *stream;
   RpWorld *newWorld;
  
   stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx");
   if( stream )
   {
       if( RwStreamFindChunk(stream, rwID_WORLD, NULL, NULL) )
       {
           newWorld = RpWorldStreamRead(stream);
       }
  
       RwStreamClose(stream, NULL);
   }
Parameters:
stream  Pointer to the stream.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldStreamWrite , RpWorldStreamGetSize , RwStreamOpen , RwStreamClose , RwStreamFindChunk , RpWorldPluginAttach
const RpWorld* RpWorldStreamWrite const RpWorld   world,
RwStream   stream
 

RpWorldStreamWrite is used to write the specified world to the given binary stream. Only those parts of the world contained in static objects are written to the stream. Note that the stream must be opened prior to this function call.

The world plugin must be attached before using this function.

For example:

    RwStream *streamOut;    
    RpWorld *worldOut;    

    // Write object 
 
    streamOut = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMWRITE, "world.rws");    

    RpWorldStreamWrite(worldOut, streamOut);    

    RwStreamClose(streamOut, NULL);    
Parameters:
world  Pointer to the world.
stream  Pointer to the stream.
Returns:
Returns pointer to the specified world if successful or NULL if there is an error.
See also:
RpWorldStreamRead , RpWorldStreamGetSize , RwStreamOpen , RwStreamClose , RpWorldPluginAttach
RpWorld* RpWorldUnlock RpWorld   world
 

RpWorldUnlock is used to unlock the specified world. This function releases the world's data structures after modification so that the world's meshes can be rebuilt.

The world plugin must be attached before using this function.

Parameters:
world  Pointer to the world.
Returns:
Returns pointer to the world if successful or NULL if there is an error.
See also:
RpWorldLock , RpWorldPluginAttach
RwBool RpWorldValidatePlugins RpWorld   world
 

RpWorldValidatePlugins is used to validate the plugin memory allocated within the specified world. 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:
world  Pointer to the world.
Returns:
Returns TRUE if the world data is valid or FALSE if there is an error or if the world data has become corrupt.
See also:
RpWorldRegisterPlugin , RpWorldRegisterPluginStream , RpWorldSetStreamAlwaysCallBack , RpWorldGetPluginOffset , RpWorldSectorRegisterPlugin , RpWorldSectorRegisterPluginStream , RpWorldSectorSetStreamAlwaysCallBack , RpWorldSectorValidatePlugins , RpWorldSectorGetPluginOffset , RpWorldPluginAttach

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