Before any of the plugin functions can be used, RpTeamPluginAttach must be called to attach the plugin. The team plugin also uses functionality from the following plugins which must also be attached: RpWorld, RpHAnim, RpMatFX and RpSkin.
The RpTeam plugin contains:
|
rpTEAMELEMENTMAXLOD defines the maximum number of level of details that can be added to the dictionary for a single element. |
|
rpTEAMELEMENTUNUSED should be used for the dictionary index when disabling an element that a player is constructed. A player is constructed using RpTeamPlayerSetElement |
|
rpTEAMMAXNUMBONES defines the maximum number of bones the Team plugin can render for a single skinned character. |
|
rpTEAMMAXNUMSHADOWS defines the maximum number of shadows the Team plugin can render.
|
|
RpTeam represents a single team. This should be considered an opaque type. Use the RpTeam API functions to access it. |
|
RpTeamCameraTestSphere represents the function called from RpTeamRender to allow custom player culling. The callback is set per team by RpTeamSetCameraTestSphereCallBack. The fuction should return :-
To stop a player from being rendered completely unselect the player with RpTeamPlayerSetActivity
|
|
RpTeamCameraTestSphereData represents the user data to be passed to the RpTeamCameraTestSphere function. |
|
RpTeamDictionary represents the part dictionary of a team. It can be retrieved by RpTeamGetDictionary. This should be considered an opaque type. Use the RpTeamDictionary API functions to access it. |
|
RpTeamLODCallBack represents the function called from RpTeamRender to calculate the correct LOD for each player. Only players which are active in the team will be processed, RpTeamPlayerSetActivity. A player will also be processed if it has been set to synchronize per frame, RpTeamPlayerSetSyncLODPerFrame.
|
|
RpTeamLODCamera represents a camera within the team used to calculate the LOD for the players.
|
|
RpTeamLODData represents the user data to be passed to the RpTeamLODCallBack function.
|
|
RpTeamPlayer represents a player in a team. They are retrieved by RpTeamGetPlayer. This should be considered an opaque type. Use the RpTeamPlayer API functions to access it.
|
|
RpTeamPlayerRenderCallBack represents the function called from RpTeamRender to allow player specific alteration to atomics. The callback is set per player by RpTeamPlayerSetRenderCallBack.
|
|
RpTeamRenderData represents the user data to be passeds to the RpTeamPlayerRenderCallBack function. |
|
RpTeamElementLOD defines the special LOD elements. The values rpTEAMELEMENTLODSHADOW1 and rpTEAMELEMENTLODSHADOW4 are used whilst rendering the player shadows and should be heavily reduced LOD. |
|
RpTeamElementType defines the different type of atomic which the Team can control. The type is used when setting elements into the team's dictionary.
|
|
RpTeamLockMode defines the different areas of the team which can be locked and then altered.
|
|
RpTeamCreate is called to create an RpTeam object. The team object contains players and a player element dictionary. The players are then constructed from the elements in the player dictionary. The team is created locked with RpTeamLockMode rpTEAMLOCKALL and should be unlocked before rendering. Once a team has been created a RpTeamDictionary should be attached to the team.
|
|
RpTeamDestroy is called to destroy a team object. All the players will be destroyed, and the player's hierarchy frame will be destroyed. The team's dictionary must be destroyed manually as it may be in use by a number of teams.
|
|
RpTeamDictionaryCreate is called to create an RpTeamDictionary object. The team dictionary object contains the player elements used to construct a team's players.
|
|
RpTeamDictionaryDestroy is called to destroy a team dictionary object. All the elements and all the levels of detail in the team dictionary will be destroyed.
|
|
RpTeamDictionaryGetElement is used to return an atomic element from the team dictionary. The element will remain in the dictionary.
|
|
RpTeamDictionaryGetLODElement is used to return an element's level of detail atomic from the team dictionary. The element will remain in the dictionary.
|
|
RpTeamDictionaryGetNumOfElements returns the number of elements the team's dictionary can contain.
|
|
RpTeamDictionaryInstance is called to instance the dictionary elements. All elements in the dictionary and all levels of detail will be instanced. RpAtomicInstance contains more details about the instancing process. This function must be called between RwCameraBeginUpdate and RwCameraEndUpdate as this function executes the rendering pipelines to guarantee that all the needed data is generated. NOTE: See the platform specific documentation to see if this feature is not supported on your target platform.
|
|
RpTeamDictionarySetElement is used to set an atomic element into the dictionary. As no level of detail is specified it's assumed to be using RpTeamElementLOD default rpTEAMELEMENTLODFIRST. To permanently remove an element from the dictionary, set a NULL element into the dictionary element.
|
|
RpTeamDictionarySetLODElement is used to set an atomic element into the dictionary. The dictionary elements are broken up into a number of levels of detail, defined by rpTEAMELEMENTMAXLOD. The atomic element will be stored in the correct level of detail index. We define two extra special levels of detail called rpTEAMELEMENTLODSHADOW1 and rpTEAMELEMENTLODSHADOW4, which should be used for shadow rendering geometry. This geometry should be low detail, none textured, with no pre-light colors. The geometry should also be generated from a single mesh. To permanently remove an element from the dictionary, set a NULL element into the dictionary element with the correct level of detail.
|
|
RpTeamDictionaryStreamGetSize is used to determine the size in bytes of the binary representation of the specified dictionary. This is used in the binary chunk header to indicate the size of the team chunk. The size does not include the size of the chunk header.
|
|
RpTeamDictionaryStreamRead is used to read a dictionary from the specified binary stream. Prior to this function call, a binary team chunk must have been found in the stream. The sequence to locate and read a team dictionary from a binary stream is as follows: RwStream *stream; RpTeamDictionary *newTeamDictionary; stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx"); if( stream ) { if( RwStreamFindChunk(stream, rwID_TEAMDICTIONARY, NULL, NULL) ) { newTeamDictionary = RpTeamDictionaryStreamRead(stream); } RwStreamClose(stream, NULL); }
|
|
RpTeamDictionaryStreamWrite is used to write the specified dictionary to the given binary stream. The stream must have been opened prior to this function call.
|
|
RpTeamGetCameraTestSphereCallBack is called to query the current team player frustum test call back function.
|
|
RpTeamGetDictionary returns a pointer to the team's element dictionary.
|
|
RpTeamGetLODCallBack is called to retrieve the team's current, calculate player LOD callback function.
|
|
RpTeamGetLODCamera is called to return the camera used by the default LOD callback function to calculate a players LOD. The camera is set with RpTeamSetLODCamera.
|
|
RpTeamGetLODFarRange is called to return the far range used by the default LOD callback function to calculate a players LOD. The far range is set with RpTeamSetLODFarRange.
|
|
RpTeamGetNumberOfElements returns the number of elements each player can be constucted from.
|
|
RpTeamGetNumberOfPlayers returns the number of players in a team.
|
|
RpTeamGetPersistentLights returns the persistent lights currently defined for the team.
|
|
RpTeamGetPlayer returns a pointer to the indexed player in the team.
|
|
RpTeamGetShadows is used to get the shadow data for a team.
|
|
RpTeamLock should be called before any of the team's internal data structures are changed. This function prepares the team for unlocking after its data has been modified so that the rendering optimizations can be rebuilt. A newly created geometry is already locked. The lock flags are (type RpTeamLockMode):
|
|
RpTeamMaterialGetPlayerDualTexture is used to return the defined second pass player specific texture.
|
|
RpTeamMaterialGetPlayerTexture is used to return the defined player specific texture.
|
|
RpTeamMaterialGetTeamTexture is used to return the defined team specific texture.
|
|
RpTeamMaterialSetPlayerDualTexture is used to set a player specific second pass texture. This allows the developer to use a single piece of geometry and overload the second pass texture that is used to render geometry. If no texture is specified for an individual player then the generic material effect second pass texture is used when rendering. A player specific second pass texture can be removed by setting NULL for the player.
|
|
RpTeamMaterialSetPlayerTexture is used to set a player specific base texture. This allows the developer to use a single piece of geometry and overload the texture that is used to render the texture with. If no texture is specified for an individual player then the team specific texture is used when rendering. If no player and team specific textures are defined then the base texture is used when rendering. A player specific texture can be removed by setting NULL for the player.
|
|
RpTeamMaterialSetTeamTexture is used to set a team specific base texture. This allows the developer to use a single piece of geometry and overload the texture that is used to render the texture with on a team basis. Hence it is possible to have a number of team's using the same pieces of geometry. If no texture is specified for a team or an individual player then the base texture is used when rendering. A player specific texture is used in favor of a team specific texture. A team specific texture can be removed by setting NULL for that team.
|
|
RpTeamPlayerGetActivity is used to return if the player is set to be rendered. The team should be locked before any players activity is altered with RpTeamLockMode rpTEAMLOCKPLAYERS.
|
|
RpTeamPlayerGetBoundingSphere is used to get the players bounding sphere. This is used during RpTeamRender to determine clipping and shadow rendering information. If the bounding sphere intersects the the near clip plane the whole player is culled.
|
|
RpTeamPlayerGetCurrentLOD is called to return the RpTeamPlayer's current LOD. If a player's LOD is not updated because the player has been removed from the LOD sync list with RpTeamPlayerSetSyncLODPerFrame then the LOD value will be used when the player's parts are rendered.
|
|
RpTeamPlayerGetElement is used to return the dictionary index for the element that the player is constructed from.
|
|
RpTeamPlayerGetHierarchyFrame is used to return the hierarchy frame for the player.
|
|
RpTeamPlayerGetRenderCallBack is used to get the players render callback set with RpTeamPlayerSetRenderCallBack.
|
|
RpTeamPlayerGetShadows is used to return if the player's shadows are set to rendered. The team should be locked before any player's shadows are altered with RpTeamLockMode rpTEAMLOCKPLAYERSHADOWS.
|
|
RpTeamPlayerGetSyncLODPerFrame is called to query if a RpTeamPlayer will have their LOD updated during RpTeamRender with the LOD callback function.
|
|
RpTeamPlayerSetActivity is used to define if the player should be rendered. Hence it is possible to define a whole team of players and only render the players who are actually 'playing'. The team should be locked before any players activity is altered with RpTeamLockMode rpTEAMLOCKPLAYERS.
|
|
RpTeamPlayerSetCurrentLOD is called to directly set a RpTeamPlayer's current LOD. If a player doesn't have it's LOD calculated during RpTeamRender via the LOD callback function, then this function should be used. Any LOD value set will persist until the LOD function is called or the user updates it. Therefore, it is not necessary to change the LOD values each frame. The team should be locked before any individual player level of detail are changed with RpTeamLockMode rpTEAMLOCKPLAYERLODS.
|
|
RpTeamPlayerSetElement is used to add a dictionary element to the player. The players are constructed by referencing dictionary elements. When the player is rendered, all the dictionary elements that they are constructed from will be positioned and rendered. To remove a dictionary element from the players constuction set rpTEAMELEMENTUNUSED for the dictionary index. The team should be locked before any player elements are altered with RpTeamLockMode rpTEAMLOCKPLAYERS.
|
|
RpTeamPlayerSetHierarchyFrame is used to attach a hierarchy frame to a player. Each player needs a unique hierarchy to define the skinning and rigid element positions. The team should be locked before any players hierarchy frame setup is altered with RpTeamLockMode rpTEAMLOCKPLAYERS.
|
|
RpTeamPlayerSetRenderCallBack is used to setup a players render callback. The team which the player is a member of must be locked with RpTeamLockMode rpTEAMLOCKPLAYERS. When an element in the dictionary, that the player is generated from, is rendered the callbacks will be called to allow the user to over load features of the atomic. If the pre-render callback function returns NULL then the post-render call back will be not be processed.
|
|
RpTeamPlayerSetShadows is used to define if the player's shadows should be rendered. Hence it is possible to disable the rendering of specific player's shadows. All players shadows are enabled by default when the team is created. The team should be locked before any player's shadows are altered with RpTeamLockMode rpTEAMLOCKPLAYERSHADOWS.
|
|
RpTeamPlayerSetSyncLODPerFrame is called to specify if a RpTeamPlayer should have their LOD updated during RpTeamRender with the LOD callback function. The team should be locked before any individual players level of detail setup is changed with RpTeamLockMode rpTEAMLOCKPLAYERLODS.
|
|
RpTeamPluginAttach is called by the application to indicate that the team plugin should be attached. The call to this function should be placed between RwEngineInit and RwEngineOpen. The team plugin uses functionality from the following plugins, whilst must also be attached: Scene Management, RpHAnim, RpMatFX and RpSkin.
|
|
RpTeamRender is called to render the team. Only the players who have been selected will be considered for rendering. The team will be rendered with the correct team and player textures defined by RpTeamMaterialSetPlayerTexture and RpTeamMaterialSetTeamTexture. The player's level of detail will determine which atomic element is used when rendering a player's dictionary element. 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 player's local transformation matrices are recalculated, if necessary, so that the dictionary elements are rendered in the correct position and orientation. The team must be unlocked before rendering.
|
|
RpTeamSetCameraTestSphereCallBack is called to overload the default team player frustum test function. Each frame, any player that is active ( RpTeamPlayerSetActivity ), is considered for rendering. The player's bounding sphere ( RpTeamPlayerGetBoundingSphere ) is tested against the active camera's frustum. The user may want to overload this test to allow a close up as the default frustum test culls players that intersect the near clip plane. This stops the camera from accidently being inside the player.
|
|
RpTeamSetDictionary attaches a RpTeamDictionary to the the specified team. Currently a team dictionary may not be attached to multiple team objects. The team should be locked before any elements are added to it's dictionary with RpTeamLockMode rpTEAMLOCKDICTIONARY.
|
|
RpTeamSetLODCallBack is called to overload the default LOD calculation callback function. The callback is called each frame for all the players who have the sync per frame enabled, RpTeamPlayerSetSyncLODPerFrame. If the default LOD callback is not overloaded then a camera RpTeamSetLODCamera and far range RpTeamSetLODFarRange should be setup. The team should be locked before any level of detail setup is changed with RpTeamLockMode rpTEAMLOCKTEAMLOD.
|
|
RpTeamSetLODCamera is called to define the RwCamera which the default LOD callback uses as the base reference frame to calculate the LOD during RpTeamRender. The position of the camera's frame defines the origin of the LOD calculation. If no camera is specified the default LOD callback will use the current camera, see RwCameraGetCurrentCamera. The team should be locked before any level of detail setup is changed with RpTeamLockMode rpTEAMLOCKTEAMLOD.
|
|
RpTeamSetLODFarRange is called to define the range of the default LOD callback function. The default LOD function calculates the z distance of a player from the LOD camera's frame. The z distance from the camera's frame is split evenly between the LODs up to the farRange. Any players further from the reference RwCamera than the farRange will receive the maximum level of detail value. / \ | | LOD 0 LOD 1 LOD 2 ... LOD max +-> -----|-----|-----|-----|-----|--------> / farRange L The team should be locked before any level of detail setup is changed with RpTeamLockMode rpTEAMLOCKTEAMLOD.
|
|
RpTeamSetPersistentLights is called to define the ambient and directional light the team should use to light the players. RpTeam only supports a custom light mode of a single directional and a single ambient light. These two lights are used for the entire team and the rendering pipelines have been optimized to reflect this. Any lights added to a world will be ignored whilst rendering the team. The team should be locked with rpTEAMLOCKLIGHTS before changing the lights.
|
|
RpTeamSetShadows is used to set the shadow data for a team. Each team object requires it's own shadow data, although teams may share shadow data. The team should be locked before it's shadow data is attached with RpTeamLockMode rpTEAMLOCKSHADOWS.
|
|
RpTeamStreamGetSize is used to determine the size in bytes of the binary representation of the specified team. This is used in the binary chunk header to indicate the size of the team chunk. The size does not include the size of the chunk header.
|
|
RpTeamStreamRead is used to read a team from the specified binary stream. Prior to this function call, a binary team chunk must have been found in the stream. The team's dictionary should be passed to the stream reading function. This allows the team to reattach the team and player specific textures setup for the dictionary element geometry materials. The sequence to locate and read a team from a binary stream where a team dictionary already exists, is as follows: RwStream *stream; RpTeam *newTeam; RpTeamDictionary *teamDictionary; stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx"); if( stream ) { if( RwStreamFindChunk(stream, rwID_TEAM, NULL, NULL) ) { newTeam = RpTeamStreamRead(stream, teamDictionary); } RwStreamClose(stream, NULL); }
|
|
RpTeamStreamWrite is used to write the specified team to the given binary stream. The stream must have been opened prior to this function call.
|
|
RpTeamUnlock is used to unlock the specified team. This function is typically used to release the team's internal data structures after modification so that the team's rendering data can be optimized. A newly created team is always locked and should be unlocked before it can be used in any rendering.
|
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |