This object is the primary container object for dynamic model data.
The data itself is stored as lists of Triangles (RpTriangle) stored in a Morph Target (RpMorphTarget). Each such Triangle object also contains a reference to a Material (RpMaterial) object, which defines that triangle's appearance.
During scene generation process, RenderWare Graphics will use the Geometry data to generate Mesh (RpMesh) data for rendering. A Geometry object cannot be directly liked to a Frame as there is no storage for these. Instead, you should create an Atomic with a reference the Geometry, then link that Atomic to a Frame.
Further information is available in the Dynamic Models chapter of the User Guide.
|
RpGeometryCallBack represents the simple callback function for the RpGeometry object. The callback may return NULL to terminate further callbacks on the geometry.
|
|
RpGeometrySortByMaterialCallBack RpGeometrySortByMaterialCallBack is used by RpGeometrySortByMaterial in order to preserve the validity of plugin data when the vertices in an RpGeometry are sorted (and some possibly duplicated). A vertex map table is provided to the callback - this contains, for each vertex in the new geometry, the index of the corresponding vertex in the original geometry.
|
|
RpGeometryFlag Geometry type flags When creating a geometry, these flags can be OR'ed together to specify the format along with the rpGEOMETRYTEXCOORDSETS(n) macro if more than two sets of texture coordinates are required. See RpGeometryCreate for more details.
|
|
|
RpGeometryAddMorphTarget is used to add a new morph target to the specified geometry. Space is allocated for the morph target's vertices (and vertex normals if the geometry requires them) but their values are completely undefined. The new morph target's bounding sphere is also undefined. The sphere must be determined and set using RpMorphTargetCalcBoundingSphere and RpMorphTargetSetBoundingSphere before it is used. All morph targets in the geometry have the same number of vertices and triangle topology (vertex connectivity). The world plugin must be attached before using this function.
|
|
RpGeometryAddMorphTargets is used to add N new morph target to the specified geometry. Space is allocated for the morph targets vertices (and vertex normals if the geometry requires them) but their values are completely undefined. The new morph targets bounding spheres are also undefined. The spheres must be determined and set using RpMorphTargetCalcBoundingSphere and RpMorphTargetSetBoundingSphere before they are used. All morph targets in the geometry have the same number of vertices and triangle topology (vertex connectivity). The world plugin must be attached before using this function.
|
|
RpGeometryCreate is used to create a new geometry according to the specified number of vertices and triangles and the specified format. The geometry is created with one morph target. Arrays are allocated for the vertex and triangle lists as well as for the vertex normals, pre-light colors and texture coordinates if any of these are required according to the format. All arrays are undefined and must be initialized before the geometry is unlocked, including the material properties defined in the triangle list. The format is specified by combining RpGeometryFlag flags using an OR operation. The rpGEOMETRYTEXTURED and rpGEOMETRYTEXTURED2 flags specify that either a single or double set of texture coordinates are required. Alternatively, the rpGEOMETRYTEXCOORDSETS(n) macro may be used to explicitly set the number of sets required up to rwMAXTEXTURECOORDS (restricted to 8). In this case, the backward compatibility flags (rpGEOMETRYTEXTURED and rpGEOMETRYTEXTURED2) are set internally to reflect the status, rpGEOMETRYTEXTURED2 indicating that 2 or more sets are present. For example:- geom1 = RpGeometryCreate(numVerts, numTris, rpGEOMETRYTRISTRIP | rpGEOMETRYTEXTURED | rpGEOMETRYNORMALS | rpGEOMETRYLIGHT); geom2 = RpGeometryCreate(numVerts, numTris, rpGEOMETRYTRISTRIP | rpGEOMETRYTEXCOORDSETS(2) | rpGEOMETRYNORMALS | rpGEOMETRYLIGHT); Note that the geometry is created with a reference count of one. Hence, it is the responsiblity of the application to destroy the geometry if it is no longer required. The newly created geometry is in a locked state and must be unlocked if it is to be used in any rendering. The world plugin must be attached before using this function.
|
|
RpGeometryCreateSpace is used to create an empty geometry containing no vertices or polygons and one morph target with a bounding sphere of the specified radius, centered at the origin. Note that the returned geometry is unlocked. This function is typically used to create 'invisible' surfaces for use in collision simulations. The world plugin must be attached before using this function.
|
|
RpGeometryDestroy is used to destroy the specified geometry and any resources associated with it. Only geometries whose reference count is zero are actually removed from the system. Reference counts greater than one indicate that this particular geometry is still being used by other atomics; in this situation, this function will only decrement the geometry's reference count. It is the application's responsibility to destroy the geometry if it is no longer required and it is not referenced by any atomics. This does not apply if the geometry was acquired by reading an atomic from a binary stream: destroying the atomic will also destroy the geometry it references. The world plugin must be attached before using this function.
|
|
RpGeometryForAllMaterials is used to apply the given callback function to all materials referenced by polygons in the specified geometry. 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, RpGeometryForAllMaterials will still return successfully. The world plugin must be attached before using this function.
|
|
RpGeometryForAllMeshes is used to apply the given callback function to all meshes in the given geometry. The format of the callback function is: RpMesh *(*RpMeshCallBack)(RpMesh *mesh, RpMeshHeader *meshHeader, 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 RpGeometryForAllMeshes will still return successfully. The world plugin must be attached before using this function.
|
|
RpGeometryGetFlags is used to retrieve the property flags associated with the specified 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.
|
|
RpGeometryGetMaterial is used to retrieve the material with the given index from the specified geometry's material list. 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.
|
|
RpGeometryGetMorphTarget is used to retrieve the morph target with the specified index from the given 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.
|
|
RpGeometryGetNumMaterials is used to retrieve the number of different materials in use by all polygons in the specified 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.
|
|
RpGeometryGetNumMorphTargets is used to determine the number of morph targets defined in the specified geometry. All geometries have at least one morph target allocated to them at creation time (though it may not necessarily be initialized). 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.
|
|
RpGeometryGetNumTexCoordSets is used to determine the number of sets of texture coordinates in the specified geometry. Each set has one texture coordinate per vertex. 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.
|
|
RpGeometryGetNumTriangles is used to retrieve the number of triangles defining the specified geometry. The triangles define the geometry's topology (vertex connectivity) and material properties which are shared between each morph target. Hence, all morph targets have the same number of triangles. 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.
|
|
RpGeometryGetNumVertices is used to determine the number of vertices defining the specified geometry. All morph targets have the same number of vertices. 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.
|
|
RpGeometryGetPluginOffset is used to get the offset of a previously registered plugin. The world plugin must be attached before using this function.
|
|
RpGeometryGetPreLightColors is used to retrieve the array of pre-lighting colors from the specified geometry. The array only exists if the geometry has been created using the rpGEOMETRYPRELIT flag. The pre-lighting colors reside within the geometry's topology, at one color per vertex, and are therefore shared between all morph targets. Use this function to initialize or redefine the pre-lighting colors. 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.
|
|
RpGeometryGetTriangles is used to retrieve the array of triangles from the specified geometry. The triangles define the geometry's topology (vertex connectivity) and material properties, which are shared between each morph target. Hence, all morph targets have the same number of triangles. The material associated with each triangle can be used to define the geometry's color, opacity and texture. Use this function prior to initializing or redefining the geometry's topology and material properties. The geometry must be locked before modifying the geometry's topology and material data. 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.
RpGeometry *geometry; RpTriangle *tlist; RpMaterial *red, *white; tlist = RpGeometryGetTriangles(geometry); // First triangle... RpGeometryTriangleSetVertexIndices(geometry, &tlist[0], 0, 1, 2 ); RpGeometryTriangleSetMaterial(geometry, &tlist[0], red ); // Second triangle... RpGeometryTriangleSetVertexIndices(geometry, &tlist[1], 0, 2, 3 ); RpGeometryTriangleSetMaterial(geometry, &tlist[1], white ); |
|
RpGeometryGetVertexTexCoords is used to retrieve a particular set of vertex texture coordinates, if any exist in the specified geometry. The number of sets available may be determined using RpGeometryGetNumTexCoordSets, and is fixed when the geometry is created (see RpGeometryCreate). Vertex texture coordinates reside within the geometry's topology, with each set having a (u,v) coordinate pair per vertex, and are therefore shared between all morph targets. Use this function to initialize or redefine the vertex texture coordinates. There is a one-to-one correspondence between the vertex texture coordinates array and the vertex list array defined in the morph targets. The geometry must be locked before modifying the vertex texture coordinates. 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.
RpGeometry *geometry; RwTexCoords *texCoord; texCoord = RpGeometryGetVertexTexCoords(geometry, rwTEXTURECOORDINATEINDEX0); texCoord[0].u = (RwReal)(0.0); texCoord[0].v = (RwReal)(0.0); texCoord[1].u = (RwReal)(1.0); texCoord[1].v = (RwReal)(0.0); texCoord[2].u = (RwReal)(0.0); texCoord[2].v = (RwReal)(1.0); texCoord[3].u = (RwReal)(1.0); texCoord[3].v = (RwReal)(1.0); |
|
RpGeometryIsCorrectlySorted is used to check if the specified geometry is sorted by material, with no shared vertices at material boundaries. The world plugin must be attached before using this function.
|
|
RpGeometryLock is used to lock the specified geometry so an application can access it's internal data structures. This function prepares the geometry for unlocking after its data has been modified so that a geometry's meshes can be rebuilt. (Meshes are used to group polygons with the same material, enabling efficient rendering.) A newly created geometry is already locked. The world plugin must be attached before using this function.
|
|
RpGeometryRegisterPlugin is used to register a plugin and reserve some space within a geometry. 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.
|
|
RpGeometryRegisterPluginStream 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.
|
|
RpGeometryRemoveMorphTarget is used to destroy the morph target with the specified index in the given geometry. The world plugin must be attached before using this function.
|
|
RpGeometrySetFlags is used to modify the property flags for the given geometry. Note that the new flag settings will completely replace the existing ones. Developers can logically OR (or add) flags together to combine them. 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.
|
|
RpGeometrySetStreamAlwaysCallBack 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.
|
|
RpGeometrySortByMaterial is used to create a modified clone of the specified geometry, the modification entailing sorting vertices by material and duplicating them along material boundaries. The new geometry is returned in the unlocked state. If the source geometry contains any plugin data, the app should provide an RpGeometrySortByMaterialCallBack function to update this data as appropriate. The callback will receive pointers to the original geometry, the new geometry, a mapping array (for every vertex in the new geometry, what was the index of the corresponding vertex in the source geometry?) and the length of that array (the number of vertices in the new geometry). The world plugin must be attached before using this function.
|
|
RpGeometryStreamGetSize is used to determine the size in bytes of the binary representation of the specified geometry. This is used in the binary chunk header to indicate the size of the geometry chunk. The size does not include the size of the chunk header. The world plugin must be attached before using this function.
|
|
RpGeometryStreamRead is used to read a geometry from the specified binary stream. Prior to this function call a binary geometry chunk must have been found in the stream. The world plugin must be attached before using this function. The sequence to locate and read a geometry from a binary stream connected to a disk file is as follows: RwStream *stream; RpGeometry *NewGeometry; stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx"); if( stream ) { if( RwStreamFindChunk(stream, rwID_GEOMETRY, NULL, NULL) ) { NewGeometry = RpGeometryStreamRead(stream); } RwStreamClose(stream, NULL); }
|
|
RpGeometryStreamWrite is used to write the specified geometry to the given binary stream. The stream must have been opened prior to this function call. The world plugin must be attached before using this function.
|
|
RpGeometryTransform is used to apply the specified transformation matrix to the given geometry. The transformation is applied equally to all morph targets defined in the geometry and for each morph target transforms both the vertex positions and vertex normals. All morph target bounding spheres are also recalculated. Note that the transformation modifies the morph target data and is permanent. Note also that geometry locking and unlocking is performed, as appropriate, before and after applying the transformation. The world plugin must be attached before using this function.
|
|
RpGeometryTriangleGetMaterial is used to retrieve the material associated with the specified triangle in the given geometry. The world plugin must be attached before using this function.
|
|
RpGeometryTriangleGetVertexIndices is used to retrieve the vertex indices that define the given triangle in the specified geometry. Specify NULL for those vertex indices not required. The world plugin must be attached before using this function.
|
|
RpGeometryTriangleSetMaterial is used to associate the specified material with the given triangle in the given geometry. The geometry's material list is modified accordingly and the material's reference count incremented. The world plugin must be attached before using this function.
|
|
RpGeometryTriangleSetVertexIndices is used to define the specified triangle in the given geometry according to the given vertex indices. The world plugin must be attached before using this function.
|
|
RpGeometryUnlock is used to unlock the specified geometry. This function is typically used to release the geometry's data structures after modification so that a geometry's meshes can be rebuilt from the new data. (Meshes are used to group polygons with the same material, enabling efficient rendering.) Newly created geometry is always locked and should be unlocked before it can be used in any rendering. Note all triangles in a geometry must have a material assigned to them before it can be unlocked. Note that the bounding sphere on each morph target will need recalculating if the geometry's vertex data has changed; RpGeometryUnlock does not do this for you. The world plugin must be attached before using this function.
|
|
RpGeometryValidatePlugins is used to validate the plugin memory allocated within the specified geometry. 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) |