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.
|
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.
|
|
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.
|
|
The bit-field type RpAtomicFlag specifies the options available for controlling the behavior of atomics. See API function RpAtomicSetFlags. |
|
RpAtomicSetGeomFlag defines how an atomic references a new geometry
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
RpAtomicGetPluginOffset is used to get the offset of a previously registered atomic plugin. The world plugin must be attached before using this function.
|
|
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.
RpAtomic *(*RpAtomicCallBackRender)(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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
RpAtomicSetFreeListCreateParams allows the developer to specify how many RpAtomic s to preallocate space for. Call before RwEngineInit.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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); }
|
|
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.
|
|
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.
|
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |